It took me way too long to realize this can't work. The reason: definitions can exist in the app's source directory. And there's no way to deduce that.
I could start passing that to the driver, but it would suck to need to do so just to speed up the initial load..
36OINW5D3J2CFMKWXBLHEPVUGVSPY77YEBEAJAXS52AEBYKMIOTQC
on.load_settings = function(settings)
local manifest_version
App_name, manifest_version = 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
for name, def in pairs(Definitions) do
local filename = definition_file(name, manifest_version)
print('loading', filename)
local f = io.open(filename)
def.data = load_from_iterator(f:lines())
print(def.data[1])
end
end
{"box_height":680,"on.save_settings":742,"on.load_settings":764,"Menu_border_color":612,"Menu_command_color":613,"Menu_highlight_color":614,"draw_menu_bar":641,"add_hotkey_to_menu":616,"get_manifest":750,"draw_manifest_navigator":677,"load_manifest":757,"num_lines_for_manifest_navigator":676,"reset_manifest_navigator":621,"add_thick_line":400,"load_from_iterator":763,"Viewport":604,"get_definition_from_app":735,"vy":546,"manifest_navigator_up":628,"on.mouse_press":722,"on.mouse_release":721,"delete_definition":673,"A":713,"move_candidate_to_front_of_manifest":632,"on.keychord_press":739,"keychord_press_on_manifest_navigator":756,"text_input_on_manifest_navigator":634,"Animating":726,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"update_editor_box":711,"sx":544,"on.key_release":720,"fw_parent":763,"on":1,"font":353,"Mouse_cursor":559,"definition_file":761,"on.code_change":753,"set_mouse_cursor":562,"Manifest_versions":749,"draw_ticks":663,"order_of_magnitude":573,"Manifest_navigator":495,"line_height":365,"vx":545,"Surface":422,"on.initialize":695,"manifest_navigator_down":635,"draw_cursor":639,"scale":712,"table_and_array_both_empty":689,"B":379,"on.text_input":521,"Cursor_node":172,"approximate_up":658,"maybe_update_key_in_definitions":529,"Manifest":748,"fw_app":"driver","approximate":579,"compute_layout":385,"Page":475,"sy":469,"schema1_of_y":667,"on.update":741,"on_handle":547,"--":727,"Definitions":503,"new_definition":745,"tick_spec":660,"initialize_editor":678,"Ticks_font":669,"load_definition":716,"y_of_schema1":364,"copy_shape":396,"on.draw":565,"mouse_cursor":558,"Menu_background_color":611}
{"box_height":680,"on.save_settings":742,"on.load_settings":759,"Menu_border_color":612,"Menu_command_color":613,"Menu_highlight_color":614,"draw_menu_bar":641,"add_hotkey_to_menu":616,"get_manifest":750,"draw_manifest_navigator":677,"load_manifest":757,"num_lines_for_manifest_navigator":676,"reset_manifest_navigator":621,"add_thick_line":400,"load_from_iterator":763,"Viewport":604,"get_definition_from_app":735,"vy":546,"manifest_navigator_up":628,"on.mouse_press":722,"on.mouse_release":721,"delete_definition":673,"A":713,"move_candidate_to_front_of_manifest":632,"on.keychord_press":739,"keychord_press_on_manifest_navigator":756,"text_input_on_manifest_navigator":634,"Animating":726,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"update_editor_box":711,"sx":544,"on.key_release":720,"fw_parent":762,"on":1,"font":353,"Mouse_cursor":559,"definition_file":761,"on.code_change":753,"set_mouse_cursor":562,"Manifest_versions":749,"draw_ticks":663,"order_of_magnitude":573,"Manifest_navigator":495,"line_height":365,"vx":545,"Surface":422,"on.initialize":695,"manifest_navigator_down":635,"draw_cursor":639,"scale":712,"table_and_array_both_empty":689,"B":379,"on.text_input":521,"Cursor_node":172,"approximate_up":658,"maybe_update_key_in_definitions":529,"Manifest":748,"fw_app":"driver","approximate":579,"compute_layout":385,"Page":475,"sy":469,"schema1_of_y":667,"on.update":741,"on_handle":547,"--":727,"Definitions":503,"new_definition":745,"tick_spec":660,"initialize_editor":678,"Ticks_font":669,"load_definition":716,"y_of_schema1":364,"copy_shape":396,"on.draw":565,"mouse_cursor":558,"Menu_background_color":611}
load_from_iterator = function(f)
local result = {}
while true do
local line = f()
if line == nil then break end
table.insert(result, line)
end
if #result == 0 then
table.insert(result, '')
end
return result
end
{"box_height":680,"on.save_settings":742,"on.load_settings":759,"Menu_border_color":612,"Menu_command_color":613,"Menu_highlight_color":614,"draw_menu_bar":641,"add_hotkey_to_menu":616,"get_manifest":750,"draw_manifest_navigator":677,"load_manifest":757,"num_lines_for_manifest_navigator":676,"reset_manifest_navigator":621,"add_thick_line":400,"load_from_iterator":762,"Viewport":604,"get_definition_from_app":735,"vy":546,"manifest_navigator_up":628,"on.mouse_press":722,"on.mouse_release":721,"delete_definition":673,"A":713,"move_candidate_to_front_of_manifest":632,"on.keychord_press":739,"keychord_press_on_manifest_navigator":756,"text_input_on_manifest_navigator":634,"Animating":726,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"update_editor_box":711,"sx":544,"on.key_release":720,"fw_parent":761,"on":1,"font":353,"Mouse_cursor":559,"definition_file":761,"on.code_change":753,"set_mouse_cursor":562,"Manifest_versions":749,"draw_ticks":663,"order_of_magnitude":573,"Manifest_navigator":495,"line_height":365,"vx":545,"Surface":422,"on.initialize":695,"manifest_navigator_down":635,"draw_cursor":639,"scale":712,"table_and_array_both_empty":689,"B":379,"on.text_input":521,"Cursor_node":172,"approximate_up":658,"maybe_update_key_in_definitions":529,"Manifest":748,"fw_app":"driver","approximate":579,"compute_layout":385,"Page":475,"sy":469,"schema1_of_y":667,"on.update":741,"on_handle":547,"--":727,"Definitions":503,"new_definition":745,"tick_spec":660,"initialize_editor":678,"Ticks_font":669,"load_definition":716,"y_of_schema1":364,"copy_shape":396,"on.draw":565,"mouse_cursor":558,"Menu_background_color":611}
load_from_iterator = function(f)
local result = {}
local i,line = 0, ''
while true do
local line = f()
if line == nil then break end
table.insert(result, line)
end
if #result == 0 then
table.insert(result, '')
end
return result
end
{"box_height":680,"on.save_settings":742,"on.load_settings":759,"Menu_border_color":612,"Menu_command_color":613,"Menu_highlight_color":614,"draw_menu_bar":641,"add_hotkey_to_menu":616,"get_manifest":750,"draw_manifest_navigator":677,"load_manifest":757,"num_lines_for_manifest_navigator":676,"reset_manifest_navigator":621,"add_thick_line":400,"load_from_iterator":670,"Viewport":604,"get_definition_from_app":735,"vy":546,"manifest_navigator_up":628,"on.mouse_press":722,"on.mouse_release":721,"delete_definition":673,"A":713,"move_candidate_to_front_of_manifest":632,"on.keychord_press":739,"keychord_press_on_manifest_navigator":756,"text_input_on_manifest_navigator":634,"Animating":726,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"update_editor_box":711,"sx":544,"on.key_release":720,"fw_parent":760,"on":1,"font":353,"Mouse_cursor":559,"definition_file":761,"on.code_change":753,"set_mouse_cursor":562,"Manifest_versions":749,"draw_ticks":663,"order_of_magnitude":573,"Manifest_navigator":495,"line_height":365,"vx":545,"Surface":422,"on.initialize":695,"manifest_navigator_down":635,"draw_cursor":639,"scale":712,"table_and_array_both_empty":689,"B":379,"on.text_input":521,"Cursor_node":172,"approximate_up":658,"maybe_update_key_in_definitions":529,"Manifest":748,"fw_app":"driver","approximate":579,"compute_layout":385,"Page":475,"sy":469,"schema1_of_y":667,"on.update":741,"on_handle":547,"--":727,"Definitions":503,"new_definition":745,"tick_spec":660,"initialize_editor":678,"Ticks_font":669,"load_definition":716,"y_of_schema1":364,"copy_shape":396,"on.draw":565,"mouse_cursor":558,"Menu_background_color":611}
definition_file = function(name, manifest_version)
local client_app_save_dir = love.filesystem.getSaveDirectory():gsub(love.filesystem.getIdentity()..'$', App_name)
local filename = live.versioned_filename(manifest_version[name], name)
return client_app_save_dir..'/'..filename
end
{"on_handle":547,"B":379,"manifest_coord":636,"initialize_editor":678,"manifest_index":637,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"vx":545,"Animating":726,"Surface":422,"on.key_release":720,"fw_app":"driver","sy":469,"mouse_cursor":558,"update_editor_box":711,"Mouse_cursor":559,"tick_spec":660,"on.mouse_release":721,"draw_ticks":663,"Manifest_navigator":495,"Page":475,"y_of_schema1":364,"order_of_magnitude":573,"load_definition":716,"Manifest_versions":749,"approximate":579,"Manifest":748,"on.update":741,"on.save_settings":742,"on":1,"get_manifest":750,"approximate_up":658,"box_height":680,"Ticks_font":669,"Definitions":503,"new_definition":745,"add_thick_line":400,"copy_shape":396,"Cursor_node":172,"definition_file":760,"schema1_of_y":667,"load_manifest":757,"Menu_background_color":611,"Viewport":604,"Menu_border_color":612,"on.code_change":753,"Menu_command_color":613,"on.draw":565,"Menu_highlight_color":614,"set_mouse_cursor":562,"draw_menu_bar":641,"vy":546,"on.mouse_press":722,"A":713,"num_lines_for_manifest_navigator":676,"draw_manifest_navigator":677,"move_candidate_to_front_of_manifest":632,"compute_layout":385,"add_hotkey_to_menu":616,"on.load_settings":759,"reset_manifest_navigator":621,"font":353,"text_input_on_manifest_navigator":634,"maybe_update_key_in_definitions":529,"on.text_input":521,"--":727,"table_and_array_both_empty":689,"get_definition_from_app":735,"scale":712,"load_from_iterator":670,"manifest_navigator_up":628,"draw_cursor":639,"manifest_navigator_down":635,"on.keychord_press":739,"fw_parent":759,"delete_definition":673,"on_text":539,"on.initialize":695,"line_height":365,"keychord_press_on_manifest_navigator":756}
definition_file = function(name, manifest_version)
local client_app_save_dir = love.filesystem.getSaveDirectory():gsub(love.filesystem.getIdentity()..'$', App_name)
print(name, manifest_version[name])
local filename = live.versioned_filename(manifest_version[name], name)
return client_app_save_dir..'/'..filename
end
on.load_settings = function(settings)
local manifest_version
App_name, manifest_version = 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
for name, def in pairs(Definitions) do
print(name, definition_file(name, manifest_version))
def.data = load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+"))
end
end
{"Page":475,"load_definition":716,"initialize_editor":678,"box_height":680,"Ticks_font":669,"fw_parent":758,"sy":469,"fw_app":"driver","on.load_settings":759,"table_and_array_both_empty":689,"Manifest_navigator":495,"compute_layout":385,"Manifest":748,"B":379,"get_manifest":750,"on.keychord_press":739,"Menu_background_color":611,"new_definition":745,"Menu_border_color":612,"Menu_command_color":613,"A":713,"Menu_highlight_color":614,"Definitions":503,"on":1,"add_hotkey_to_menu":616,"Animating":726,"on.mouse_press":722,"on.key_release":720,"num_lines_for_manifest_navigator":676,"reset_manifest_navigator":621,"font":353,"load_from_iterator":670,"maybe_update_key_in_definitions":529,"get_definition_from_app":735,"on.text_input":521,"vx":545,"manifest_navigator_up":628,"manifest_navigator_down":635,"vy":546,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"order_of_magnitude":573,"keychord_press_on_manifest_navigator":756,"text_input_on_manifest_navigator":634,"on.update":741,"approximate":579,"draw_cursor":639,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"line_height":365,"--":727,"on.mouse_release":721,"on.save_settings":742,"tick_spec":660,"Manifest_versions":749,"on_handle":547,"draw_ticks":663,"y_of_schema1":364,"manifest_coord":636,"on.initialize":695,"draw_manifest_navigator":677,"scale":712,"mouse_cursor":558,"approximate_up":658,"Mouse_cursor":559,"update_editor_box":711,"draw_menu_bar":641,"Surface":422,"set_mouse_cursor":562,"on.draw":565,"on.code_change":753,"Viewport":604,"copy_shape":396,"load_manifest":757,"add_thick_line":400,"schema1_of_y":667,"definition_file":758,"Cursor_node":172}
{"Page":475,"load_definition":716,"initialize_editor":678,"box_height":680,"Ticks_font":669,"fw_parent":757,"sy":469,"fw_app":"driver","on.load_settings":754,"table_and_array_both_empty":689,"Manifest_navigator":495,"compute_layout":385,"Manifest":748,"B":379,"get_manifest":750,"on.keychord_press":739,"Menu_background_color":611,"new_definition":745,"Menu_border_color":612,"Menu_command_color":613,"A":713,"Menu_highlight_color":614,"Definitions":503,"on":1,"add_hotkey_to_menu":616,"Animating":726,"on.mouse_press":722,"on.key_release":720,"num_lines_for_manifest_navigator":676,"reset_manifest_navigator":621,"font":353,"load_from_iterator":670,"maybe_update_key_in_definitions":529,"get_definition_from_app":735,"on.text_input":521,"vx":545,"manifest_navigator_up":628,"manifest_navigator_down":635,"vy":546,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"order_of_magnitude":573,"keychord_press_on_manifest_navigator":756,"text_input_on_manifest_navigator":634,"on.update":741,"approximate":579,"draw_cursor":639,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"line_height":365,"--":727,"on.mouse_release":721,"on.save_settings":742,"tick_spec":660,"Manifest_versions":749,"on_handle":547,"draw_ticks":663,"y_of_schema1":364,"manifest_coord":636,"on.initialize":695,"draw_manifest_navigator":677,"scale":712,"mouse_cursor":558,"approximate_up":658,"Mouse_cursor":559,"update_editor_box":711,"draw_menu_bar":641,"Surface":422,"set_mouse_cursor":562,"on.draw":565,"on.code_change":753,"Viewport":604,"copy_shape":396,"load_manifest":757,"add_thick_line":400,"schema1_of_y":667,"definition_file":758,"Cursor_node":172}
definition_file = function(name, manifest_version)
local client_app_save_dir = love.filesystem.getSaveDirectory():gsub(love.filesystem.getIdentity()..'$', App_name)
print(name, manifest_version[name])
-- local filename = live.versioned_filename(manifest_version[name], name)
-- return client_app_save_dir..'/'..filename
end
{"Menu_border_color":612,"Menu_command_color":613,"Animating":726,"Menu_highlight_color":614,"draw_menu_bar":641,"mouse_cursor":558,"add_hotkey_to_menu":616,"Mouse_cursor":559,"draw_manifest_navigator":677,"num_lines_for_manifest_navigator":676,"draw_ticks":663,"reset_manifest_navigator":621,"scale":712,"load_from_iterator":670,"get_definition_from_app":735,"schema1_of_y":667,"manifest_navigator_up":628,"load_manifest":757,"manifest_navigator_down":635,"get_manifest":750,"y_of_schema1":364,"delete_definition":673,"definition_file":752,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":756,"Definitions":503,"text_input_on_manifest_navigator":634,"new_definition":745,"manifest_coord":636,"manifest_index":637,"manifest_navigator_candidates":638,"add_def_to_menu":640,"approximate_up":658,"maybe_update_key_in_definitions":529,"font":353,"add_thick_line":400,"copy_shape":396,"tick_spec":660,"Cursor_node":172,"on_text":539,"on.text_input":521,"Surface":422,"on.draw":565,"load_definition":716,"Viewport":604,"on":1,"Menu_background_color":611,"on.initialize":695,"table_and_array_both_empty":689,"on.load_settings":754,"B":379,"initialize_editor":678,"compute_layout":385,"on.keychord_press":739,"A":713,"Ticks_font":669,"approximate":579,"vy":546,"on.key_release":720,"fw_parent":756,"on.code_change":753,"fw_app":"driver","draw_cursor":639,"update_editor_box":711,"on.update":741,"on_handle":547,"box_height":680,"Page":475,"Manifest_versions":749,"on.mouse_press":722,"set_mouse_cursor":562,"order_of_magnitude":573,"sx":544,"on.save_settings":742,"vx":545,"Manifest_navigator":495,"on.mouse_release":721,"--":727,"Manifest":748,"sy":469,"line_height":365}
load_manifest = function()
-- Connect to an app and load its manifest into global Manifest.
-- Also return the name of the app we have connected to.
local new_manifest, app_name, manifest_version = get_manifest()
-- preserve existing order
-- 1. add new definitions in front
for _,name in ipairs(new_manifest) do
if not array.find(Manifest, name) then
table.insert(Manifest, 1, name)
end
end
-- 2. remove missing definitions
for idx=#Manifest,1,-1 do
local name = Manifest[idx]
if not array.find(new_manifest, name) then
table.remove(Manifest, idx)
end
end
print('load_manifest', manifest_version)
return app_name, manifest_version
end
{"Menu_border_color":612,"Menu_command_color":613,"Animating":726,"Menu_highlight_color":614,"draw_menu_bar":641,"mouse_cursor":558,"add_hotkey_to_menu":616,"Mouse_cursor":559,"draw_manifest_navigator":677,"num_lines_for_manifest_navigator":676,"draw_ticks":663,"reset_manifest_navigator":621,"scale":712,"load_from_iterator":670,"get_definition_from_app":735,"schema1_of_y":667,"manifest_navigator_up":628,"load_manifest":755,"manifest_navigator_down":635,"get_manifest":750,"y_of_schema1":364,"delete_definition":673,"definition_file":752,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":756,"Definitions":503,"text_input_on_manifest_navigator":634,"new_definition":745,"manifest_coord":636,"manifest_index":637,"manifest_navigator_candidates":638,"add_def_to_menu":640,"approximate_up":658,"maybe_update_key_in_definitions":529,"font":353,"add_thick_line":400,"copy_shape":396,"tick_spec":660,"Cursor_node":172,"on_text":539,"on.text_input":521,"Surface":422,"on.draw":565,"load_definition":716,"Viewport":604,"on":1,"Menu_background_color":611,"on.initialize":695,"table_and_array_both_empty":689,"on.load_settings":754,"B":379,"initialize_editor":678,"compute_layout":385,"on.keychord_press":739,"A":713,"Ticks_font":669,"approximate":579,"vy":546,"on.key_release":720,"fw_parent":755,"on.code_change":753,"fw_app":"driver","draw_cursor":639,"update_editor_box":711,"on.update":741,"on_handle":547,"box_height":680,"Page":475,"Manifest_versions":749,"on.mouse_press":722,"set_mouse_cursor":562,"order_of_magnitude":573,"sx":544,"on.save_settings":742,"vx":545,"Manifest_navigator":495,"on.mouse_release":721,"--":727,"Manifest":748,"sy":469,"line_height":365}
keychord_press_on_manifest_navigator = function(chord, key)
if chord == 'escape' then
reset_manifest_navigator()
elseif chord == 'return' then
if Manifest_navigator.for_delete then
delete_definition(Manifest_navigator.candidates[Manifest_navigator.index])
else
load_definition(Manifest_navigator.candidates[Manifest_navigator.index])
end
A()
reset_manifest_navigator()
elseif chord == 'backspace' then
local len = utf8.len(Manifest_navigator.filter)
local byte_offset = Text.offset(Manifest_navigator.filter, len)
Manifest_navigator.filter = string.sub(Manifest_navigator.filter, 1, byte_offset-1)
Manifest_navigator.index = 1
Manifest_navigator.candidates = manifest_navigator_candidates()
elseif chord == 'left' then
if Manifest_navigator.index > 1 then
Manifest_navigator.index = Manifest_navigator.index-1
end
elseif chord == 'right' then
if Manifest_navigator.index < #Manifest_navigator.candidates then
Manifest_navigator.index = Manifest_navigator.index+1
end
elseif chord == 'down' then
manifest_navigator_down()
elseif chord == 'up' then
manifest_navigator_up()
end
end
{"Menu_border_color":612,"Menu_command_color":613,"Animating":726,"Menu_highlight_color":614,"draw_menu_bar":641,"mouse_cursor":558,"add_hotkey_to_menu":616,"Mouse_cursor":559,"draw_manifest_navigator":677,"num_lines_for_manifest_navigator":676,"draw_ticks":663,"reset_manifest_navigator":621,"scale":712,"load_from_iterator":670,"get_definition_from_app":735,"schema1_of_y":667,"manifest_navigator_up":628,"load_manifest":755,"manifest_navigator_down":635,"get_manifest":750,"y_of_schema1":364,"delete_definition":673,"definition_file":752,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"Definitions":503,"text_input_on_manifest_navigator":634,"new_definition":745,"manifest_coord":636,"manifest_index":637,"manifest_navigator_candidates":638,"add_def_to_menu":640,"approximate_up":658,"maybe_update_key_in_definitions":529,"font":353,"add_thick_line":400,"copy_shape":396,"tick_spec":660,"Cursor_node":172,"on_text":539,"on.text_input":521,"Surface":422,"on.draw":565,"load_definition":716,"Viewport":604,"on":1,"Menu_background_color":611,"on.initialize":695,"table_and_array_both_empty":689,"on.load_settings":754,"B":379,"initialize_editor":678,"compute_layout":385,"on.keychord_press":739,"A":713,"Ticks_font":669,"approximate":579,"vy":546,"on.key_release":720,"fw_parent":754,"on.code_change":753,"fw_app":"driver","draw_cursor":639,"update_editor_box":711,"on.update":741,"on_handle":547,"box_height":680,"Page":475,"Manifest_versions":749,"on.mouse_press":722,"set_mouse_cursor":562,"order_of_magnitude":573,"sx":544,"on.save_settings":742,"vx":545,"Manifest_navigator":495,"on.mouse_release":721,"--":727,"Manifest":748,"sy":469,"line_height":365}
load_manifest = function()
-- Connect to an app and load its manifest into global Manifest.
-- Also return the name of the app we have connected to.
local new_manifest, app_name, manifest_version = get_manifest()
-- preserve existing order
-- 1. add new definitions in front
for _,name in ipairs(new_manifest) do
if not array.find(Manifest, name) then
table.insert(Manifest, 1, name)
end
end
-- 2. remove missing definitions
for idx=#Manifest,1,-1 do
local name = Manifest[idx]
if not array.find(new_manifest, name) then
table.remove(Manifest, idx)
end
end
print('load_manifest', manifest_version)
return app_name, manifest_version
end
on.load_settings = function(settings)
local manifest_version
App_name, manifest_version = 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
for name, def in pairs(Definitions) do
--print(name, definition_file(name, manifest_version))
def.data = load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+"))
end
end
{"draw_ticks":663,"Menu_command_color":613,"Menu_highlight_color":614,"on.update":741,"on.keychord_press":739,"reset_manifest_navigator":621,"draw_cursor":639,"fw_parent":753,"fw_app":"driver","manifest_navigator_up":628,"vx":545,"approximate_up":658,"Animating":726,"move_candidate_to_front_of_manifest":632,"vy":546,"on.mouse_release":721,"on.mouse_press":722,"Page":475,"box_height":680,"on_handle":547,"on_text":539,"on.initialize":695,"y_of_schema1":364,"Manifest":748,"definition_file":752,"sy":469,"draw_menu_bar":641,"tick_spec":660,"font":353,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Mouse_cursor":559,"Manifest_navigator":495,"set_mouse_cursor":562,"new_definition":745,"load_definition":716,"line_height":365,"order_of_magnitude":573,"Manifest_versions":749,"delete_definition":673,"Definitions":503,"approximate":579,"on.save_settings":742,"keychord_press_on_manifest_navigator":675,"on.load_settings":754,"text_input_on_manifest_navigator":634,"maybe_update_key_in_definitions":529,"--":727,"manifest_coord":636,"load_from_iterator":670,"manifest_index":637,"on.draw":565,"manifest_navigator_candidates":638,"on.code_change":753,"update_editor_box":711,"add_def_to_menu":640,"get_definition_from_app":735,"load_manifest":694,"draw_manifest_navigator":677,"schema1_of_y":667,"get_manifest":750,"add_hotkey_to_menu":616,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"scale":712,"Surface":422,"manifest_navigator_down":635,"on.key_release":720,"on.text_input":521,"sx":544,"initialize_editor":678,"A":713,"Viewport":604,"compute_layout":385,"Ticks_font":669,"B":379,"table_and_array_both_empty":689,"Menu_background_color":611,"on":1,"Menu_border_color":612}
on.code_change = function()
print('code changed')
--[[
Animating = {
step = 0, frame_time = 0,
step_increment = -0.05,
start = Viewport.zoom,
viewport_key = 'zoom',
} --]]
A() -- just in case we edited Page
end
{"draw_ticks":663,"Menu_command_color":613,"Menu_highlight_color":614,"on.update":741,"on.keychord_press":739,"reset_manifest_navigator":621,"draw_cursor":639,"fw_parent":752,"fw_app":"driver","manifest_navigator_up":628,"vx":545,"approximate_up":658,"Animating":726,"move_candidate_to_front_of_manifest":632,"vy":546,"on.mouse_release":721,"on.mouse_press":722,"Page":475,"box_height":680,"on_handle":547,"on_text":539,"on.initialize":695,"y_of_schema1":364,"Manifest":748,"definition_file":752,"sy":469,"draw_menu_bar":641,"tick_spec":660,"font":353,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Mouse_cursor":559,"Manifest_navigator":495,"set_mouse_cursor":562,"new_definition":745,"load_definition":716,"line_height":365,"order_of_magnitude":573,"Manifest_versions":749,"delete_definition":673,"Definitions":503,"approximate":579,"on.save_settings":742,"keychord_press_on_manifest_navigator":675,"on.load_settings":751,"text_input_on_manifest_navigator":634,"maybe_update_key_in_definitions":529,"--":727,"manifest_coord":636,"load_from_iterator":670,"manifest_index":637,"on.draw":565,"manifest_navigator_candidates":638,"on.code_change":753,"update_editor_box":711,"add_def_to_menu":640,"get_definition_from_app":735,"load_manifest":694,"draw_manifest_navigator":677,"schema1_of_y":667,"get_manifest":750,"add_hotkey_to_menu":616,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"scale":712,"Surface":422,"manifest_navigator_down":635,"on.key_release":720,"on.text_input":521,"sx":544,"initialize_editor":678,"A":713,"Viewport":604,"compute_layout":385,"Ticks_font":669,"B":379,"table_and_array_both_empty":689,"Menu_background_color":611,"on":1,"Menu_border_color":612}
{"draw_ticks":663,"Menu_command_color":613,"Menu_highlight_color":614,"on.update":741,"on.keychord_press":739,"reset_manifest_navigator":621,"draw_cursor":639,"fw_parent":751,"fw_app":"driver","manifest_navigator_up":628,"vx":545,"approximate_up":658,"Animating":726,"move_candidate_to_front_of_manifest":632,"vy":546,"on.mouse_release":721,"on.mouse_press":722,"Page":475,"box_height":680,"on_handle":547,"on_text":539,"on.initialize":695,"y_of_schema1":364,"Manifest":748,"definition_file":752,"sy":469,"draw_menu_bar":641,"tick_spec":660,"font":353,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Mouse_cursor":559,"Manifest_navigator":495,"set_mouse_cursor":562,"new_definition":745,"load_definition":716,"line_height":365,"order_of_magnitude":573,"Manifest_versions":749,"delete_definition":673,"Definitions":503,"approximate":579,"on.save_settings":742,"keychord_press_on_manifest_navigator":675,"on.load_settings":751,"text_input_on_manifest_navigator":634,"maybe_update_key_in_definitions":529,"--":727,"manifest_coord":636,"load_from_iterator":670,"manifest_index":637,"on.draw":565,"manifest_navigator_candidates":638,"on.code_change":747,"update_editor_box":711,"add_def_to_menu":640,"get_definition_from_app":735,"load_manifest":694,"draw_manifest_navigator":677,"schema1_of_y":667,"get_manifest":750,"add_hotkey_to_menu":616,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"scale":712,"Surface":422,"manifest_navigator_down":635,"on.key_release":720,"on.text_input":521,"sx":544,"initialize_editor":678,"A":713,"Viewport":604,"compute_layout":385,"Ticks_font":669,"B":379,"table_and_array_both_empty":689,"Menu_background_color":611,"on":1,"Menu_border_color":612}
definition_file = function(name, manifest_version)
return love.filesystem.getSaveDirectory():gsub(love.filesystem.getIdentity()..'$', App_name)..'/'..live.versioned_filename(manifest_version[name], name)
end
on.load_settings = function(settings)
local manifest_version
App_name, manifest_version = 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
for name, def in pairs(Definitions) do
def.data = load_from_iterator(get_definition_from_app(name):gmatch("[^\r\n]+"))
end
end
{"draw_ticks":663,"Menu_command_color":613,"Menu_highlight_color":614,"on.update":741,"on.keychord_press":739,"reset_manifest_navigator":621,"draw_cursor":639,"fw_parent":750,"fw_app":"driver","manifest_navigator_up":628,"vx":545,"approximate_up":658,"Animating":726,"move_candidate_to_front_of_manifest":632,"vy":546,"on.mouse_release":721,"on.mouse_press":722,"Page":475,"box_height":680,"on_handle":547,"on_text":539,"on.initialize":695,"y_of_schema1":364,"Manifest":748,"definition_file":746,"sy":469,"draw_menu_bar":641,"tick_spec":660,"font":353,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Mouse_cursor":559,"Manifest_navigator":495,"set_mouse_cursor":562,"new_definition":745,"load_definition":716,"line_height":365,"order_of_magnitude":573,"Manifest_versions":749,"delete_definition":673,"Definitions":503,"approximate":579,"on.save_settings":742,"keychord_press_on_manifest_navigator":675,"on.load_settings":751,"text_input_on_manifest_navigator":634,"maybe_update_key_in_definitions":529,"--":727,"manifest_coord":636,"load_from_iterator":670,"manifest_index":637,"on.draw":565,"manifest_navigator_candidates":638,"on.code_change":747,"update_editor_box":711,"add_def_to_menu":640,"get_definition_from_app":735,"load_manifest":694,"draw_manifest_navigator":677,"schema1_of_y":667,"get_manifest":750,"add_hotkey_to_menu":616,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"scale":712,"Surface":422,"manifest_navigator_down":635,"on.key_release":720,"on.text_input":521,"sx":544,"initialize_editor":678,"A":713,"Viewport":604,"compute_layout":385,"Ticks_font":669,"B":379,"table_and_array_both_empty":689,"Menu_background_color":611,"on":1,"Menu_border_color":612}
{"draw_ticks":663,"Menu_command_color":613,"Menu_highlight_color":614,"on.update":741,"on.keychord_press":739,"reset_manifest_navigator":621,"draw_cursor":639,"fw_parent":749,"fw_app":"driver","manifest_navigator_up":628,"vx":545,"approximate_up":658,"Animating":726,"move_candidate_to_front_of_manifest":632,"vy":546,"on.mouse_release":721,"on.mouse_press":722,"Page":475,"box_height":680,"on_handle":547,"on_text":539,"on.initialize":695,"y_of_schema1":364,"Manifest":748,"definition_file":746,"sy":469,"draw_menu_bar":641,"tick_spec":660,"font":353,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Mouse_cursor":559,"Manifest_navigator":495,"set_mouse_cursor":562,"new_definition":745,"load_definition":716,"line_height":365,"order_of_magnitude":573,"Manifest_versions":749,"delete_definition":673,"Definitions":503,"approximate":579,"on.save_settings":742,"keychord_press_on_manifest_navigator":675,"on.load_settings":700,"text_input_on_manifest_navigator":634,"maybe_update_key_in_definitions":529,"--":727,"manifest_coord":636,"load_from_iterator":670,"manifest_index":637,"on.draw":565,"manifest_navigator_candidates":638,"on.code_change":747,"update_editor_box":711,"add_def_to_menu":640,"get_definition_from_app":735,"load_manifest":694,"draw_manifest_navigator":677,"schema1_of_y":667,"get_manifest":750,"add_hotkey_to_menu":616,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"scale":712,"Surface":422,"manifest_navigator_down":635,"on.key_release":720,"on.text_input":521,"sx":544,"initialize_editor":678,"A":713,"Viewport":604,"compute_layout":385,"Ticks_font":669,"B":379,"table_and_array_both_empty":689,"Menu_background_color":611,"on":1,"Menu_border_color":612}
get_manifest = function()
live.send_to_app('MANIFEST')
local response
repeat
love.timer.sleep(0.01)
response = live.receive_from_app()
until response
local result = {}
if #response == 0 then
-- error; retry
return result
else
-- stop retrying
Manifest_navigator.reload = false
end
local app_name
local manifest_version = json.decode(response)
for name, value in pairs(manifest_version) do
if not starts_with(name, 'fw_') then
table.insert(result, name)
elseif name == 'fw_app' then
app_name = value
end
end
print('get manifest', manifest_version)
return result, app_name, manifest_version
end
{"draw_ticks":663,"Menu_command_color":613,"Menu_highlight_color":614,"on.update":741,"on.keychord_press":739,"reset_manifest_navigator":621,"draw_cursor":639,"fw_parent":748,"fw_app":"driver","manifest_navigator_up":628,"vx":545,"approximate_up":658,"Animating":726,"move_candidate_to_front_of_manifest":632,"vy":546,"on.mouse_release":721,"on.mouse_press":722,"Page":475,"box_height":680,"on_handle":547,"on_text":539,"on.initialize":695,"y_of_schema1":364,"Manifest":748,"definition_file":746,"sy":469,"draw_menu_bar":641,"tick_spec":660,"font":353,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Mouse_cursor":559,"Manifest_navigator":495,"set_mouse_cursor":562,"new_definition":745,"load_definition":716,"line_height":365,"order_of_magnitude":573,"Manifest_versions":749,"delete_definition":673,"Definitions":503,"approximate":579,"on.save_settings":742,"keychord_press_on_manifest_navigator":675,"on.load_settings":700,"text_input_on_manifest_navigator":634,"maybe_update_key_in_definitions":529,"--":727,"manifest_coord":636,"load_from_iterator":670,"manifest_index":637,"on.draw":565,"manifest_navigator_candidates":638,"on.code_change":747,"update_editor_box":711,"add_def_to_menu":640,"get_definition_from_app":735,"load_manifest":694,"draw_manifest_navigator":677,"schema1_of_y":667,"get_manifest":706,"add_hotkey_to_menu":616,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"scale":712,"Surface":422,"manifest_navigator_down":635,"on.key_release":720,"on.text_input":521,"sx":544,"initialize_editor":678,"A":713,"Viewport":604,"compute_layout":385,"Ticks_font":669,"B":379,"table_and_array_both_empty":689,"Menu_background_color":611,"on":1,"Menu_border_color":612}
Manifest_versions = {
-- map from definition name to its version id in the file system
-- Up to date after calling load_settings/load_manifest/get_manifest. Then it slowly diverges from reality.
}
{"draw_ticks":663,"Menu_command_color":613,"Menu_highlight_color":614,"on.update":741,"on.keychord_press":739,"reset_manifest_navigator":621,"draw_cursor":639,"fw_parent":747,"fw_app":"driver","manifest_navigator_up":628,"vx":545,"approximate_up":658,"Animating":726,"move_candidate_to_front_of_manifest":632,"vy":546,"on.mouse_release":721,"on.mouse_press":722,"Page":475,"box_height":680,"on_handle":547,"on_text":539,"on.initialize":695,"y_of_schema1":364,"Manifest":748,"definition_file":746,"sy":469,"draw_menu_bar":641,"tick_spec":660,"font":353,"mouse_cursor":558,"num_lines_for_manifest_navigator":676,"Mouse_cursor":559,"Manifest_navigator":495,"set_mouse_cursor":562,"new_definition":745,"load_definition":716,"line_height":365,"order_of_magnitude":573,"delete_definition":673,"Definitions":503,"approximate":579,"on.save_settings":742,"keychord_press_on_manifest_navigator":675,"on.load_settings":700,"text_input_on_manifest_navigator":634,"maybe_update_key_in_definitions":529,"--":727,"manifest_coord":636,"load_from_iterator":670,"manifest_index":637,"on.draw":565,"manifest_navigator_candidates":638,"on.code_change":747,"update_editor_box":711,"add_def_to_menu":640,"get_definition_from_app":735,"load_manifest":694,"draw_manifest_navigator":677,"schema1_of_y":667,"get_manifest":706,"add_hotkey_to_menu":616,"add_thick_line":400,"Cursor_node":172,"copy_shape":396,"scale":712,"Surface":422,"manifest_navigator_down":635,"on.key_release":720,"on.text_input":521,"sx":544,"initialize_editor":678,"A":713,"Viewport":604,"compute_layout":385,"Ticks_font":669,"B":379,"table_and_array_both_empty":689,"Menu_background_color":611,"on":1,"Menu_border_color":612}
Manifest = {
-- list of definitions to display in command palette
-- Don't confuse this with Live.manifest, the manifest for the current (driver) app.
-- Manifest is for the client app.
}
on.code_change = function()
print('code changed')
--print(definition_file('Angle'))
--[[
Animating = {
step = 0, frame_time = 0,
step_increment = -0.05,
start = Viewport.zoom,
viewport_key = 'zoom',
} --]]
A() -- just in case we edited Page
end
{"copy_shape":396,"manifest_navigator_up":628,"manifest_navigator_down":635,"on":1,"Page":475,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"text_input_on_manifest_navigator":634,"on_handle":547,"initialize_editor":678,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"on.key_release":720,"compute_layout":385,"on.text_input":521,"mouse_cursor":558,"Mouse_cursor":559,"tick_spec":660,"set_mouse_cursor":562,"draw_ticks":663,"definition_file":746,"line_height":365,"order_of_magnitude":573,"get_manifest":706,"approximate":579,"load_manifest":694,"vx":545,"scale":712,"load_definition":716,"fw_parent":746,"vy":546,"fw_app":"driver","font":353,"box_height":680,"--":727,"on.mouse_press":722,"Ticks_font":669,"on.mouse_release":721,"on.save_settings":742,"on.update":741,"on.load_settings":700,"update_editor_box":711,"A":713,"Manifest_navigator":495,"table_and_array_both_empty":689,"on.initialize":695,"Animating":726,"schema1_of_y":667,"y_of_schema1":364,"Cursor_node":172,"Manifest":744,"Menu_background_color":611,"on.keychord_press":739,"Menu_border_color":612,"Viewport":604,"Menu_command_color":613,"draw_cursor":639,"Menu_highlight_color":614,"new_definition":745,"draw_menu_bar":641,"Definitions":503,"add_hotkey_to_menu":616,"B":379,"Surface":422,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"on.code_change":747,"reset_manifest_navigator":621,"on.draw":565,"approximate_up":658,"load_from_iterator":670,"maybe_update_key_in_definitions":529,"add_thick_line":400}
{"copy_shape":396,"manifest_navigator_up":628,"manifest_navigator_down":635,"on":1,"Page":475,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"text_input_on_manifest_navigator":634,"on_handle":547,"initialize_editor":678,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"on.key_release":720,"compute_layout":385,"on.text_input":521,"mouse_cursor":558,"Mouse_cursor":559,"tick_spec":660,"set_mouse_cursor":562,"draw_ticks":663,"definition_file":746,"line_height":365,"order_of_magnitude":573,"get_manifest":706,"approximate":579,"load_manifest":694,"vx":545,"scale":712,"load_definition":716,"fw_parent":745,"vy":546,"fw_app":"driver","font":353,"box_height":680,"--":727,"on.mouse_press":722,"Ticks_font":669,"on.mouse_release":721,"on.save_settings":742,"on.update":741,"on.load_settings":700,"update_editor_box":711,"A":713,"Manifest_navigator":495,"table_and_array_both_empty":689,"on.initialize":695,"Animating":726,"schema1_of_y":667,"y_of_schema1":364,"Cursor_node":172,"Manifest":744,"Menu_background_color":611,"on.keychord_press":739,"Menu_border_color":612,"Viewport":604,"Menu_command_color":613,"draw_cursor":639,"Menu_highlight_color":614,"new_definition":745,"draw_menu_bar":641,"Definitions":503,"add_hotkey_to_menu":616,"B":379,"Surface":422,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"on.code_change":734,"reset_manifest_navigator":621,"on.draw":565,"approximate_up":658,"load_from_iterator":670,"maybe_update_key_in_definitions":529,"add_thick_line":400}
definition_file = function(name)
return love.filesystem.getSaveDirectory():gsub(love.filesystem.getIdentity()..'$', App_name)..'/'..live.versioned_filename(Live.manifest[name], name)
end
new_definition = function()
table.insert(Definitions, {
type='text',
data={''},
x=0, y=0,
width=600,
bg={r=0.7,g=0.7,b=1},
})
Viewport.x = Definitions[name].x-30
Viewport.y = Definitions[name].y-30
Cursor_node = Definitions[name]
Cursor_node.show_cursor = true
end
{"copy_shape":396,"manifest_navigator_up":628,"manifest_navigator_down":635,"on":1,"Page":475,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"text_input_on_manifest_navigator":634,"on_handle":547,"initialize_editor":678,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"on.key_release":720,"compute_layout":385,"on.text_input":521,"mouse_cursor":558,"Mouse_cursor":559,"tick_spec":660,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"order_of_magnitude":573,"get_manifest":706,"approximate":579,"load_manifest":694,"vx":545,"scale":712,"load_definition":716,"fw_parent":744,"vy":546,"fw_app":"driver","font":353,"box_height":680,"--":727,"on.mouse_press":722,"Ticks_font":669,"on.mouse_release":721,"on.save_settings":742,"on.update":741,"on.load_settings":700,"update_editor_box":711,"A":713,"Manifest_navigator":495,"table_and_array_both_empty":689,"on.initialize":695,"Animating":726,"schema1_of_y":667,"y_of_schema1":364,"Cursor_node":172,"Manifest":744,"Menu_background_color":611,"on.keychord_press":739,"Menu_border_color":612,"Viewport":604,"Menu_command_color":613,"draw_cursor":639,"Menu_highlight_color":614,"new_definition":745,"draw_menu_bar":641,"Definitions":503,"add_hotkey_to_menu":616,"B":379,"Surface":422,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"on.code_change":734,"reset_manifest_navigator":621,"on.draw":565,"approximate_up":658,"load_from_iterator":670,"maybe_update_key_in_definitions":529,"add_thick_line":400}
{"copy_shape":396,"manifest_navigator_up":628,"manifest_navigator_down":635,"on":1,"Page":475,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"text_input_on_manifest_navigator":634,"on_handle":547,"initialize_editor":678,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"on.key_release":720,"compute_layout":385,"on.text_input":521,"mouse_cursor":558,"Mouse_cursor":559,"tick_spec":660,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"order_of_magnitude":573,"get_manifest":706,"approximate":579,"load_manifest":694,"vx":545,"scale":712,"load_definition":716,"fw_parent":743,"vy":546,"fw_app":"driver","font":353,"box_height":680,"--":727,"on.mouse_press":722,"Ticks_font":669,"on.mouse_release":721,"on.save_settings":742,"on.update":741,"on.load_settings":700,"update_editor_box":711,"A":713,"Manifest_navigator":495,"table_and_array_both_empty":689,"on.initialize":695,"Animating":726,"schema1_of_y":667,"y_of_schema1":364,"Cursor_node":172,"Manifest":744,"Menu_background_color":611,"on.keychord_press":739,"Menu_border_color":612,"Viewport":604,"Menu_command_color":613,"draw_cursor":639,"Menu_highlight_color":614,"new_definition":681,"draw_menu_bar":641,"Definitions":503,"add_hotkey_to_menu":616,"B":379,"Surface":422,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"on.code_change":734,"reset_manifest_navigator":621,"on.draw":565,"approximate_up":658,"load_from_iterator":670,"maybe_update_key_in_definitions":529,"add_thick_line":400}
Manifest = {
-- list of definitions to display in command palette
-- We can't reuse Live.manifest because we care
-- about and manage the order of display.
}
{"copy_shape":396,"manifest_navigator_up":628,"manifest_navigator_down":635,"on":1,"Page":475,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"text_input_on_manifest_navigator":634,"on_handle":547,"initialize_editor":678,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"on.key_release":720,"compute_layout":385,"on.text_input":521,"mouse_cursor":558,"Mouse_cursor":559,"tick_spec":660,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"order_of_magnitude":573,"get_manifest":706,"approximate":579,"load_manifest":694,"vx":545,"scale":712,"load_definition":716,"fw_parent":742,"vy":546,"fw_app":"driver","font":353,"box_height":680,"--":727,"on.mouse_press":722,"Ticks_font":669,"on.mouse_release":721,"on.save_settings":742,"on.update":741,"on.load_settings":700,"update_editor_box":711,"A":713,"Manifest_navigator":495,"table_and_array_both_empty":689,"on.initialize":695,"Animating":726,"schema1_of_y":667,"y_of_schema1":364,"Cursor_node":172,"Manifest":743,"Menu_background_color":611,"on.keychord_press":739,"Menu_border_color":612,"Viewport":604,"Menu_command_color":613,"draw_cursor":639,"Menu_highlight_color":614,"new_definition":681,"draw_menu_bar":641,"Definitions":503,"add_hotkey_to_menu":616,"B":379,"Surface":422,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"on.code_change":734,"reset_manifest_navigator":621,"on.draw":565,"approximate_up":658,"load_from_iterator":670,"maybe_update_key_in_definitions":529,"add_thick_line":400}
Manifest = {
-- list of definitions to display in command palette
-- TODO: can we just reuse Live.manifest here?
}
on.save_settings = function()
if Settings == nil then
Settings = {} -- just for initial schema migration
end
for key,node in pairs(Definitions) do
if type(key) == 'number' then
-- can't save the array side for now because of a limitation in the
Definitions[key] = nil
else
node.data = nil -- don't save uncommitted data for now
node.show_cursor = nil
node.editor = nil -- TODO: check for hierarchy
end
end
Settings[App_name] = {
viewport=Viewport,
definitions=Definitions,
}
return Settings
end
{"copy_shape":396,"manifest_navigator_up":628,"manifest_navigator_down":635,"on":1,"Page":475,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"text_input_on_manifest_navigator":634,"on_handle":547,"initialize_editor":678,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"on.key_release":720,"compute_layout":385,"on.text_input":521,"mouse_cursor":558,"Mouse_cursor":559,"tick_spec":660,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"order_of_magnitude":573,"get_manifest":706,"approximate":579,"load_manifest":694,"vx":545,"scale":712,"load_definition":716,"fw_parent":741,"vy":546,"fw_app":"driver","font":353,"box_height":680,"--":727,"on.mouse_press":722,"Ticks_font":669,"on.mouse_release":721,"on.save_settings":742,"on.update":741,"on.load_settings":700,"update_editor_box":711,"A":713,"Manifest_navigator":495,"table_and_array_both_empty":689,"on.initialize":695,"Animating":726,"schema1_of_y":667,"y_of_schema1":364,"Cursor_node":172,"Manifest":494,"Menu_background_color":611,"on.keychord_press":739,"Menu_border_color":612,"Viewport":604,"Menu_command_color":613,"draw_cursor":639,"Menu_highlight_color":614,"new_definition":681,"draw_menu_bar":641,"Definitions":503,"add_hotkey_to_menu":616,"B":379,"Surface":422,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"on.code_change":734,"reset_manifest_navigator":621,"on.draw":565,"approximate_up":658,"load_from_iterator":670,"maybe_update_key_in_definitions":529,"add_thick_line":400}
on.update = function(dt)
if Animating then
Animating.frame_time = Animating.frame_time + dt
print(Animating.frame_time)
if Animating.frame_time > 0.01 then
Animating.frame_time = Animating.frame_time - 0.01
Animating.step = Animating.step+1
if Animating.step >= 10 then
Animating = nil
return
end
Viewport[Animating.viewport_key] = Animating.start + Animating.step * Animating.step_increment
B()
end
return
end
if Pan then
set_mouse_cursor('hand')
elseif Move or on_handle(App.mouse_x(), App.mouse_y()) then
set_mouse_cursor('crosshair')
else
set_mouse_cursor('arrow')
end
if Pan then
Viewport.x = Pan.x - App.mouse_x()
Viewport.y = Pan.y - App.mouse_y()
B()
return
end
if Move then
Move.node.x = sx(App.mouse_x())-Move.xoff
Move.node.y = sy(App.mouse_y())-Move.yoff
A()
return
end
end
{"copy_shape":396,"manifest_navigator_up":628,"manifest_navigator_down":635,"on":1,"Page":475,"delete_definition":673,"move_candidate_to_front_of_manifest":632,"keychord_press_on_manifest_navigator":675,"text_input_on_manifest_navigator":634,"on_handle":547,"initialize_editor":678,"manifest_coord":636,"manifest_index":637,"on_text":539,"manifest_navigator_candidates":638,"add_def_to_menu":640,"sx":544,"on.key_release":720,"compute_layout":385,"on.text_input":521,"mouse_cursor":558,"Mouse_cursor":559,"tick_spec":660,"set_mouse_cursor":562,"draw_ticks":663,"line_height":365,"order_of_magnitude":573,"get_manifest":706,"approximate":579,"load_manifest":694,"vx":545,"scale":712,"load_definition":716,"fw_parent":740,"vy":546,"fw_app":"driver","font":353,"box_height":680,"--":727,"on.mouse_press":722,"Ticks_font":669,"on.mouse_release":721,"on.save_settings":702,"on.update":741,"on.load_settings":700,"update_editor_box":711,"A":713,"Manifest_navigator":495,"table_and_array_both_empty":689,"on.initialize":695,"Animating":726,"schema1_of_y":667,"y_of_schema1":364,"Cursor_node":172,"Manifest":494,"Menu_background_color":611,"on.keychord_press":739,"Menu_border_color":612,"Viewport":604,"Menu_command_color":613,"draw_cursor":639,"Menu_highlight_color":614,"new_definition":681,"draw_menu_bar":641,"Definitions":503,"add_hotkey_to_menu":616,"B":379,"Surface":422,"draw_manifest_navigator":677,"get_definition_from_app":735,"num_lines_for_manifest_navigator":676,"sy":469,"on.code_change":734,"reset_manifest_navigator":621,"on.draw":565,"approximate_up":658,"load_from_iterator":670,"maybe_update_key_in_definitions":529,"add_thick_line":400}
on.update = function(dt)
print(dt)
if Animating then
Animating.frame_time = Animating.frame_time + dt
print(Animating.frame_time)
if Animating.frame_time > 0.01 then
Animating.frame_time = Animating.frame_time - 0.01
Animating.step = Animating.step+1
if Animating.step >= 10 then
Animating = nil
return
end
Viewport[Animating.viewport_key] = Animating.start + Animating.step * Animating.step_increment
B()
end
return
end
if Pan then
set_mouse_cursor('hand')
elseif Move or on_handle(App.mouse_x(), App.mouse_y()) then
set_mouse_cursor('crosshair')
else
set_mouse_cursor('arrow')
end
if Pan then
Viewport.x = Pan.x - App.mouse_x()
Viewport.y = Pan.y - App.mouse_y()
B()
return
end
if Move then
Move.node.x = sx(App.mouse_x())-Move.xoff
Move.node.y = sy(App.mouse_y())-Move.yoff
A()
return
end
end
{"keychord_press_on_manifest_navigator":675,"on.mouse_press":722,"y_of_schema1":364,"on.mouse_release":721,"manifest_coord":636,"on.update":740,"manifest_index":637,"manifest_navigator_candidates":638,"set_mouse_cursor":562,"add_def_to_menu":640,"draw_ticks":663,"line_height":365,"font":353,"order_of_magnitude":573,"fw_parent":739,"fw_app":"driver","approximate":579,"on":1,"tick_spec":660,"add_thick_line":400,"copy_shape":396,"--":727,"box_height":680,"compute_layout":385,"Manifest_navigator":495,"on.code_change":734,"load_definition":716,"on.save_settings":702,"on.load_settings":700,"load_manifest":694,"get_manifest":706,"Ticks_font":669,"initialize_editor":678,"Definitions":503,"new_definition":681,"Manifest":494,"text_input_on_manifest_navigator":634,"table_and_array_both_empty":689,"move_candidate_to_front_of_manifest":632,"maybe_update_key_in_definitions":529,"delete_definition":673,"Menu_background_color":611,"on.initialize":695,"vy":546,"A":713,"Menu_border_color":612,"approximate_up":658,"Menu_command_color":613,"Animating":726,"Menu_highlight_color":614,"update_editor_box":711,"draw_menu_bar":641,"mouse_cursor":558,"add_hotkey_to_menu":616,"Page":475,"Mouse_cursor":559,"draw_manifest_navigator":677,"on_handle":547,"num_lines_for_manifest_navigator":676,"on.text_input":521,"on.draw":565,"reset_manifest_navigator":621,"on_text":539,"scale":712,"load_from_iterator":670,"sy":469,"get_definition_from_app":735,"Surface":422,"sx":544,"B":379,"vx":545,"manifest_navigator_up":628,"Cursor_node":172,"manifest_navigator_down":635,"Viewport":604,"on.keychord_press":739,"on.key_release":720,"schema1_of_y":667,"draw_cursor":639}