aboutsummaryrefslogtreecommitdiff
path: root/src/WinButton.cc
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-08-15 21:03:57 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-11-01 10:04:02 (GMT)
commit698a4af938737295494dade50950d1aeebc8b55d (patch)
tree075017c3a59ac2575f708d223cf2391e82b9eb69 /src/WinButton.cc
parent678a98de943963e993827540496741ae814af8bd (diff)
downloadfluxbox_paul-698a4af938737295494dade50950d1aeebc8b55d.zip
fluxbox_paul-698a4af938737295494dade50950d1aeebc8b55d.tar.bz2
Move declarations of Resource enums to a separate file
The reason for this is that I need to access those enums from fluxbox-update_configs and I don't want to #include and link everything in src. I also merged Slit::Placement, Toolbar::Placement and FbWinFrame::TabPlacement into one enum.
Diffstat (limited to 'src/WinButton.cc')
-rw-r--r--src/WinButton.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/WinButton.cc b/src/WinButton.cc
index 703820d..3af0f1d 100644
--- a/src/WinButton.cc
+++ b/src/WinButton.cc
@@ -36,7 +36,7 @@
36WinButton::WinButton(FluxboxWindow &listen_to, 36WinButton::WinButton(FluxboxWindow &listen_to,
37 FbTk::ThemeProxy<WinButtonTheme> &theme, 37 FbTk::ThemeProxy<WinButtonTheme> &theme,
38 FbTk::ThemeProxy<WinButtonTheme> &pressed, 38 FbTk::ThemeProxy<WinButtonTheme> &pressed,
39 Type buttontype, const FbTk::FbWindow &parent, 39 WinButtonType buttontype, const FbTk::FbWindow &parent,
40 int x, int y, 40 int x, int y,
41 unsigned int width, unsigned int height): 41 unsigned int width, unsigned int height):
42 FbTk::Button(parent, x, y, width, height), 42 FbTk::Button(parent, x, y, width, height),
@@ -47,7 +47,7 @@ WinButton::WinButton(FluxboxWindow &listen_to,
47 47
48 join(theme.reconfigSig(), FbTk::MemFun(*this, &WinButton::updateAll)); 48 join(theme.reconfigSig(), FbTk::MemFun(*this, &WinButton::updateAll));
49 49
50 if (buttontype == MENUICON) 50 if (buttontype == MENUICONBUTTON)
51 updateAll(); 51 updateAll();
52} 52}
53 53
@@ -116,26 +116,26 @@ void WinButton::setPressedColor(const FbTk::Color &color) {
116 116
117Pixmap WinButton::getBackgroundPixmap() const { 117Pixmap WinButton::getBackgroundPixmap() const {
118 switch(m_type) { 118 switch(m_type) {
119 case MAXIMIZE: 119 case MAXIMIZEBUTTON:
120 return m_theme->maximizePixmap().pixmap().drawable(); 120 return m_theme->maximizePixmap().pixmap().drawable();
121 break; 121 break;
122 case MINIMIZE: 122 case MINIMIZEBUTTON:
123 return m_theme->iconifyPixmap().pixmap().drawable(); 123 return m_theme->iconifyPixmap().pixmap().drawable();
124 break; 124 break;
125 case STICK: 125 case STICKBUTTON:
126 if (m_listen_to.isStuck()) 126 if (m_listen_to.isStuck())
127 return m_theme->stuckPixmap().pixmap().drawable(); 127 return m_theme->stuckPixmap().pixmap().drawable();
128 return m_theme->stickPixmap().pixmap().drawable(); 128 return m_theme->stickPixmap().pixmap().drawable();
129 break; 129 break;
130 case CLOSE: 130 case CLOSEBUTTON:
131 return m_theme->closePixmap().pixmap().drawable(); 131 return m_theme->closePixmap().pixmap().drawable();
132 break; 132 break;
133 case SHADE: 133 case SHADEBUTTON:
134 if (m_listen_to.isShaded()) 134 if (m_listen_to.isShaded())
135 return m_theme->unshadePixmap().pixmap().drawable(); 135 return m_theme->unshadePixmap().pixmap().drawable();
136 return m_theme->shadePixmap().pixmap().drawable(); 136 return m_theme->shadePixmap().pixmap().drawable();
137 break; 137 break;
138 case MENUICON: 138 case MENUICONBUTTON:
139 if (m_icon_pixmap.drawable()) 139 if (m_icon_pixmap.drawable())
140 return m_theme->titlePixmap().pixmap().drawable(); 140 return m_theme->titlePixmap().pixmap().drawable();
141 return m_theme->menuiconPixmap().pixmap().drawable(); 141 return m_theme->menuiconPixmap().pixmap().drawable();
@@ -146,20 +146,20 @@ Pixmap WinButton::getBackgroundPixmap() const {
146 146
147Pixmap WinButton::getPressedPixmap() const { 147Pixmap WinButton::getPressedPixmap() const {
148 switch(m_type) { 148 switch(m_type) {
149 case MAXIMIZE: 149 case MAXIMIZEBUTTON:
150 return m_pressed_theme->maximizePixmap().pixmap().drawable(); 150 return m_pressed_theme->maximizePixmap().pixmap().drawable();
151 case MINIMIZE: 151 case MINIMIZEBUTTON:
152 return m_pressed_theme->iconifyPixmap().pixmap().drawable(); 152 return m_pressed_theme->iconifyPixmap().pixmap().drawable();
153 case STICK: 153 case STICKBUTTON:
154 return m_pressed_theme->stickPixmap().pixmap().drawable(); 154 return m_pressed_theme->stickPixmap().pixmap().drawable();
155 case CLOSE: 155 case CLOSEBUTTON:
156 return m_pressed_theme->closePixmap().pixmap().drawable(); 156 return m_pressed_theme->closePixmap().pixmap().drawable();
157 case SHADE: 157 case SHADEBUTTON:
158 if (m_listen_to.isShaded()) 158 if (m_listen_to.isShaded())
159 return m_pressed_theme->unshadePixmap().pixmap().drawable(); 159 return m_pressed_theme->unshadePixmap().pixmap().drawable();
160 else 160 else
161 return m_pressed_theme->shadePixmap().pixmap().drawable(); 161 return m_pressed_theme->shadePixmap().pixmap().drawable();
162 case MENUICON: 162 case MENUICONBUTTON:
163 if (m_icon_pixmap.drawable()) 163 if (m_icon_pixmap.drawable())
164 return m_theme->titlePixmap().pixmap().drawable(); 164 return m_theme->titlePixmap().pixmap().drawable();
165 else 165 else
@@ -185,7 +185,7 @@ void WinButton::drawType() {
185 185
186 // otherwise draw old style imagery 186 // otherwise draw old style imagery
187 switch (m_type) { 187 switch (m_type) {
188 case MAXIMIZE: 188 case MAXIMIZEBUTTON:
189 // if no pixmap was used, use old style 189 // if no pixmap was used, use old style
190 if (gc() == 0) // must have valid graphic context 190 if (gc() == 0) // must have valid graphic context
191 return; 191 return;
@@ -195,10 +195,10 @@ void WinButton::drawType() {
195 drawLine(gc(), 195 drawLine(gc(),
196 2, 3, width() - 3, 3); 196 2, 3, width() - 3, 3);
197 break; 197 break;
198 case MINIMIZE: 198 case MINIMIZEBUTTON:
199 drawRectangle(gc(), 2, height() - 5, width() - 5, 2); 199 drawRectangle(gc(), 2, height() - 5, width() - 5, 2);
200 break; 200 break;
201 case STICK: 201 case STICKBUTTON:
202 // width/4 != width/2, so we use /4*2 so that it's properly centred 202 // width/4 != width/2, so we use /4*2 so that it's properly centred
203 if (m_listen_to.isStuck()) { 203 if (m_listen_to.isStuck()) {
204 fillRectangle(gc(), 204 fillRectangle(gc(),
@@ -210,7 +210,7 @@ void WinButton::drawType() {
210 width()/10*2 + oddW, height()/10*2 + oddH); 210 width()/10*2 + oddW, height()/10*2 + oddH);
211 } 211 }
212 break; 212 break;
213 case CLOSE: 213 case CLOSEBUTTON:
214 drawLine(gc(), 214 drawLine(gc(),
215 2, 2, 215 2, 2,
216 width() - 3, height() - 3); 216 width() - 3, height() - 3);
@@ -229,7 +229,7 @@ void WinButton::drawType() {
229 2, height() - 3, 229 2, height() - 3,
230 width() - 3, 2); 230 width() - 3, 2);
231 break; 231 break;
232 case SHADE: 232 case SHADEBUTTON:
233 233
234 { 234 {
235 int size = width() - 5 - oddW; 235 int size = width() - 5 - oddW;
@@ -246,7 +246,7 @@ void WinButton::drawType() {
246 246
247 break; 247 break;
248 } 248 }
249 case MENUICON: 249 case MENUICONBUTTON:
250 if (m_icon_pixmap.drawable()) { 250 if (m_icon_pixmap.drawable()) {
251 251
252 if (m_icon_mask.drawable()) { 252 if (m_icon_mask.drawable()) {
@@ -282,7 +282,7 @@ void WinButton::clear() {
282void WinButton::updateAll() { 282void WinButton::updateAll() {
283 283
284 // update the menu icon 284 // update the menu icon
285 if (m_type == MENUICON && !m_listen_to.empty()) { 285 if (m_type == MENUICONBUTTON && !m_listen_to.empty()) {
286 286
287 Display* display = m_listen_to.fbWindow().display(); 287 Display* display = m_listen_to.fbWindow().display();
288 int screen = m_listen_to.screen().screenNumber(); 288 int screen = m_listen_to.screen().screenNumber();
@@ -308,7 +308,7 @@ void WinButton::updateAll() {
308 setBackgroundPixmap(my_pm); 308 setBackgroundPixmap(my_pm);
309 309
310 // incorrect, pressed_pixmap is stateful in shade, so we'll do oneoff for now 310 // incorrect, pressed_pixmap is stateful in shade, so we'll do oneoff for now
311 if (m_type == SHADE) { 311 if (m_type == SHADEBUTTON) {
312 Pixmap p_pm = getPressedPixmap(); 312 Pixmap p_pm = getPressedPixmap();
313 if (p_pm != None) 313 if (p_pm != None)
314 setPressedPixmap(p_pm); 314 setPressedPixmap(p_pm);