diff options
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 610ae13..5b39b2f 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -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: fluxbox.cc,v 1.150 2003/05/15 23:30:03 fluxgen Exp $ | 25 | // $Id: fluxbox.cc,v 1.151 2003/05/18 22:04:06 fluxgen Exp $ |
26 | 26 | ||
27 | #include "fluxbox.hh" | 27 | #include "fluxbox.hh" |
28 | 28 | ||
@@ -155,8 +155,9 @@ char *basename (char *s) { | |||
155 | //----------------------------------------------------------------- | 155 | //----------------------------------------------------------------- |
156 | //---- accessors for int, bool, and some enums with Resource ------ | 156 | //---- accessors for int, bool, and some enums with Resource ------ |
157 | //----------------------------------------------------------------- | 157 | //----------------------------------------------------------------- |
158 | |||
158 | template<> | 159 | template<> |
159 | void Resource<int>:: | 160 | void FbTk::Resource<int>:: |
160 | setFromString(const char* strval) { | 161 | setFromString(const char* strval) { |
161 | int val; | 162 | int val; |
162 | if (sscanf(strval, "%d", &val)==1) | 163 | if (sscanf(strval, "%d", &val)==1) |
@@ -164,13 +165,13 @@ setFromString(const char* strval) { | |||
164 | } | 165 | } |
165 | 166 | ||
166 | template<> | 167 | template<> |
167 | void Resource<std::string>:: | 168 | void FbTk::Resource<std::string>:: |
168 | setFromString(const char *strval) { | 169 | setFromString(const char *strval) { |
169 | *this = strval; | 170 | *this = strval; |
170 | } | 171 | } |
171 | 172 | ||
172 | template<> | 173 | template<> |
173 | void Resource<bool>:: | 174 | void FbTk::Resource<bool>:: |
174 | setFromString(char const *strval) { | 175 | setFromString(char const *strval) { |
175 | if (strcasecmp(strval, "true")==0) | 176 | if (strcasecmp(strval, "true")==0) |
176 | *this = true; | 177 | *this = true; |
@@ -179,7 +180,7 @@ setFromString(char const *strval) { | |||
179 | } | 180 | } |
180 | 181 | ||
181 | template<> | 182 | template<> |
182 | void Resource<Fluxbox::FocusModel>:: | 183 | void FbTk::Resource<Fluxbox::FocusModel>:: |
183 | setFromString(char const *strval) { | 184 | setFromString(char const *strval) { |
184 | // auto raise options here for backwards read compatibility | 185 | // auto raise options here for backwards read compatibility |
185 | // they are not supported for saving purposes. Nor does the "AutoRaise" | 186 | // they are not supported for saving purposes. Nor does the "AutoRaise" |
@@ -197,7 +198,7 @@ setFromString(char const *strval) { | |||
197 | } | 198 | } |
198 | 199 | ||
199 | template<> | 200 | template<> |
200 | void Resource<Fluxbox::TitlebarList>:: | 201 | void FbTk::Resource<Fluxbox::TitlebarList>:: |
201 | setFromString(char const *strval) { | 202 | setFromString(char const *strval) { |
202 | vector<std::string> val; | 203 | vector<std::string> val; |
203 | StringUtil::stringtok(val, strval); | 204 | StringUtil::stringtok(val, strval); |
@@ -222,7 +223,7 @@ setFromString(char const *strval) { | |||
222 | } | 223 | } |
223 | 224 | ||
224 | template<> | 225 | template<> |
225 | void Resource<unsigned int>:: | 226 | void FbTk::Resource<unsigned int>:: |
226 | setFromString(const char *strval) { | 227 | setFromString(const char *strval) { |
227 | if (sscanf(strval, "%ul", &m_value) != 1) | 228 | if (sscanf(strval, "%ul", &m_value) != 1) |
228 | setDefaultValue(); | 229 | setDefaultValue(); |
@@ -232,13 +233,13 @@ setFromString(const char *strval) { | |||
232 | //---- manipulators for int, bool, and some enums with Resource --- | 233 | //---- manipulators for int, bool, and some enums with Resource --- |
233 | //----------------------------------------------------------------- | 234 | //----------------------------------------------------------------- |
234 | template<> | 235 | template<> |
235 | std::string Resource<bool>:: | 236 | std::string FbTk::Resource<bool>:: |
236 | getString() { | 237 | getString() { |
237 | return std::string(**this == true ? "true" : "false"); | 238 | return std::string(**this == true ? "true" : "false"); |
238 | } | 239 | } |
239 | 240 | ||
240 | template<> | 241 | template<> |
241 | std::string Resource<int>:: | 242 | std::string FbTk::Resource<int>:: |
242 | getString() { | 243 | getString() { |
243 | char strval[256]; | 244 | char strval[256]; |
244 | sprintf(strval, "%d", **this); | 245 | sprintf(strval, "%d", **this); |
@@ -246,11 +247,11 @@ getString() { | |||
246 | } | 247 | } |
247 | 248 | ||
248 | template<> | 249 | template<> |
249 | std::string Resource<std::string>:: | 250 | std::string FbTk::Resource<std::string>:: |
250 | getString() { return **this; } | 251 | getString() { return **this; } |
251 | 252 | ||
252 | template<> | 253 | template<> |
253 | std::string Resource<Fluxbox::FocusModel>:: | 254 | std::string FbTk::Resource<Fluxbox::FocusModel>:: |
254 | getString() { | 255 | getString() { |
255 | switch (m_value) { | 256 | switch (m_value) { |
256 | case Fluxbox::SLOPPYFOCUS: | 257 | case Fluxbox::SLOPPYFOCUS: |
@@ -265,7 +266,7 @@ getString() { | |||
265 | } | 266 | } |
266 | 267 | ||
267 | template<> | 268 | template<> |
268 | std::string Resource<Fluxbox::TitlebarList>:: | 269 | std::string FbTk::Resource<Fluxbox::TitlebarList>:: |
269 | getString() { | 270 | getString() { |
270 | string retval; | 271 | string retval; |
271 | int size=m_value.size(); | 272 | int size=m_value.size(); |
@@ -299,7 +300,7 @@ getString() { | |||
299 | } | 300 | } |
300 | 301 | ||
301 | template<> | 302 | template<> |
302 | string Resource<unsigned int>:: | 303 | string FbTk::Resource<unsigned int>:: |
303 | getString() { | 304 | getString() { |
304 | char tmpstr[128]; | 305 | char tmpstr[128]; |
305 | sprintf(tmpstr, "%ul", m_value); | 306 | sprintf(tmpstr, "%ul", m_value); |
@@ -307,7 +308,7 @@ getString() { | |||
307 | } | 308 | } |
308 | 309 | ||
309 | template<> | 310 | template<> |
310 | void Resource<Fluxbox::Layer>:: | 311 | void FbTk::Resource<Fluxbox::Layer>:: |
311 | setFromString(const char *strval) { | 312 | setFromString(const char *strval) { |
312 | int tempnum = 0; | 313 | int tempnum = 0; |
313 | if (sscanf(strval, "%d", &tempnum) == 1) | 314 | if (sscanf(strval, "%d", &tempnum) == 1) |
@@ -332,7 +333,7 @@ setFromString(const char *strval) { | |||
332 | 333 | ||
333 | 334 | ||
334 | template<> | 335 | template<> |
335 | string Resource<Fluxbox::Layer>:: | 336 | string FbTk::Resource<Fluxbox::Layer>:: |
336 | getString() { | 337 | getString() { |
337 | 338 | ||
338 | if (m_value.getNum() == Fluxbox::instance()->getMenuLayer()) | 339 | if (m_value.getNum() == Fluxbox::instance()->getMenuLayer()) |