This commit is contained in:
Allen Webster 2016-02-26 00:50:43 -05:00
commit 362d1ce70c
3 changed files with 28 additions and 24 deletions

View File

@ -76,7 +76,7 @@ HOOK_SIG(my_file_settings){
push_parameter(app, cmd_context, par_lex_as_cpp_file, treat_as_code);
push_parameter(app, cmd_context, par_wrap_lines, !treat_as_code);
push_parameter(app, cmd_context, par_key_mapid, (treat_as_code)?(my_code_map):(mapid_file));
push_parameter(app, cmd_context, par_key_mapid, (treat_as_code)?((int)my_code_map):((int)mapid_file));
exec_command(cmd_context, cmdid_set_settings);
}
}

View File

@ -12,9 +12,7 @@
#include "4ed_keyboard.cpp"
internal void
keycode_init(Display* dpy, Key_Codes *codes){
set_dynamic_key_names(codes);
keycode_init(Display* dpy){
#if 0
// NOTE(inso): these are for XInput, currently not used.
@ -46,18 +44,18 @@ keycode_init(Display* dpy, Key_Codes *codes){
KeySym sym;
Code code;
} sym_table[] = {
{ XK_BackSpace, codes->back },
{ XK_Delete, codes->del },
{ XK_Up, codes->up },
{ XK_Down, codes->down },
{ XK_Left, codes->left },
{ XK_Right, codes->right },
{ XK_Insert, codes->insert },
{ XK_Home, codes->home },
{ XK_End, codes->end },
{ XK_Page_Up, codes->page_up },
{ XK_Page_Down, codes->page_down },
{ XK_Escape, codes->esc }
{ XK_BackSpace, key_back },
{ XK_Delete, key_del },
{ XK_Up, key_up },
{ XK_Down, key_down },
{ XK_Left, key_left },
{ XK_Right, key_right },
{ XK_Insert, key_insert },
{ XK_Home, key_home },
{ XK_End, key_end },
{ XK_Page_Up, key_page_up },
{ XK_Page_Down, key_page_down },
{ XK_Escape, key_esc }
};
const int table_size = sizeof(sym_table) / sizeof(struct SymMapping);

View File

@ -22,7 +22,12 @@
#include "4ed_mem.cpp"
#include "4ed_math.cpp"
#include "4coder_custom.h"
#include "4coder_custom.cpp"
#undef exec_command
#undef exec_command_keep_stack
#undef clear_parameters
#include "4ed_system.h"
#include "4ed_rendering.h"
#include "4ed.h"
@ -101,8 +106,7 @@ struct Linux_Vars{
XIM input_method;
XIMStyle input_style;
XIC input_context;
Key_Codes key_codes;
Key_Input_Data key_data;
Mouse_State mouse_data;
@ -1630,7 +1634,7 @@ main(int argc, char **argv)
linuxvars.XDisplay = XOpenDisplay(0);
keycode_init(linuxvars.XDisplay, &linuxvars.key_codes);
keycode_init(linuxvars.XDisplay);
#ifdef FRED_SUPER
char *custom_file_default = "4coder_custom.so";
@ -1651,6 +1655,10 @@ main(int argc, char **argv)
}
#endif
if (linuxvars.custom_api.get_bindings == 0){
linuxvars.custom_api.get_bindings = get_bindings;
}
Thread_Context background[4] = {};
linuxvars.groups[BACKGROUND_THREADS].threads = background;
linuxvars.groups[BACKGROUND_THREADS].count = ArrayCount(background);
@ -1796,8 +1804,7 @@ main(int argc, char **argv)
XSetWMProtocols(linuxvars.XDisplay, linuxvars.XWindow, &WM_DELETE_WINDOW, 1);
}
linuxvars.app.init(linuxvars.system, &linuxvars.target,
&memory_vars, &exchange_vars, &linuxvars.key_codes,
linuxvars.app.init(linuxvars.system, &linuxvars.target, &memory_vars, &exchange_vars,
linuxvars.clipboard_contents, current_directory,
linuxvars.custom_api);
@ -1929,7 +1936,7 @@ main(int argc, char **argv)
case MappingNotify: {
if(Event.xmapping.request == MappingModifier || Event.xmapping.request == MappingKeyboard){
XRefreshKeyboardMapping(&Event.xmapping);
keycode_init(linuxvars.XDisplay, &linuxvars.key_codes);
keycode_init(linuxvars.XDisplay);
}
}break;
@ -2057,7 +2064,6 @@ main(int argc, char **argv)
u64 start_time = system_time();
linuxvars.app.step(linuxvars.system,
&linuxvars.key_codes,
&input_data,
&mouse,
&linuxvars.target,