diff options
Diffstat (limited to 'src/Screen.hh')
-rw-r--r-- | src/Screen.hh | 101 |
1 files changed, 56 insertions, 45 deletions
diff --git a/src/Screen.hh b/src/Screen.hh index 8ab49d5..93825ff 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -1,5 +1,5 @@ | |||
1 | // Screen.hh for fluxbox | 1 | // Screen.hh for Fluxbox Window Manager |
2 | // Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) | 2 | // Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org) |
3 | // | 3 | // |
4 | // Screen.hh for Blackbox - an X11 Window manager | 4 | // Screen.hh for Blackbox - an X11 Window manager |
5 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) | 5 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) |
@@ -22,26 +22,11 @@ | |||
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.9 2002/01/11 10:20:00 fluxgen Exp $ | ||
25 | 26 | ||
27 | #ifndef _SCREEN_HH_ | ||
28 | #define _SCREEN_HH_ | ||
26 | 29 | ||
27 | #ifndef __Screen_hh | ||
28 | #define __Screen_hh | ||
29 | |||
30 | #include <X11/Xlib.h> | ||
31 | #include <X11/Xresource.h> | ||
32 | |||
33 | #ifdef TIME_WITH_SYS_TIME | ||
34 | # include <sys/time.h> | ||
35 | # include <time.h> | ||
36 | #else // !TIME_WITH_SYS_TIME | ||
37 | # ifdef HAVE_SYS_TIME_H | ||
38 | # include <sys/time.h> | ||
39 | # else // !HAVE_SYS_TIME_H | ||
40 | # include <time.h> | ||
41 | # endif // HAVE_SYS_TIME_H | ||
42 | #endif // TIME_WITH_SYS_TIME | ||
43 | |||
44 | #include <stdio.h> | ||
45 | 30 | ||
46 | #include "Theme.hh" | 31 | #include "Theme.hh" |
47 | 32 | ||
@@ -82,6 +67,24 @@ class BScreen; | |||
82 | # include "Slit.hh" | 67 | # include "Slit.hh" |
83 | #endif // SLIT | 68 | #endif // SLIT |
84 | 69 | ||
70 | |||
71 | #include <X11/Xlib.h> | ||
72 | #include <X11/Xresource.h> | ||
73 | |||
74 | #ifdef TIME_WITH_SYS_TIME | ||
75 | # include <sys/time.h> | ||
76 | # include <time.h> | ||
77 | #else // !TIME_WITH_SYS_TIME | ||
78 | # ifdef HAVE_SYS_TIME_H | ||
79 | # include <sys/time.h> | ||
80 | # else // !HAVE_SYS_TIME_H | ||
81 | # include <time.h> | ||
82 | # endif // HAVE_SYS_TIME_H | ||
83 | #endif // TIME_WITH_SYS_TIME | ||
84 | |||
85 | #include <stdio.h> | ||
86 | #include <string> | ||
87 | |||
85 | class BScreen : public ScreenInfo { | 88 | class BScreen : public ScreenInfo { |
86 | public: | 89 | public: |
87 | BScreen(Fluxbox *, int); | 90 | BScreen(Fluxbox *, int); |
@@ -100,11 +103,14 @@ public: | |||
100 | inline const Bool &isScreenManaged(void) const { return managed; } | 103 | inline const Bool &isScreenManaged(void) const { return managed; } |
101 | inline const Bool &isTabRotateVertical(void) const | 104 | inline const Bool &isTabRotateVertical(void) const |
102 | { return resource.tab_rotate_vertical; } | 105 | { return resource.tab_rotate_vertical; } |
106 | inline const Bool &isSloppyWindowGrouping(void) const | ||
107 | { return resource.sloppy_window_grouping; } | ||
103 | inline const Bool &doAutoRaise(void) const { return resource.auto_raise; } | 108 | inline const Bool &doAutoRaise(void) const { return resource.auto_raise; } |
104 | inline const Bool &doImageDither(void) const | 109 | inline const Bool &doImageDither(void) const |
105 | { return resource.image_dither; } | 110 | { return resource.image_dither; } |
106 | inline const Bool &doOrderedDither(void) const | 111 | inline const Bool &doOrderedDither(void) const |
107 | { return resource.ordered_dither; } | 112 | { return resource.ordered_dither; } |
113 | inline const Bool &doMaxOverSlit(void) const { return resource.max_over_slit; } | ||
108 | inline const Bool &doOpaqueMove(void) const { return resource.opaque_move; } | 114 | inline const Bool &doOpaqueMove(void) const { return resource.opaque_move; } |
109 | inline const Bool &doFullMax(void) const { return resource.full_max; } | 115 | inline const Bool &doFullMax(void) const { return resource.full_max; } |
110 | inline const Bool &doFocusNew(void) const { return resource.focus_new; } | 116 | inline const Bool &doFocusNew(void) const { return resource.focus_new; } |
@@ -115,7 +121,7 @@ public: | |||
115 | inline const BColor *getBorderColor(void) { return &theme->getBorderColor(); } | 121 | inline const BColor *getBorderColor(void) { return &theme->getBorderColor(); } |
116 | inline BImageControl *getImageControl(void) { return image_control; } | 122 | inline BImageControl *getImageControl(void) { return image_control; } |
117 | inline Rootmenu *getRootmenu(void) { return rootmenu; } | 123 | inline Rootmenu *getRootmenu(void) { return rootmenu; } |
118 | 124 | inline std::string &getRootCommand(void) { return rootcommand; } | |
119 | #ifdef SLIT | 125 | #ifdef SLIT |
120 | inline const Bool &isSlitOnTop(void) const { return resource.slit_on_top; } | 126 | inline const Bool &isSlitOnTop(void) const { return resource.slit_on_top; } |
121 | inline const Bool &doSlitAutoHide(void) const | 127 | inline const Bool &doSlitAutoHide(void) const |
@@ -138,13 +144,13 @@ public: | |||
138 | 144 | ||
139 | inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } | 145 | inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } |
140 | 146 | ||
141 | inline const unsigned int &getHandleWidth(void) const | 147 | inline const unsigned int getHandleWidth(void) const |
142 | { return theme->getHandleWidth(); } | 148 | { return theme->getHandleWidth(); } |
143 | inline const unsigned int &getBevelWidth(void) const | 149 | inline const unsigned int getBevelWidth(void) const |
144 | { return theme->getBevelWidth(); } | 150 | { return theme->getBevelWidth(); } |
145 | inline const unsigned int &getFrameWidth(void) const | 151 | inline const unsigned int getFrameWidth(void) const |
146 | { return theme->getFrameWidth(); } | 152 | { return theme->getFrameWidth(); } |
147 | inline const unsigned int &getBorderWidth(void) const | 153 | inline const unsigned int getBorderWidth(void) const |
148 | { return theme->getBorderWidth(); } | 154 | { return theme->getBorderWidth(); } |
149 | inline const unsigned int getBorderWidth2x(void) const | 155 | inline const unsigned int getBorderWidth2x(void) const |
150 | { return theme->getBorderWidth()*2; } | 156 | { return theme->getBorderWidth()*2; } |
@@ -168,12 +174,17 @@ public: | |||
168 | { return resource.row_direction; } | 174 | { return resource.row_direction; } |
169 | inline const int &getColPlacementDirection(void) const | 175 | inline const int &getColPlacementDirection(void) const |
170 | { return resource.col_direction; } | 176 | { return resource.col_direction; } |
177 | inline const unsigned int &getTabWidth(void) const | ||
178 | { return resource.tab_width; } | ||
179 | inline const unsigned int &getTabHeight(void) const | ||
180 | { return resource.tab_height; } | ||
171 | inline const int getTabPlacement(void) | 181 | inline const int getTabPlacement(void) |
172 | { return resource.tab_placement; } | 182 | { return resource.tab_placement; } |
173 | inline const int getTabAlignment(void) | 183 | inline const int getTabAlignment(void) |
174 | { return resource.tab_alignment; } | 184 | { return resource.tab_alignment; } |
175 | 185 | ||
176 | inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; } | 186 | inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; } |
187 | inline void saveRootCommand(std::string rootcmd) { rootcommand = rootcmd; } | ||
177 | inline void saveSloppyFocus(Bool s) { resource.sloppy_focus = s; } | 188 | inline void saveSloppyFocus(Bool s) { resource.sloppy_focus = s; } |
178 | inline void saveSemiSloppyFocus(Bool s) { resource.semi_sloppy_focus = s; } | 189 | inline void saveSemiSloppyFocus(Bool s) { resource.semi_sloppy_focus = s; } |
179 | inline void saveAutoRaise(Bool a) { resource.auto_raise = a; } | 190 | inline void saveAutoRaise(Bool a) { resource.auto_raise = a; } |
@@ -189,14 +200,19 @@ public: | |||
189 | inline void saveEdgeSnapThreshold(int t) | 200 | inline void saveEdgeSnapThreshold(int t) |
190 | { resource.edge_snap_threshold = t; } | 201 | { resource.edge_snap_threshold = t; } |
191 | inline void saveImageDither(Bool d) { resource.image_dither = d; } | 202 | inline void saveImageDither(Bool d) { resource.image_dither = d; } |
203 | inline void saveMaxOverSlit(Bool m) { resource.max_over_slit = m; } | ||
192 | inline void saveOpaqueMove(Bool o) { resource.opaque_move = o; } | 204 | inline void saveOpaqueMove(Bool o) { resource.opaque_move = o; } |
193 | inline void saveFullMax(Bool f) { resource.full_max = f; } | 205 | inline void saveFullMax(Bool f) { resource.full_max = f; } |
194 | inline void saveFocusNew(Bool f) { resource.focus_new = f; } | 206 | inline void saveFocusNew(Bool f) { resource.focus_new = f; } |
195 | inline void saveFocusLast(Bool f) { resource.focus_last = f; } | 207 | inline void saveFocusLast(Bool f) { resource.focus_last = f; } |
208 | inline void saveTabWidth(unsigned int w) { resource.tab_width = w; } | ||
209 | inline void saveTabHeight(unsigned int h) { resource.tab_height = h; } | ||
196 | inline void saveTabPlacement(unsigned int p) { resource.tab_placement = p; } | 210 | inline void saveTabPlacement(unsigned int p) { resource.tab_placement = p; } |
197 | inline void saveTabAlignment(unsigned int a) { resource.tab_alignment = a; } | 211 | inline void saveTabAlignment(unsigned int a) { resource.tab_alignment = a; } |
198 | inline void saveTabRotateVertical(Bool r) | 212 | inline void saveTabRotateVertical(Bool r) |
199 | { resource.tab_rotate_vertical = r; } | 213 | { resource.tab_rotate_vertical = r; } |
214 | inline void saveSloppyWindowGrouping(Bool s) | ||
215 | { resource.sloppy_window_grouping = s; } | ||
200 | inline void iconUpdate(void) { iconmenu->update(); } | 216 | inline void iconUpdate(void) { iconmenu->update(); } |
201 | inline Iconmenu *getIconmenu(void) { return iconmenu; } | 217 | inline Iconmenu *getIconmenu(void) { return iconmenu; } |
202 | 218 | ||
@@ -211,9 +227,9 @@ public: | |||
211 | inline void saveClock24Hour(Bool c) { resource.clock24hour = c; } | 227 | inline void saveClock24Hour(Bool c) { resource.clock24hour = c; } |
212 | #endif // HAVE_STRFTIME | 228 | #endif // HAVE_STRFTIME |
213 | 229 | ||
214 | inline WindowStyle *getWindowStyle(void) { return theme->getWindowStyle(); } | 230 | inline Theme::WindowStyle *getWindowStyle(void) { return &theme->getWindowStyle(); } |
215 | inline MenuStyle *getMenuStyle(void) { return theme->getMenuStyle(); } | 231 | inline Theme::MenuStyle *getMenuStyle(void) { return &theme->getMenuStyle(); } |
216 | inline ToolbarStyle *getToolbarStyle(void) { return theme->getToolbarStyle(); } | 232 | inline Theme::ToolbarStyle *getToolbarStyle(void) { return &theme->getToolbarStyle(); } |
217 | 233 | ||
218 | FluxboxWindow *getIcon(int); | 234 | FluxboxWindow *getIcon(int); |
219 | 235 | ||
@@ -254,16 +270,17 @@ public: | |||
254 | void updateNetizenWindowRaise(Window); | 270 | void updateNetizenWindowRaise(Window); |
255 | void updateNetizenWindowLower(Window); | 271 | void updateNetizenWindowLower(Window); |
256 | 272 | ||
257 | enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement, LeftRight, | 273 | enum { ROWSMARTPLACEMENT = 1, COLSMARTPLACEMENT, CASCADEPLACEMENT, LEFTRIGHT, |
258 | RightLeft, TopBottom, BottomTop }; | 274 | RIGHTLEFT, TOPBOTTOM, BOTTOMTOP }; |
259 | enum { LeftJustify = 1, RightJustify, CenterJustify }; | 275 | enum { LEFTJUSTIFY = 1, RIGHTJUSTIFY, CENTERJUSTIFY }; |
260 | enum { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet }; | 276 | enum { ROUNDBULLET = 1, TRIANGELBULLET, SQUAERBULLET, NOBULLET }; |
261 | enum { Restart = 1, RestartOther, Exit, Shutdown, Execute, Reconfigure, | 277 | enum { RESTART = 1, RESTARTOTHER, EXIT, SHUTDOWN, EXECUTE, RECONFIGURE, |
262 | WindowShade, WindowIconify, WindowMaximize, WindowClose, WindowRaise, | 278 | WINDOWSHADE, WINDOWICONIFY, WINDOWMAXIMIZE, WINDOWCLOSE, WINDOWRAISE, |
263 | WindowLower, WindowStick, WindowKill, SetStyle, WindowTab}; | 279 | WINDOWLOWER, WINDOWSTICK, WINDOWKILL, SETSTYLE, WINDOWTAB}; |
264 | 280 | ||
265 | private: | 281 | private: |
266 | Theme *theme; | 282 | Theme *theme; |
283 | std::string rootcommand; | ||
267 | 284 | ||
268 | Bool root_colormap_installed, managed, geom_visible; | 285 | Bool root_colormap_installed, managed, geom_visible; |
269 | GC opGC; | 286 | GC opGC; |
@@ -296,28 +313,22 @@ private: | |||
296 | LinkedList<Workspace> *workspacesList; | 313 | LinkedList<Workspace> *workspacesList; |
297 | 314 | ||
298 | struct resource { | 315 | struct resource { |
299 | // WindowStyle wstyle; | ||
300 | // ToolbarStyle tstyle; | ||
301 | // MenuStyle mstyle; | ||
302 | 316 | ||
303 | Bool toolbar_on_top, toolbar_auto_hide, sloppy_focus, auto_raise, | 317 | Bool toolbar_on_top, toolbar_auto_hide, sloppy_focus, auto_raise, |
304 | auto_edge_balance, image_dither, ordered_dither, opaque_move, full_max, | 318 | auto_edge_balance, image_dither, ordered_dither, opaque_move, full_max, |
305 | focus_new, focus_last, tab_rotate_vertical, semi_sloppy_focus; | 319 | focus_new, focus_last, max_over_slit, tab_rotate_vertical, semi_sloppy_focus, |
306 | // BColor border_color; | 320 | sloppy_window_grouping; |
307 | // XrmDatabase stylerc; | ||
308 | 321 | ||
309 | int workspaces, toolbar_placement, toolbar_width_percent, placement_policy, | 322 | int workspaces, toolbar_placement, toolbar_width_percent, placement_policy, |
310 | edge_snap_threshold, row_direction, col_direction; | 323 | edge_snap_threshold, row_direction, col_direction; |
311 | 324 | ||
312 | unsigned int tab_placement, tab_alignment; | 325 | unsigned int tab_placement, tab_alignment, tab_width, tab_height; |
313 | 326 | ||
314 | #ifdef SLIT | 327 | #ifdef SLIT |
315 | Bool slit_on_top, slit_auto_hide; | 328 | Bool slit_on_top, slit_auto_hide; |
316 | int slit_placement, slit_direction; | 329 | int slit_placement, slit_direction; |
317 | #endif // SLIT | 330 | #endif // SLIT |
318 | 331 | ||
319 | // unsigned int handle_width, frame_width, | ||
320 | // border_width, border_width_2x; | ||
321 | 332 | ||
322 | #ifdef HAVE_STRFTIME | 333 | #ifdef HAVE_STRFTIME |
323 | char *strftime_format; | 334 | char *strftime_format; |
@@ -346,4 +357,4 @@ protected: | |||
346 | }; | 357 | }; |
347 | 358 | ||
348 | 359 | ||
349 | #endif // __Screen_hh | 360 | #endif // _SCREEN_HH_ |