From 3cdb2f4fcbdf7bfae7a3da3bc6bfbe7162f5b7b4 Mon Sep 17 00:00:00 2001 From: Petr Pavlu Date: Mon, 24 Aug 2015 19:55:11 +0100 Subject: [PATCH] Turn ColorScheme properties into an enumeration --- cppconsui/Button.cpp | 4 +- cppconsui/CheckBox.cpp | 4 +- cppconsui/ColorPickerComboBox.cpp | 8 +-- cppconsui/ColorScheme.cpp | 90 +++++++++++++------------- cppconsui/ColorScheme.h | 30 +++++---- cppconsui/Container.cpp | 3 +- cppconsui/HorizontalLine.cpp | 2 +- cppconsui/Label.cpp | 2 +- cppconsui/Panel.cpp | 4 +- cppconsui/TextEdit.cpp | 2 +- cppconsui/TextView.cpp | 7 +- cppconsui/TreeView.cpp | 5 +- cppconsui/VerticalLine.cpp | 2 +- src/BuddyListNode.cpp | 4 +- src/CenterIM.cpp | 133 ++++++++++++++++++++------------------ src/Conversation.cpp | 4 +- 16 files changed, 157 insertions(+), 147 deletions(-) diff --git a/cppconsui/Button.cpp b/cppconsui/Button.cpp index c665cc9..7b7f605 100644 --- a/cppconsui/Button.cpp +++ b/cppconsui/Button.cpp @@ -111,11 +111,11 @@ int Button::draw(Curses::ViewPort area, Error &error) int attrs; if (has_focus) { - DRAW(getAttributes(ColorScheme::BUTTON_FOCUS, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_BUTTON_FOCUS, &attrs, error)); attrs |= Curses::Attr::REVERSE; } else - DRAW(getAttributes(ColorScheme::BUTTON_NORMAL, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_BUTTON_NORMAL, &attrs, error)); DRAW(area.attrOn(attrs, error)); // Print text. diff --git a/cppconsui/CheckBox.cpp b/cppconsui/CheckBox.cpp index f00d93c..feb8362 100644 --- a/cppconsui/CheckBox.cpp +++ b/cppconsui/CheckBox.cpp @@ -66,11 +66,11 @@ int CheckBox::draw(Curses::ViewPort area, Error &error) int attrs; if (has_focus) { - DRAW(getAttributes(ColorScheme::CHECKBOX_FOCUS, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_CHECKBOX_FOCUS, &attrs, error)); attrs |= Curses::Attr::REVERSE; } else - DRAW(getAttributes(ColorScheme::CHECKBOX_NORMAL, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_CHECKBOX_NORMAL, &attrs, error)); DRAW(area.attrOn(attrs, error)); // Print text. diff --git a/cppconsui/ColorPickerComboBox.cpp b/cppconsui/ColorPickerComboBox.cpp index b042e8a..31ba110 100644 --- a/cppconsui/ColorPickerComboBox.cpp +++ b/cppconsui/ColorPickerComboBox.cpp @@ -98,11 +98,11 @@ int ColorPickerComboBox::draw(Curses::ViewPort area, Error &error) { int attrs; if (has_focus) { - DRAW(getAttributes(ColorScheme::BUTTON_FOCUS, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_BUTTON_FOCUS, &attrs, error)); attrs |= Curses::Attr::REVERSE; } else - DRAW(getAttributes(ColorScheme::BUTTON_NORMAL, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_BUTTON_NORMAL, &attrs, error)); int color = selected_color; @@ -215,11 +215,11 @@ int ColorPickerComboBox::ColorButton::draw(Curses::ViewPort area, Error &error) { int attrs; if (has_focus) { - DRAW(getAttributes(ColorScheme::BUTTON_FOCUS, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_BUTTON_FOCUS, &attrs, error)); attrs |= Curses::Attr::REVERSE; } else - DRAW(getAttributes(ColorScheme::BUTTON_NORMAL, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_BUTTON_NORMAL, &attrs, error)); DRAW(area.attrOn(attrs, error)); DRAW(area.fill(attrs, 0, 0, real_width, 1, error)); diff --git a/cppconsui/ColorScheme.cpp b/cppconsui/ColorScheme.cpp index 513eb41..3a21343 100644 --- a/cppconsui/ColorScheme.cpp +++ b/cppconsui/ColorScheme.cpp @@ -140,30 +140,30 @@ void ColorScheme::clear() const char *ColorScheme::propertyToWidgetName(int property) { - switch (property) { - case BUTTON_FOCUS: - case BUTTON_NORMAL: + switch (static_cast(property)) { + case PROPERTY_BUTTON_FOCUS: + case PROPERTY_BUTTON_NORMAL: return "button"; - case CHECKBOX_FOCUS: - case CHECKBOX_NORMAL: + case PROPERTY_CHECKBOX_FOCUS: + case PROPERTY_CHECKBOX_NORMAL: return "checkbox"; - case CONTAINER_BACKGROUND: + case PROPERTY_CONTAINER_BACKGROUND: return "container"; - case HORIZONTALLINE_LINE: + case PROPERTY_HORIZONTALLINE_LINE: return "horizontalline"; - case LABEL_TEXT: + case PROPERTY_LABEL_TEXT: return "label"; - case PANEL_LINE: - case PANEL_TITLE: + case PROPERTY_PANEL_LINE: + case PROPERTY_PANEL_TITLE: return "panel"; - case TEXTEDIT_TEXT: + case PROPERTY_TEXTEDIT_TEXT: return "textedit"; - case TEXTVIEW_TEXT: - case TEXTVIEW_SCROLLBAR: + case PROPERTY_TEXTVIEW_TEXT: + case PROPERTY_TEXTVIEW_SCROLLBAR: return "textview"; - case VERTICALLINE_LINE: + case PROPERTY_VERTICALLINE_LINE: return "verticalline"; - case TREEVIEW_LINE: + case PROPERTY_TREEVIEW_LINE: return "treeview"; } return NULL; @@ -171,27 +171,27 @@ const char *ColorScheme::propertyToWidgetName(int property) const char *ColorScheme::propertyToPropertyName(int property) { - switch (property) { - case BUTTON_FOCUS: - case CHECKBOX_FOCUS: + switch (static_cast(property)) { + case PROPERTY_BUTTON_FOCUS: + case PROPERTY_CHECKBOX_FOCUS: return "focus"; - case BUTTON_NORMAL: - case CHECKBOX_NORMAL: + case PROPERTY_BUTTON_NORMAL: + case PROPERTY_CHECKBOX_NORMAL: return "normal"; - case CONTAINER_BACKGROUND: + case PROPERTY_CONTAINER_BACKGROUND: return "background"; - case HORIZONTALLINE_LINE: - case PANEL_LINE: - case VERTICALLINE_LINE: - case TREEVIEW_LINE: + case PROPERTY_HORIZONTALLINE_LINE: + case PROPERTY_PANEL_LINE: + case PROPERTY_VERTICALLINE_LINE: + case PROPERTY_TREEVIEW_LINE: return "line"; - case LABEL_TEXT: - case TEXTEDIT_TEXT: - case TEXTVIEW_TEXT: + case PROPERTY_LABEL_TEXT: + case PROPERTY_TEXTEDIT_TEXT: + case PROPERTY_TEXTVIEW_TEXT: return "text"; - case PANEL_TITLE: + case PROPERTY_PANEL_TITLE: return "title"; - case TEXTVIEW_SCROLLBAR: + case PROPERTY_TEXTVIEW_SCROLLBAR: return "scrollbar"; } return NULL; @@ -208,72 +208,72 @@ ColorScheme::PropertyConversionResult ColorScheme::stringPairToPropertyPair( if (strcmp(widget, "button") == 0) { if (strcmp(property, "focus") == 0) { - *out_property = BUTTON_FOCUS; + *out_property = PROPERTY_BUTTON_FOCUS; return CONVERSION_SUCCESS; } if (strcmp(property, "normal") == 0) { - *out_property = BUTTON_NORMAL; + *out_property = PROPERTY_BUTTON_NORMAL; return CONVERSION_SUCCESS; } return CONVERSION_ERROR_PROPERTY; } else if (strcmp(widget, "checkbox") == 0) { if (strcmp(property, "focus") == 0) { - *out_property = CHECKBOX_FOCUS; + *out_property = PROPERTY_CHECKBOX_FOCUS; return CONVERSION_SUCCESS; } if (strcmp(property, "normal") == 0) { - *out_property = CHECKBOX_NORMAL; + *out_property = PROPERTY_CHECKBOX_NORMAL; return CONVERSION_SUCCESS; } return CONVERSION_ERROR_PROPERTY; } else if (strcmp(widget, "container") == 0) { if (strcmp(property, "background") == 0) { - *out_property = CONTAINER_BACKGROUND; + *out_property = PROPERTY_CONTAINER_BACKGROUND; return CONVERSION_SUCCESS; } return CONVERSION_ERROR_PROPERTY; } else if (strcmp(widget, "horizontalline") == 0) { if (strcmp(property, "line") == 0) { - *out_property = HORIZONTALLINE_LINE; + *out_property = PROPERTY_HORIZONTALLINE_LINE; return CONVERSION_SUCCESS; } return CONVERSION_ERROR_PROPERTY; } else if (strcmp(widget, "label") == 0) { if (strcmp(property, "text") == 0) { - *out_property = LABEL_TEXT; + *out_property = PROPERTY_LABEL_TEXT; return CONVERSION_SUCCESS; } return CONVERSION_ERROR_PROPERTY; } else if (strcmp(widget, "panel") == 0) { if (strcmp(property, "line") == 0) { - *out_property = PANEL_LINE; + *out_property = PROPERTY_PANEL_LINE; return CONVERSION_SUCCESS; } if (strcmp(property, "title") == 0) { - *out_property = PANEL_TITLE; + *out_property = PROPERTY_PANEL_TITLE; return CONVERSION_SUCCESS; } return CONVERSION_ERROR_PROPERTY; } else if (strcmp(widget, "textedit") == 0) { if (strcmp(property, "text") == 0) { - *out_property = TEXTEDIT_TEXT; + *out_property = PROPERTY_TEXTEDIT_TEXT; return CONVERSION_SUCCESS; } return CONVERSION_ERROR_PROPERTY; } else if (strcmp(widget, "textview") == 0) { if (strcmp(property, "text") == 0) { - *out_property = TEXTVIEW_TEXT; + *out_property = PROPERTY_TEXTVIEW_TEXT; return CONVERSION_SUCCESS; } if (strcmp(property, "scrollbar") == 0) { - *out_property = TEXTVIEW_SCROLLBAR; + *out_property = PROPERTY_TEXTVIEW_SCROLLBAR; return CONVERSION_SUCCESS; } @@ -295,19 +295,19 @@ ColorScheme::PropertyConversionResult ColorScheme::stringPairToPropertyPair( if (endptr != '\0' || errno == ERANGE || i > INT_MAX) return CONVERSION_ERROR_PROPERTY; - *out_property = TEXTVIEW_TEXT; + *out_property = PROPERTY_TEXTVIEW_TEXT; *out_subproperty = i; return CONVERSION_SUCCESS; } else if (strcmp(widget, "verticalline") == 0) { if (strcmp(property, "line") == 0) { - *out_property = VERTICALLINE_LINE; + *out_property = PROPERTY_VERTICALLINE_LINE; return CONVERSION_SUCCESS; } } else if (strcmp(widget, "treeview") == 0) { if (strcmp(property, "line") == 0) { - *out_property = TREEVIEW_LINE; + *out_property = PROPERTY_TREEVIEW_LINE; return CONVERSION_SUCCESS; } } diff --git a/cppconsui/ColorScheme.h b/cppconsui/ColorScheme.h index 6e56783..506a45e 100644 --- a/cppconsui/ColorScheme.h +++ b/cppconsui/ColorScheme.h @@ -61,20 +61,22 @@ public: CONVERSION_ERROR_PROPERTY, }; - static const int BUTTON_FOCUS = 0; - static const int BUTTON_NORMAL = 1; - static const int CHECKBOX_FOCUS = 2; - static const int CHECKBOX_NORMAL = 3; - static const int CONTAINER_BACKGROUND = 4; - static const int HORIZONTALLINE_LINE = 5; - static const int LABEL_TEXT = 6; - static const int PANEL_LINE = 7; - static const int PANEL_TITLE = 8; - static const int TEXTEDIT_TEXT = 9; - static const int TEXTVIEW_TEXT = 10; - static const int TEXTVIEW_SCROLLBAR = 11; - static const int VERTICALLINE_LINE = 12; - static const int TREEVIEW_LINE = 13; + enum Property { + PROPERTY_BUTTON_FOCUS, + PROPERTY_BUTTON_NORMAL, + PROPERTY_CHECKBOX_FOCUS, + PROPERTY_CHECKBOX_NORMAL, + PROPERTY_CONTAINER_BACKGROUND, + PROPERTY_HORIZONTALLINE_LINE, + PROPERTY_LABEL_TEXT, + PROPERTY_PANEL_LINE, + PROPERTY_PANEL_TITLE, + PROPERTY_TEXTEDIT_TEXT, + PROPERTY_TEXTVIEW_TEXT, + PROPERTY_TEXTVIEW_SCROLLBAR, + PROPERTY_VERTICALLINE_LINE, + PROPERTY_TREEVIEW_LINE, + }; typedef std::pair PropertyPair; typedef std::map Properties; diff --git a/cppconsui/Container.cpp b/cppconsui/Container.cpp index fb3082d..8a61033 100644 --- a/cppconsui/Container.cpp +++ b/cppconsui/Container.cpp @@ -59,7 +59,8 @@ int Container::draw(Curses::ViewPort area, Error &error) area.scroll(scroll_xpos, scroll_ypos); int attrs; - DRAW(getAttributes(ColorScheme::CONTAINER_BACKGROUND, &attrs, error)); + DRAW( + getAttributes(ColorScheme::PROPERTY_CONTAINER_BACKGROUND, &attrs, error)); DRAW(area.fill(attrs, error)); for (Children::iterator i = children.begin(); i != children.end(); ++i) diff --git a/cppconsui/HorizontalLine.cpp b/cppconsui/HorizontalLine.cpp index 05cf23b..ae5fa31 100644 --- a/cppconsui/HorizontalLine.cpp +++ b/cppconsui/HorizontalLine.cpp @@ -42,7 +42,7 @@ int HorizontalLine::draw(Curses::ViewPort area, Error &error) return 0; int attrs; - DRAW(getAttributes(ColorScheme::HORIZONTALLINE_LINE, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_HORIZONTALLINE_LINE, &attrs, error)); DRAW(area.attrOn(attrs, error)); for (int i = 0; i < real_width; i++) diff --git a/cppconsui/Label.cpp b/cppconsui/Label.cpp index a5a2400..443a64b 100644 --- a/cppconsui/Label.cpp +++ b/cppconsui/Label.cpp @@ -52,7 +52,7 @@ Label::~Label() int Label::draw(Curses::ViewPort area, Error &error) { int attrs; - DRAW(getAttributes(ColorScheme::LABEL_TEXT, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_LABEL_TEXT, &attrs, error)); DRAW(area.attrOn(attrs, error)); // Print text. diff --git a/cppconsui/Panel.cpp b/cppconsui/Panel.cpp index 70c124b..c0e0a71 100644 --- a/cppconsui/Panel.cpp +++ b/cppconsui/Panel.cpp @@ -64,14 +64,14 @@ int Panel::draw(Curses::ViewPort area, Error &error) if (draw_title_width) { // Draw title. - DRAW(getAttributes(ColorScheme::PANEL_TITLE, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_PANEL_TITLE, &attrs, error)); DRAW(area.attrOn(attrs, error)); DRAW(area.addString(2 + hline_len, 0, draw_title_width, title, error)); DRAW(area.attrOff(attrs, error)); } // Draw lines. - DRAW(getAttributes(ColorScheme::PANEL_LINE, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_PANEL_LINE, &attrs, error)); DRAW(area.attrOn(attrs, error)); // Draw top horizontal line. diff --git a/cppconsui/TextEdit.cpp b/cppconsui/TextEdit.cpp index 6372371..1a425eb 100644 --- a/cppconsui/TextEdit.cpp +++ b/cppconsui/TextEdit.cpp @@ -90,7 +90,7 @@ int TextEdit::draw(Curses::ViewPort area, Error &error) DRAW(area.erase(error)); int attrs; - DRAW(getAttributes(ColorScheme::TEXTEDIT_TEXT, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_TEXTEDIT_TEXT, &attrs, error)); DRAW(area.attrOn(attrs, error)); ScreenLines::iterator i; diff --git a/cppconsui/TextView.cpp b/cppconsui/TextView.cpp index 6b4418e..28e280e 100644 --- a/cppconsui/TextView.cpp +++ b/cppconsui/TextView.cpp @@ -64,7 +64,7 @@ int TextView::draw(Curses::ViewPort area, Error &error) view_top = screen_lines.size() - real_height; int attrs; - DRAW(getAttributes(ColorScheme::TEXTVIEW_TEXT, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_TEXTVIEW_TEXT, &attrs, error)); DRAW(area.attrOn(attrs, error)); ScreenLines::iterator i; @@ -74,7 +74,7 @@ int TextView::draw(Curses::ViewPort area, Error &error) int attrs2 = 0; if (i->parent->color != 0) { DRAW(getAttributes( - ColorScheme::TEXTVIEW_TEXT, i->parent->color, &attrs2, error)); + ColorScheme::PROPERTY_TEXTVIEW_TEXT, i->parent->color, &attrs2, error)); DRAW(area.attrOff(attrs, error)); DRAW(area.attrOn(attrs2, error)); } @@ -119,7 +119,8 @@ int TextView::draw(Curses::ViewPort area, Error &error) } int attrs; - DRAW(getAttributes(ColorScheme::TEXTVIEW_SCROLLBAR, &attrs, error)); + DRAW( + getAttributes(ColorScheme::PROPERTY_TEXTVIEW_SCROLLBAR, &attrs, error)); attrs |= Curses::Attr::REVERSE; DRAW(area.attrOn(attrs, error)); diff --git a/cppconsui/TreeView.cpp b/cppconsui/TreeView.cpp index 618de44..d171557 100644 --- a/cppconsui/TreeView.cpp +++ b/cppconsui/TreeView.cpp @@ -75,7 +75,8 @@ int TreeView::draw(Curses::ViewPort area, Error &error) area.scroll(scroll_xpos, scroll_ypos); int attrs; - DRAW(getAttributes(ColorScheme::CONTAINER_BACKGROUND, &attrs, error)); + DRAW( + getAttributes(ColorScheme::PROPERTY_CONTAINER_BACKGROUND, &attrs, error)); DRAW(area.fill(attrs, error)); int height; @@ -465,7 +466,7 @@ int TreeView::drawNode( int j; int attrs; - DRAW(getAttributes(ColorScheme::TREEVIEW_LINE, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_TREEVIEW_LINE, &attrs, error)); DRAW(area.attrOn(attrs, error)); for (j = 1; j < *out_height; ++j) diff --git a/cppconsui/VerticalLine.cpp b/cppconsui/VerticalLine.cpp index 472cc0d..f898c90 100644 --- a/cppconsui/VerticalLine.cpp +++ b/cppconsui/VerticalLine.cpp @@ -42,7 +42,7 @@ int VerticalLine::draw(Curses::ViewPort area, Error &error) return 0; int attrs; - DRAW(getAttributes(ColorScheme::VERTICALLINE_LINE, &attrs, error)); + DRAW(getAttributes(ColorScheme::PROPERTY_VERTICALLINE_LINE, &attrs, error)); DRAW(area.attrOn(attrs, error)); for (int i = 0; i < real_height; i++) diff --git a/src/BuddyListNode.cpp b/src/BuddyListNode.cpp index 4bfbf99..04c9e7f 100644 --- a/src/BuddyListNode.cpp +++ b/src/BuddyListNode.cpp @@ -563,7 +563,7 @@ int BuddyListBuddy::getAttributes( int property, int subproperty, int *attrs, CppConsUI::Error &error) const { if (BUDDYLIST->getColorizationMode() != BuddyList::COLOR_BY_ACCOUNT || - property != CppConsUI::ColorScheme::BUTTON_NORMAL) + property != CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL) return Button::getAttributes(property, subproperty, attrs, error); // TODO Implement caching for these two properties. @@ -961,7 +961,7 @@ int BuddyListContact::getAttributes( int property, int subproperty, int *attrs, CppConsUI::Error &error) const { if (BUDDYLIST->getColorizationMode() != BuddyList::COLOR_BY_ACCOUNT || - property != CppConsUI::ColorScheme::BUTTON_NORMAL) + property != CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL) return Button::getAttributes(property, subproperty, attrs, error); // TODO Implement caching for these two properties. diff --git a/src/CenterIM.cpp b/src/CenterIM.cpp index d120458..e652322 100644 --- a/src/CenterIM.cpp +++ b/src/CenterIM.cpp @@ -1009,125 +1009,130 @@ void CenterIM::loadDefaultColorSchemeConfig() // Inititialize default color schemes. COLORSCHEME->setAttributes(SCHEME_ACCOUNTSTATUSMENU, - CppConsUI::ColorScheme::PANEL_LINE, CppConsUI::Curses::Color::CYAN, + CppConsUI::ColorScheme::PROPERTY_PANEL_LINE, CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_ACCOUNTSTATUSMENU, - CppConsUI::ColorScheme::HORIZONTALLINE_LINE, CppConsUI::Curses::Color::CYAN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_HORIZONTALLINE_LINE, + CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_ACCOUNTSTATUSMENU, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::CYAN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLIST, - CppConsUI::ColorScheme::TREEVIEW_LINE, CppConsUI::Curses::Color::GREEN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_TREEVIEW_LINE, + CppConsUI::Curses::Color::GREEN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLIST, - CppConsUI::ColorScheme::PANEL_LINE, CppConsUI::Curses::Color::BLUE, + CppConsUI::ColorScheme::PROPERTY_PANEL_LINE, CppConsUI::Curses::Color::BLUE, CppConsUI::Curses::Color::DEFAULT, CppConsUI::Curses::Attr::BOLD); COLORSCHEME->setAttributes(SCHEME_BUDDYLIST, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::GREEN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::GREEN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLISTGROUP, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::MAGENTA, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::MAGENTA, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLISTBUDDY_AWAY, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::BLUE, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::BLUE, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLISTBUDDY_NA, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::MAGENTA, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::MAGENTA, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLISTBUDDY_OFFLINE, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::RED, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::RED, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLISTBUDDY_ONLINE, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::GREEN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::GREEN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLISTCONTACT_AWAY, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::BLUE, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::BLUE, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLISTCONTACT_NA, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::MAGENTA, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::MAGENTA, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLISTCONTACT_OFFLINE, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::RED, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::RED, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_BUDDYLISTCONTACT_ONLINE, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::GREEN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::GREEN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_CONVERSATION, - CppConsUI::ColorScheme::TEXTVIEW_TEXT, CppConsUI::Curses::Color::MAGENTA, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_TEXTVIEW_TEXT, + CppConsUI::Curses::Color::MAGENTA, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributesExt(SCHEME_CONVERSATION, - CppConsUI::ColorScheme::TEXTVIEW_TEXT, 1, CppConsUI::Curses::Color::CYAN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_TEXTVIEW_TEXT, 1, + CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributesExt(SCHEME_CONVERSATION, - CppConsUI::ColorScheme::TEXTVIEW_TEXT, 2, CppConsUI::Curses::Color::MAGENTA, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_TEXTVIEW_TEXT, 2, + CppConsUI::Curses::Color::MAGENTA, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_CONVERSATION, - CppConsUI::ColorScheme::PANEL_LINE, CppConsUI::Curses::Color::BLUE, + CppConsUI::ColorScheme::PROPERTY_PANEL_LINE, CppConsUI::Curses::Color::BLUE, CppConsUI::Curses::Color::DEFAULT, CppConsUI::Curses::Attr::BOLD); COLORSCHEME->setAttributes(SCHEME_CONVERSATION, - CppConsUI::ColorScheme::HORIZONTALLINE_LINE, CppConsUI::Curses::Color::BLUE, - CppConsUI::Curses::Color::DEFAULT, CppConsUI::Curses::Attr::BOLD); + CppConsUI::ColorScheme::PROPERTY_HORIZONTALLINE_LINE, + CppConsUI::Curses::Color::BLUE, CppConsUI::Curses::Color::DEFAULT, + CppConsUI::Curses::Attr::BOLD); COLORSCHEME->setAttributes(SCHEME_CONVERSATION, - CppConsUI::ColorScheme::VERTICALLINE_LINE, CppConsUI::Curses::Color::BLUE, - CppConsUI::Curses::Color::DEFAULT, CppConsUI::Curses::Attr::BOLD); + CppConsUI::ColorScheme::PROPERTY_VERTICALLINE_LINE, + CppConsUI::Curses::Color::BLUE, CppConsUI::Curses::Color::DEFAULT, + CppConsUI::Curses::Attr::BOLD); COLORSCHEME->setAttributes(SCHEME_CONVERSATION, - CppConsUI::ColorScheme::TEXTEDIT_TEXT, CppConsUI::Curses::Color::CYAN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_TEXTEDIT_TEXT, + CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_CONVERSATION, - CppConsUI::ColorScheme::LABEL_TEXT, CppConsUI::Curses::Color::CYAN, + CppConsUI::ColorScheme::PROPERTY_LABEL_TEXT, CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_CONVERSATION_ACTIVE, - CppConsUI::ColorScheme::LABEL_TEXT, CppConsUI::Curses::Color::MAGENTA, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_LABEL_TEXT, + CppConsUI::Curses::Color::MAGENTA, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_CONVERSATION_NEW, - CppConsUI::ColorScheme::LABEL_TEXT, CppConsUI::Curses::Color::CYAN, + CppConsUI::ColorScheme::PROPERTY_LABEL_TEXT, CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT, CppConsUI::Curses::Attr::BOLD); - COLORSCHEME->setAttributes(SCHEME_FOOTER, CppConsUI::ColorScheme::LABEL_TEXT, + COLORSCHEME->setAttributes(SCHEME_FOOTER, + CppConsUI::ColorScheme::PROPERTY_LABEL_TEXT, CppConsUI::Curses::Color::BLACK, CppConsUI::Curses::Color::WHITE); COLORSCHEME->setAttributes(SCHEME_FOOTER, - CppConsUI::ColorScheme::CONTAINER_BACKGROUND, + CppConsUI::ColorScheme::PROPERTY_CONTAINER_BACKGROUND, CppConsUI::Curses::Color::BLACK, CppConsUI::Curses::Color::WHITE); COLORSCHEME->setAttributes(SCHEME_GENERALMENU, - CppConsUI::ColorScheme::PANEL_LINE, CppConsUI::Curses::Color::CYAN, + CppConsUI::ColorScheme::PROPERTY_PANEL_LINE, CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_GENERALMENU, - CppConsUI::ColorScheme::HORIZONTALLINE_LINE, CppConsUI::Curses::Color::CYAN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_HORIZONTALLINE_LINE, + CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_GENERALMENU, - CppConsUI::ColorScheme::BUTTON_NORMAL, CppConsUI::Curses::Color::CYAN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_BUTTON_NORMAL, + CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_GENERALWINDOW, - CppConsUI::ColorScheme::PANEL_LINE, CppConsUI::Curses::Color::CYAN, + CppConsUI::ColorScheme::PROPERTY_PANEL_LINE, CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_GENERALWINDOW, - CppConsUI::ColorScheme::HORIZONTALLINE_LINE, CppConsUI::Curses::Color::CYAN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_HORIZONTALLINE_LINE, + CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); COLORSCHEME->setAttributes(SCHEME_GENERALWINDOW, - CppConsUI::ColorScheme::VERTICALLINE_LINE, CppConsUI::Curses::Color::CYAN, - CppConsUI::Curses::Color::DEFAULT); + CppConsUI::ColorScheme::PROPERTY_VERTICALLINE_LINE, + CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); - COLORSCHEME->setAttributes(SCHEME_LOG, CppConsUI::ColorScheme::PANEL_LINE, - CppConsUI::Curses::Color::BLUE, CppConsUI::Curses::Color::DEFAULT, - CppConsUI::Curses::Attr::BOLD); - COLORSCHEME->setAttributes(SCHEME_LOG, CppConsUI::ColorScheme::TEXTVIEW_TEXT, + COLORSCHEME->setAttributes(SCHEME_LOG, + CppConsUI::ColorScheme::PROPERTY_PANEL_LINE, CppConsUI::Curses::Color::BLUE, + CppConsUI::Curses::Color::DEFAULT, CppConsUI::Curses::Attr::BOLD); + COLORSCHEME->setAttributes(SCHEME_LOG, + CppConsUI::ColorScheme::PROPERTY_TEXTVIEW_TEXT, CppConsUI::Curses::Color::CYAN, CppConsUI::Curses::Color::DEFAULT); - COLORSCHEME->setAttributes(SCHEME_HEADER, CppConsUI::ColorScheme::LABEL_TEXT, + COLORSCHEME->setAttributes(SCHEME_HEADER, + CppConsUI::ColorScheme::PROPERTY_LABEL_TEXT, CppConsUI::Curses::Color::BLACK, CppConsUI::Curses::Color::WHITE); COLORSCHEME->setAttributes(SCHEME_HEADER, - CppConsUI::ColorScheme::CONTAINER_BACKGROUND, + CppConsUI::ColorScheme::PROPERTY_CONTAINER_BACKGROUND, CppConsUI::Curses::Color::BLACK, CppConsUI::Curses::Color::WHITE); COLORSCHEME->setAttributes(SCHEME_HEADER_REQUEST, - CppConsUI::ColorScheme::LABEL_TEXT, CppConsUI::Curses::Color::RED, + CppConsUI::ColorScheme::PROPERTY_LABEL_TEXT, CppConsUI::Curses::Color::RED, CppConsUI::Curses::Color::WHITE); } diff --git a/src/Conversation.cpp b/src/Conversation.cpp index 352f284..d6668a3 100644 --- a/src/Conversation.cpp +++ b/src/Conversation.cpp @@ -293,8 +293,8 @@ int Conversation::ConversationLine::draw( // Use HorizontalLine colors. int attrs; - DRAW( - getAttributes(CppConsUI::ColorScheme::HORIZONTALLINE_LINE, &attrs, error)); + DRAW(getAttributes( + CppConsUI::ColorScheme::PROPERTY_HORIZONTALLINE_LINE, &attrs, error)); DRAW(area.attrOn(attrs, error)); int i; -- 2.11.4.GIT