news download themes documentation links










ToolbarTheme.cc

00001 // ToolbarTheme.cc  a theme class for Toolbar
00002 // Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
00003 //
00004 // Permission is hereby granted, free of charge, to any person obtaining a
00005 // copy of this software and associated documentation files (the "Software"),
00006 // to deal in the Software without restriction, including without limitation
00007 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008 // and/or sell copies of the Software, and to permit persons to whom the
00009 // Software is furnished to do so, subject to the following conditions:
00010 //
00011 // The above copyright notice and this permission notice shall be included in
00012 // all copies or substantial portions of the Software.
00013 //
00014 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00017 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00018 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00019 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00020 // DEALINGS IN THE SOFTWARE.
00021 
00022 // $Id: ToolbarTheme.cc,v 1.13 2003/10/13 23:47:38 fluxgen Exp $
00023 
00024 #include "ToolbarTheme.hh"
00025 
00026 #include "FbTk/App.hh"
00027 
00028 #include <iostream>
00029 using namespace std;
00030 
00031 template<>
00032 void FbTk::ThemeItem<bool>::load() { }
00033 
00034 template<>
00035 void FbTk::ThemeItem<bool>::setDefaultValue() {
00036     *(*this) = false;
00037 }
00038 
00039 template<>
00040 void FbTk::ThemeItem<bool>::setFromString(char const *strval) {
00041     if (strcasecmp(strval, "true")==0)
00042         *(*this) = true;
00043     else
00044         *(*this) = false;
00045 }
00046 
00047 ToolbarTheme::ToolbarTheme(int screen_num):
00048     FbTk::Theme(screen_num),
00049     m_toolbar(*this, "toolbar", "Toolbar"),
00050     m_border(*this, "toolbar", "Toolbar"),
00051     m_bevel_width(*this, "toolbar.bevelWidth", "Toolbar.BevelWidth"),
00052     m_shape(*this, "toolbar.shaped", "Toolbar.Shaped"),    
00053     m_alpha(*this, "toolbar.alpha", "Toolbar.Alpha"),
00054     m_height(*this, "toolbar.height", "Toolbar.Height"),
00055     m_button_size(*this, "toolbar.button.size", "Toolbar.Button.Size") {
00056     // set default value
00057     *m_bevel_width = 0;
00058     *m_alpha = 255;
00059     *m_shape = false;
00060     *m_height = 0;
00061     *m_button_size = -1;
00062 }
00063 
00064 ToolbarTheme::~ToolbarTheme() {
00065 
00066 }
00067 
00068 void ToolbarTheme::reconfigTheme() {
00069     if (*m_alpha > 255)
00070         *m_alpha = 255;
00071     else if (*m_alpha < 0)
00072         *m_alpha = 0;
00073 
00074     if (*m_bevel_width > 20)
00075         *m_bevel_width = 20;
00076 
00077     if (*m_height > 100)
00078         *m_height = 100;
00079     else if (*m_height < 0)
00080         *m_height = 0;
00081 
00082     if (*m_button_size > 100)
00083         *m_button_size = 100;
00084 }

Fluxbox CVS-Jan-2003




      



Got comments about the page? Send them to webmaster.
If you have general Fluxbox related questions ask them on our irc channel or mailing lists.

Show Source








Designed by aLEczapKA