all repos — fluxbox @ 251ca294abe7af0cbe5caf3c33052292cad42fa5

custom fork of the fluxbox windowmanager

moved Resource to FbTk
fluxgen fluxgen
commit

251ca294abe7af0cbe5caf3c33052292cad42fa5

parent

b90558a9a967ddd076ba5ed5fa02f0a6160760bd

5 files changed, 46 insertions(+), 45 deletions(-)

jump to
M src/IntResMenuItem.ccsrc/IntResMenuItem.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: 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 <cstdio>

@@ -36,7 +36,7 @@ }

}; -IntResMenuItem::IntResMenuItem(const char *label, Resource<int> &res, int min_val, int max_val): +IntResMenuItem::IntResMenuItem(const char *label, FbTk::Resource<int> &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());
M src/IntResMenuItem.hhsrc/IntResMenuItem.hh

@@ -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: 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<int> &res, int min_val, int max_val); + IntResMenuItem(const char *label, FbTk::Resource<int> &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<int> &m_res; ///< resource item to be changed + FbTk::Resource<int> &m_res; ///< resource item to be changed }; #endif // INTRESMENUITEM_HH
M src/Screen.hhsrc/Screen.hh

@@ -22,7 +22,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: 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<Workspace *> Workspaces; typedef std::vector<std::string> 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 @@ inline const Slit *slit() const { return m_slit.get(); }

inline Slit::Placement getSlitPlacement() const { return *resource.slit_placement; } inline Slit::Direction getSlitDirection() const { return *resource.slit_direction; } - inline Resource<int> &slitAlphaResource() { return resource.slit_alpha; } + inline FbTk::Resource<int> &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 @@

inline int getToolbarOnHead() { return *resource.toolbar_on_head; } inline int getToolbarWidthPercent() const { return *resource.toolbar_width_percent; } - inline Resource<int> &getToolbarWidthPercentResource() { return resource.toolbar_width_percent; } - inline const Resource<int> &getToolbarWidthPercentResource() const { return resource.toolbar_width_percent; } + inline FbTk::Resource<int> &getToolbarWidthPercentResource() { return resource.toolbar_width_percent; } + inline const FbTk::Resource<int> &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 @@

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<bool> toolbar_auto_hide, + FbTk::Resource<bool> 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<std::string> rootcommand; - Resource<Fluxbox::FocusModel> focus_model; + FbTk::Resource<std::string> rootcommand; + FbTk::Resource<Fluxbox::FocusModel> focus_model; bool ordered_dither; - Resource<int> workspaces, toolbar_width_percent, edge_snap_threshold, + FbTk::Resource<int> workspaces, toolbar_width_percent, edge_snap_threshold, menu_alpha; - Resource<Fluxbox::Layer> slit_layernum, toolbar_layernum; + FbTk::Resource<Fluxbox::Layer> slit_layernum, toolbar_layernum; int placement_policy, row_direction, col_direction; - Resource<ToolbarHandler::ToolbarMode> toolbar_mode; - Resource<int> toolbar_on_head; - Resource<Toolbar::Placement> toolbar_placement; - Resource<bool> slit_auto_hide; - Resource<Slit::Placement> slit_placement; - Resource<Slit::Direction> slit_direction; - Resource<int> slit_alpha; + FbTk::Resource<ToolbarHandler::ToolbarMode> toolbar_mode; + FbTk::Resource<int> toolbar_on_head; + FbTk::Resource<Toolbar::Placement> toolbar_placement; + FbTk::Resource<bool> slit_auto_hide; + FbTk::Resource<Slit::Placement> slit_placement; + FbTk::Resource<Slit::Direction> slit_direction; + FbTk::Resource<int> slit_alpha; unsigned int slit_on_head;
M src/fluxbox.ccsrc/fluxbox.cc

@@ -22,7 +22,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: 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 @@

//----------------------------------------------------------------- //---- accessors for int, bool, and some enums with Resource ------ //----------------------------------------------------------------- + template<> -void Resource<int>:: +void FbTk::Resource<int>:: setFromString(const char* strval) { int val; if (sscanf(strval, "%d", &val)==1)

@@ -164,13 +165,13 @@ *this = val;

} template<> -void Resource<std::string>:: +void FbTk::Resource<std::string>:: setFromString(const char *strval) { *this = strval; } template<> -void Resource<bool>:: +void FbTk::Resource<bool>:: setFromString(char const *strval) { if (strcasecmp(strval, "true")==0) *this = true;

@@ -179,7 +180,7 @@ *this = false;

} template<> -void Resource<Fluxbox::FocusModel>:: +void FbTk::Resource<Fluxbox::FocusModel>:: 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 @@ setDefaultValue();

} template<> -void Resource<Fluxbox::TitlebarList>:: +void FbTk::Resource<Fluxbox::TitlebarList>:: setFromString(char const *strval) { vector<std::string> val; StringUtil::stringtok(val, strval);

@@ -222,7 +223,7 @@ }

} template<> -void Resource<unsigned int>:: +void FbTk::Resource<unsigned int>:: setFromString(const char *strval) { if (sscanf(strval, "%ul", &m_value) != 1) setDefaultValue();

@@ -232,13 +233,13 @@ //-----------------------------------------------------------------

//---- manipulators for int, bool, and some enums with Resource --- //----------------------------------------------------------------- template<> -std::string Resource<bool>:: +std::string FbTk::Resource<bool>:: getString() { return std::string(**this == true ? "true" : "false"); } template<> -std::string Resource<int>:: +std::string FbTk::Resource<int>:: getString() { char strval[256]; sprintf(strval, "%d", **this);

@@ -246,11 +247,11 @@ return std::string(strval);

} template<> -std::string Resource<std::string>:: +std::string FbTk::Resource<std::string>:: getString() { return **this; } template<> -std::string Resource<Fluxbox::FocusModel>:: +std::string FbTk::Resource<Fluxbox::FocusModel>:: getString() { switch (m_value) { case Fluxbox::SLOPPYFOCUS:

@@ -265,7 +266,7 @@ return string("ClickToFocus");

} template<> -std::string Resource<Fluxbox::TitlebarList>:: +std::string FbTk::Resource<Fluxbox::TitlebarList>:: getString() { string retval; int size=m_value.size();

@@ -299,7 +300,7 @@ return retval;

} template<> -string Resource<unsigned int>:: +string FbTk::Resource<unsigned int>:: getString() { char tmpstr[128]; sprintf(tmpstr, "%ul", m_value);

@@ -307,7 +308,7 @@ return string(tmpstr);

} template<> -void Resource<Fluxbox::Layer>:: +void FbTk::Resource<Fluxbox::Layer>:: setFromString(const char *strval) { int tempnum = 0; if (sscanf(strval, "%d", &tempnum) == 1)

@@ -332,7 +333,7 @@ }

template<> -string Resource<Fluxbox::Layer>:: +string FbTk::Resource<Fluxbox::Layer>:: getString() { if (m_value.getNum() == Fluxbox::instance()->getMenuLayer())
M src/fluxbox.hhsrc/fluxbox.hh

@@ -22,7 +22,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: 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 @@ void setTitlebar(std::vector<Fluxbox::Titlebar>& dir, const char *arg);

std::auto_ptr<FbAtoms> m_fbatoms; - ResourceManager m_resourcemanager, m_screen_rm; + FbTk::ResourceManager m_resourcemanager, m_screen_rm; //--- Resources - Resource<bool> m_rc_tabs, m_rc_ignoreborder; - Resource<int> m_rc_colors_per_channel, m_rc_numlayers; - Resource<std::string> m_rc_stylefile, + FbTk::Resource<bool> m_rc_tabs, m_rc_ignoreborder; + FbTk::Resource<int> m_rc_colors_per_channel, m_rc_numlayers; + FbTk::Resource<std::string> m_rc_stylefile, m_rc_menufile, m_rc_keyfile, m_rc_slitlistfile, m_rc_groupfile; - Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right; - Resource<unsigned int> m_rc_cache_life, m_rc_cache_max; + FbTk::Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right; + FbTk::Resource<unsigned int> m_rc_cache_life, m_rc_cache_max; std::map<Window, FluxboxWindow *> m_window_search;