1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2 // ScreenResource.hh for Blackbox - an X11 Window manager
3 // Copyright (c) 2001 - 2005 Sean 'Shaleh' Perry <shaleh@debian.org>
4 // Copyright (c) 1997 - 2000, 2002 - 2005
5 // Bradley T Hughes <bhughes at trolltech.com>
7 // Permission is hereby granted, free of charge, to any person obtaining a
8 // copy of this software and associated documentation files (the "Software"),
9 // to deal in the Software without restriction, including without limitation
10 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 // and/or sell copies of the Software, and to permit persons to whom the
12 // Software is furnished to do so, subject to the following conditions:
14 // The above copyright notice and this permission notice shall be included in
15 // all copies or substantial portions of the Software.
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 // DEALINGS IN THE SOFTWARE.
25 #ifndef __ScreenResource_hh
26 #define __ScreenResource_hh
38 struct ToolbarOptions
{
41 bool always_on_top
, auto_hide
;
43 std::string strftime_format
;
49 bool always_on_top
, auto_hide
;
54 bt::Color text
, foreground
, frame_border
;
55 bt::Texture title
, label
, button
, handle
, grip
;
57 bt::Alignment alignment
;
58 bt::Bitmap iconify
, maximize
, restore
, close
;
61 unsigned int title_margin
, label_margin
, button_margin
,
62 frame_border_width
, handle_height
;
65 unsigned int title_height
, label_height
, button_width
, grip_width
;
69 bt::Bitmap left
, right
;
70 bt::Color slabel_text
, wlabel_text
, clock_text
, foreground
;
71 bt::Texture toolbar
, slabel
, wlabel
, clock
, button
, pressed
;
73 bt::Alignment alignment
;
74 unsigned int frame_margin
, label_margin
, button_margin
;
77 unsigned int toolbar_height
, label_height
, button_width
, hidden_height
;
86 class ScreenResource
: public bt::NoCopy
{
88 void loadStyle(BScreen
* screen
, const std::string
& style
);
89 void load(bt::Resource
& res
, unsigned int screen
);
90 void save(bt::Resource
& res
, BScreen
* screen
);
92 inline const ToolbarOptions
&toolbarOptions(void) const
93 { return _toolbarOptions
; }
94 inline const SlitOptions
&slitOptions(void) const
95 { return _slitOptions
; }
97 inline const WindowStyle
&windowStyle(void) const
98 { return _windowStyle
; }
99 inline const ToolbarStyle
&toolbarStyle(void) const
100 { return _toolbarStyle
; }
101 inline const SlitStyle
&slitStyle(void) const
102 { return _slitStyle
; }
104 inline unsigned int workspaceCount(void) const
105 { return workspace_count
; }
106 inline void setWorkspaceCount(unsigned int w
)
107 { workspace_count
= w
; }
109 const bt::ustring
workspaceName(unsigned int i
) const;
110 void setWorkspaceName(unsigned int w
, const bt::ustring
&name
);
112 inline const std::string
& rootCommand(void) const
113 { return root_command
; }
116 ToolbarOptions _toolbarOptions
;
117 SlitOptions _slitOptions
;
119 WindowStyle _windowStyle
;
120 ToolbarStyle _toolbarStyle
;
121 SlitStyle _slitStyle
;
123 unsigned int workspace_count
;
124 std::vector
<bt::ustring
> workspace_names
;
125 std::string root_command
;
128 #endif // __ScreenResource_hh