aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/fluxbox.hh')
-rw-r--r--src/fluxbox.hh72
1 files changed, 38 insertions, 34 deletions
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index 0da630d..c32e74b 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -80,54 +80,56 @@ class Fluxbox : public FbTk::App,
80 public FbTk::SignalEventHandler, 80 public FbTk::SignalEventHandler,
81 public FbTk::Observer { 81 public FbTk::Observer {
82public: 82public:
83 Fluxbox(int argc, char **argv, const char * dpy_name= 0, 83 Fluxbox(int argc, char **argv, const char * dpy_name= 0,
84 const char *rcfilename = 0); 84 const char *rcfilename = 0);
85 virtual ~Fluxbox(); 85 virtual ~Fluxbox();
86 86
87 static Fluxbox *instance() { return s_singleton; } 87 static Fluxbox *instance() { return s_singleton; }
88
88 /// main event loop 89 /// main event loop
89 void eventLoop(); 90 void eventLoop();
90 bool validateWindow(Window win) const; 91 bool validateWindow(Window win) const;
91 void grab(); 92 void grab();
92 void ungrab(); 93 void ungrab();
93 Keys *keys() { return m_key.get(); } 94 Keys *keys() { return m_key.get(); }
94 inline Atom getFluxboxPidAtom() const { return m_fluxbox_pid; } 95 Atom getFluxboxPidAtom() const { return m_fluxbox_pid; }
95 96
96 // Not currently implemented until we decide how it'll be used 97 // Not currently implemented until we decide how it'll be used
97 //WinClient *searchGroup(Window); 98 //WinClient *searchGroup(Window);
98 WinClient *searchWindow(Window); 99 WinClient *searchWindow(Window);
99 inline WinClient *getFocusedWindow() { return m_focused_window; } 100 WinClient *getFocusedWindow() { return m_focused_window; }
100 101
101 int initScreen(int screen_nr); 102 int initScreen(int screen_nr);
102 BScreen *searchScreen(Window w); 103 BScreen *searchScreen(Window w);
103 104
104 inline unsigned int getDoubleClickInterval() const { return *m_rc_double_click_interval; } 105 unsigned int getDoubleClickInterval() const { return *m_rc_double_click_interval; }
105 inline Time getLastTime() const { return m_last_time; } 106 Time getLastTime() const { return m_last_time; }
106 107
107 AtomHandler *getAtomHandler(const std::string &name); 108 AtomHandler *getAtomHandler(const std::string &name);
108 void addAtomHandler(AtomHandler *atomh, const std::string &name); 109 void addAtomHandler(AtomHandler *atomh, const std::string &name);
109 void removeAtomHandler(AtomHandler *atomh); 110 void removeAtomHandler(AtomHandler *atomh);
110 111
111 /// obsolete 112 /// obsolete
112 enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENUICON, EMPTY}; 113 enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENUICON, EMPTY};
113 enum TabsAttachArea{ATTACH_AREA_WINDOW= 0, ATTACH_AREA_TITLEBAR}; 114 enum TabsAttachArea{ATTACH_AREA_WINDOW= 0, ATTACH_AREA_TITLEBAR};
114 115
115 116
116 inline bool getIgnoreBorder() const { return *m_rc_ignoreborder; } 117 bool getIgnoreBorder() const { return *m_rc_ignoreborder; }
117 inline bool &getPseudoTrans() { return *m_rc_pseudotrans; } 118 bool &getPseudoTrans() { return *m_rc_pseudotrans; }
118 119
119 inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() const { return *m_rc_titlebar_right; } 120 const std::vector<Fluxbox::Titlebar>& getTitlebarRight() const { return *m_rc_titlebar_right; }
120 inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() const { return *m_rc_titlebar_left; } 121 const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() const { return *m_rc_titlebar_left; }
121 inline Fluxbox::TabsAttachArea getTabsAttachArea() const { return *m_rc_tabs_attach_area; } 122 Fluxbox::TabsAttachArea getTabsAttachArea() const { return *m_rc_tabs_attach_area; }
122 inline const std::string &getStyleFilename() const { return *m_rc_stylefile; } 123 const std::string &getStyleFilename() const { return *m_rc_stylefile; }
124 const std::string &getStyleOverlayFilename() const { return *m_rc_styleoverlayfile; }
123 125
124 inline const std::string &getMenuFilename() const { return *m_rc_menufile; } 126 const std::string &getMenuFilename() const { return *m_rc_menufile; }
125 inline const std::string &getSlitlistFilename() const { return *m_rc_slitlistfile; } 127 const std::string &getSlitlistFilename() const { return *m_rc_slitlistfile; }
126 inline const std::string &getAppsFilename() const { return *m_rc_appsfile; } 128 const std::string &getAppsFilename() const { return *m_rc_appsfile; }
127 inline int colorsPerChannel() const { return *m_rc_colors_per_channel; } 129 int colorsPerChannel() const { return *m_rc_colors_per_channel; }
128 inline int getNumberOfLayers() const { return *m_rc_numlayers; } 130 int getNumberOfLayers() const { return *m_rc_numlayers; }
129 inline int getTabsPadding() const { return *m_rc_tabs_padding; } 131 int getTabsPadding() const { return *m_rc_tabs_padding; }
130 inline int getFocusedTabMinWidth() const { return *m_rc_focused_tab_min_width; } 132 int getFocusedTabMinWidth() const { return *m_rc_focused_tab_min_width; }
131 133
132 // class to store layer numbers (special Resource type) 134 // class to store layer numbers (special Resource type)
133 // we have a special resource type because we need to be able to name certain layers 135 // we have a special resource type because we need to be able to name certain layers
@@ -135,7 +137,7 @@ public:
135 class Layer { 137 class Layer {
136 public: 138 public:
137 explicit Layer(int i) : m_num(i) {}; 139 explicit Layer(int i) : m_num(i) {};
138 inline int getNum() const { return m_num; } 140 int getNum() const { return m_num; }
139 141
140 Layer &operator=(int num) { m_num = num; return *this; } 142 Layer &operator=(int num) { m_num = num; return *this; }
141 143
@@ -144,22 +146,22 @@ public:
144 }; 146 };
145 147
146 // TODO these probably should be configurable 148 // TODO these probably should be configurable
147 inline int getMenuLayer() const { return 0; } 149 int getMenuLayer() const { return 0; }
148 inline int getAboveDockLayer() const { return 2; } 150 int getAboveDockLayer() const { return 2; }
149 inline int getDockLayer() const { return 4; } 151 int getDockLayer() const { return 4; }
150 inline int getTopLayer() const { return 6; } 152 int getTopLayer() const { return 6; }
151 inline int getNormalLayer() const { return 8; } 153 int getNormalLayer() const { return 8; }
152 inline int getBottomLayer() const { return 10; } 154 int getBottomLayer() const { return 10; }
153 inline int getDesktopLayer() const { return 12; } 155 int getDesktopLayer() const { return 12; }
154 156
155 157
156 inline time_t getAutoRaiseDelay() const { return *m_rc_auto_raise_delay; } 158 time_t getAutoRaiseDelay() const { return *m_rc_auto_raise_delay; }
157 159
158 inline unsigned int getCacheLife() const { return *m_rc_cache_life * 60000; } 160 unsigned int getCacheLife() const { return *m_rc_cache_life * 60000; }
159 inline unsigned int getCacheMax() const { return *m_rc_cache_max; } 161 unsigned int getCacheMax() const { return *m_rc_cache_max; }
160 inline bool useMod1() const { return *m_rc_use_mod1; } 162 bool useMod1() const { return *m_rc_use_mod1; }
161 163
162 inline void maskWindowEvents(Window w, FluxboxWindow *bw) 164 void maskWindowEvents(Window w, FluxboxWindow *bw)
163 { m_masked = w; m_masked_window = bw; } 165 { m_masked = w; m_masked_window = bw; }
164 166
165 void watchKeyRelease(BScreen &screen, unsigned int mods); 167 void watchKeyRelease(BScreen &screen, unsigned int mods);
@@ -173,6 +175,7 @@ public:
173 void loadRootCommand(BScreen &scr); 175 void loadRootCommand(BScreen &scr);
174 void loadTitlebar(); 176 void loadTitlebar();
175 void saveStyleFilename(const char *val) { m_rc_stylefile = (val == 0 ? "" : val); } 177 void saveStyleFilename(const char *val) { m_rc_stylefile = (val == 0 ? "" : val); }
178 void saveStyleOverlayFilename(const char *val) { m_rc_styleoverlayfile = (val == 0 ? "" : val); }
176 void saveMenuFilename(const char *); 179 void saveMenuFilename(const char *);
177 void clearMenuFilenames(); 180 void clearMenuFilenames();
178 void saveTitlebarFilename(const char *); 181 void saveTitlebarFilename(const char *);
@@ -247,7 +250,7 @@ private:
247 void handleButtonEvent(XButtonEvent &be); 250 void handleButtonEvent(XButtonEvent &be);
248 void handleUnmapNotify(XUnmapEvent &ue); 251 void handleUnmapNotify(XUnmapEvent &ue);
249 void handleClientMessage(XClientMessageEvent &ce); 252 void handleClientMessage(XClientMessageEvent &ce);
250 void handleKeyEvent(XKeyEvent &ke); 253 void handleKeyEvent(XKeyEvent &ke);
251 void setTitlebar(std::vector<Fluxbox::Titlebar>& dir, const char *arg); 254 void setTitlebar(std::vector<Fluxbox::Titlebar>& dir, const char *arg);
252 255
253 std::auto_ptr<FbAtoms> m_fbatoms; 256 std::auto_ptr<FbAtoms> m_fbatoms;
@@ -263,6 +266,7 @@ private:
263 m_rc_tabs_padding, 266 m_rc_tabs_padding,
264 m_rc_focused_tab_min_width; 267 m_rc_focused_tab_min_width;
265 FbTk::Resource<std::string> m_rc_stylefile, 268 FbTk::Resource<std::string> m_rc_stylefile,
269 m_rc_styleoverlayfile,
266 m_rc_menufile, m_rc_keyfile, m_rc_slitlistfile, 270 m_rc_menufile, m_rc_keyfile, m_rc_slitlistfile,
267 m_rc_groupfile, m_rc_appsfile; 271 m_rc_groupfile, m_rc_appsfile;
268 272
@@ -280,7 +284,7 @@ private:
280 // A window is the group leader, which can map to several 284 // A window is the group leader, which can map to several
281 // WinClients in the group, it is *not* fluxbox's concept of groups 285 // WinClients in the group, it is *not* fluxbox's concept of groups
282 // See ICCCM section 4.1.11 286 // See ICCCM section 4.1.11
283 // The group leader (which may not be mapped, so may not have a WinClient) 287 // The group leader (which may not be mapped, so may not have a WinClient)
284 // will have it's window being the group index 288 // will have it's window being the group index
285 std::multimap<Window, WinClient *> m_group_search; 289 std::multimap<Window, WinClient *> m_group_search;
286 290