summaryrefslogtreecommitdiff
path: root/src/fluxbox.hh
diff options
context:
space:
mode:
authorrathnor <rathnor>2002-12-01 13:42:15 (GMT)
committerrathnor <rathnor>2002-12-01 13:42:15 (GMT)
commit28b5c604490094e187494dcc566bd3d7a05a2c25 (patch)
tree8f78f5714a5cd055c10b067a2656fe7b2338e71a /src/fluxbox.hh
parentb9134162f9633784d9097df18769a699a62650fe (diff)
downloadfluxbox_lack-28b5c604490094e187494dcc566bd3d7a05a2c25.zip
fluxbox_lack-28b5c604490094e187494dcc566bd3d7a05a2c25.tar.bz2
Indenting from tabs to emacs 4-space
Diffstat (limited to 'src/fluxbox.hh')
-rw-r--r--src/fluxbox.hh298
1 files changed, 149 insertions, 149 deletions
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index 0d446d8..12faaa4 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.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: fluxbox.hh,v 1.34 2002/11/30 20:16:14 fluxgen Exp $ 25// $Id: fluxbox.hh,v 1.35 2002/12/01 13:42:07 rathnor Exp $
26 26
27#ifndef FLUXBOX_HH 27#ifndef FLUXBOX_HH
28#define FLUXBOX_HH 28#define FLUXBOX_HH
@@ -76,206 +76,206 @@ class Tab;
76 singleton type 76 singleton type
77*/ 77*/
78class Fluxbox : public BaseDisplay, public TimeoutHandler, 78class Fluxbox : public BaseDisplay, public TimeoutHandler,
79 public FbTk::SignalEventHandler, 79 public FbTk::SignalEventHandler,
80 public FbAtoms, 80 public FbAtoms,
81 public FbTk::Observer { 81 public FbTk::Observer {
82public: 82public:
83 Fluxbox(int argc, char **argv, const char * dpy_name= 0, const char *rc = 0); 83 Fluxbox(int argc, char **argv, const char * dpy_name= 0, const char *rc = 0);
84 virtual ~Fluxbox(); 84 virtual ~Fluxbox();
85 85
86 static Fluxbox *instance() { return singleton; } 86 static Fluxbox *instance() { return singleton; }
87 87
88 inline bool useTabs() { return *m_rc_tabs; } 88 inline bool useTabs() { return *m_rc_tabs; }
89 inline bool useIconBar() { return *m_rc_iconbar; } 89 inline bool useIconBar() { return *m_rc_iconbar; }
90 inline void saveTabs(bool value) { *m_rc_tabs = value; } 90 inline void saveTabs(bool value) { *m_rc_tabs = value; }
91 inline void saveIconBar(bool value) { m_rc_iconbar = value; } 91 inline void saveIconBar(bool value) { m_rc_iconbar = value; }
92#ifdef HAVE_GETPID 92#ifdef HAVE_GETPID
93 inline Atom getFluxboxPidAtom() const { return fluxbox_pid; } 93 inline Atom getFluxboxPidAtom() const { return fluxbox_pid; }
94 #ifdef KDE 94#ifdef KDE
95 //For KDE dock applets 95 //For KDE dock applets
96 inline Atom getKWM1DockwindowAtom() const { return kwm1_dockwindow; } //KDE v1.x 96 inline Atom getKWM1DockwindowAtom() const { return kwm1_dockwindow; } //KDE v1.x
97 inline Atom getKWM2DockwindowAtom() const { return kwm2_dockwindow; } //KDE v2.x 97 inline Atom getKWM2DockwindowAtom() const { return kwm2_dockwindow; } //KDE v2.x
98 #endif 98#endif
99#endif // HAVE_GETPID 99#endif // HAVE_GETPID
100 100
101 Basemenu *searchMenu(Window); 101 Basemenu *searchMenu(Window);
102 102
103 FluxboxWindow *searchGroup(Window, FluxboxWindow *); 103 FluxboxWindow *searchGroup(Window, FluxboxWindow *);
104 FluxboxWindow *searchWindow(Window); 104 FluxboxWindow *searchWindow(Window);
105 inline FluxboxWindow *getFocusedWindow() { return focused_window; } 105 inline FluxboxWindow *getFocusedWindow() { return focused_window; }
106 106
107 107
108 BScreen *searchScreen(Window w); 108 BScreen *searchScreen(Window w);
109 109
110 inline const Time &getDoubleClickInterval() const { return resource.double_click_interval; } 110 inline const Time &getDoubleClickInterval() const { return resource.double_click_interval; }
111 inline const Time &getLastTime() const { return last_time; } 111 inline const Time &getLastTime() const { return last_time; }
112 112
113 Toolbar *searchToolbar(Window w); 113 Toolbar *searchToolbar(Window w);
114 Tab *searchTab(Window); 114 Tab *searchTab(Window);
115 115
116 /// obsolete 116 /// obsolete
117 enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENU, EMPTY}; 117 enum Titlebar{SHADE=0, MINIMIZE, MAXIMIZE, CLOSE, STICK, MENU, EMPTY};
118 118
119 inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() { return *m_rc_titlebar_right; } 119 inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() { return *m_rc_titlebar_right; }
120 inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() { return *m_rc_titlebar_left; } 120 inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() { return *m_rc_titlebar_left; }
121 inline const char *getStyleFilename() const { return m_rc_stylefile->c_str(); } 121 inline const char *getStyleFilename() const { return m_rc_stylefile->c_str(); }
122 122
123 inline const char *getMenuFilename() const { return m_rc_menufile->c_str(); } 123 inline const char *getMenuFilename() const { return m_rc_menufile->c_str(); }
124 inline const std::string &getSlitlistFilename() const { return *m_rc_slitlistfile; } 124 inline const std::string &getSlitlistFilename() const { return *m_rc_slitlistfile; }
125 inline int colorsPerChannel() const { return *m_rc_colors_per_channel; } 125 inline int colorsPerChannel() const { return *m_rc_colors_per_channel; }
126 126
127 inline const timeval &getAutoRaiseDelay() const { return resource.auto_raise_delay; } 127 inline const timeval &getAutoRaiseDelay() const { return resource.auto_raise_delay; }
128 128
129 inline unsigned int getCacheLife() const { return *m_rc_cache_life * 60000; } 129 inline unsigned int getCacheLife() const { return *m_rc_cache_life * 60000; }
130 inline unsigned int getCacheMax() const { return *m_rc_cache_max; } 130 inline unsigned int getCacheMax() const { return *m_rc_cache_max; }
131 131
132 inline void maskWindowEvents(Window w, FluxboxWindow *bw) 132 inline void maskWindowEvents(Window w, FluxboxWindow *bw)
133 { masked = w; masked_window = bw; } 133 { masked = w; masked_window = bw; }
134 inline void setNoFocus(Bool f) { no_focus = f; } 134 inline void setNoFocus(Bool f) { no_focus = f; }
135 135
136 void setFocusedWindow(FluxboxWindow *w); 136 void setFocusedWindow(FluxboxWindow *w);
137 void shutdown(); 137 void shutdown();
138 void load_rc(BScreen *); 138 void load_rc(BScreen *);
139 void loadRootCommand(BScreen *); 139 void loadRootCommand(BScreen *);
140 void loadTitlebar(); 140 void loadTitlebar();
141 void saveStyleFilename(const char *val) { m_rc_stylefile = (val == 0 ? "" : val); } 141 void saveStyleFilename(const char *val) { m_rc_stylefile = (val == 0 ? "" : val); }
142 void saveMenuFilename(const char *); 142 void saveMenuFilename(const char *);
143 void saveTitlebarFilename(const char *); 143 void saveTitlebarFilename(const char *);
144 void saveSlitlistFilename(const char *val) { m_rc_slitlistfile = (val == 0 ? "" : val); } 144 void saveSlitlistFilename(const char *val) { m_rc_slitlistfile = (val == 0 ? "" : val); }
145 void saveMenuSearch(Window, Basemenu *); 145 void saveMenuSearch(Window, Basemenu *);
146 void saveWindowSearch(Window, FluxboxWindow *); 146 void saveWindowSearch(Window, FluxboxWindow *);
147 void saveToolbarSearch(Window, Toolbar *); 147 void saveToolbarSearch(Window, Toolbar *);
148 void saveTabSearch(Window, Tab *); 148 void saveTabSearch(Window, Tab *);
149 void saveGroupSearch(Window, FluxboxWindow *); 149 void saveGroupSearch(Window, FluxboxWindow *);
150 void save_rc(); 150 void save_rc();
151 void removeMenuSearch(Window); 151 void removeMenuSearch(Window);
152 void removeWindowSearch(Window); 152 void removeWindowSearch(Window);
153 void removeToolbarSearch(Window); 153 void removeToolbarSearch(Window);
154 void removeTabSearch(Window); 154 void removeTabSearch(Window);
155 void removeGroupSearch(Window); 155 void removeGroupSearch(Window);
156 void restart(const char * = 0); 156 void restart(const char * = 0);
157 void reconfigure(); 157 void reconfigure();
158 void reconfigureTabs(); 158 void reconfigureTabs();
159 void rereadMenu(); 159 void rereadMenu();
160 void checkMenu(); 160 void checkMenu();
161 161
162 /// handle any system signal sent to the application 162 /// handle any system signal sent to the application
163 void handleSignal(int signum); 163 void handleSignal(int signum);
164 void update(FbTk::Subject *changed); 164 void update(FbTk::Subject *changed);
165 165
166 void attachSignals(FluxboxWindow &win); 166 void attachSignals(FluxboxWindow &win);
167 167
168 virtual void timeout(); 168 virtual void timeout();
169 169
170 inline const Cursor &getSessionCursor() const { return cursor.session; } 170 inline const Cursor &getSessionCursor() const { return cursor.session; }
171 inline const Cursor &getMoveCursor() const { return cursor.move; } 171 inline const Cursor &getMoveCursor() const { return cursor.move; }
172 inline const Cursor &getLowerLeftAngleCursor() const { return cursor.ll_angle; } 172 inline const Cursor &getLowerLeftAngleCursor() const { return cursor.ll_angle; }
173 inline const Cursor &getLowerRightAngleCursor() const { return cursor.lr_angle; } 173 inline const Cursor &getLowerRightAngleCursor() const { return cursor.lr_angle; }
174 174
175 175
176 176
177#ifdef SLIT 177#ifdef SLIT
178 Slit *searchSlit(Window); 178 Slit *searchSlit(Window);
179 179
180 void saveSlitSearch(Window, Slit *); 180 void saveSlitSearch(Window, Slit *);
181 void removeSlitSearch(Window); 181 void removeSlitSearch(Window);
182#endif // SLIT 182#endif // SLIT
183 183
184#ifndef HAVE_STRFTIME 184#ifndef HAVE_STRFTIME
185 185
186 enum { B_AMERICANDATE = 1, B_EUROPEANDATE }; 186 enum { B_AMERICANDATE = 1, B_EUROPEANDATE };
187#endif // HAVE_STRFTIME 187#endif // HAVE_STRFTIME
188 188
189 typedef std::vector<Fluxbox::Titlebar> TitlebarList; 189 typedef std::vector<Fluxbox::Titlebar> TitlebarList;
190 190
191private: 191private:
192 struct cursor { 192 struct cursor {
193 Cursor session, move, ll_angle, lr_angle; 193 Cursor session, move, ll_angle, lr_angle;
194 } cursor; 194 } cursor;
195 195
196 typedef struct MenuTimestamp { 196 typedef struct MenuTimestamp {
197 char *filename; 197 char *filename;
198 time_t timestamp; 198 time_t timestamp;
199 } MenuTimestamp; 199 } MenuTimestamp;
200 200
201 struct resource { 201 struct resource {
202 Time double_click_interval; 202 Time double_click_interval;
203 timeval auto_raise_delay; 203 timeval auto_raise_delay;
204 } resource; 204 } resource;
205 205
206 206
207 std::string getRcFilename(); 207 std::string getRcFilename();
208 void getDefaultDataFilename(char *, std::string &); 208 void getDefaultDataFilename(char *, std::string &);
209 void load_rc(); 209 void load_rc();
210 210
211 void reload_rc(); 211 void reload_rc();
212 void real_rereadMenu(); 212 void real_rereadMenu();
213 void real_reconfigure(); 213 void real_reconfigure();
214 214
215 void handleEvent(XEvent *xe); 215 void handleEvent(XEvent *xe);
216 216
217 void setupConfigFiles(); 217 void setupConfigFiles();
218 void handleButtonEvent(XButtonEvent &be); 218 void handleButtonEvent(XButtonEvent &be);
219 void handleUnmapNotify(XUnmapEvent &ue); 219 void handleUnmapNotify(XUnmapEvent &ue);
220 void handleClientMessage(XClientMessageEvent &ce); 220 void handleClientMessage(XClientMessageEvent &ce);
221 void handleKeyEvent(XKeyEvent &ke); 221 void handleKeyEvent(XKeyEvent &ke);
222 void doWindowAction(Keys::KeyAction action, const int param); 222 void doWindowAction(Keys::KeyAction action, const int param);
223 223
224 ResourceManager m_resourcemanager, m_screen_rm; 224 ResourceManager m_resourcemanager, m_screen_rm;
225 225
226 //--- Resources 226 //--- Resources
227 Resource<bool> m_rc_tabs, m_rc_iconbar; 227 Resource<bool> m_rc_tabs, m_rc_iconbar;
228 Resource<int> m_rc_colors_per_channel; 228 Resource<int> m_rc_colors_per_channel;
229 Resource<std::string> m_rc_stylefile, 229 Resource<std::string> m_rc_stylefile,
230 m_rc_menufile, m_rc_keyfile, m_rc_slitlistfile, 230 m_rc_menufile, m_rc_keyfile, m_rc_slitlistfile,
231 m_rc_groupfile; 231 m_rc_groupfile;
232 232
233 Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right; 233 Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right;
234 Resource<unsigned int> m_rc_cache_life, m_rc_cache_max; 234 Resource<unsigned int> m_rc_cache_life, m_rc_cache_max;
235 235
236 void setTitlebar(std::vector<Fluxbox::Titlebar>& dir, const char *arg); 236 void setTitlebar(std::vector<Fluxbox::Titlebar>& dir, const char *arg);
237 237
238 std::map<Window, FluxboxWindow *> windowSearch; 238 std::map<Window, FluxboxWindow *> windowSearch;
239 std::map<Window, FluxboxWindow *> groupSearch; 239 std::map<Window, FluxboxWindow *> groupSearch;
240 std::map<Window, Basemenu *> menuSearch; 240 std::map<Window, Basemenu *> menuSearch;
241 std::map<Window, Toolbar *> toolbarSearch; 241 std::map<Window, Toolbar *> toolbarSearch;
242 typedef std::map<Window, Tab *> TabList; 242 typedef std::map<Window, Tab *> TabList;
243 TabList tabSearch; 243 TabList tabSearch;
244 244
245#ifdef SLIT 245#ifdef SLIT
246 std::map<Window, Slit *> slitSearch; 246 std::map<Window, Slit *> slitSearch;
247#ifdef KDE 247#ifdef KDE
248 //For KDE dock applets 248 //For KDE dock applets
249 Atom kwm1_dockwindow; //KDE v1.x 249 Atom kwm1_dockwindow; //KDE v1.x
250 Atom kwm2_dockwindow; //KDE v2.x 250 Atom kwm2_dockwindow; //KDE v2.x
251#endif//KDE 251#endif//KDE
252#endif // SLIT 252#endif // SLIT
253 253
254 std::list<MenuTimestamp *> menuTimestamps; 254 std::list<MenuTimestamp *> menuTimestamps;
255 typedef std::list<BScreen *> ScreenList; 255 typedef std::list<BScreen *> ScreenList;
256 ScreenList screenList; 256 ScreenList screenList;
257 257
258 FluxboxWindow *focused_window, *masked_window; 258 FluxboxWindow *focused_window, *masked_window;
259 BTimer timer; 259 BTimer timer;
260 260
261 261
262#ifdef HAVE_GETPID 262#ifdef HAVE_GETPID
263 Atom fluxbox_pid; 263 Atom fluxbox_pid;
264#endif // HAVE_GETPID 264#endif // HAVE_GETPID
265 265
266 bool no_focus, reconfigure_wait, reread_menu_wait; 266 bool no_focus, reconfigure_wait, reread_menu_wait;
267 Time last_time; 267 Time last_time;
268 Window masked; 268 Window masked;
269 std::string rc_file; ///< resource filename 269 std::string rc_file; ///< resource filename
270 char **argv; 270 char **argv;
271 int argc; 271 int argc;
272 std::auto_ptr<Keys> key; 272 std::auto_ptr<Keys> key;
273 std::string slitlist_path; 273 std::string slitlist_path;
274 //default arguments for titlebar left and right 274 //default arguments for titlebar left and right
275 static Fluxbox::Titlebar m_titlebar_left[], m_titlebar_right[]; 275 static Fluxbox::Titlebar m_titlebar_left[], m_titlebar_right[];
276 276
277 static Fluxbox *singleton; 277 static Fluxbox *singleton;
278 std::vector<AtomHandler *> m_atomhandler; 278 std::vector<AtomHandler *> m_atomhandler;
279}; 279};
280 280
281 281