diff --git a/src/BorderTheme.cc b/src/FbTk/BorderTheme.cc similarity index 93% rename from src/BorderTheme.cc rename to src/FbTk/BorderTheme.cc index c3c0c069..12239543 100644 --- a/src/BorderTheme.cc +++ b/src/FbTk/BorderTheme.cc @@ -20,11 +20,11 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id$ - #include "BorderTheme.hh" -BorderTheme::BorderTheme(FbTk::Theme &theme, const std::string &name, +namespace FbTk { + +BorderTheme::BorderTheme(Theme &theme, const std::string &name, const std::string &altname): m_width(theme, name + ".borderWidth", altname + ".BorderWidth"), m_color(theme, name + ".borderColor", altname + ".BorderColor") { @@ -32,3 +32,5 @@ BorderTheme::BorderTheme(FbTk::Theme &theme, const std::string &name, *m_width = 0; m_color->setFromString("black", theme.screenNum()); } + +}; // end namespace FbTk diff --git a/src/BorderTheme.hh b/src/FbTk/BorderTheme.hh similarity index 79% rename from src/BorderTheme.hh rename to src/FbTk/BorderTheme.hh index b5a4dd10..9b9ca550 100644 --- a/src/BorderTheme.hh +++ b/src/FbTk/BorderTheme.hh @@ -20,26 +20,28 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id$ +#ifndef FBTK_BORDERTHEME_HH +#define FBTK_BORDERTHEME_HH -#ifndef BORDERTHEME_HH -#define BORDERTHEME_HH +#include "Theme.hh" +#include "Color.hh" -#include "FbTk/Theme.hh" -#include "FbTk/Color.hh" +namespace FbTk { /// helper class for border theme items class BorderTheme { public: - BorderTheme(FbTk::Theme &theme, const std::string &name, const std::string &altname); + BorderTheme(Theme &theme, const std::string &name, const std::string &altname); virtual ~BorderTheme() { } int width() const { return *m_width; } - const FbTk::Color &color() const { return *m_color; } + const Color &color() const { return *m_color; } private: - FbTk::ThemeItem m_width; - FbTk::ThemeItem m_color; + ThemeItem m_width; + ThemeItem m_color; }; -#endif // BORDERTHEME_HH +}; // end namespace FbTk + +#endif // FBTK_BORDERTHEME_HH diff --git a/src/FbTk/Makefile.am b/src/FbTk/Makefile.am index e3e5d766..75733a72 100644 --- a/src/FbTk/Makefile.am +++ b/src/FbTk/Makefile.am @@ -28,6 +28,7 @@ libFbTk_a_SOURCES = App.hh App.cc Color.cc Color.hh Command.hh \ BoolMenuItem.hh IntMenuItem.hh \ MultiButtonMenuItem.hh MultiButtonMenuItem.cc \ MenuTheme.hh MenuTheme.cc NotCopyable.hh \ + BorderTheme.hh BorderTheme.cc TextTheme.hh TextTheme.cc \ RefCount.hh SimpleCommand.hh SignalHandler.cc SignalHandler.hh \ Text.hh Text.cc \ Texture.cc Texture.hh TextureRender.hh TextureRender.cc \ diff --git a/src/TextTheme.cc b/src/FbTk/TextTheme.cc similarity index 89% rename from src/TextTheme.cc rename to src/FbTk/TextTheme.cc index a35af647..848ee016 100644 --- a/src/TextTheme.cc +++ b/src/FbTk/TextTheme.cc @@ -20,31 +20,29 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id$ - #include "TextTheme.hh" -#include "FbTk/App.hh" +#include "App.hh" #include -TextTheme::TextTheme(FbTk::Theme &theme, +namespace FbTk { + +TextTheme::TextTheme(Theme &theme, const std::string &name, const std::string &altname): m_font(theme, name + ".font", altname + ".Font"), m_text_color(theme, name + ".textColor", altname + ".TextColor"), m_justify(theme, name + ".justify", altname + ".Justify"), - m_text_gc(RootWindow(FbTk::App::instance()->display(), theme.screenNum())) { - *m_justify = FbTk::LEFT; + m_text_gc(RootWindow(App::instance()->display(), theme.screenNum())) { + *m_justify = LEFT; // set default values m_text_color->setFromString("white", theme.screenNum()); update(); } -TextTheme::~TextTheme() { - -} - void TextTheme::update() { m_text_gc.setForeground(*m_text_color); } + +}; // end namespace FbTk diff --git a/src/TextTheme.hh b/src/FbTk/TextTheme.hh similarity index 65% rename from src/TextTheme.hh rename to src/FbTk/TextTheme.hh index 2b1ce53d..ea22d4b7 100644 --- a/src/TextTheme.hh +++ b/src/FbTk/TextTheme.hh @@ -20,34 +20,36 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id$ +#ifndef FBTK_TEXTTHEME_HH +#define FBTK_TEXTTHEME_HH -#ifndef TEXTTHEME_HH -#define TEXTTHEME_HH +#include "Theme.hh" +#include "Font.hh" +#include "Color.hh" +#include "Text.hh" +#include "GContext.hh" -#include "FbTk/Theme.hh" -#include "FbTk/Font.hh" -#include "FbTk/Color.hh" -#include "FbTk/Text.hh" -#include "FbTk/GContext.hh" +namespace FbTk { class TextTheme { public: - TextTheme(FbTk::Theme &theme, const std::string &name, const std::string &altname); - virtual ~TextTheme(); + TextTheme(Theme &theme, const std::string &name, const std::string &altname); + virtual ~TextTheme() { } void update(); - FbTk::Font &font() { return *m_font; } - const FbTk::Font &font() const { return *m_font; } - const FbTk::Color &textColor() const { return *m_text_color; } - FbTk::Justify justify() const { return *m_justify; } + Font &font() { return *m_font; } + const Font &font() const { return *m_font; } + const Color &textColor() const { return *m_text_color; } + Justify justify() const { return *m_justify; } GC textGC() const { return m_text_gc.gc(); } private: - FbTk::ThemeItem m_font; - FbTk::ThemeItem m_text_color; - FbTk::ThemeItem m_justify; - FbTk::GContext m_text_gc; + ThemeItem m_font; + ThemeItem m_text_color; + ThemeItem m_justify; + GContext m_text_gc; }; -#endif // TEXTTHEME_HH +}; // end namespace FbTk + +#endif // FBTK_TEXTTHEME_HH diff --git a/src/FbWinFrameTheme.hh b/src/FbWinFrameTheme.hh index c68c418c..df3c3120 100644 --- a/src/FbWinFrameTheme.hh +++ b/src/FbWinFrameTheme.hh @@ -29,10 +29,10 @@ #include "FbTk/Text.hh" #include "FbTk/Color.hh" #include "FbTk/Theme.hh" +#include "FbTk/BorderTheme.hh" #include "FbTk/Subject.hh" #include "FbTk/GContext.hh" -#include "BorderTheme.hh" #include "IconbarTheme.hh" #include "Shape.hh" @@ -84,7 +84,7 @@ public: inline Cursor bottomSideCursor() const { return m_cursor_bottom_side; } inline Shape::ShapePlace shapePlace() const { return *m_shape_place; } - inline const BorderTheme &border(bool focus) const { return (focus ? m_border_focus : m_border_unfocus); } + inline const FbTk::BorderTheme &border(bool focus) const { return (focus ? m_border_focus : m_border_unfocus); } unsigned int titleHeight() const { return *m_title_height; } unsigned int bevelWidth() const { return *m_bevel_width; } @@ -109,7 +109,7 @@ private: FbTk::ThemeItem m_shape_place; FbTk::ThemeItem m_title_height, m_bevel_width, m_handle_width; - BorderTheme m_border_focus, m_border_unfocus; + FbTk::BorderTheme m_border_focus, m_border_unfocus; FbTk::GContext m_button_pic_focus_gc, m_button_pic_unfocus_gc; diff --git a/src/IconbarTheme.hh b/src/IconbarTheme.hh index 419ab1a2..9e2307bb 100644 --- a/src/IconbarTheme.hh +++ b/src/IconbarTheme.hh @@ -26,10 +26,9 @@ #define ICONBARTHEME_HH #include "FbTk/Theme.hh" +#include "FbTk/BorderTheme.hh" #include "FbTk/Texture.hh" - -#include "TextTheme.hh" -#include "BorderTheme.hh" +#include "FbTk/TextTheme.hh" class IconbarTheme:public FbTk::Theme { public: @@ -39,21 +38,21 @@ public: void reconfigTheme(); bool fallback(FbTk::ThemeItem_base &item); - TextTheme &focusedText() { return m_focused_text; } - TextTheme &unfocusedText() { return m_unfocused_text; } + FbTk::TextTheme &focusedText() { return m_focused_text; } + FbTk::TextTheme &unfocusedText() { return m_unfocused_text; } + + const FbTk::BorderTheme &focusedBorder() const { return m_focused_border; } + const FbTk::BorderTheme &unfocusedBorder() const { return m_unfocused_border; } + const FbTk::BorderTheme &border() const { return m_border; } - const BorderTheme &focusedBorder() const { return m_focused_border; } - const BorderTheme &unfocusedBorder() const { return m_unfocused_border; } - const BorderTheme &border() const { return m_border; } - const FbTk::Texture &focusedTexture() const { return *m_focused_texture; } const FbTk::Texture &unfocusedTexture() const { return *m_unfocused_texture; } const FbTk::Texture &emptyTexture() const { return *m_empty_texture; } private: FbTk::ThemeItem m_focused_texture, m_unfocused_texture, m_empty_texture; - BorderTheme m_focused_border, m_unfocused_border, m_border; - TextTheme m_focused_text, m_unfocused_text; + FbTk::BorderTheme m_focused_border, m_unfocused_border, m_border; + FbTk::TextTheme m_focused_text, m_unfocused_text; std::string m_name, m_altname; }; diff --git a/src/Makefile.am b/src/Makefile.am index e6f21d35..6b29c1ac 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -120,8 +120,6 @@ fluxbox_SOURCES = AtomHandler.hh ArrowButton.hh ArrowButton.cc \ Shape.hh Shape.cc \ MenuTheme.hh MenuTheme.cc \ Container.hh Container.cc \ - TextTheme.hh TextTheme.cc \ - BorderTheme.hh BorderTheme.cc \ CommandDialog.hh CommandDialog.cc SendToMenu.hh SendToMenu.cc \ AlphaMenu.hh AlphaMenu.cc ObjectResource.hh \ CompareWindow.hh \ diff --git a/src/ToolTheme.cc b/src/ToolTheme.cc index 2432655b..4cfb9910 100644 --- a/src/ToolTheme.cc +++ b/src/ToolTheme.cc @@ -26,7 +26,7 @@ ToolTheme::ToolTheme(int screen_num, const std::string &name, const std::string &altname): FbTk::Theme(screen_num), - TextTheme(*this, name, altname), + FbTk::TextTheme(*this, name, altname), m_texture(*this, name, altname), m_border(*this, name, altname), m_alpha(255) { diff --git a/src/ToolTheme.hh b/src/ToolTheme.hh index 52e926a1..270b67a8 100644 --- a/src/ToolTheme.hh +++ b/src/ToolTheme.hh @@ -26,18 +26,15 @@ #define TOOLTHEME_HH -#include "TextTheme.hh" -#include "BorderTheme.hh" - +#include "FbTk/TextTheme.hh" +#include "FbTk/BorderTheme.hh" #include "FbTk/Texture.hh" #include #include -class ToolbarTheme; - /// Handles toolbar item theme for text and texture -class ToolTheme: public FbTk::Theme, public TextTheme { +class ToolTheme: public FbTk::Theme, public FbTk::TextTheme { public: ToolTheme(int screen_num, const std::string &name, const std::string &altname); virtual ~ToolTheme(); @@ -47,7 +44,7 @@ public: void reconfigTheme(); // textures const FbTk::Texture &texture() const { return *m_texture; } - const BorderTheme &border() const { return m_border; } + const FbTk::BorderTheme &border() const { return m_border; } inline unsigned char alpha() const { return m_alpha; } inline void setAlpha(unsigned char alpha) { m_alpha = alpha; } @@ -56,7 +53,7 @@ protected: private: FbTk::ThemeItem m_texture; - BorderTheme m_border; + FbTk::BorderTheme m_border; unsigned char m_alpha; }; diff --git a/src/ToolbarTheme.hh b/src/ToolbarTheme.hh index c4dfaae6..c62a5c13 100644 --- a/src/ToolbarTheme.hh +++ b/src/ToolbarTheme.hh @@ -27,8 +27,7 @@ #include "FbTk/Theme.hh" #include "FbTk/Texture.hh" #include "FbTk/Color.hh" - -#include "BorderTheme.hh" +#include "FbTk/BorderTheme.hh" /// toolbar theme class container class ToolbarTheme: public FbTk::Theme { @@ -39,7 +38,7 @@ public: void reconfigTheme(); - inline const BorderTheme &border() const { return m_border; } + inline const FbTk::BorderTheme &border() const { return m_border; } inline const FbTk::Texture &toolbar() const { return *m_toolbar; } bool fallback(FbTk::ThemeItem_base &item); @@ -50,7 +49,7 @@ public: inline int buttonSize() const { return *m_button_size; } private: FbTk::ThemeItem m_toolbar; - BorderTheme m_border; + FbTk::BorderTheme m_border; FbTk::ThemeItem m_bevel_width; FbTk::ThemeItem m_shape;