From 2760b03b2e0a7ee93e4ce70daf73faa609076dff Mon Sep 17 00:00:00 2001 From: akir Date: Mon, 18 Oct 2004 01:24:24 +0000 Subject: cosmetic changes, added ResizeModel to ScreenRessources --- src/Screen.cc | 4 ++-- src/Screen.hh | 9 +++++---- src/ScreenResources.cc | 24 ++++++++++++++++++++++++ src/Window.cc | 4 ++-- 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 9a8d2a0..2d5cf5e 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.295 2004/10/16 22:18:56 akir Exp $ +// $Id: Screen.cc,v 1.296 2004/10/18 01:24:23 akir Exp $ #include "Screen.hh" @@ -172,7 +172,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm, click_raises(rm, true, scrname+".clickRaises", altscrname+".ClickRaises"), decorate_transient(rm, false, scrname+".decorateTransient", altscrname+".DecorateTransient"), rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"), - resizemode(rm, "", scrname+".resizeMode", altscrname+".ResizeMode"), + resize_model(rm, BOTTOMRESIZE, scrname+".resizeMode", altscrname+".ResizeMode"), windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"), focus_model(rm, CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"), follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"), diff --git a/src/Screen.hh b/src/Screen.hh index 4788fff..e861386 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.148 2004/10/16 22:18:56 akir Exp $ +// $Id: Screen.hh,v 1.149 2004/10/18 01:24:23 akir Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -77,7 +77,8 @@ class Subject; */ class BScreen : public FbTk::Observer, private FbTk::NotCopyable { public: - enum FocusModel { SLOPPYFOCUS=0, SEMISLOPPYFOCUS, CLICKTOFOCUS }; + enum ResizeModel { BOTTOMRESIZE = 0, QUADRANTRESIZE, DEFAULTRESIZE = BOTTOMRESIZE }; + enum FocusModel { SLOPPYFOCUS = 0, SEMISLOPPYFOCUS, CLICKTOFOCUS }; enum FollowModel { ///< a window becomes active / focussed on a different workspace IGNORE_OTHER_WORKSPACES = 0, ///< who cares? FOLLOW_ACTIVE_WINDOW, ///< go to that workspace @@ -128,7 +129,7 @@ public: FbTk::Menu &configMenu() { return *m_configmenu.get(); } inline const std::string &getRootCommand() const { return *resource.rootcommand; } - inline const std::string &getResizeMode() const { return *resource.resizemode; } + inline ResizeModel getResizeModel() const { return *resource.resize_model; } inline FocusModel getFocusModel() const { return *resource.focus_model; } inline FollowModel getFollowModel() const { return *resource.follow_model; } @@ -437,7 +438,7 @@ private: focus_last, focus_new, antialias, auto_raise, click_raises, decorate_transient; FbTk::Resource rootcommand; - FbTk::Resource resizemode; + FbTk::Resource resize_model; FbTk::Resource windowmenufile; FbTk::Resource focus_model; FbTk::Resource follow_model; diff --git a/src/ScreenResources.cc b/src/ScreenResources.cc index 70179b6..3d153e6 100644 --- a/src/ScreenResources.cc +++ b/src/ScreenResources.cc @@ -124,6 +124,30 @@ void FbTk::Resource::setFromString(const char *str) { } template<> +std::string FbTk::Resource:: +getString() { + switch (m_value) { + case BScreen::QUADRANTRESIZE: + return std::string("Quadrant"); + case BScreen::BOTTOMRESIZE: + return std::string("Bottom"); + }; + + return std::string("Default"); +} + +template<> +void FbTk::Resource:: +setFromString(char const *strval) { + if (strcasecmp(strval, "Bottom") == 0) { + m_value = BScreen::BOTTOMRESIZE; + } else if (strcasecmp(strval, "Quadrant") == 0) { + m_value = BScreen::QUADRANTRESIZE; + } else + m_value = BScreen::DEFAULTRESIZE; +} + +template<> std::string FbTk::Resource:: getString() { switch (m_value) { diff --git a/src/Window.cc b/src/Window.cc index 26fd542..18570a5 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.302 2004/10/17 21:40:15 akir Exp $ +// $Id: Window.cc,v 1.303 2004/10/18 01:24:24 akir Exp $ #include "Window.hh" @@ -2585,7 +2585,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { m_resize_corner = RIGHTBOTTOM; else if (me.window == frame().gripLeft()) m_resize_corner = LEFTBOTTOM; - else if (screen().getResizeMode() != "quadrant") + else if (screen().getResizeModel() != BScreen::QUADRANTRESIZE) m_resize_corner = RIGHTBOTTOM; else if (me.x < cx) m_resize_corner = (me.y < cy) ? LEFTTOP : LEFTBOTTOM; -- cgit v0.11.2