#pragma once #include #include #include #include namespace lumacs { /// RGB Color representation struct Color { int r, g, b; Color(int r = 0, int g = 0, int b = 0) : r(r), g(g), b(b) {} /// Convert to ncurses color index (will be assigned dynamically) int to_ncurses_color() const; /// Comparison operator for use in maps bool operator<(const Color& other) const; }; /// Theme element types enum class ThemeElement { // Text elements Normal, Keyword, String, Comment, Function, Type, Number, Constant, Error, // UI elements StatusLine, StatusLineInactive, MessageLine, LineNumber, Cursor, Selection, SearchMatch, SearchFail, // Window elements WindowBorder, WindowBorderActive, // Special Background }; /// A theme defines colors and attributes for various UI elements class Theme { public: Theme(const std::string& name) : name_(name) {} /// Set color for a theme element void set_color(ThemeElement element, const Color& fg, const Color& bg = Color(-1, -1, -1)); /// Get foreground color for an element Color get_fg_color(ThemeElement element) const; /// Get background color for an element Color get_bg_color(ThemeElement element) const; /// Get ncurses color pair for an element int get_color_pair(ThemeElement element) const; /// Theme name const std::string& name() const { return name_; } /// Initialize all color pairs for ncurses void initialize_ncurses_colors(); private: std::string name_; std::map> colors_; // fg, bg mutable std::map color_pairs_; mutable int next_pair_id_ = 1; }; /// Theme manager - handles multiple themes and switching between them class ThemeManager { public: /// Register a new theme void register_theme(std::shared_ptr theme); /// Set the active theme void set_active_theme(const std::string& name); /// Get the active theme std::shared_ptr active_theme() const { return active_theme_; } /// Get available theme names std::vector theme_names() const; /// Create default themes void create_default_themes(); /// Create Everforest dark theme std::shared_ptr create_everforest_theme(); /// Create default light theme std::shared_ptr create_default_theme(); private: std::map> themes_; std::shared_ptr active_theme_; }; } // namespace lumacs