cleaning
fluxgen fluxgen
2 files changed,
13 insertions(+),
64 deletions(-)
M
src/ToolbarTheme.cc
→
src/ToolbarTheme.cc
@@ -19,7 +19,7 @@ // 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: ToolbarTheme.cc,v 1.7 2003/08/13 09:53:46 fluxgen Exp $ +// $Id: ToolbarTheme.cc,v 1.8 2003/08/13 15:12:39 fluxgen Exp $ #include "ToolbarTheme.hh"@@ -45,36 +45,20 @@ }
ToolbarTheme::ToolbarTheme(int screen_num): FbTk::Theme(screen_num), - m_button_color(*this, - "toolbar.button.picColor", "Toolbar.Button.PicColor"), - m_border_color(*this, - "toolbar.borderColor", "Toolbar.BorderColor"), m_toolbar(*this, "toolbar", "Toolbar"), - m_button(*this, "toolbar.button", "Toolbar.Button"), - m_pressed_button(*this, - "toolbar.button.pressed", "Toolbar.Button.Pressed"), - m_border_width(*this, "toolbar.borderWidth", "Toolbar.BorderWidth"), + m_border(*this, "toolbar", "Toolbar"), m_bevel_width(*this, "toolbar.bevelWidth", "Toolbar.BevelWidth"), - m_button_border_width(*this, "toolbar.button.borderWidth", "Toolbar.Button.BorderWidth"), m_shape(*this, "toolbar.shaped", "Toolbar.Shaped"), m_alpha(*this, "toolbar.alpha", "Toolbar.Alpha"), m_display(FbTk::App::instance()->display()) { - Window rootwindow = RootWindow(m_display, screen_num); - - XGCValues gcv; - unsigned long gc_value_mask = GCForeground; - - - gcv.foreground = m_button_color->pixel(); - m_button_pic_gc = - XCreateGC(m_display, rootwindow, - gc_value_mask, &gcv); + *m_bevel_width = 0; + *m_alpha = 255; } ToolbarTheme::~ToolbarTheme() { - XFreeGC(m_display, m_button_pic_gc); + } void ToolbarTheme::reconfigTheme() {@@ -82,12 +66,4 @@ if (*m_alpha > 255)
*m_alpha = 255; else if (*m_alpha < 0) *m_alpha = 0; - - XGCValues gcv; - unsigned long gc_value_mask = GCForeground; - - gcv.foreground = m_button_color->pixel(); - XChangeGC(m_display, m_button_pic_gc, - gc_value_mask, &gcv); - }
M
src/ToolbarTheme.hh
→
src/ToolbarTheme.hh
@@ -19,17 +19,16 @@ // 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: ToolbarTheme.hh,v 1.7 2003/08/13 09:53:35 fluxgen Exp $ +// $Id: ToolbarTheme.hh,v 1.8 2003/08/13 15:12:39 fluxgen Exp $ #ifndef TOOLBARTHEME_HH #define TOOLBARTHEME_HH #include "FbTk/Theme.hh" -#include "Font.hh" #include "Texture.hh" #include "Color.hh" -#include "Text.hh" -#include "Subject.hh" + +#include "BorderTheme.hh" /// toolbar theme class container class ToolbarTheme: public FbTk::Theme {@@ -39,47 +38,21 @@ virtual ~ToolbarTheme();
void reconfigTheme(); - /** - @name colors - */ - ///@{ - const FbTk::Color &buttonColor() const { return *m_button_color; } - const FbTk::Color &borderColor() const { return *m_border_color; } - ///@} - /** - @name textures - */ - ///@{ - const FbTk::Texture &toolbar() const { return *m_toolbar; } - const FbTk::Texture &button() const { return *m_button; } - const FbTk::Texture &pressedButton() const { return *m_pressed_button; } - ///@} - /** - @name graphic context - */ - ///@{ - GC buttonPicGC() const { return m_button_pic_gc; } - ///@} + inline const BorderTheme &border() const { return m_border; } + inline const FbTk::Texture &toolbar() const { return *m_toolbar; } - inline int borderWidth() const { return *m_border_width; } inline int bevelWidth() const { return *m_bevel_width; } - inline int buttonBorderWidth() const { return *m_button_border_width; } inline bool shape() const { return *m_shape; } inline unsigned char alpha() const { return *m_alpha; } private: - // text colors - FbTk::ThemeItem<FbTk::Color> m_button_color, m_border_color; - // textures - FbTk::ThemeItem<FbTk::Texture> m_toolbar, m_button, m_pressed_button; + FbTk::ThemeItem<FbTk::Texture> m_toolbar; + BorderTheme m_border; - FbTk::ThemeItem<int> m_border_width, m_bevel_width, m_button_border_width; + FbTk::ThemeItem<int> m_bevel_width; FbTk::ThemeItem<bool> m_shape; FbTk::ThemeItem<int> m_alpha; - - // graphic context - GC m_button_pic_gc; Display *m_display;