aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-06-20 01:30:08 (GMT)
committerfluxgen <fluxgen>2003-06-20 01:30:08 (GMT)
commit4dd65d902ae9d3e5576cbc66eafdcbc6687081a2 (patch)
tree38c13b20774b29f326eb6325fe6282f3e049a48a /src
parentb0d89d4e8c16b947c1e51a1aace21b9c75e4c50b (diff)
downloadfluxbox_paul-4dd65d902ae9d3e5576cbc66eafdcbc6687081a2.zip
fluxbox_paul-4dd65d902ae9d3e5576cbc66eafdcbc6687081a2.tar.bz2
moved slit resources into slit
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc41
-rw-r--r--src/Screen.hh37
2 files changed, 20 insertions, 58 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index df272f2..d508c5c 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.185 2003/06/18 13:42:21 fluxgen Exp $ 25// $Id: Screen.cc,v 1.186 2003/06/20 01:30:08 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -464,7 +464,6 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
464 image_dither(rm, false, scrname+".imageDither", altscrname+".ImageDither"), 464 image_dither(rm, false, scrname+".imageDither", altscrname+".ImageDither"),
465 opaque_move(rm, false, "session.opaqueMove", "Session.OpaqueMove"), 465 opaque_move(rm, false, "session.opaqueMove", "Session.OpaqueMove"),
466 full_max(rm, true, scrname+".fullMaximization", altscrname+".FullMaximization"), 466 full_max(rm, true, scrname+".fullMaximization", altscrname+".FullMaximization"),
467 max_over_slit(rm, true, scrname+".maxOverSlit",altscrname+".MaxOverSlit"),
468 sloppy_window_grouping(rm, true, 467 sloppy_window_grouping(rm, true,
469 scrname+".sloppywindowgrouping", altscrname+".SloppyWindowGrouping"), 468 scrname+".sloppywindowgrouping", altscrname+".SloppyWindowGrouping"),
470 workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"), 469 workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"),
@@ -482,22 +481,13 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
482 scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"), 481 scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"),
483 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"), 482 edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"),
484 menu_alpha(rm, 255, scrname+".menuAlpha", altscrname+".MenuAlpha"), 483 menu_alpha(rm, 255, scrname+".menuAlpha", altscrname+".MenuAlpha"),
485 slit_layernum(rm, Fluxbox::Layer(Fluxbox::instance()->getDockLayer()), 484
486 scrname+".slit.layer", altscrname+".Slit.Layer"),
487 toolbar_layernum(rm, Fluxbox::Layer(Fluxbox::instance()->getDesktopLayer()), 485 toolbar_layernum(rm, Fluxbox::Layer(Fluxbox::instance()->getDesktopLayer()),
488 scrname+".toolbar.layer", altscrname+".Toolbar.Layer"), 486 scrname+".toolbar.layer", altscrname+".Toolbar.Layer"),
489 toolbar_mode(rm, ToolbarHandler::ICONS, scrname+".toolbar.mode", altscrname+".Toolbar.Mode"), 487 toolbar_mode(rm, ToolbarHandler::ICONS, scrname+".toolbar.mode", altscrname+".Toolbar.Mode"),
490 toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead"), 488 toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead"),
491 toolbar_placement(rm, Toolbar::BOTTOMCENTER, 489 toolbar_placement(rm, Toolbar::BOTTOMCENTER,
492 scrname+".toolbar.placement", altscrname+".Toolbar.Placement"), 490 scrname+".toolbar.placement", altscrname+".Toolbar.Placement") {
493 slit_auto_hide(rm, false,
494 scrname+".slit.autoHide", altscrname+".Slit.AutoHide"),
495 slit_placement(rm, Slit::BOTTOMRIGHT,
496 scrname+".slit.placement", altscrname+".Slit.Placement"),
497 slit_direction(rm, Slit::VERTICAL,
498 scrname+".slit.direction", altscrname+".Slit.Direction"),
499 slit_alpha(rm, 255, scrname+".slit.alpha", altscrname+".Slit.Alpha"),
500 slit_on_head(rm, 0, scrname+".slit.onhead", altscrname+".Slit.onHead") {
501 491
502}; 492};
503 493
@@ -522,6 +512,9 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
522 *resource.rootcommand)), 512 *resource.rootcommand)),
523 m_root_window(scrn), 513 m_root_window(scrn),
524 resource(rm, screenname, altscreenname), 514 resource(rm, screenname, altscreenname),
515 m_name(screenname),
516 m_altname(altscreenname),
517 m_resource_manager(rm),
525 m_toolbarhandler(0), 518 m_toolbarhandler(0),
526 m_available_workspace_area(new Strut(0, 0, 0, 0)), 519 m_available_workspace_area(new Strut(0, 0, 0, 0)),
527 m_xinerama_headinfo(0) { 520 m_xinerama_headinfo(0) {
@@ -618,7 +611,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
618 m_current_workspace = m_workspaces_list.front(); 611 m_current_workspace = m_workspaces_list.front();
619 612
620#ifdef SLIT 613#ifdef SLIT
621 m_slit.reset(new Slit(*this, *layerManager().getLayer(getSlitLayerNum()), 614 m_slit.reset(new Slit(*this, *layerManager().getLayer(Fluxbox::instance()->getDesktopLayer()),
622 Fluxbox::instance()->getSlitlistFilename().c_str())); 615 Fluxbox::instance()->getSlitlistFilename().c_str()));
623#endif // SLIT 616#endif // SLIT
624 617
@@ -900,11 +893,8 @@ void BScreen::reconfigure() {
900 } 893 }
901 894
902#ifdef SLIT 895#ifdef SLIT
903 if (slit()) { 896 if (slit())
904 slit()->setPlacement(static_cast<Slit::Placement>(getSlitPlacement()));
905 slit()->setDirection(static_cast<Slit::Direction>(getSlitDirection()));
906 slit()->reconfigure(); 897 slit()->reconfigure();
907 }
908#endif // SLIT 898#endif // SLIT
909 899
910 //reconfigure workspaces 900 //reconfigure workspaces
@@ -2234,10 +2224,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
2234 BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuFocusLast, 2224 BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuFocusLast,
2235 "Focus Last Window on Workspace"), 2225 "Focus Last Window on Workspace"),
2236 *resource.focus_last, saverc_cmd)); 2226 *resource.focus_last, saverc_cmd));
2237 menu.insert(new 2227
2238 BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuMaxOverSlit,
2239 "Maximize Over Slit"),
2240 *resource.max_over_slit, saverc_cmd));
2241 menu.insert(new 2228 menu.insert(new
2242 BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuWorkspaceWarping, 2229 BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuWorkspaceWarping,
2243 "Workspace Warping"), 2230 "Workspace Warping"),
@@ -2689,13 +2676,3 @@ void BScreen::setOnHead<Toolbar>(Toolbar &tbar, int head) {
2689 tbar.reconfigure(); 2676 tbar.reconfigure();
2690} 2677}
2691 2678
2692template <>
2693int BScreen::getOnHead<Slit>(Slit &tbar) {
2694 return getSlitOnHead();
2695}
2696
2697template <>
2698void BScreen::setOnHead<Slit>(Slit &slit, int head) {
2699 saveSlitOnHead(head);
2700 slit.reconfigure();
2701}
diff --git a/src/Screen.hh b/src/Screen.hh
index 9a16597..e1922eb 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.106 2003/06/18 13:42:21 fluxgen Exp $ 25// $Id: Screen.hh,v 1.107 2003/06/20 01:28:16 fluxgen Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -31,7 +31,6 @@
31#include "Subject.hh" 31#include "Subject.hh"
32#include "MultLayers.hh" 32#include "MultLayers.hh"
33#include "ToolbarHandler.hh" 33#include "ToolbarHandler.hh"
34#include "Slit.hh"
35#include "FbRootWindow.hh" 34#include "FbRootWindow.hh"
36#include "NotCopyable.hh" 35#include "NotCopyable.hh"
37 36
@@ -53,6 +52,7 @@ class WinButtonTheme;
53class WinClient; 52class WinClient;
54class Workspace; 53class Workspace;
55class Strut; 54class Strut;
55class Slit;
56 56
57namespace FbTk { 57namespace FbTk {
58class MenuTheme; 58class MenuTheme;
@@ -88,7 +88,6 @@ public:
88 inline bool doAutoRaise() const { return *resource.auto_raise; } 88 inline bool doAutoRaise() const { return *resource.auto_raise; }
89 inline bool clickRaises() const { return *resource.click_raises; } 89 inline bool clickRaises() const { return *resource.click_raises; }
90 inline bool doImageDither() const { return *resource.image_dither; } 90 inline bool doImageDither() const { return *resource.image_dither; }
91 inline bool doMaxOverSlit() const { return *resource.max_over_slit; }
92 inline bool doOpaqueMove() const { return *resource.opaque_move; } 91 inline bool doOpaqueMove() const { return *resource.opaque_move; }
93 inline bool doFullMax() const { return *resource.full_max; } 92 inline bool doFullMax() const { return *resource.full_max; }
94 inline bool doFocusNew() const { return *resource.focus_new; } 93 inline bool doFocusNew() const { return *resource.focus_new; }
@@ -105,22 +104,9 @@ public:
105 inline const std::string &getRootCommand() const { return *resource.rootcommand; } 104 inline const std::string &getRootCommand() const { return *resource.rootcommand; }
106 inline Fluxbox::FocusModel getFocusModel() const { return *resource.focus_model; } 105 inline Fluxbox::FocusModel getFocusModel() const { return *resource.focus_model; }
107 106
108 inline bool &doSlitAutoHide() { return *resource.slit_auto_hide; }
109 inline const bool &doSlitAutoHide() const { return *resource.slit_auto_hide; }
110
111 inline Slit *slit() { return m_slit.get(); } 107 inline Slit *slit() { return m_slit.get(); }
112 inline const Slit *slit() const { return m_slit.get(); } 108 inline const Slit *slit() const { return m_slit.get(); }
113 109
114 inline Slit::Placement getSlitPlacement() const { return *resource.slit_placement; }
115 inline Slit::Direction getSlitDirection() const { return *resource.slit_direction; }
116 inline FbTk::Resource<int> &slitAlphaResource() { return resource.slit_alpha; }
117 inline void saveSlitPlacement(Slit::Placement p) { resource.slit_placement = p; }
118 inline void saveSlitDirection(Slit::Direction d) { resource.slit_direction = d; }
119 inline void saveSlitAutoHide(bool t) { resource.slit_auto_hide = t; }
120
121 inline int getSlitOnHead() const { return *resource.slit_on_head; }
122 inline void saveSlitOnHead(int h) { *resource.slit_on_head = h; }
123
124 inline const Toolbar *toolbar() const { return m_toolbarhandler->getToolbar(); } 110 inline const Toolbar *toolbar() const { return m_toolbarhandler->getToolbar(); }
125 inline Toolbar *toolbar() { return m_toolbarhandler->getToolbar(); } 111 inline Toolbar *toolbar() { return m_toolbarhandler->getToolbar(); }
126 112
@@ -188,7 +174,6 @@ public:
188 inline int getRowPlacementDirection() const { return resource.row_direction; } 174 inline int getRowPlacementDirection() const { return resource.row_direction; }
189 inline int getColPlacementDirection() const { return resource.col_direction; } 175 inline int getColPlacementDirection() const { return resource.col_direction; }
190 176
191 inline int getSlitLayerNum() const { return (*resource.slit_layernum).getNum(); }
192 inline int getToolbarLayerNum() const { return (*resource.toolbar_layernum).getNum(); } 177 inline int getToolbarLayerNum() const { return (*resource.toolbar_layernum).getNum(); }
193 178
194 179
@@ -203,14 +188,13 @@ public:
203 inline void saveToolbarPlacement(Toolbar::Placement place) { *resource.toolbar_placement = place; } 188 inline void saveToolbarPlacement(Toolbar::Placement place) { *resource.toolbar_placement = place; }
204 inline void saveToolbarOnHead(int head) { *resource.toolbar_on_head = head; } 189 inline void saveToolbarOnHead(int head) { *resource.toolbar_on_head = head; }
205 inline void saveToolbarLayer(Fluxbox::Layer layer) { *resource.toolbar_layernum = layer; } 190 inline void saveToolbarLayer(Fluxbox::Layer layer) { *resource.toolbar_layernum = layer; }
206 inline void saveSlitLayer(Fluxbox::Layer layer) { *resource.slit_layernum = layer; }
207 191
208 inline void savePlacementPolicy(int p) { resource.placement_policy = p; } 192 inline void savePlacementPolicy(int p) { resource.placement_policy = p; }
209 inline void saveRowPlacementDirection(int d) { resource.row_direction = d; } 193 inline void saveRowPlacementDirection(int d) { resource.row_direction = d; }
210 inline void saveColPlacementDirection(int d) { resource.col_direction = d; } 194 inline void saveColPlacementDirection(int d) { resource.col_direction = d; }
211 inline void saveEdgeSnapThreshold(int t) { resource.edge_snap_threshold = t; } 195 inline void saveEdgeSnapThreshold(int t) { resource.edge_snap_threshold = t; }
212 inline void saveImageDither(bool d) { resource.image_dither = d; } 196 inline void saveImageDither(bool d) { resource.image_dither = d; }
213 inline void saveMaxOverSlit(bool m) { resource.max_over_slit = m; } 197
214 inline void saveOpaqueMove(bool o) { resource.opaque_move = o; } 198 inline void saveOpaqueMove(bool o) { resource.opaque_move = o; }
215 inline void saveFullMax(bool f) { resource.full_max = f; } 199 inline void saveFullMax(bool f) { resource.full_max = f; }
216 inline void saveFocusNew(bool f) { resource.focus_new = f; } 200 inline void saveFocusNew(bool f) { resource.focus_new = f; }
@@ -240,7 +224,10 @@ public:
240 FluxboxWindow *getIcon(unsigned int index); 224 FluxboxWindow *getIcon(unsigned int index);
241 FbTk::MultLayers &layerManager() { return m_layermanager; } 225 FbTk::MultLayers &layerManager() { return m_layermanager; }
242 const FbTk::MultLayers &layerManager() const { return m_layermanager; } 226 const FbTk::MultLayers &layerManager() const { return m_layermanager; }
243 227 FbTk::ResourceManager &resourceManager() { return m_resource_manager; }
228 const FbTk::ResourceManager &resourceManager() const { return m_resource_manager; }
229 const std::string &name() const { return m_name; }
230 const std::string &altName() const { return m_altname; }
244 int addWorkspace(); 231 int addWorkspace();
245 int removeLastWorkspace(); 232 int removeLastWorkspace();
246 //scroll workspaces 233 //scroll workspaces
@@ -425,7 +412,6 @@ private:
425 412
426 FbTk::Resource<bool> toolbar_auto_hide, 413 FbTk::Resource<bool> toolbar_auto_hide,
427 image_dither, opaque_move, full_max, 414 image_dither, opaque_move, full_max,
428 max_over_slit,
429 sloppy_window_grouping, workspace_warping, 415 sloppy_window_grouping, workspace_warping,
430 desktop_wheeling, show_window_pos, 416 desktop_wheeling, show_window_pos,
431 focus_last, focus_new, 417 focus_last, focus_new,
@@ -435,16 +421,12 @@ private:
435 bool ordered_dither; 421 bool ordered_dither;
436 FbTk::Resource<int> workspaces, toolbar_width_percent, edge_snap_threshold, 422 FbTk::Resource<int> workspaces, toolbar_width_percent, edge_snap_threshold,
437 menu_alpha; 423 menu_alpha;
438 FbTk::Resource<Fluxbox::Layer> slit_layernum, toolbar_layernum; 424 FbTk::Resource<Fluxbox::Layer> toolbar_layernum;
439 int placement_policy, row_direction, col_direction; 425 int placement_policy, row_direction, col_direction;
440 426
441 FbTk::Resource<ToolbarHandler::ToolbarMode> toolbar_mode; 427 FbTk::Resource<ToolbarHandler::ToolbarMode> toolbar_mode;
442 FbTk::Resource<int> toolbar_on_head; 428 FbTk::Resource<int> toolbar_on_head;
443 FbTk::Resource<Toolbar::Placement> toolbar_placement; 429 FbTk::Resource<Toolbar::Placement> toolbar_placement;
444 FbTk::Resource<bool> slit_auto_hide;
445 FbTk::Resource<Slit::Placement> slit_placement;
446 FbTk::Resource<Slit::Direction> slit_direction;
447 FbTk::Resource<int> slit_alpha, slit_on_head;
448 430
449 std::string strftime_format; 431 std::string strftime_format;
450 432
@@ -454,6 +436,9 @@ private:
454 436
455 } resource; 437 } resource;
456 438
439 const std::string m_name, m_altname;
440 FbTk::ResourceManager &m_resource_manager;
441
457 std::auto_ptr<ToolbarHandler> m_toolbarhandler; 442 std::auto_ptr<ToolbarHandler> m_toolbarhandler;
458 443
459 bool m_xinerama_avail; 444 bool m_xinerama_avail;