From 251ca294abe7af0cbe5caf3c33052292cad42fa5 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 18 May 2003 22:04:06 +0000 Subject: moved Resource to FbTk --- src/IntResMenuItem.cc | 4 ++-- src/IntResMenuItem.hh | 6 +++--- src/Screen.hh | 36 ++++++++++++++++++------------------ src/fluxbox.cc | 31 ++++++++++++++++--------------- src/fluxbox.hh | 14 +++++++------- 5 files changed, 46 insertions(+), 45 deletions(-) diff --git a/src/IntResMenuItem.cc b/src/IntResMenuItem.cc index b272268..8cdb9a8 100644 --- a/src/IntResMenuItem.cc +++ b/src/IntResMenuItem.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IntResMenuItem.cc,v 1.1 2003/02/17 12:45:59 fluxgen Exp $ +// $Id: IntResMenuItem.cc,v 1.2 2003/05/18 21:59:14 fluxgen Exp $ #include "IntResMenuItem.hh" #include @@ -36,7 +36,7 @@ std::string appendIntValue(const std::string &label, int value) { }; -IntResMenuItem::IntResMenuItem(const char *label, Resource &res, int min_val, int max_val): +IntResMenuItem::IntResMenuItem(const char *label, FbTk::Resource &res, int min_val, int max_val): FbTk::MenuItem(label), m_org_label(FbTk::MenuItem::label()), m_max(max_val), m_min(min_val), m_res(res) { setLabel(appendIntValue(m_org_label, *m_res).c_str()); diff --git a/src/IntResMenuItem.hh b/src/IntResMenuItem.hh index 3466c91..6da3db9 100644 --- a/src/IntResMenuItem.hh +++ b/src/IntResMenuItem.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IntResMenuItem.hh,v 1.1 2003/02/17 12:45:58 fluxgen Exp $ +// $Id: IntResMenuItem.hh,v 1.2 2003/05/18 21:59:14 fluxgen Exp $ #ifndef INTRESMENUITEM_HH #define INTRESMENUITEM_HH @@ -30,7 +30,7 @@ /// Changes an resource integer value between min and max class IntResMenuItem: public FbTk::MenuItem { public: - IntResMenuItem(const char *label, Resource &res, int min_val, int max_val); + IntResMenuItem(const char *label, FbTk::Resource &res, int min_val, int max_val); void click(int button, int time); @@ -38,7 +38,7 @@ private: std::string m_org_label; ///< original label const int m_max; ///< maximum value the integer can have const int m_min; ///< minimum value the integer can have - Resource &m_res; ///< resource item to be changed + FbTk::Resource &m_res; ///< resource item to be changed }; #endif // INTRESMENUITEM_HH diff --git a/src/Screen.hh b/src/Screen.hh index 46f86c4..d06937b 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.98 2003/05/15 23:25:36 fluxgen Exp $ +// $Id: Screen.hh,v 1.99 2003/05/18 22:00:04 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -69,7 +69,7 @@ public: typedef std::vector Workspaces; typedef std::vector WorkspaceNames; - BScreen(ResourceManager &rm, + BScreen(FbTk::ResourceManager &rm, const std::string &screenname, const std::string &altscreenname, int scrn, int number_of_layers); ~BScreen(); @@ -111,7 +111,7 @@ public: inline Slit::Placement getSlitPlacement() const { return *resource.slit_placement; } inline Slit::Direction getSlitDirection() const { return *resource.slit_direction; } - inline Resource &slitAlphaResource() { return resource.slit_alpha; } + inline FbTk::Resource &slitAlphaResource() { return resource.slit_alpha; } inline void saveSlitPlacement(Slit::Placement p) { resource.slit_placement = p; } inline void saveSlitDirection(Slit::Direction d) { resource.slit_direction = d; } inline void saveSlitAutoHide(bool t) { resource.slit_auto_hide = t; } @@ -178,8 +178,8 @@ public: inline int getToolbarOnHead() { return *resource.toolbar_on_head; } inline int getToolbarWidthPercent() const { return *resource.toolbar_width_percent; } - inline Resource &getToolbarWidthPercentResource() { return resource.toolbar_width_percent; } - inline const Resource &getToolbarWidthPercentResource() const { return resource.toolbar_width_percent; } + inline FbTk::Resource &getToolbarWidthPercentResource() { return resource.toolbar_width_percent; } + inline const FbTk::Resource &getToolbarWidthPercentResource() const { return resource.toolbar_width_percent; } inline ToolbarHandler::ToolbarMode toolbarMode() const { return *resource.toolbar_mode; } inline int getPlacementPolicy() const { return resource.placement_policy; } inline int getEdgeSnapThreshold() const { return *resource.edge_snap_threshold; } @@ -388,31 +388,31 @@ private: FbRootWindow m_root_window; struct ScreenResource { - ScreenResource(ResourceManager &rm, const std::string &scrname, + ScreenResource(FbTk::ResourceManager &rm, const std::string &scrname, const std::string &altscrname); - Resource toolbar_auto_hide, + FbTk::Resource toolbar_auto_hide, image_dither, opaque_move, full_max, max_over_slit, sloppy_window_grouping, workspace_warping, desktop_wheeling, show_window_pos, focus_last, focus_new, antialias, auto_raise, click_raises; - Resource rootcommand; - Resource focus_model; + FbTk::Resource rootcommand; + FbTk::Resource focus_model; bool ordered_dither; - Resource workspaces, toolbar_width_percent, edge_snap_threshold, + FbTk::Resource workspaces, toolbar_width_percent, edge_snap_threshold, menu_alpha; - Resource slit_layernum, toolbar_layernum; + FbTk::Resource slit_layernum, toolbar_layernum; int placement_policy, row_direction, col_direction; - Resource toolbar_mode; - Resource toolbar_on_head; - Resource toolbar_placement; - Resource slit_auto_hide; - Resource slit_placement; - Resource slit_direction; - Resource slit_alpha; + FbTk::Resource toolbar_mode; + FbTk::Resource toolbar_on_head; + FbTk::Resource toolbar_placement; + FbTk::Resource slit_auto_hide; + FbTk::Resource slit_placement; + FbTk::Resource slit_direction; + FbTk::Resource slit_alpha; unsigned int slit_on_head; diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 610ae13..5b39b2f 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.150 2003/05/15 23:30:03 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.151 2003/05/18 22:04:06 fluxgen Exp $ #include "fluxbox.hh" @@ -155,8 +155,9 @@ char *basename (char *s) { //----------------------------------------------------------------- //---- accessors for int, bool, and some enums with Resource ------ //----------------------------------------------------------------- + template<> -void Resource:: +void FbTk::Resource:: setFromString(const char* strval) { int val; if (sscanf(strval, "%d", &val)==1) @@ -164,13 +165,13 @@ setFromString(const char* strval) { } template<> -void Resource:: +void FbTk::Resource:: setFromString(const char *strval) { *this = strval; } template<> -void Resource:: +void FbTk::Resource:: setFromString(char const *strval) { if (strcasecmp(strval, "true")==0) *this = true; @@ -179,7 +180,7 @@ setFromString(char const *strval) { } template<> -void Resource:: +void FbTk::Resource:: setFromString(char const *strval) { // auto raise options here for backwards read compatibility // they are not supported for saving purposes. Nor does the "AutoRaise" @@ -197,7 +198,7 @@ setFromString(char const *strval) { } template<> -void Resource:: +void FbTk::Resource:: setFromString(char const *strval) { vector val; StringUtil::stringtok(val, strval); @@ -222,7 +223,7 @@ setFromString(char const *strval) { } template<> -void Resource:: +void FbTk::Resource:: setFromString(const char *strval) { if (sscanf(strval, "%ul", &m_value) != 1) setDefaultValue(); @@ -232,13 +233,13 @@ setFromString(const char *strval) { //---- manipulators for int, bool, and some enums with Resource --- //----------------------------------------------------------------- template<> -std::string Resource:: +std::string FbTk::Resource:: getString() { return std::string(**this == true ? "true" : "false"); } template<> -std::string Resource:: +std::string FbTk::Resource:: getString() { char strval[256]; sprintf(strval, "%d", **this); @@ -246,11 +247,11 @@ getString() { } template<> -std::string Resource:: +std::string FbTk::Resource:: getString() { return **this; } template<> -std::string Resource:: +std::string FbTk::Resource:: getString() { switch (m_value) { case Fluxbox::SLOPPYFOCUS: @@ -265,7 +266,7 @@ getString() { } template<> -std::string Resource:: +std::string FbTk::Resource:: getString() { string retval; int size=m_value.size(); @@ -299,7 +300,7 @@ getString() { } template<> -string Resource:: +string FbTk::Resource:: getString() { char tmpstr[128]; sprintf(tmpstr, "%ul", m_value); @@ -307,7 +308,7 @@ getString() { } template<> -void Resource:: +void FbTk::Resource:: setFromString(const char *strval) { int tempnum = 0; if (sscanf(strval, "%d", &tempnum) == 1) @@ -332,7 +333,7 @@ setFromString(const char *strval) { template<> -string Resource:: +string FbTk::Resource:: getString() { if (m_value.getNum() == Fluxbox::instance()->getMenuLayer()) diff --git a/src/fluxbox.hh b/src/fluxbox.hh index e0cfc6c..2d03b07 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.hh,v 1.59 2003/05/14 14:35:39 fluxgen Exp $ +// $Id: fluxbox.hh,v 1.60 2003/05/18 22:02:55 fluxgen Exp $ #ifndef FLUXBOX_HH #define FLUXBOX_HH @@ -227,18 +227,18 @@ private: std::auto_ptr m_fbatoms; - ResourceManager m_resourcemanager, m_screen_rm; + FbTk::ResourceManager m_resourcemanager, m_screen_rm; //--- Resources - Resource m_rc_tabs, m_rc_ignoreborder; - Resource m_rc_colors_per_channel, m_rc_numlayers; - Resource m_rc_stylefile, + FbTk::Resource m_rc_tabs, m_rc_ignoreborder; + FbTk::Resource m_rc_colors_per_channel, m_rc_numlayers; + FbTk::Resource m_rc_stylefile, m_rc_menufile, m_rc_keyfile, m_rc_slitlistfile, m_rc_groupfile; - Resource m_rc_titlebar_left, m_rc_titlebar_right; - Resource m_rc_cache_life, m_rc_cache_max; + FbTk::Resource m_rc_titlebar_left, m_rc_titlebar_right; + FbTk::Resource m_rc_cache_life, m_rc_cache_max; std::map m_window_search; -- cgit v0.11.2