summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Screen.cc3
-rw-r--r--src/Screen.hh9
-rw-r--r--src/ScreenResources.cc28
3 files changed, 38 insertions, 2 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 24e75b0..9a8d2a0 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.294 2004/10/04 15:37:58 rathnor Exp $ 25// $Id: Screen.cc,v 1.295 2004/10/16 22:18:56 akir Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -175,6 +175,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
175 resizemode(rm, "", scrname+".resizeMode", altscrname+".ResizeMode"), 175 resizemode(rm, "", scrname+".resizeMode", altscrname+".ResizeMode"),
176 windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"), 176 windowmenufile(rm, "", scrname+".windowMenu", altscrname+".WindowMenu"),
177 focus_model(rm, CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"), 177 focus_model(rm, CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"),
178 follow_model(rm, IGNORE_OTHER_WORKSPACES, scrname+".followModel", altscrname+".followModel"),
178 workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"), 179 workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"),
179 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), 180 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"),
180 focused_alpha(rm, 255, scrname+".window.focus.alpha", altscrname+".Window.Focus.Alpha"), 181 focused_alpha(rm, 255, scrname+".window.focus.alpha", altscrname+".Window.Focus.Alpha"),
diff --git a/src/Screen.hh b/src/Screen.hh
index 039f9f3..4788fff 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.hh,v 1.147 2004/09/16 10:10:37 fluxgen Exp $ 25// $Id: Screen.hh,v 1.148 2004/10/16 22:18:56 akir Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -78,6 +78,11 @@ class Subject;
78class BScreen : public FbTk::Observer, private FbTk::NotCopyable { 78class BScreen : public FbTk::Observer, private FbTk::NotCopyable {
79public: 79public:
80 enum FocusModel { SLOPPYFOCUS=0, SEMISLOPPYFOCUS, CLICKTOFOCUS }; 80 enum FocusModel { SLOPPYFOCUS=0, SEMISLOPPYFOCUS, CLICKTOFOCUS };
81 enum FollowModel { ///< a window becomes active / focussed on a different workspace
82 IGNORE_OTHER_WORKSPACES = 0, ///< who cares?
83 FOLLOW_ACTIVE_WINDOW, ///< go to that workspace
84 FETCH_ACTIVE_WINDOW ///< put that window to the current workspace
85 };
81 enum FocusDir { FOCUSUP, FOCUSDOWN, FOCUSLEFT, FOCUSRIGHT }; 86 enum FocusDir { FOCUSUP, FOCUSDOWN, FOCUSLEFT, FOCUSRIGHT };
82 enum PlacementPolicy { ROWSMARTPLACEMENT, COLSMARTPLACEMENT, 87 enum PlacementPolicy { ROWSMARTPLACEMENT, COLSMARTPLACEMENT,
83 CASCADEPLACEMENT, UNDERMOUSEPLACEMENT}; 88 CASCADEPLACEMENT, UNDERMOUSEPLACEMENT};
@@ -125,6 +130,7 @@ public:
125 inline const std::string &getRootCommand() const { return *resource.rootcommand; } 130 inline const std::string &getRootCommand() const { return *resource.rootcommand; }
126 inline const std::string &getResizeMode() const { return *resource.resizemode; } 131 inline const std::string &getResizeMode() const { return *resource.resizemode; }
127 inline FocusModel getFocusModel() const { return *resource.focus_model; } 132 inline FocusModel getFocusModel() const { return *resource.focus_model; }
133 inline FollowModel getFollowModel() const { return *resource.follow_model; }
128 134
129 inline Slit *slit() { return m_slit.get(); } 135 inline Slit *slit() { return m_slit.get(); }
130 inline const Slit *slit() const { return m_slit.get(); } 136 inline const Slit *slit() const { return m_slit.get(); }
@@ -434,6 +440,7 @@ private:
434 FbTk::Resource<std::string> resizemode; 440 FbTk::Resource<std::string> resizemode;
435 FbTk::Resource<std::string> windowmenufile; 441 FbTk::Resource<std::string> windowmenufile;
436 FbTk::Resource<FocusModel> focus_model; 442 FbTk::Resource<FocusModel> focus_model;
443 FbTk::Resource<FollowModel> follow_model;
437 bool ordered_dither; 444 bool ordered_dither;
438 FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha, 445 FbTk::Resource<int> workspaces, edge_snap_threshold, focused_alpha,
439 unfocused_alpha, menu_alpha, menu_delay, menu_delay_close; 446 unfocused_alpha, menu_alpha, menu_delay, menu_delay_close;
diff --git a/src/ScreenResources.cc b/src/ScreenResources.cc
index cd5bb8d..70179b6 100644
--- a/src/ScreenResources.cc
+++ b/src/ScreenResources.cc
@@ -157,6 +157,34 @@ setFromString(char const *strval) {
157} 157}
158 158
159template<> 159template<>
160std::string FbTk::Resource<BScreen::FollowModel>::
161getString() {
162 switch (m_value) {
163 case BScreen::FOLLOW_ACTIVE_WINDOW:
164 return std::string("Follow");
165 break;
166 case BScreen::FETCH_ACTIVE_WINDOW:
167 return std::string("Current");
168 break;
169 };
170
171 return std::string("Ignore");
172}
173
174template<>
175void FbTk::Resource<BScreen::FollowModel>::
176setFromString(char const *strval) {
177 if (strcasecmp(strval, "Follow") == 0)
178 m_value = BScreen::FOLLOW_ACTIVE_WINDOW;
179 else if (strcasecmp(strval, "Current") == 0 ||
180 strcasecmp(strval, "CurrentWorkspace") == 0 ||
181 strcasecmp(strval, "Fetch") == 0)
182 m_value = BScreen::FETCH_ACTIVE_WINDOW;
183 else
184 setDefaultValue();
185}
186
187template<>
160void FbTk::Resource<FbTk::GContext::LineStyle>::setDefaultValue() { 188void FbTk::Resource<FbTk::GContext::LineStyle>::setDefaultValue() {
161 *(*this) = FbTk::GContext::LINESOLID; 189 *(*this) = FbTk::GContext::LINESOLID;
162} 190}