aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2006-03-18 22:02:21 (GMT)
committerfluxgen <fluxgen>2006-03-18 22:02:21 (GMT)
commit716bb32ec2999c1418ebd56d53b1ec43285a1b07 (patch)
treecec487865cb365a5ad4594f941c47dfb416b8218
parentf5c2861baf1f5cec6c771527a65ecd1e0ed3ac85 (diff)
downloadfluxbox-716bb32ec2999c1418ebd56d53b1ec43285a1b07.zip
fluxbox-716bb32ec2999c1418ebd56d53b1ec43285a1b07.tar.bz2
Using WinButton enum for titlebar button type
-rw-r--r--src/Resources.cc32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/Resources.cc b/src/Resources.cc
index 1c9b456..c6ddf3c 100644
--- a/src/Resources.cc
+++ b/src/Resources.cc
@@ -26,13 +26,15 @@
26 26
27#include "FbTk/StringUtil.hh" 27#include "FbTk/StringUtil.hh"
28#include "FbTk/Resource.hh" 28#include "FbTk/Resource.hh"
29#include "WinButton.hh"
30
29#include "fluxbox.hh" 31#include "fluxbox.hh"
30 32
31#include "Layer.hh" 33#include "Layer.hh"
32 34
33#include <stdio.h> 35#include <stdio.h>
34#include <string> 36#include <string>
35 37#include <vector>
36using namespace std; 38using namespace std;
37using namespace FbTk; 39using namespace FbTk;
38 40
@@ -62,7 +64,7 @@ setFromString(char const *strval) {
62} 64}
63 65
64template<> 66template<>
65void FbTk::Resource<Fluxbox::TitlebarList>:: 67void FbTk::Resource<std::vector<WinButton::Type> >::
66setFromString(char const *strval) { 68setFromString(char const *strval) {
67 vector<std::string> val; 69 vector<std::string> val;
68 StringUtil::stringtok(val, strval); 70 StringUtil::stringtok(val, strval);
@@ -72,17 +74,17 @@ setFromString(char const *strval) {
72 74
73 for (int i=0; i<size; i++) { 75 for (int i=0; i<size; i++) {
74 if (strcasecmp(val[i].c_str(), "Maximize")==0) 76 if (strcasecmp(val[i].c_str(), "Maximize")==0)
75 m_value.push_back(Fluxbox::MAXIMIZE); 77 m_value.push_back(WinButton::MAXIMIZE);
76 else if (strcasecmp(val[i].c_str(), "Minimize")==0) 78 else if (strcasecmp(val[i].c_str(), "Minimize")==0)
77 m_value.push_back(Fluxbox::MINIMIZE); 79 m_value.push_back(WinButton::MINIMIZE);
78 else if (strcasecmp(val[i].c_str(), "Shade")==0) 80 else if (strcasecmp(val[i].c_str(), "Shade")==0)
79 m_value.push_back(Fluxbox::SHADE); 81 m_value.push_back(WinButton::SHADE);
80 else if (strcasecmp(val[i].c_str(), "Stick")==0) 82 else if (strcasecmp(val[i].c_str(), "Stick")==0)
81 m_value.push_back(Fluxbox::STICK); 83 m_value.push_back(WinButton::STICK);
82 else if (strcasecmp(val[i].c_str(), "MenuIcon")==0) 84 else if (strcasecmp(val[i].c_str(), "MenuIcon")==0)
83 m_value.push_back(Fluxbox::MENUICON); 85 m_value.push_back(WinButton::MENUICON);
84 else if (strcasecmp(val[i].c_str(), "Close")==0) 86 else if (strcasecmp(val[i].c_str(), "Close")==0)
85 m_value.push_back(Fluxbox::CLOSE); 87 m_value.push_back(WinButton::CLOSE);
86 } 88 }
87} 89}
88 90
@@ -133,28 +135,28 @@ getString() const { return **this; }
133 135
134 136
135template<> 137template<>
136std::string FbTk::Resource<Fluxbox::TitlebarList>:: 138std::string FbTk::Resource<std::vector<WinButton::Type> >::
137getString() const { 139getString() const {
138 string retval; 140 string retval;
139 int size=m_value.size(); 141 int size=m_value.size();
140 for (int i=0; i<size; i++) { 142 for (int i=0; i<size; i++) {
141 switch (m_value[i]) { 143 switch (m_value[i]) {
142 case Fluxbox::SHADE: 144 case WinButton::SHADE:
143 retval.append("Shade"); 145 retval.append("Shade");
144 break; 146 break;
145 case Fluxbox::MINIMIZE: 147 case WinButton::MINIMIZE:
146 retval.append("Minimize"); 148 retval.append("Minimize");
147 break; 149 break;
148 case Fluxbox::MAXIMIZE: 150 case WinButton::MAXIMIZE:
149 retval.append("Maximize"); 151 retval.append("Maximize");
150 break; 152 break;
151 case Fluxbox::CLOSE: 153 case WinButton::CLOSE:
152 retval.append("Close"); 154 retval.append("Close");
153 break; 155 break;
154 case Fluxbox::STICK: 156 case WinButton::STICK:
155 retval.append("Stick"); 157 retval.append("Stick");
156 break; 158 break;
157 case Fluxbox::MENUICON: 159 case WinButton::MENUICON:
158 retval.append("MenuIcon"); 160 retval.append("MenuIcon");
159 break; 161 break;
160 default: 162 default: