2017-01-29 00:03:23 +00:00
|
|
|
/*
|
|
|
|
4coder_default_bidings.cpp - Supplies the default bindings used for default 4coder behavior.
|
|
|
|
*/
|
2016-03-15 14:12:06 +00:00
|
|
|
|
2016-03-21 22:27:27 +00:00
|
|
|
// TOP
|
|
|
|
|
2018-05-09 07:10:07 +00:00
|
|
|
#if !defined(FCODER_DEFAULT_BINDINGS_CPP)
|
|
|
|
#define FCODER_DEFAULT_BINDINGS_CPP
|
2016-06-28 22:58:50 +00:00
|
|
|
|
2016-05-06 16:45:50 +00:00
|
|
|
#include "4coder_default_include.cpp"
|
2020-01-15 18:14:17 +00:00
|
|
|
|
|
|
|
// NOTE(allen): Users can declare their own managed IDs here.
|
|
|
|
|
2019-12-17 08:11:31 +00:00
|
|
|
#include "4coder_default_map.cpp"
|
2020-01-19 18:30:37 +00:00
|
|
|
#include "4coder_mac_map.cpp"
|
2020-01-15 18:14:17 +00:00
|
|
|
#include "generated/managed_id_metadata.cpp"
|
2019-10-14 22:57:47 +00:00
|
|
|
|
2019-10-10 22:57:02 +00:00
|
|
|
void
|
|
|
|
custom_layer_init(Application_Links *app){
|
|
|
|
Thread_Context *tctx = get_thread_context(app);
|
2019-12-03 19:35:41 +00:00
|
|
|
|
|
|
|
// NOTE(allen): setup for default framework
|
2019-10-22 05:17:24 +00:00
|
|
|
async_task_handler_init(app, &global_async_system);
|
2019-10-31 21:42:11 +00:00
|
|
|
code_index_init();
|
2019-11-05 06:25:19 +00:00
|
|
|
buffer_modified_set_init();
|
2019-10-26 20:48:50 +00:00
|
|
|
Profile_Global_List *list = get_core_profile_list(app);
|
|
|
|
ProfileThreadName(tctx, list, string_u8_litexpr("main"));
|
2019-11-25 20:32:02 +00:00
|
|
|
initialize_managed_id_metadata(app);
|
2019-11-26 06:09:31 +00:00
|
|
|
set_default_color_scheme(app);
|
2019-12-03 19:35:41 +00:00
|
|
|
|
|
|
|
// NOTE(allen): default hooks and command maps
|
|
|
|
set_all_default_hooks(app);
|
|
|
|
mapping_init(tctx, &framework_mapping);
|
2019-12-17 08:11:31 +00:00
|
|
|
setup_default_mapping(&framework_mapping, mapid_global, mapid_file, mapid_code);
|
2016-03-15 14:12:06 +00:00
|
|
|
}
|
2019-10-14 22:57:47 +00:00
|
|
|
|
2020-01-19 21:30:28 +00:00
|
|
|
function void
|
|
|
|
setup_built_in_mapping(Application_Links *app, String_Const_u8 name, Mapping *mapping, i64 global_id, i64 file_id, i64 code_id){
|
|
|
|
Thread_Context *tctx = get_thread_context(app);
|
|
|
|
if (string_match(name, string_u8_litexpr("default"))){
|
|
|
|
mapping_release(tctx, mapping);
|
|
|
|
mapping_init(tctx, mapping);
|
|
|
|
setup_default_mapping(mapping, global_id, file_id, code_id);
|
|
|
|
}
|
|
|
|
else if (string_match(name, string_u8_litexpr("mac-default"))){
|
|
|
|
mapping_release(tctx, mapping);
|
|
|
|
mapping_init(tctx, mapping);
|
|
|
|
setup_mac_mapping(mapping, global_id, file_id, code_id);
|
|
|
|
}
|
|
|
|
else if (string_match(name, string_u8_litexpr("choose"))){
|
|
|
|
mapping_release(tctx, mapping);
|
|
|
|
mapping_init(tctx, mapping);
|
|
|
|
#if OS_MAC
|
|
|
|
setup_mac_mapping(mapping, global_id, file_id, code_id);
|
|
|
|
#else
|
|
|
|
setup_default_mapping(mapping, global_id, file_id, code_id);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-28 22:58:50 +00:00
|
|
|
#endif //FCODER_DEFAULT_BINDINGS
|
2016-05-12 02:15:54 +00:00
|
|
|
|
2016-03-21 22:27:27 +00:00
|
|
|
// BOTTOM
|
2017-01-29 00:03:23 +00:00
|
|
|
|