summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2007-12-28 04:39:31 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2007-12-28 04:39:31 (GMT)
commit00ceefd8846bda6f4dc43a5a990086545ea28727 (patch)
treea87c37dbb853e3604b52198e6a64e8d45711fb27
parentb5c354b994bc06667abe35e2d528c0f025703c4e (diff)
downloadfluxbox_lack-00ceefd8846bda6f4dc43a5a990086545ea28727.zip
fluxbox_lack-00ceefd8846bda6f4dc43a5a990086545ea28727.tar.bz2
moved BorderTheme and TextTheme to FbTk
-rw-r--r--src/FbTk/BorderTheme.cc (renamed from src/BorderTheme.cc)8
-rw-r--r--src/FbTk/BorderTheme.hh (renamed from src/BorderTheme.hh)22
-rw-r--r--src/FbTk/Makefile.am1
-rw-r--r--src/FbTk/TextTheme.cc (renamed from src/TextTheme.cc)18
-rw-r--r--src/FbTk/TextTheme.hh (renamed from src/TextTheme.hh)40
-rw-r--r--src/FbWinFrameTheme.hh6
-rw-r--r--src/IconbarTheme.hh21
-rw-r--r--src/Makefile.am2
-rw-r--r--src/ToolTheme.cc2
-rw-r--r--src/ToolTheme.hh13
-rw-r--r--src/ToolbarTheme.hh7
11 files changed, 69 insertions, 71 deletions
diff --git a/src/BorderTheme.cc b/src/FbTk/BorderTheme.cc
index c3c0c06..1223954 100644
--- a/src/BorderTheme.cc
+++ b/src/FbTk/BorderTheme.cc
@@ -20,11 +20,11 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id$
24
25#include "BorderTheme.hh" 23#include "BorderTheme.hh"
26 24
27BorderTheme::BorderTheme(FbTk::Theme &theme, const std::string &name, 25namespace FbTk {
26
27BorderTheme::BorderTheme(Theme &theme, const std::string &name,
28 const std::string &altname): 28 const std::string &altname):
29 m_width(theme, name + ".borderWidth", altname + ".BorderWidth"), 29 m_width(theme, name + ".borderWidth", altname + ".BorderWidth"),
30 m_color(theme, name + ".borderColor", altname + ".BorderColor") { 30 m_color(theme, name + ".borderColor", altname + ".BorderColor") {
@@ -32,3 +32,5 @@ BorderTheme::BorderTheme(FbTk::Theme &theme, const std::string &name,
32 *m_width = 0; 32 *m_width = 0;
33 m_color->setFromString("black", theme.screenNum()); 33 m_color->setFromString("black", theme.screenNum());
34} 34}
35
36}; // end namespace FbTk
diff --git a/src/BorderTheme.hh b/src/FbTk/BorderTheme.hh
index b5a4dd1..9b9ca55 100644
--- a/src/BorderTheme.hh
+++ b/src/FbTk/BorderTheme.hh
@@ -20,26 +20,28 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id$ 23#ifndef FBTK_BORDERTHEME_HH
24#define FBTK_BORDERTHEME_HH
24 25
25#ifndef BORDERTHEME_HH 26#include "Theme.hh"
26#define BORDERTHEME_HH 27#include "Color.hh"
27 28
28#include "FbTk/Theme.hh" 29namespace FbTk {
29#include "FbTk/Color.hh"
30 30
31/// helper class for border theme items 31/// helper class for border theme items
32class BorderTheme { 32class BorderTheme {
33public: 33public:
34 BorderTheme(FbTk::Theme &theme, const std::string &name, const std::string &altname); 34 BorderTheme(Theme &theme, const std::string &name, const std::string &altname);
35 virtual ~BorderTheme() { } 35 virtual ~BorderTheme() { }
36 36
37 int width() const { return *m_width; } 37 int width() const { return *m_width; }
38 const FbTk::Color &color() const { return *m_color; } 38 const Color &color() const { return *m_color; }
39 39
40private: 40private:
41 FbTk::ThemeItem<int> m_width; 41 ThemeItem<int> m_width;
42 FbTk::ThemeItem<FbTk::Color> m_color; 42 ThemeItem<Color> m_color;
43}; 43};
44 44
45#endif // BORDERTHEME_HH 45}; // end namespace FbTk
46
47#endif // FBTK_BORDERTHEME_HH
diff --git a/src/FbTk/Makefile.am b/src/FbTk/Makefile.am
index e3e5d76..75733a7 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 \
28 BoolMenuItem.hh IntMenuItem.hh \ 28 BoolMenuItem.hh IntMenuItem.hh \
29 MultiButtonMenuItem.hh MultiButtonMenuItem.cc \ 29 MultiButtonMenuItem.hh MultiButtonMenuItem.cc \
30 MenuTheme.hh MenuTheme.cc NotCopyable.hh \ 30 MenuTheme.hh MenuTheme.cc NotCopyable.hh \
31 BorderTheme.hh BorderTheme.cc TextTheme.hh TextTheme.cc \
31 RefCount.hh SimpleCommand.hh SignalHandler.cc SignalHandler.hh \ 32 RefCount.hh SimpleCommand.hh SignalHandler.cc SignalHandler.hh \
32 Text.hh Text.cc \ 33 Text.hh Text.cc \
33 Texture.cc Texture.hh TextureRender.hh TextureRender.cc \ 34 Texture.cc Texture.hh TextureRender.hh TextureRender.cc \
diff --git a/src/TextTheme.cc b/src/FbTk/TextTheme.cc
index a35af64..848ee01 100644
--- a/src/TextTheme.cc
+++ b/src/FbTk/TextTheme.cc
@@ -20,31 +20,29 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id$
24
25#include "TextTheme.hh" 23#include "TextTheme.hh"
26 24
27#include "FbTk/App.hh" 25#include "App.hh"
28 26
29#include <X11/Xlib.h> 27#include <X11/Xlib.h>
30 28
31TextTheme::TextTheme(FbTk::Theme &theme, 29namespace FbTk {
30
31TextTheme::TextTheme(Theme &theme,
32 const std::string &name, const std::string &altname): 32 const std::string &name, const std::string &altname):
33 m_font(theme, name + ".font", altname + ".Font"), 33 m_font(theme, name + ".font", altname + ".Font"),
34 m_text_color(theme, name + ".textColor", altname + ".TextColor"), 34 m_text_color(theme, name + ".textColor", altname + ".TextColor"),
35 m_justify(theme, name + ".justify", altname + ".Justify"), 35 m_justify(theme, name + ".justify", altname + ".Justify"),
36 m_text_gc(RootWindow(FbTk::App::instance()->display(), theme.screenNum())) { 36 m_text_gc(RootWindow(App::instance()->display(), theme.screenNum())) {
37 *m_justify = FbTk::LEFT; 37 *m_justify = LEFT;
38 // set default values 38 // set default values
39 m_text_color->setFromString("white", theme.screenNum()); 39 m_text_color->setFromString("white", theme.screenNum());
40 40
41 update(); 41 update();
42} 42}
43 43
44TextTheme::~TextTheme() {
45
46}
47
48void TextTheme::update() { 44void TextTheme::update() {
49 m_text_gc.setForeground(*m_text_color); 45 m_text_gc.setForeground(*m_text_color);
50} 46}
47
48}; // end namespace FbTk
diff --git a/src/TextTheme.hh b/src/FbTk/TextTheme.hh
index 2b1ce53..ea22d4b 100644
--- a/src/TextTheme.hh
+++ b/src/FbTk/TextTheme.hh
@@ -20,34 +20,36 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id$ 23#ifndef FBTK_TEXTTHEME_HH
24#define FBTK_TEXTTHEME_HH
24 25
25#ifndef TEXTTHEME_HH 26#include "Theme.hh"
26#define TEXTTHEME_HH 27#include "Font.hh"
28#include "Color.hh"
29#include "Text.hh"
30#include "GContext.hh"
27 31
28#include "FbTk/Theme.hh" 32namespace FbTk {
29#include "FbTk/Font.hh"
30#include "FbTk/Color.hh"
31#include "FbTk/Text.hh"
32#include "FbTk/GContext.hh"
33 33
34class TextTheme { 34class TextTheme {
35public: 35public:
36 TextTheme(FbTk::Theme &theme, const std::string &name, const std::string &altname); 36 TextTheme(Theme &theme, const std::string &name, const std::string &altname);
37 virtual ~TextTheme(); 37 virtual ~TextTheme() { }
38 38
39 void update(); 39 void update();
40 40
41 FbTk::Font &font() { return *m_font; } 41 Font &font() { return *m_font; }
42 const FbTk::Font &font() const { return *m_font; } 42 const Font &font() const { return *m_font; }
43 const FbTk::Color &textColor() const { return *m_text_color; } 43 const Color &textColor() const { return *m_text_color; }
44 FbTk::Justify justify() const { return *m_justify; } 44 Justify justify() const { return *m_justify; }
45 GC textGC() const { return m_text_gc.gc(); } 45 GC textGC() const { return m_text_gc.gc(); }
46private: 46private:
47 FbTk::ThemeItem<FbTk::Font> m_font; 47 ThemeItem<Font> m_font;
48 FbTk::ThemeItem<FbTk::Color> m_text_color; 48 ThemeItem<Color> m_text_color;
49 FbTk::ThemeItem<FbTk::Justify> m_justify; 49 ThemeItem<Justify> m_justify;
50 FbTk::GContext m_text_gc; 50 GContext m_text_gc;
51}; 51};
52 52
53#endif // TEXTTHEME_HH 53}; // end namespace FbTk
54
55#endif // FBTK_TEXTTHEME_HH
diff --git a/src/FbWinFrameTheme.hh b/src/FbWinFrameTheme.hh
index c68c418..df3c312 100644
--- a/src/FbWinFrameTheme.hh
+++ b/src/FbWinFrameTheme.hh
@@ -29,10 +29,10 @@
29#include "FbTk/Text.hh" 29#include "FbTk/Text.hh"
30#include "FbTk/Color.hh" 30#include "FbTk/Color.hh"
31#include "FbTk/Theme.hh" 31#include "FbTk/Theme.hh"
32#include "FbTk/BorderTheme.hh"
32#include "FbTk/Subject.hh" 33#include "FbTk/Subject.hh"
33#include "FbTk/GContext.hh" 34#include "FbTk/GContext.hh"
34 35
35#include "BorderTheme.hh"
36#include "IconbarTheme.hh" 36#include "IconbarTheme.hh"
37#include "Shape.hh" 37#include "Shape.hh"
38 38
@@ -84,7 +84,7 @@ public:
84 inline Cursor bottomSideCursor() const { return m_cursor_bottom_side; } 84 inline Cursor bottomSideCursor() const { return m_cursor_bottom_side; }
85 85
86 inline Shape::ShapePlace shapePlace() const { return *m_shape_place; } 86 inline Shape::ShapePlace shapePlace() const { return *m_shape_place; }
87 inline const BorderTheme &border(bool focus) const { return (focus ? m_border_focus : m_border_unfocus); } 87 inline const FbTk::BorderTheme &border(bool focus) const { return (focus ? m_border_focus : m_border_unfocus); }
88 88
89 unsigned int titleHeight() const { return *m_title_height; } 89 unsigned int titleHeight() const { return *m_title_height; }
90 unsigned int bevelWidth() const { return *m_bevel_width; } 90 unsigned int bevelWidth() const { return *m_bevel_width; }
@@ -109,7 +109,7 @@ private:
109 FbTk::ThemeItem<Shape::ShapePlace> m_shape_place; 109 FbTk::ThemeItem<Shape::ShapePlace> m_shape_place;
110 110
111 FbTk::ThemeItem<int> m_title_height, m_bevel_width, m_handle_width; 111 FbTk::ThemeItem<int> m_title_height, m_bevel_width, m_handle_width;
112 BorderTheme m_border_focus, m_border_unfocus; 112 FbTk::BorderTheme m_border_focus, m_border_unfocus;
113 113
114 FbTk::GContext m_button_pic_focus_gc, m_button_pic_unfocus_gc; 114 FbTk::GContext m_button_pic_focus_gc, m_button_pic_unfocus_gc;
115 115
diff --git a/src/IconbarTheme.hh b/src/IconbarTheme.hh
index 419ab1a..9e2307b 100644
--- a/src/IconbarTheme.hh
+++ b/src/IconbarTheme.hh
@@ -26,10 +26,9 @@
26#define ICONBARTHEME_HH 26#define ICONBARTHEME_HH
27 27
28#include "FbTk/Theme.hh" 28#include "FbTk/Theme.hh"
29#include "FbTk/BorderTheme.hh"
29#include "FbTk/Texture.hh" 30#include "FbTk/Texture.hh"
30 31#include "FbTk/TextTheme.hh"
31#include "TextTheme.hh"
32#include "BorderTheme.hh"
33 32
34class IconbarTheme:public FbTk::Theme { 33class IconbarTheme:public FbTk::Theme {
35public: 34public:
@@ -39,21 +38,21 @@ public:
39 void reconfigTheme(); 38 void reconfigTheme();
40 bool fallback(FbTk::ThemeItem_base &item); 39 bool fallback(FbTk::ThemeItem_base &item);
41 40
42 TextTheme &focusedText() { return m_focused_text; } 41 FbTk::TextTheme &focusedText() { return m_focused_text; }
43 TextTheme &unfocusedText() { return m_unfocused_text; } 42 FbTk::TextTheme &unfocusedText() { return m_unfocused_text; }
43
44 const FbTk::BorderTheme &focusedBorder() const { return m_focused_border; }
45 const FbTk::BorderTheme &unfocusedBorder() const { return m_unfocused_border; }
46 const FbTk::BorderTheme &border() const { return m_border; }
44 47
45 const BorderTheme &focusedBorder() const { return m_focused_border; }
46 const BorderTheme &unfocusedBorder() const { return m_unfocused_border; }
47 const BorderTheme &border() const { return m_border; }
48
49 const FbTk::Texture &focusedTexture() const { return *m_focused_texture; } 48 const FbTk::Texture &focusedTexture() const { return *m_focused_texture; }
50 const FbTk::Texture &unfocusedTexture() const { return *m_unfocused_texture; } 49 const FbTk::Texture &unfocusedTexture() const { return *m_unfocused_texture; }
51 const FbTk::Texture &emptyTexture() const { return *m_empty_texture; } 50 const FbTk::Texture &emptyTexture() const { return *m_empty_texture; }
52 51
53private: 52private:
54 FbTk::ThemeItem<FbTk::Texture> m_focused_texture, m_unfocused_texture, m_empty_texture; 53 FbTk::ThemeItem<FbTk::Texture> m_focused_texture, m_unfocused_texture, m_empty_texture;
55 BorderTheme m_focused_border, m_unfocused_border, m_border; 54 FbTk::BorderTheme m_focused_border, m_unfocused_border, m_border;
56 TextTheme m_focused_text, m_unfocused_text; 55 FbTk::TextTheme m_focused_text, m_unfocused_text;
57 std::string m_name, m_altname; 56 std::string m_name, m_altname;
58}; 57};
59 58
diff --git a/src/Makefile.am b/src/Makefile.am
index e6f21d3..6b29c1a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -120,8 +120,6 @@ fluxbox_SOURCES = AtomHandler.hh ArrowButton.hh ArrowButton.cc \
120 Shape.hh Shape.cc \ 120 Shape.hh Shape.cc \
121 MenuTheme.hh MenuTheme.cc \ 121 MenuTheme.hh MenuTheme.cc \
122 Container.hh Container.cc \ 122 Container.hh Container.cc \
123 TextTheme.hh TextTheme.cc \
124 BorderTheme.hh BorderTheme.cc \
125 CommandDialog.hh CommandDialog.cc SendToMenu.hh SendToMenu.cc \ 123 CommandDialog.hh CommandDialog.cc SendToMenu.hh SendToMenu.cc \
126 AlphaMenu.hh AlphaMenu.cc ObjectResource.hh \ 124 AlphaMenu.hh AlphaMenu.cc ObjectResource.hh \
127 CompareWindow.hh \ 125 CompareWindow.hh \
diff --git a/src/ToolTheme.cc b/src/ToolTheme.cc
index 2432655..4cfb991 100644
--- a/src/ToolTheme.cc
+++ b/src/ToolTheme.cc
@@ -26,7 +26,7 @@
26 26
27ToolTheme::ToolTheme(int screen_num, const std::string &name, const std::string &altname): 27ToolTheme::ToolTheme(int screen_num, const std::string &name, const std::string &altname):
28 FbTk::Theme(screen_num), 28 FbTk::Theme(screen_num),
29 TextTheme(*this, name, altname), 29 FbTk::TextTheme(*this, name, altname),
30 m_texture(*this, name, altname), 30 m_texture(*this, name, altname),
31 m_border(*this, name, altname), 31 m_border(*this, name, altname),
32 m_alpha(255) { 32 m_alpha(255) {
diff --git a/src/ToolTheme.hh b/src/ToolTheme.hh
index 52e926a..270b67a 100644
--- a/src/ToolTheme.hh
+++ b/src/ToolTheme.hh
@@ -26,18 +26,15 @@
26#define TOOLTHEME_HH 26#define TOOLTHEME_HH
27 27
28 28
29#include "TextTheme.hh" 29#include "FbTk/TextTheme.hh"
30#include "BorderTheme.hh" 30#include "FbTk/BorderTheme.hh"
31
32#include "FbTk/Texture.hh" 31#include "FbTk/Texture.hh"
33 32
34#include <X11/Xlib.h> 33#include <X11/Xlib.h>
35#include <string> 34#include <string>
36 35
37class ToolbarTheme;
38
39/// Handles toolbar item theme for text and texture 36/// Handles toolbar item theme for text and texture
40class ToolTheme: public FbTk::Theme, public TextTheme { 37class ToolTheme: public FbTk::Theme, public FbTk::TextTheme {
41public: 38public:
42 ToolTheme(int screen_num, const std::string &name, const std::string &altname); 39 ToolTheme(int screen_num, const std::string &name, const std::string &altname);
43 virtual ~ToolTheme(); 40 virtual ~ToolTheme();
@@ -47,7 +44,7 @@ public:
47 void reconfigTheme(); 44 void reconfigTheme();
48 // textures 45 // textures
49 const FbTk::Texture &texture() const { return *m_texture; } 46 const FbTk::Texture &texture() const { return *m_texture; }
50 const BorderTheme &border() const { return m_border; } 47 const FbTk::BorderTheme &border() const { return m_border; }
51 inline unsigned char alpha() const { return m_alpha; } 48 inline unsigned char alpha() const { return m_alpha; }
52 inline void setAlpha(unsigned char alpha) { m_alpha = alpha; } 49 inline void setAlpha(unsigned char alpha) { m_alpha = alpha; }
53 50
@@ -56,7 +53,7 @@ protected:
56 53
57private: 54private:
58 FbTk::ThemeItem<FbTk::Texture> m_texture; 55 FbTk::ThemeItem<FbTk::Texture> m_texture;
59 BorderTheme m_border; 56 FbTk::BorderTheme m_border;
60 unsigned char m_alpha; 57 unsigned char m_alpha;
61}; 58};
62 59
diff --git a/src/ToolbarTheme.hh b/src/ToolbarTheme.hh
index c4dfaae..c62a5c1 100644
--- a/src/ToolbarTheme.hh
+++ b/src/ToolbarTheme.hh
@@ -27,8 +27,7 @@
27#include "FbTk/Theme.hh" 27#include "FbTk/Theme.hh"
28#include "FbTk/Texture.hh" 28#include "FbTk/Texture.hh"
29#include "FbTk/Color.hh" 29#include "FbTk/Color.hh"
30 30#include "FbTk/BorderTheme.hh"
31#include "BorderTheme.hh"
32 31
33/// toolbar theme class container 32/// toolbar theme class container
34class ToolbarTheme: public FbTk::Theme { 33class ToolbarTheme: public FbTk::Theme {
@@ -39,7 +38,7 @@ public:
39 void reconfigTheme(); 38 void reconfigTheme();
40 39
41 40
42 inline const BorderTheme &border() const { return m_border; } 41 inline const FbTk::BorderTheme &border() const { return m_border; }
43 inline const FbTk::Texture &toolbar() const { return *m_toolbar; } 42 inline const FbTk::Texture &toolbar() const { return *m_toolbar; }
44 43
45 bool fallback(FbTk::ThemeItem_base &item); 44 bool fallback(FbTk::ThemeItem_base &item);
@@ -50,7 +49,7 @@ public:
50 inline int buttonSize() const { return *m_button_size; } 49 inline int buttonSize() const { return *m_button_size; }
51private: 50private:
52 FbTk::ThemeItem<FbTk::Texture> m_toolbar; 51 FbTk::ThemeItem<FbTk::Texture> m_toolbar;
53 BorderTheme m_border; 52 FbTk::BorderTheme m_border;
54 53
55 FbTk::ThemeItem<int> m_bevel_width; 54 FbTk::ThemeItem<int> m_bevel_width;
56 FbTk::ThemeItem<bool> m_shape; 55 FbTk::ThemeItem<bool> m_shape;