diff options
| author | Arslaan Pathan <[email protected]> | 2026-03-27 15:27:07 +1300 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-03-27 15:27:07 +1300 |
| commit | 3d03dff199e057582b342d8dfd74af971bc2273b (patch) | |
| tree | 630575056ba8937ed87282049e962cd8ec01c9ed /config.def.h | |
| parent | 7bc8d32de08de78945fd7893a4343875970e0012 (diff) | |
| download | cinnamon-browser-3d03dff199e057582b342d8dfd74af971bc2273b.tar.xz cinnamon-browser-3d03dff199e057582b342d8dfd74af971bc2273b.zip | |
Implement command bar, make Keybinds use functions rather than command strings
Diffstat (limited to 'config.def.h')
| -rw-r--r-- | config.def.h | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/config.def.h b/config.def.h index 8ea25ec..485c3b5 100644 --- a/config.def.h +++ b/config.def.h @@ -4,6 +4,11 @@ #ifndef CONFIG_H #define CONFIG_H +/* forward declarations */ +int mode; +/* Cinnamon is declared in main.c before including config.h. Yes, I know this code is held together by hopes and dreams, but good enough. */ +void tabopen(Cinnamon* cinnamon); + /* default window width/height, can be resized after. */ #define WINDOW_WIDTH 1024 #define WINDOW_HEIGHT 768 @@ -16,25 +21,28 @@ /* Keybind definitions */ typedef struct { const char* key; - const char* command; + void (*fptr)(Cinnamon*); } Keybind; -/* TODO: make this use functions and not command strings */ +static void _insmode(Cinnamon* cinnamon) { + mode = 1; +} + static const Keybind keybinds[] = { - { "<S-o>", ":tab_open" }, - { "d", ":tab_close" }, - { "o", ":commandline_show \":open\"" }, - { "i", ":mode insert" }, - { "<A-1>", ":tab_select 1" }, - { "<A-2>", ":tab_select 2" }, - { "<A-3>", ":tab_select 3" }, - { "<A-4>", ":tab_select 4" }, - { "<A-5>", ":tab_select 5" }, - { "<A-6>", ":tab_select 6" }, - { "<A-7>", ":tab_select 7" }, - { "<A-8>", ":tab_select 8" }, - { "<A-9>", ":tab_select 9" }, - { "<A-0>", ":tab_select 10" }, + { "<S-o>", &tabopen }, + // { "d", ":tab_close" }, + // { "o", ":commandline_show \":open\"" }, + { "i", &_insmode }, + // { "<A-1>", ":tab_select 1" }, + // { "<A-2>", ":tab_select 2" }, + // { "<A-3>", ":tab_select 3" }, + // { "<A-4>", ":tab_select 4" }, + // { "<A-5>", ":tab_select 5" }, + // { "<A-6>", ":tab_select 6" }, + // { "<A-7>", ":tab_select 7" }, + // { "<A-8>", ":tab_select 8" }, + // { "<A-9>", ":tab_select 9" }, + // { "<A-0>", ":tab_select 10" }, }; #endif |
