config.h (966B)
1 /* hfc config file */ 2 3 #ifndef HFC_CONFIG_H 4 #define HFC_CONFIG_H 5 6 #include <stddef.h> 7 #include <stdbool.h> 8 9 #define MAX_KEYBINDINGS 64 10 11 typedef struct { 12 char fg[16]; 13 char bg[16]; 14 bool bold; 15 } ColorSetting; 16 17 typedef struct { 18 ColorSetting header; 19 ColorSetting footer; 20 ColorSetting entry_selected; 21 ColorSetting entry_highlight; 22 ColorSetting entry_default; 23 ColorSetting table_header; 24 25 char path_urls[256]; 26 } HFCConfig; 27 28 typedef struct { 29 int key; 30 char action[32]; 31 } KeyBinding; 32 33 extern HFCConfig config; 34 extern KeyBinding keybindings[MAX_KEYBINDINGS]; 35 extern int keybinding_count; 36 37 void init_colors(void); 38 void load_config(void); 39 const char *get_config_path(const char *filename, char *buffer, size_t size); 40 void apply_color(ColorSetting *setting, short pair_id); 41 void remove_color(ColorSetting *setting, short pair_id); 42 const char *get_keys_for_action(const char *action); 43 short get_color_code(const char *name); 44 45 #endif 46