aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-05-02 21:12:22 (GMT)
committerfluxgen <fluxgen>2004-05-02 21:12:22 (GMT)
commit745dcf42c3e5f52b66afe2ce2f8b806cde71fad9 (patch)
treea949360957b679b23a0ab9f0a3d292ff19efaf68 /src/Screen.hh
parent347689ba694614893cba18db8acf2fd008bc127c (diff)
downloadfluxbox_pavel-745dcf42c3e5f52b66afe2ce2f8b806cde71fad9.zip
fluxbox_pavel-745dcf42c3e5f52b66afe2ce2f8b806cde71fad9.tar.bz2
iconmenu is now handled in IconMenu which is created in WorkspaceMenu, moved all parsing of menu file to MenuCreator
Diffstat (limited to 'src/Screen.hh')
-rw-r--r--src/Screen.hh42
1 files changed, 16 insertions, 26 deletions
diff --git a/src/Screen.hh b/src/Screen.hh
index 381eea5..8c74e44 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.140 2004/04/28 14:59:11 rathnor Exp $ 25// $Id: Screen.hh,v 1.141 2004/05/02 21:10:30 fluxgen Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -74,9 +74,13 @@ class BScreen : public FbTk::Observer, private FbTk::NotCopyable {
74public: 74public:
75 enum FocusModel { SLOPPYFOCUS=0, SEMISLOPPYFOCUS, CLICKTOFOCUS }; 75 enum FocusModel { SLOPPYFOCUS=0, SEMISLOPPYFOCUS, CLICKTOFOCUS };
76 enum FocusDir { FOCUSUP, FOCUSDOWN, FOCUSLEFT, FOCUSRIGHT }; 76 enum FocusDir { FOCUSUP, FOCUSDOWN, FOCUSLEFT, FOCUSRIGHT };
77 enum PlacementPolicy { ROWSMARTPLACEMENT, COLSMARTPLACEMENT, CASCADEPLACEMENT, UNDERMOUSEPLACEMENT}; 77 enum PlacementPolicy { ROWSMARTPLACEMENT, COLSMARTPLACEMENT,
78 CASCADEPLACEMENT, UNDERMOUSEPLACEMENT};
78 enum RowDirection { LEFTRIGHT, RIGHTLEFT}; 79 enum RowDirection { LEFTRIGHT, RIGHTLEFT};
79 enum ColumnDirection { TOPBOTTOM, BOTTOMTOP}; 80 enum ColumnDirection { TOPBOTTOM, BOTTOMTOP};
81 // prevFocus/nextFocus option bits
82 enum { CYCLEGROUPS = 0x01, CYCLESKIPSTUCK = 0x02, CYCLESKIPSHADED = 0x04,
83 CYCLELINEAR = 0x08, CYCLEDEFAULT = 0x00 };
80 84
81 typedef std::vector<FluxboxWindow *> Icons; 85 typedef std::vector<FluxboxWindow *> Icons;
82 typedef std::list<WinClient *> FocusedWindows; 86 typedef std::list<WinClient *> FocusedWindows;
@@ -89,6 +93,7 @@ public:
89 ~BScreen(); 93 ~BScreen();
90 94
91 void initWindows(); 95 void initWindows();
96 void initMenus();
92 inline bool isSloppyFocus() const { return (*resource.focus_model == SLOPPYFOCUS); } 97 inline bool isSloppyFocus() const { return (*resource.focus_model == SLOPPYFOCUS); }
93 inline bool isSemiSloppyFocus() const { return (*resource.focus_model == SEMISLOPPYFOCUS); } 98 inline bool isSemiSloppyFocus() const { return (*resource.focus_model == SEMISLOPPYFOCUS); }
94 inline bool isRootColormapInstalled() const { return root_colormap_installed; } 99 inline bool isRootColormapInstalled() const { return root_colormap_installed; }
@@ -105,11 +110,13 @@ public:
105 inline bool doShowWindowPos() const { return *resource.show_window_pos; } 110 inline bool doShowWindowPos() const { return *resource.show_window_pos; }
106 inline bool antialias() const { return *resource.antialias; } 111 inline bool antialias() const { return *resource.antialias; }
107 inline bool decorateTransient() const { return *resource.decorate_transient; } 112 inline bool decorateTransient() const { return *resource.decorate_transient; }
108 113 inline const std::string &windowMenuFilename() const { return *resource.windowmenufile; }
109 inline FbTk::ImageControl &imageControl() { return *m_image_control.get(); } 114 inline FbTk::ImageControl &imageControl() { return *m_image_control.get(); }
110 const FbTk::Menu &getRootmenu() const { return *m_rootmenu.get(); } 115 const FbTk::Menu &getRootmenu() const { return *m_rootmenu.get(); }
111 FbTk::Menu &getRootmenu() { return *m_rootmenu.get(); } 116 FbTk::Menu &getRootmenu() { return *m_rootmenu.get(); }
112 117 const FbTk::Menu &configMenu() const { return *m_configmenu.get(); }
118 FbTk::Menu &configMenu() { return *m_configmenu.get(); }
119
113 inline const std::string &getRootCommand() const { return *resource.rootcommand; } 120 inline const std::string &getRootCommand() const { return *resource.rootcommand; }
114 inline const std::string &getResizeMode() const { return *resource.resizemode; } 121 inline const std::string &getResizeMode() const { return *resource.resizemode; }
115 inline FocusModel getFocusModel() const { return *resource.focus_model; } 122 inline FocusModel getFocusModel() const { return *resource.focus_model; }
@@ -121,9 +128,8 @@ public:
121 inline Workspace *currentWorkspace() { return m_current_workspace; } 128 inline Workspace *currentWorkspace() { return m_current_workspace; }
122 inline const Workspace *currentWorkspace() const { return m_current_workspace; } 129 inline const Workspace *currentWorkspace() const { return m_current_workspace; }
123 130
124 const FbTk::Menu &getWorkspacemenu() const { return *workspacemenu.get(); } 131 const FbTk::Menu &getWorkspacemenu() const { return *m_workspacemenu.get(); }
125 FbTk::Menu &getWorkspacemenu() { return *workspacemenu.get(); } 132 FbTk::Menu &getWorkspacemenu() { return *m_workspacemenu.get(); }
126
127 133
128 134
129 unsigned int currentWorkspaceID() const; 135 unsigned int currentWorkspaceID() const;
@@ -200,6 +206,7 @@ public:
200 inline void saveFocusModel(FocusModel model) { resource.focus_model = model; } 206 inline void saveFocusModel(FocusModel model) { resource.focus_model = model; }
201 inline void saveWorkspaces(int w) { *resource.workspaces = w; } 207 inline void saveWorkspaces(int w) { *resource.workspaces = w; }
202 208
209 void saveMenu(FbTk::Menu &menu) { m_rootmenu_list.push_back(&menu); }
203 210
204 void setAntialias(bool value); 211 void setAntialias(bool value);
205 212
@@ -338,13 +345,6 @@ public:
338 345
339 346
340 347
341
342
343
344 // prevFocus/nextFocus option bits
345 enum { CYCLEGROUPS = 0x01, CYCLESKIPSTUCK = 0x02, CYCLESKIPSHADED = 0x04,
346 CYCLELINEAR = 0x08, CYCLEDEFAULT = 0x00 };
347
348 class ScreenSubject:public FbTk::Subject { 348 class ScreenSubject:public FbTk::Subject {
349 public: 349 public:
350 ScreenSubject(BScreen &scr):m_scr(scr) { } 350 ScreenSubject(BScreen &scr):m_scr(scr) { }
@@ -356,17 +356,10 @@ public:
356 356
357private: 357private:
358 void setupConfigmenu(FbTk::Menu &menu); 358 void setupConfigmenu(FbTk::Menu &menu);
359 void createStyleMenu(FbTk::Menu &menu, const char *label, const char *directory);
360
361 bool parseMenuFile(std::ifstream &filestream, FbTk::Menu &menu, int &row);
362
363 void initMenu(); 359 void initMenu();
364
365 bool doSkipWindow(const WinClient &winclient, int options); 360 bool doSkipWindow(const WinClient &winclient, int options);
366
367 void renderGeomWindow(); 361 void renderGeomWindow();
368 void renderPosWindow(); 362 void renderPosWindow();
369 void updateIconMenu();
370 363
371 ScreenSubject 364 ScreenSubject
372 m_clientlist_sig, ///< client signal 365 m_clientlist_sig, ///< client signal
@@ -387,9 +380,7 @@ private:
387 FbTk::FbWindow m_geom_window, m_pos_window; 380 FbTk::FbWindow m_geom_window, m_pos_window;
388 381
389 std::auto_ptr<FbTk::ImageControl> m_image_control; 382 std::auto_ptr<FbTk::ImageControl> m_image_control;
390 std::auto_ptr<FbTk::Menu> m_configmenu; 383 std::auto_ptr<FbTk::Menu> m_configmenu, m_rootmenu, m_workspacemenu;
391
392 std::auto_ptr<FbTk::Menu> m_rootmenu;
393 384
394 typedef std::list<FbTk::Menu *> Rootmenus; 385 typedef std::list<FbTk::Menu *> Rootmenus;
395 typedef std::list<Netizen *> Netizens; 386 typedef std::list<Netizen *> Netizens;
@@ -410,8 +401,6 @@ private:
410 std::auto_ptr<Slit> m_slit; 401 std::auto_ptr<Slit> m_slit;
411 402
412 Workspace *m_current_workspace; 403 Workspace *m_current_workspace;
413 std::auto_ptr<FbTk::Menu> workspacemenu;
414 std::auto_ptr<FbTk::Menu> m_iconmenu;
415 404
416 WorkspaceNames m_workspace_names; 405 WorkspaceNames m_workspace_names;
417 Workspaces m_workspaces_list; 406 Workspaces m_workspaces_list;
@@ -434,6 +423,7 @@ private:
434 antialias, auto_raise, click_raises, decorate_transient; 423 antialias, auto_raise, click_raises, decorate_transient;
435 FbTk::Resource<std::string> rootcommand; 424 FbTk::Resource<std::string> rootcommand;
436 FbTk::Resource<std::string> resizemode; 425 FbTk::Resource<std::string> resizemode;
426 FbTk::Resource<std::string> windowmenufile;
437 FbTk::Resource<FocusModel> focus_model; 427 FbTk::Resource<FocusModel> focus_model;
438 bool ordered_dither; 428 bool ordered_dither;
439 FbTk::Resource<int> workspaces, edge_snap_threshold, menu_alpha, menu_delay, menu_delay_close; 429 FbTk::Resource<int> workspaces, edge_snap_threshold, menu_alpha, menu_delay, menu_delay_close;