aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-01-20 02:17:23 (GMT)
committerfluxgen <fluxgen>2002-01-20 02:17:23 (GMT)
commit6ea3678d0221914a3f54a78bbe8b8b282c4ce8e7 (patch)
treef4bf575038afede621ecf6568ec4384463d8e631 /src/Screen.hh
parentaaa0c6d0780ceb021a3306e2f0c3ae965541eff6 (diff)
downloadfluxbox-6ea3678d0221914a3f54a78bbe8b8b282c4ce8e7.zip
fluxbox-6ea3678d0221914a3f54a78bbe8b8b282c4ce8e7.tar.bz2
Fixed resources
Diffstat (limited to 'src/Screen.hh')
-rw-r--r--src/Screen.hh156
1 files changed, 66 insertions, 90 deletions
diff --git a/src/Screen.hh b/src/Screen.hh
index 93825ff..cba7f44 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.9 2002/01/11 10:20:00 fluxgen Exp $ 25// $Id: Screen.hh,v 1.10 2002/01/20 02:17:23 fluxgen Exp $
26 26
27#ifndef _SCREEN_HH_ 27#ifndef _SCREEN_HH_
28#define _SCREEN_HH_ 28#define _SCREEN_HH_
@@ -87,50 +87,39 @@ class BScreen;
87 87
88class BScreen : public ScreenInfo { 88class BScreen : public ScreenInfo {
89public: 89public:
90 BScreen(Fluxbox *, int); 90 BScreen(ResourceManager &rm, Fluxbox *b,
91 ~BScreen(void); 91 const string &screenname, const string &altscreenname,
92 92 int scrn);
93 inline const Bool &isToolbarOnTop(void) const 93 ~BScreen();
94 { return resource.toolbar_on_top; } 94
95 inline const Bool &doToolbarAutoHide(void) const 95 inline const bool isToolbarOnTop(void) { return *resource.toolbar_on_top; }
96 { return resource.toolbar_auto_hide; } 96 inline const bool doToolbarAutoHide(void) { return *resource.toolbar_auto_hide; }
97 inline const Bool &isSloppyFocus(void) const 97 inline const bool isSloppyFocus(void) { return resource.sloppy_focus; }
98 { return resource.sloppy_focus; } 98 inline const bool isSemiSloppyFocus(void) { return resource.semi_sloppy_focus; }
99 inline const Bool &isSemiSloppyFocus(void) const 99 inline const bool isRootColormapInstalled(void) { return root_colormap_installed; }
100 { return resource.semi_sloppy_focus; } 100 inline const bool isScreenManaged(void) { return managed; }
101 inline const Bool &isRootColormapInstalled(void) const 101 inline const bool isTabRotateVertical(void) { return *resource.tab_rotate_vertical; }
102 { return root_colormap_installed; } 102 inline const bool isSloppyWindowGrouping(void) { return *resource.sloppy_window_grouping; }
103 inline const Bool &isScreenManaged(void) const { return managed; } 103 inline const bool doAutoRaise(void) { return resource.auto_raise; }
104 inline const Bool &isTabRotateVertical(void) const 104 inline const bool doImageDither(void) { return *resource.image_dither; }
105 { return resource.tab_rotate_vertical; } 105 inline const bool doMaxOverSlit(void) { return *resource.max_over_slit; }
106 inline const Bool &isSloppyWindowGrouping(void) const 106 inline const bool doOpaqueMove(void) { return *resource.opaque_move; }
107 { return resource.sloppy_window_grouping; } 107 inline const bool doFullMax(void) { return *resource.full_max; }
108 inline const Bool &doAutoRaise(void) const { return resource.auto_raise; } 108 inline const bool doFocusNew(void) { return resource.focus_new; }
109 inline const Bool &doImageDither(void) const 109 inline const bool doFocusLast(void) { return resource.focus_last; }
110 { return resource.image_dither; }
111 inline const Bool &doOrderedDither(void) const
112 { return resource.ordered_dither; }
113 inline const Bool &doMaxOverSlit(void) const { return resource.max_over_slit; }
114 inline const Bool &doOpaqueMove(void) const { return resource.opaque_move; }
115 inline const Bool &doFullMax(void) const { return resource.full_max; }
116 inline const Bool &doFocusNew(void) const { return resource.focus_new; }
117 inline const Bool &doFocusLast(void) const { return resource.focus_last; }
118 110
119 inline const GC &getOpGC() const { return theme->getOpGC(); } 111 inline const GC &getOpGC() const { return theme->getOpGC(); }
120 112
121 inline const BColor *getBorderColor(void) { return &theme->getBorderColor(); } 113 inline const BColor *getBorderColor(void) { return &theme->getBorderColor(); }
122 inline BImageControl *getImageControl(void) { return image_control; } 114 inline BImageControl *getImageControl(void) { return image_control; }
123 inline Rootmenu *getRootmenu(void) { return rootmenu; } 115 inline Rootmenu *getRootmenu(void) { return rootmenu; }
124 inline std::string &getRootCommand(void) { return rootcommand; } 116 inline std::string &getRootCommand(void) { return *resource.rootcommand; }
125#ifdef SLIT 117#ifdef SLIT
126 inline const Bool &isSlitOnTop(void) const { return resource.slit_on_top; } 118 inline const Bool &isSlitOnTop(void) const { return resource.slit_on_top; }
127 inline const Bool &doSlitAutoHide(void) const 119 inline const Bool &doSlitAutoHide(void) const { return resource.slit_auto_hide; }
128 { return resource.slit_auto_hide; }
129 inline Slit *getSlit(void) { return slit; } 120 inline Slit *getSlit(void) { return slit; }
130 inline const int &getSlitPlacement(void) const 121 inline const int &getSlitPlacement(void) const { return resource.slit_placement; }
131 { return resource.slit_placement; } 122 inline const int &getSlitDirection(void) const { return resource.slit_direction; }
132 inline const int &getSlitDirection(void) const
133 { return resource.slit_direction; }
134 inline void saveSlitPlacement(int p) { resource.slit_placement = p; } 123 inline void saveSlitPlacement(int p) { resource.slit_placement = p; }
135 inline void saveSlitDirection(int d) { resource.slit_direction = d; } 124 inline void saveSlitDirection(int d) { resource.slit_direction = d; }
136 inline void saveSlitOnTop(Bool t) { resource.slit_on_top = t; } 125 inline void saveSlitOnTop(Bool t) { resource.slit_on_top = t; }
@@ -144,61 +133,41 @@ public:
144 133
145 inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } 134 inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; }
146 135
147 inline const unsigned int getHandleWidth(void) const 136 inline const unsigned int getHandleWidth(void) const { return theme->getHandleWidth(); }
148 { return theme->getHandleWidth(); } 137 inline const unsigned int getBevelWidth(void) const { return theme->getBevelWidth(); }
149 inline const unsigned int getBevelWidth(void) const 138 inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); }
150 { return theme->getBevelWidth(); } 139 inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); }
151 inline const unsigned int getFrameWidth(void) const 140 inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; }
152 { return theme->getFrameWidth(); } 141 inline const int getCurrentWorkspaceID() { return current_workspace->getWorkspaceID(); }
153 inline const unsigned int getBorderWidth(void) const
154 { return theme->getBorderWidth(); }
155 inline const unsigned int getBorderWidth2x(void) const
156 { return theme->getBorderWidth()*2; }
157
158 inline const int getCurrentWorkspaceID()
159 { return current_workspace->getWorkspaceID(); }
160 inline const int getCount(void) { return workspacesList->count(); } 142 inline const int getCount(void) { return workspacesList->count(); }
161 inline const int getIconCount(void) { return iconList->count(); } 143 inline const int getIconCount(void) { return iconList->count(); }
162 inline LinkedList<FluxboxWindow> *getIconList(void) { return iconList; } 144 inline LinkedList<FluxboxWindow> *getIconList(void) { return iconList; }
163 inline const int &getNumberOfWorkspaces(void) const 145 inline const int getNumberOfWorkspaces(void) { return *resource.workspaces; }
164 { return resource.workspaces; } 146 inline const Toolbar::Placement getToolbarPlacement(void) { return *resource.toolbar_placement; }
165 inline const int &getToolbarPlacement(void) const 147 inline const int getToolbarWidthPercent(void) { return *resource.toolbar_width_percent; }
166 { return resource.toolbar_placement; } 148 inline const int getPlacementPolicy(void) const { return resource.placement_policy; }
167 inline const int &getToolbarWidthPercent(void) const 149 inline const int getEdgeSnapThreshold(void) { return *resource.edge_snap_threshold; }
168 { return resource.toolbar_width_percent; } 150 inline const int getRowPlacementDirection(void) const { return resource.row_direction; }
169 inline const int &getPlacementPolicy(void) const 151 inline const int getColPlacementDirection(void) const { return resource.col_direction; }
170 { return resource.placement_policy; } 152 inline const unsigned int getTabWidth(void) { return *resource.tab_width; }
171 inline const int &getEdgeSnapThreshold(void) const 153 inline const unsigned int getTabHeight(void) { return *resource.tab_height; }
172 { return resource.edge_snap_threshold; } 154 inline const Tab::Placement getTabPlacement(void) { return *resource.tab_placement; }
173 inline const int &getRowPlacementDirection(void) const 155 inline const Tab::Alignment getTabAlignment(void) { return *resource.tab_alignment; }
174 { return resource.row_direction; }
175 inline const int &getColPlacementDirection(void) const
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; }
181 inline const int getTabPlacement(void)
182 { return resource.tab_placement; }
183 inline const int getTabAlignment(void)
184 { return resource.tab_alignment; }
185 156
186 inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; } 157 inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; }
187 inline void saveRootCommand(std::string rootcmd) { rootcommand = rootcmd; } 158 inline void saveRootCommand(std::string rootcmd) { *resource.rootcommand = rootcmd; }
188 inline void saveSloppyFocus(Bool s) { resource.sloppy_focus = s; } 159 inline void saveSloppyFocus(Bool s) { resource.sloppy_focus = s; }
189 inline void saveSemiSloppyFocus(Bool s) { resource.semi_sloppy_focus = s; } 160 inline void saveSemiSloppyFocus(Bool s) { resource.semi_sloppy_focus = s; }
190 inline void saveAutoRaise(Bool a) { resource.auto_raise = a; } 161 inline void saveAutoRaise(Bool a) { resource.auto_raise = a; }
191 inline void saveWorkspaces(int w) { resource.workspaces = w; } 162 inline void saveWorkspaces(int w) { resource.workspaces = w; }
192 inline void saveToolbarOnTop(Bool r) { resource.toolbar_on_top = r; } 163 inline void saveToolbarOnTop(Bool r) { resource.toolbar_on_top = r; }
193 inline void saveToolbarAutoHide(Bool r) { resource.toolbar_auto_hide = r; } 164 inline void saveToolbarAutoHide(Bool r) { resource.toolbar_auto_hide = r; }
194 inline void saveToolbarWidthPercent(int w) 165 inline void saveToolbarWidthPercent(int w) { resource.toolbar_width_percent = w; }
195 { resource.toolbar_width_percent = w; } 166 inline void saveToolbarPlacement(Toolbar::Placement p) { *resource.toolbar_placement = p; }
196 inline void saveToolbarPlacement(int p) { resource.toolbar_placement = p; }
197 inline void savePlacementPolicy(int p) { resource.placement_policy = p; } 167 inline void savePlacementPolicy(int p) { resource.placement_policy = p; }
198 inline void saveRowPlacementDirection(int d) { resource.row_direction = d; } 168 inline void saveRowPlacementDirection(int d) { resource.row_direction = d; }
199 inline void saveColPlacementDirection(int d) { resource.col_direction = d; } 169 inline void saveColPlacementDirection(int d) { resource.col_direction = d; }
200 inline void saveEdgeSnapThreshold(int t) 170 inline void saveEdgeSnapThreshold(int t) { resource.edge_snap_threshold = t; }
201 { resource.edge_snap_threshold = t; }
202 inline void saveImageDither(Bool d) { resource.image_dither = d; } 171 inline void saveImageDither(Bool d) { resource.image_dither = d; }
203 inline void saveMaxOverSlit(Bool m) { resource.max_over_slit = m; } 172 inline void saveMaxOverSlit(Bool m) { resource.max_over_slit = m; }
204 inline void saveOpaqueMove(Bool o) { resource.opaque_move = o; } 173 inline void saveOpaqueMove(Bool o) { resource.opaque_move = o; }
@@ -207,8 +176,8 @@ public:
207 inline void saveFocusLast(Bool f) { resource.focus_last = f; } 176 inline void saveFocusLast(Bool f) { resource.focus_last = f; }
208 inline void saveTabWidth(unsigned int w) { resource.tab_width = w; } 177 inline void saveTabWidth(unsigned int w) { resource.tab_width = w; }
209 inline void saveTabHeight(unsigned int h) { resource.tab_height = h; } 178 inline void saveTabHeight(unsigned int h) { resource.tab_height = h; }
210 inline void saveTabPlacement(unsigned int p) { resource.tab_placement = p; } 179 inline void saveTabPlacement(Tab::Placement p) { *resource.tab_placement = p; }
211 inline void saveTabAlignment(unsigned int a) { resource.tab_alignment = a; } 180 inline void saveTabAlignment(Tab::Alignment a) { *resource.tab_alignment = a; }
212 inline void saveTabRotateVertical(Bool r) 181 inline void saveTabRotateVertical(Bool r)
213 { resource.tab_rotate_vertical = r; } 182 { resource.tab_rotate_vertical = r; }
214 inline void saveSloppyWindowGrouping(Bool s) 183 inline void saveSloppyWindowGrouping(Bool s)
@@ -254,7 +223,7 @@ public:
254 void prevFocus(void); 223 void prevFocus(void);
255 void nextFocus(void); 224 void nextFocus(void);
256 void raiseFocus(void); 225 void raiseFocus(void);
257 void reconfigure(void); 226 void reconfigure(void);
258 void rereadMenu(void); 227 void rereadMenu(void);
259 void shutdown(void); 228 void shutdown(void);
260 void showPosition(int, int); 229 void showPosition(int, int);
@@ -280,7 +249,6 @@ public:
280 249
281private: 250private:
282 Theme *theme; 251 Theme *theme;
283 std::string rootcommand;
284 252
285 Bool root_colormap_installed, managed, geom_visible; 253 Bool root_colormap_installed, managed, geom_visible;
286 GC opGC; 254 GC opGC;
@@ -311,18 +279,26 @@ private:
311 279
312 LinkedList<char> *workspaceNames; 280 LinkedList<char> *workspaceNames;
313 LinkedList<Workspace> *workspacesList; 281 LinkedList<Workspace> *workspacesList;
282
283 struct ScreenResource {
284 ScreenResource(ResourceManager &rm, const std::string &scrname,
285 const std::string &altscrname);
314 286
315 struct resource { 287 Resource<bool> toolbar_on_top, toolbar_auto_hide,
316 288 image_dither, opaque_move, full_max,
317 Bool toolbar_on_top, toolbar_auto_hide, sloppy_focus, auto_raise, 289 max_over_slit, tab_rotate_vertical,
318 auto_edge_balance, image_dither, ordered_dither, opaque_move, full_max,
319 focus_new, focus_last, max_over_slit, tab_rotate_vertical, semi_sloppy_focus,
320 sloppy_window_grouping; 290 sloppy_window_grouping;
291 Resource<std::string> rootcommand;
292 bool auto_raise, sloppy_focus, semi_sloppy_focus, focus_new, focus_last,
293 ordered_dither;
294 Resource<int> workspaces, toolbar_width_percent, edge_snap_threshold,
295 tab_width, tab_height;
296 int placement_policy, row_direction, col_direction;
321 297
322 int workspaces, toolbar_placement, toolbar_width_percent, placement_policy, 298 Resource<Tab::Placement> tab_placement;
323 edge_snap_threshold, row_direction, col_direction; 299 Resource<Tab::Alignment> tab_alignment;
300 Resource<Toolbar::Placement> toolbar_placement;
324 301
325 unsigned int tab_placement, tab_alignment, tab_width, tab_height;
326 302
327#ifdef SLIT 303#ifdef SLIT
328 Bool slit_on_top, slit_auto_hide; 304 Bool slit_on_top, slit_auto_hide;