/* * DWN - Desktop Window Manager * Configuration system */ #ifndef DWN_CONFIG_H #define DWN_CONFIG_H #include "dwn.h" #include /* Color configuration */ typedef struct { unsigned long panel_bg; unsigned long panel_fg; unsigned long workspace_active; unsigned long workspace_inactive; unsigned long workspace_urgent; unsigned long title_focused_bg; unsigned long title_focused_fg; unsigned long title_unfocused_bg; unsigned long title_unfocused_fg; unsigned long border_focused; unsigned long border_unfocused; unsigned long notification_bg; unsigned long notification_fg; } ColorScheme; /* Configuration structure */ struct Config { /* General */ char terminal[128]; char launcher[128]; char file_manager[128]; FocusMode focus_mode; bool show_decorations; /* Appearance */ int border_width; int title_height; int panel_height; int gap; char font_name[128]; ColorScheme colors; /* Layout */ float default_master_ratio; int default_master_count; LayoutType default_layout; /* Panels */ bool top_panel_enabled; bool bottom_panel_enabled; /* AI */ char openrouter_api_key[256]; char exa_api_key[256]; char ai_model[64]; bool ai_enabled; /* Paths */ char config_path[512]; char log_path[512]; }; /* Configuration functions */ Config *config_create(void); void config_destroy(Config *cfg); bool config_load(Config *cfg, const char *path); bool config_reload(Config *cfg); void config_set_defaults(Config *cfg); /* Getters for commonly used values */ const char *config_get_terminal(void); const char *config_get_launcher(void); int config_get_border_width(void); int config_get_title_height(void); int config_get_panel_height(void); int config_get_gap(void); const ColorScheme *config_get_colors(void); /* INI parsing helpers */ typedef void (*ConfigCallback)(const char *section, const char *key, const char *value, void *user_data); bool config_parse_ini(const char *path, ConfigCallback callback, void *user_data); #endif /* DWN_CONFIG_H */