all repos — fluxbox @ 00ceefd8846bda6f4dc43a5a990086545ea28727

custom fork of the fluxbox windowmanager

moved BorderTheme and TextTheme to FbTk
Mark Tiefenbruck mark@fluxbox.org
commit

00ceefd8846bda6f4dc43a5a990086545ea28727

parent

b5c354b994bc06667abe35e2d528c0f025703c4e

M src/BorderTheme.ccsrc/FbTk/BorderTheme.cc

@@ -20,11 +20,11 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 @@ // set default values

*m_width = 0; m_color->setFromString("black", theme.screenNum()); } + +}; // end namespace FbTk
M src/BorderTheme.hhsrc/FbTk/BorderTheme.hh

@@ -20,26 +20,28 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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<int> m_width; - FbTk::ThemeItem<FbTk::Color> m_color; + ThemeItem<int> m_width; + ThemeItem<Color> m_color; }; -#endif // BORDERTHEME_HH +}; // end namespace FbTk + +#endif // FBTK_BORDERTHEME_HH
M src/FbTk/Makefile.amsrc/FbTk/Makefile.am

@@ -28,6 +28,7 @@ Menu.hh Menu.cc MenuItem.hh MenuItem.cc \

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 \
M src/FbWinFrameTheme.hhsrc/FbWinFrameTheme.hh

@@ -29,10 +29,10 @@ #include "FbTk/Texture.hh"

#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 @@ inline Cursor topSideCursor() const { return m_cursor_top_side; }

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 @@ FbTk::ThemeItem<FbTk::Font> m_font;

FbTk::ThemeItem<Shape::ShapePlace> m_shape_place; FbTk::ThemeItem<int> 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;
M src/IconbarTheme.hhsrc/IconbarTheme.hh

@@ -26,10 +26,9 @@ #ifndef ICONBARTHEME_HH

#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 @@

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<FbTk::Texture> 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; };
M src/Makefile.amsrc/Makefile.am

@@ -120,8 +120,6 @@ WorkspaceCmd.hh WorkspaceCmd.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 \
M src/TextTheme.ccsrc/FbTk/TextTheme.cc

@@ -20,31 +20,29 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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 <X11/Xlib.h> -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
M src/TextTheme.hhsrc/FbTk/TextTheme.hh

@@ -20,34 +20,36 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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<FbTk::Font> m_font; - FbTk::ThemeItem<FbTk::Color> m_text_color; - FbTk::ThemeItem<FbTk::Justify> m_justify; - FbTk::GContext m_text_gc; + ThemeItem<Font> m_font; + ThemeItem<Color> m_text_color; + ThemeItem<Justify> m_justify; + GContext m_text_gc; }; -#endif // TEXTTHEME_HH +}; // end namespace FbTk + +#endif // FBTK_TEXTTHEME_HH
M src/ToolTheme.ccsrc/ToolTheme.cc

@@ -26,7 +26,7 @@ #include "ToolTheme.hh"

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) {
M src/ToolTheme.hhsrc/ToolTheme.hh

@@ -26,18 +26,15 @@ #ifndef TOOLTHEME_HH

#define TOOLTHEME_HH -#include "TextTheme.hh" -#include "BorderTheme.hh" - +#include "FbTk/TextTheme.hh" +#include "FbTk/BorderTheme.hh" #include "FbTk/Texture.hh" #include <X11/Xlib.h> #include <string> - -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 @@

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 @@ FbTk::ThemeItem<FbTk::Texture> &textureTheme() { return m_texture; }

private: FbTk::ThemeItem<FbTk::Texture> m_texture; - BorderTheme m_border; + FbTk::BorderTheme m_border; unsigned char m_alpha; };
M src/ToolbarTheme.hhsrc/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 @@

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 @@ inline int height() const { return *m_height; }

inline int buttonSize() const { return *m_button_size; } private: FbTk::ThemeItem<FbTk::Texture> m_toolbar; - BorderTheme m_border; + FbTk::BorderTheme m_border; FbTk::ThemeItem<int> m_bevel_width; FbTk::ThemeItem<bool> m_shape;