EDO5VRWMNMKQZ6U5EQJS7DSKMZXKX55LXDLIG6N5RTN4ZFXMD2TQC
{"manifest_navigator_down":635,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"box_height":680,"keychord_press_on_manifest_navigator":765,"on_handle":547,"text_input_on_manifest_navigator":634,"manifest_coord":636,"add_thick_line":400,"manifest_index":637,"on.mouse_press":722,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.code_change":734,"on.code_submit":766,"on":1,"on.key_release":720,"initialize_manifest_navigator":773,"initialize_editor":678,"mouse_cursor":558,"tick_spec":660,"on.initialize":695,"set_mouse_cursor":562,"A":713,"draw_ticks":663,"B":379,"on.keychord_press":774,"order_of_magnitude":573,"approximate":579,"on.save_settings":742,"on.load_settings":782,"approximate_up":658,"vy":546,"table_and_array_both_empty":689,"Ticks_font":669,"fw_parent":782,"fw_app":"driver","sy":469,"Cursor_node":172,"draw_cursor":639,"on.draw":565,"Viewport":604,"wait_for_response":781,"new_definition":767,"Manifest_navigator":495,"update_editor_box":711,"Menu_command_color":613,"get_multiple_definitions_from_app":783,"Surface":422,"schema1_of_y":667,"Menu_background_color":611,"on.mouse_release":721,"Menu_border_color":612,"on.update":741,"Animating":770,"copy_shape":396,"Menu_highlight_color":614,"compute_layout":385,"draw_menu_bar":641,"Manifest":769,"y_of_schema1":364,"font":353,"load_manifest":694,"draw_manifest_navigator":677,"get_manifest":768,"num_lines_for_manifest_navigator":676,"add_hotkey_to_menu":616,"load_definition":716,"reset_manifest_navigator":772,"Definitions":503,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"on_text":539,"get_definition_from_app":777,"line_height":365,"scale":712,"Mouse_cursor":559,"Page":475,"manifest_navigator_up":628,"on.text_input":521}
get_multiple_definitions_from_app = function(defs)
-- batch interface for speed
-- turn an array of string names into a table of string definitions corresponding to them
if #defs == 0 then return {} end
live.send_to_app('GET* '..table.concat(defs, ' '))
local response = wait_for_response()
local result = {}
for def in response:gmatch('(.-)\n==fw: definition boundary==\n') do
local name = live.get_cmd_from_buffer(def)
result[name] = def
end
return result
end
on.load_settings = function(settings)
App_name = load_manifest()
print('app name', App_name, settings)
if settings == nil then return end
Settings = settings -- stash all settings into a global for on.save_settings
if settings[App_name] == nil then
return
end
Viewport = settings[App_name].viewport
Definitions = settings[App_name].definitions
local names = {}
for name, _ in pairs(Definitions) do
table.insert(names, name)
end
local defs = get_multiple_definitions_from_app(names)
for name, def_editor in pairs(Definitions) do
if defs[name] then
def_editor.data = load_from_iterator(defs[name]:gmatch("[^\r\n]+"))
else
-- app doesn't know about this definition
-- just delete it from the driver for now
print('deleting', name)
Definitions[name] = nil
end
end
end
{"manifest_navigator_down":635,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"box_height":680,"keychord_press_on_manifest_navigator":765,"on_handle":547,"text_input_on_manifest_navigator":634,"manifest_coord":636,"add_thick_line":400,"manifest_index":637,"on.mouse_press":722,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"on.code_change":734,"on.code_submit":766,"on":1,"on.key_release":720,"initialize_manifest_navigator":773,"initialize_editor":678,"mouse_cursor":558,"tick_spec":660,"on.initialize":695,"set_mouse_cursor":562,"A":713,"draw_ticks":663,"B":379,"on.keychord_press":774,"order_of_magnitude":573,"approximate":579,"on.save_settings":742,"on.load_settings":782,"approximate_up":658,"vy":546,"table_and_array_both_empty":689,"Ticks_font":669,"fw_parent":781,"fw_app":"driver","sy":469,"Cursor_node":172,"draw_cursor":639,"on.draw":565,"Viewport":604,"wait_for_response":781,"new_definition":767,"Manifest_navigator":495,"update_editor_box":711,"Menu_command_color":613,"get_multiple_definitions_from_app":778,"Surface":422,"schema1_of_y":667,"Menu_background_color":611,"on.mouse_release":721,"Menu_border_color":612,"on.update":741,"Animating":770,"copy_shape":396,"Menu_highlight_color":614,"compute_layout":385,"draw_menu_bar":641,"Manifest":769,"y_of_schema1":364,"font":353,"load_manifest":694,"draw_manifest_navigator":677,"get_manifest":768,"num_lines_for_manifest_navigator":676,"add_hotkey_to_menu":616,"load_definition":716,"reset_manifest_navigator":772,"Definitions":503,"maybe_update_key_in_definitions":529,"load_from_iterator":670,"on_text":539,"get_definition_from_app":777,"line_height":365,"scale":712,"Mouse_cursor":559,"Page":475,"manifest_navigator_up":628,"on.text_input":521}
wait_for_response = function()
local response
repeat
love.timer.sleep(0.01)
response = live.receive_from_app()
until response
return response
end
{
"get_manifest": 768,
"Viewport": 604,
"update_editor_box": 711,
"Menu_border_color": 612,
"tick_spec": 660,
"Definitions": 503,
"Menu_highlight_color": 614,
"on.mouse_press": 722,
"draw_menu_bar": 641,
"on.mouse_release": 721,
"add_hotkey_to_menu": 616,
"on.update": 741,
"on.keychord_press": 774,
"y_of_schema1": 364,
"load_definition": 716,
"maybe_update_key_in_definitions": 529,
"get_definition_from_app": 777,
"manifest_navigator_up": 628,
"manifest_navigator_down": 635,
"delete_definition": 673,
"move_candidate_to_front_of_manifest": 632,
"table_and_array_both_empty": 689,
"keychord_press_on_manifest_navigator": 765,
"on_handle": 547,
"draw_cursor": 639,
"on_text": 539,
"compute_layout": 385,
"add_thick_line": 400,
"Cursor_node": 172,
"on.code_change": 734,
"sx": 544,
"vx": 545,
"on.text_input": 521,
"line_height": 365,
"on.key_release": 720,
"Page": 475,
"initialize_manifest_navigator": 773,
"Animating": 770,
"mouse_cursor": 558,
"fw_parent": 780,
"Mouse_cursor": 559,
"fw_app": "driver",
"vy": 546,
"set_mouse_cursor": 562,
"initialize_editor": 678,
"draw_ticks": 663,
"on": 1,
"on.initialize": 695,
"A": 713,
"order_of_magnitude": 573,
"approximate": 579,
"sy": 469,
"font": 353,
"load_from_iterator": 670,
"approximate_up": 658,
"reset_manifest_navigator": 772,
"text_input_on_manifest_navigator": 634,
"scale": 712,
"load_manifest": 694,
"manifest_coord": 636,
"num_lines_for_manifest_navigator": 676,
"Manifest_navigator": 495,
"Manifest": 769,
"manifest_navigator_candidates": 638,
"draw_manifest_navigator": 677,
"Ticks_font": 669,
"add_def_to_menu": 640,
"B": 379,
"manifest_index": 637,
"box_height": 680,
"on.code_submit": 766,
"on.save_settings": 742,
"on.load_settings": 780,
"copy_shape": 396,
"Menu_command_color": 613,
"schema1_of_y": 667,
"Surface": 422,
"get_multiple_definitions_from_app": 778,
"Menu_background_color": 611,
"on.draw": 565,
"new_definition": 767,
"wait_for_response": 781,
}
on.load_settings = function(settings)
App_name = load_manifest()
print('app name', App_name, settings)
if settings == nil then return end
Settings = settings -- stash all settings into a global for on.save_settings
if settings[App_name] == nil then
return
end
Viewport = settings[App_name].viewport
Definitions = settings[App_name].definitions
local names = {}
for name, _ in pairs(Definitions) do
table.insert(names, name)
end
local defs = get_multiple_definitions_from_app(names)
print('responses received')
for k,v in pairs(defs) do
print(k)
end
for name, def_editor in pairs(Definitions) do
if defs[name] then
def_editor.data = load_from_iterator(defs[name]:gmatch("[^\r\n]+"))
else
-- app doesn't know about this definition
-- just delete it from the driver for now
print('deleting', name)
Definitions[name] = nil
end
end
end
{"get_manifest":768,"Viewport":604,"update_editor_box":711,"Menu_border_color":612,"tick_spec":660,"Definitions":503,"Menu_highlight_color":614,"on.mouse_press":722,"draw_menu_bar":641,"on.mouse_release":721,"add_hotkey_to_menu":616,"on.update":741,"on.keychord_press":774,"y_of_schema1":364,"load_definition":716,"maybe_update_key_in_definitions":529,"get_definition_from_app":777,"manifest_navigator_up":628,"manifest_navigator_down":635,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"table_and_array_both_empty":689,"keychord_press_on_manifest_navigator":765,"on_handle":547,"draw_cursor":639,"on_text":539,"compute_layout":385,"add_thick_line":400,"Cursor_node":172,"on.code_change":734,"sx":544,"vx":545,"on.text_input":521,"line_height":365,"on.key_release":720,"Page":475,"initialize_manifest_navigator":773,"Animating":770,"mouse_cursor":558,"fw_parent":779,"Mouse_cursor":559,"fw_app":"driver","vy":546,"set_mouse_cursor":562,"initialize_editor":678,"draw_ticks":663,"on":1,"on.initialize":695,"A":713,"order_of_magnitude":573,"approximate":579,"sy":469,"font":353,"load_from_iterator":670,"approximate_up":658,"reset_manifest_navigator":772,"text_input_on_manifest_navigator":634,"scale":712,"load_manifest":694,"manifest_coord":636,"num_lines_for_manifest_navigator":676,"Manifest_navigator":495,"Manifest":769,"manifest_navigator_candidates":638,"draw_manifest_navigator":677,"Ticks_font":669,"add_def_to_menu":640,"B":379,"manifest_index":637,"box_height":680,"on.code_submit":766,"on.save_settings":742,"on.load_settings":780,"copy_shape":396,"Menu_command_color":613,"schema1_of_y":667,"Surface":422,"get_multiple_definitions_from_app":778,"Menu_background_color":611,"on.draw":565,"new_definition":767}
on.load_settings = function(settings)
App_name = load_manifest()
print('app name', App_name, settings)
if settings == nil then return end
Settings = settings -- stash all settings into a global for on.save_settings
if settings[App_name] == nil then
return
end
Viewport = settings[App_name].viewport
Definitions = settings[App_name].definitions
local names = {}
for name, _ in pairs(Definitions) do
table.insert(names, name)
end
print(get_multiple_definitions_from_app)
for name, def_editor in pairs(Definitions) do
local def = get_definition_from_app(name)
if def == '' then
-- app doesn't know about this definition
-- just delete it from the driver for now
Definitions[name] = nil
else
def_editor.data = load_from_iterator(def:gmatch("[^\r\n]+"))
end
end
end
{"Definitions":503,"manifest_navigator_up":628,"manifest_navigator_down":635,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":765,"draw_cursor":639,"manifest_coord":636,"maybe_update_key_in_definitions":529,"on":1,"order_of_magnitude":573,"add_def_to_menu":640,"approximate":579,"Page":475,"approximate_up":658,"on_handle":547,"on_text":539,"on.initialize":695,"on.mouse_press":722,"A":713,"tick_spec":660,"scale":712,"Viewport":604,"vx":545,"box_height":680,"on.key_release":720,"on.update":741,"load_definition":716,"y_of_schema1":364,"on.keychord_press":774,"on.mouse_release":721,"Mouse_cursor":559,"on.code_submit":766,"on.save_settings":742,"set_mouse_cursor":562,"on.load_settings":779,"draw_ticks":663,"initialize_manifest_navigator":773,"on.text_input":521,"table_and_array_both_empty":689,"initialize_editor":678,"get_multiple_definitions_from_app":778,"on.draw":565,"sy":469,"update_editor_box":711,"vy":546,"compute_layout":385,"add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"schema1_of_y":667,"B":379,"new_definition":767,"text_input_on_manifest_navigator":634,"mouse_cursor":558,"Manifest_navigator":495,"Menu_background_color":611,"fw_parent":778,"Menu_border_color":612,"fw_app":"driver","Menu_command_color":613,"Animating":770,"Menu_highlight_color":614,"on.code_change":734,"draw_menu_bar":641,"manifest_index":637,"add_hotkey_to_menu":616,"Surface":422,"Ticks_font":669,"draw_manifest_navigator":677,"Manifest":769,"num_lines_for_manifest_navigator":676,"sx":544,"load_manifest":694,"reset_manifest_navigator":772,"get_manifest":768,"load_from_iterator":670,"font":353,"line_height":365,"get_definition_from_app":777,"Cursor_node":172}
{"Definitions":503,"manifest_navigator_up":628,"manifest_navigator_down":635,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":765,"draw_cursor":639,"manifest_coord":636,"maybe_update_key_in_definitions":529,"on":1,"order_of_magnitude":573,"add_def_to_menu":640,"approximate":579,"Page":475,"approximate_up":658,"on_handle":547,"on_text":539,"on.initialize":695,"on.mouse_press":722,"A":713,"tick_spec":660,"scale":712,"Viewport":604,"vx":545,"box_height":680,"on.key_release":720,"on.update":741,"load_definition":716,"y_of_schema1":364,"on.keychord_press":774,"on.mouse_release":721,"Mouse_cursor":559,"on.code_submit":766,"on.save_settings":742,"set_mouse_cursor":562,"on.load_settings":776,"draw_ticks":663,"initialize_manifest_navigator":773,"on.text_input":521,"table_and_array_both_empty":689,"initialize_editor":678,"get_multiple_definitions_from_app":778,"on.draw":565,"sy":469,"update_editor_box":711,"vy":546,"compute_layout":385,"add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"schema1_of_y":667,"B":379,"new_definition":767,"text_input_on_manifest_navigator":634,"mouse_cursor":558,"Manifest_navigator":495,"Menu_background_color":611,"fw_parent":777,"Menu_border_color":612,"fw_app":"driver","Menu_command_color":613,"Animating":770,"Menu_highlight_color":614,"on.code_change":734,"draw_menu_bar":641,"manifest_index":637,"add_hotkey_to_menu":616,"Surface":422,"Ticks_font":669,"draw_manifest_navigator":677,"Manifest":769,"num_lines_for_manifest_navigator":676,"sx":544,"load_manifest":694,"reset_manifest_navigator":772,"get_manifest":768,"load_from_iterator":670,"font":353,"line_height":365,"get_definition_from_app":777,"Cursor_node":172}
get_multiple_definitions_from_app = function(defs)
-- batch interface for speed
-- turn an array of string names into a table of string definitions corresponding to them
if #defs == 0 then return {} end
live.send_to_app('GET* '..table.concat(defs, ' '))
local response = wait_for_response()
local result = {}
for def in response:gmatch('(.-)\n==fw: definition boundary==\n') do
print("=== "..def)
local name = live.get_cmd_from_buffer(def)
result[name] = def
end
return result
end
{"Definitions":503,"manifest_navigator_up":628,"manifest_navigator_down":635,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":765,"draw_cursor":639,"manifest_coord":636,"maybe_update_key_in_definitions":529,"on":1,"order_of_magnitude":573,"add_def_to_menu":640,"approximate":579,"Page":475,"approximate_up":658,"on_handle":547,"on_text":539,"on.initialize":695,"on.mouse_press":722,"A":713,"tick_spec":660,"scale":712,"Viewport":604,"vx":545,"box_height":680,"on.key_release":720,"on.update":741,"load_definition":716,"y_of_schema1":364,"on.keychord_press":774,"on.mouse_release":721,"Mouse_cursor":559,"on.code_submit":766,"on.save_settings":742,"set_mouse_cursor":562,"on.load_settings":776,"draw_ticks":663,"initialize_manifest_navigator":773,"on.text_input":521,"table_and_array_both_empty":689,"initialize_editor":678,"on.draw":565,"sy":469,"update_editor_box":711,"vy":546,"compute_layout":385,"add_thick_line":400,"manifest_navigator_candidates":638,"copy_shape":396,"schema1_of_y":667,"B":379,"new_definition":767,"text_input_on_manifest_navigator":634,"mouse_cursor":558,"Manifest_navigator":495,"Menu_background_color":611,"fw_parent":776,"Menu_border_color":612,"fw_app":"driver","Menu_command_color":613,"Animating":770,"Menu_highlight_color":614,"on.code_change":734,"draw_menu_bar":641,"manifest_index":637,"add_hotkey_to_menu":616,"Surface":422,"Ticks_font":669,"draw_manifest_navigator":677,"Manifest":769,"num_lines_for_manifest_navigator":676,"sx":544,"load_manifest":694,"reset_manifest_navigator":772,"get_manifest":768,"load_from_iterator":670,"font":353,"line_height":365,"get_definition_from_app":777,"Cursor_node":172}
get_definition_from_app = function(name)
-- return definition for a name
-- if no such definition, return ''
live.send_to_app('GET '..name)
local response
repeat
love.timer.sleep(0.01)
response = live.receive_from_app()
until response
return response
end