# espp desktop protocol golden vectors (espp.desktop v2, dispatcher module 9).
# Generated by components/desktop/test/desktop_host_test.cpp --gen; edit the
# catalogue there, not this file. Shared by the C++ host test (encoders must
# reproduce the hex, decoders must reproduce the value) and the web app's node
# test (decode(hex) must equal the JSON for d2h, encode(JSON) the hex for h2d).
#
# One vector per line: name<TAB>d2h|h2d<TAB>type hex<TAB>payload hex<TAB>decoded JSON
# (payload hex has no spaces; an empty payload is an empty field).
#
# JSON shapes (numbers are plain, strings are UTF-8):
#   prop        {tag, value} where value is by tag: Text-like -> string; Value/Min/Max/Step
#               -> int; Enabled/Visible/Focus/ItemCount/Flags/MaxLines/Width/Height/
#               InsertBefore/WindowFlags/Color/Background -> uint; Items ->
#               {start, items[]}; Columns -> [strings]; Geometry -> {x,y,w,h};
#               an unknown tag (or a malformed known one) -> {tag, raw: hex}
#   widget      {id, parent, type, weight, layout, props[]}
#   DESKTOP     {proto, flags, records[prop], apps[{id, flags, name, icon, description}],
#               windows[{id, app}]}
#   WINDOW_OPEN {window, app, flags, x, y, w, h, title, total, widgets[]}
#   WINDOW_CLOSE {window, reason}   WIDGET_SET {window, entries[{widget, props[]}]}
#   WIDGET_ADD  {window, widgets[]}  WIDGET_REMOVE {window, widgets[ids]}
#   DIALOG      {dialog, owner, kind, icon, title, text, default, buttons[]}
#   NOTIFY      {level, timeoutMs, title, text}   DIALOG_CLOSE {dialog}
#   OK          {request}   ERROR {request, errno, message}
#   GET_DESKTOP {}   LAUNCH_APP {app}   CLOSE_WINDOW {window}
#   WINDOW_EVENT {window, event, x, y, w, h}
#   WIDGET_EVENT {window, widget, event} + by event: Change/Select/Activate/Scroll {value},
#               Submit {text}, Text {offset, total, text}, Key {key, mods, codepoint}
#   DIALOG_RESULT {dialog, button, text}
desktop	d2h	81	010308010c0065737070204465736b746f700213006465736b746f705f6578616d706c6520312e300304006175746f040400f6823b00050200f10f060200320007040000400000c80200aabb03010107436f756e74657204f09fa7ae0d436f756e747320636c69636b7302030541626f7574087376673a696e666f1141626f7574207468697320646576696365030006456469746f7204f09f939d0b4564697420612066696c6501010001	{"proto":1,"flags":3,"records":[{"tag":1,"value":"espp Desktop"},{"tag":2,"value":"desktop_example 1.0"},{"tag":3,"value":1869903201},{"tag":4,"value":3900150},{"tag":5,"raw":"f10f"},{"tag":6,"raw":"3200"},{"tag":7,"raw":"00400000"},{"tag":200,"raw":"aabb"}],"apps":[{"id":1,"flags":1,"name":"Counter","icon":"🧮","description":"Counts clicks"},{"id":2,"flags":3,"name":"About","icon":"svg:info","description":"About this device"},{"id":3,"flags":0,"name":"Editor","icon":"📝","description":"Edit a file"}],"windows":[{"id":1,"app":1}]}
desktop_window_list_trimmed	d2h	81	010108010c0065737070204465736b746f700213006465736b746f705f6578616d706c6520312e300304006175746f040400f6823b00050200f10f060200320007040000400000c80200aabb03010107436f756e74657204f09fa7ae0d436f756e747320636c69636b7302030541626f7574087376673a696e666f1141626f7574207468697320646576696365030006456469746f7204f09f939d0b4564697420612066696c6502010001020003	{"proto":1,"flags":1,"records":[{"tag":1,"value":"espp Desktop"},{"tag":2,"value":"desktop_example 1.0"},{"tag":3,"value":1869903201},{"tag":4,"value":3900150},{"tag":5,"raw":"f10f"},{"tag":6,"raw":"3200"},{"tag":7,"raw":"00400000"},{"tag":200,"raw":"aabb"}],"apps":[{"id":1,"flags":1,"name":"Counter","icon":"🧮","description":"Counts clicks"},{"id":2,"flags":3,"name":"About","icon":"svg:info","description":"About this device"},{"id":3,"flags":0,"name":"Editor","icon":"📝","description":"Edit a file"}],"windows":[{"id":1,"app":1},{"id":2,"app":3}]}
window_open	d2h	82	010001ff03ffffffff0000000007436f756e74657204000400010000000101010002000100020008000300020004000002010800436f756e743a203010020001000400010008010304012c013031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738393031323334353637383930313233343536373839303132333435363738391002000300110200c800c902007879	{"window":1,"app":1,"flags":1023,"x":-1,"y":-1,"w":0,"h":0,"title":"Counter","total":4,"widgets":[{"id":1,"parent":0,"type":1,"weight":1,"layout":1,"props":[]},{"id":2,"parent":1,"type":2,"weight":0,"layout":8,"props":[]},{"id":3,"parent":2,"type":4,"weight":0,"layout":0,"props":[{"tag":1,"value":"Count: 0"},{"tag":16,"value":1}]},{"id":4,"parent":1,"type":8,"weight":1,"layout":3,"props":[{"tag":1,"value":"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"},{"tag":16,"value":3},{"tag":17,"value":200},{"tag":201,"raw":"7879"}]}]}
window_close	d2h	83	070001	{"window":7,"reason":1}
widget_set	d2h	84	010004000002160b00436f756e746572202833291808000a0014002c01c800030002010800436f756e743a20330904000000ff000500020b020003000c0e0001000200030062094203006309430400010205006c696e650a	{"window":1,"entries":[{"widget":0,"props":[{"tag":22,"value":"Counter (3)"},{"tag":24,"value":{"x":10,"y":20,"w":300,"h":200}}]},{"widget":3,"props":[{"tag":1,"value":"Count: 3"},{"tag":9,"value":16711680}]},{"widget":5,"props":[{"tag":11,"value":3},{"tag":12,"value":{"start":1,"items":["b\tB","c\tC"]}}]},{"widget":4,"props":[{"tag":2,"value":"line\n"}]}]}
widget_add	d2h	85	010001000600010005000003010500526573657410020002001502000400	{"window":1,"widgets":[{"id":6,"parent":1,"type":5,"weight":0,"layout":0,"props":[{"tag":1,"value":"Reset"},{"tag":16,"value":2},{"tag":21,"value":4}]}]}
widget_remove	d2h	86	0100020003000600	{"window":1,"widgets":[3,6]}
dialog	d2h	87	0200010001020652656e616d6509004e6577206e616d653a09006e6f7465732e74787402024f4b0643616e63656c	{"dialog":2,"owner":1,"kind":1,"icon":2,"title":"Rename","text":"New name:","default":"notes.txt","buttons":["OK","Cancel"]}
notify	d2h	88	02b80b05536176656411006e6f7465732e747874207772697474656e	{"level":2,"timeoutMs":3000,"title":"Saved","text":"notes.txt written"}
dialog_close	d2h	89	0200	{"dialog":2}
ok	d2h	8e	02	{"request":2}
error	d2h	8f	02020000006e6f207375636820617070	{"request":2,"errno":2,"message":"no such app"}
get_desktop	h2d	01		{}
launch_app	h2d	02	03	{"app":3}
close_window	h2d	03	0700	{"window":7}
window_event	h2d	04	010006ecff1e0090012c01	{"window":1,"event":6,"x":-20,"y":30,"w":400,"h":300}
widget_event_click	h2d	05	0100060001	{"window":1,"widget":6,"event":1}
widget_event_change	h2d	05	0100080002ffffffff	{"window":1,"widget":8,"event":2,"value":-1}
widget_event_submit	h2d	05	010009000368656c6c6f	{"window":1,"widget":9,"event":3,"text":"hello"}
widget_event_text_0	h2d	05	0100040004000000000a00000068656c6c6f20	{"window":1,"widget":4,"event":4,"offset":0,"total":10,"text":"hello "}
widget_event_text_6	h2d	05	0100040004060000000a00000077726c64	{"window":1,"widget":4,"event":4,"offset":6,"total":10,"text":"wrld"}
widget_event_select	h2d	05	010005000502000000	{"window":1,"widget":5,"event":5,"value":2}
widget_event_activate	h2d	05	010005000602000000	{"window":1,"widget":5,"event":6,"value":2}
widget_event_key	h2d	05	010004000700010300000000	{"window":1,"widget":4,"event":7,"key":256,"mods":3,"codepoint":0}
widget_event_key_char	h2d	05	010004000700000000f60100	{"window":1,"widget":4,"event":7,"key":0,"mods":0,"codepoint":128512}
widget_event_scroll	h2d	05	010004000878000000	{"window":1,"widget":4,"event":8,"value":120}
dialog_result_text	h2d	06	02000072656e616d65642e747874	{"dialog":2,"button":0,"text":"renamed.txt"}
dialog_result_dismissed	h2d	06	0200ff	{"dialog":2,"button":255,"text":""}
