aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc31
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
158template<> 159template<>
159void Resource<int>:: 160void FbTk::Resource<int>::
160setFromString(const char* strval) { 161setFromString(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
166template<> 167template<>
167void Resource<std::string>:: 168void FbTk::Resource<std::string>::
168setFromString(const char *strval) { 169setFromString(const char *strval) {
169 *this = strval; 170 *this = strval;
170} 171}
171 172
172template<> 173template<>
173void Resource<bool>:: 174void FbTk::Resource<bool>::
174setFromString(char const *strval) { 175setFromString(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
181template<> 182template<>
182void Resource<Fluxbox::FocusModel>:: 183void FbTk::Resource<Fluxbox::FocusModel>::
183setFromString(char const *strval) { 184setFromString(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
199template<> 200template<>
200void Resource<Fluxbox::TitlebarList>:: 201void FbTk::Resource<Fluxbox::TitlebarList>::
201setFromString(char const *strval) { 202setFromString(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
224template<> 225template<>
225void Resource<unsigned int>:: 226void FbTk::Resource<unsigned int>::
226setFromString(const char *strval) { 227setFromString(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//-----------------------------------------------------------------
234template<> 235template<>
235std::string Resource<bool>:: 236std::string FbTk::Resource<bool>::
236getString() { 237getString() {
237 return std::string(**this == true ? "true" : "false"); 238 return std::string(**this == true ? "true" : "false");
238} 239}
239 240
240template<> 241template<>
241std::string Resource<int>:: 242std::string FbTk::Resource<int>::
242getString() { 243getString() {
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
248template<> 249template<>
249std::string Resource<std::string>:: 250std::string FbTk::Resource<std::string>::
250getString() { return **this; } 251getString() { return **this; }
251 252
252template<> 253template<>
253std::string Resource<Fluxbox::FocusModel>:: 254std::string FbTk::Resource<Fluxbox::FocusModel>::
254getString() { 255getString() {
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
267template<> 268template<>
268std::string Resource<Fluxbox::TitlebarList>:: 269std::string FbTk::Resource<Fluxbox::TitlebarList>::
269getString() { 270getString() {
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
301template<> 302template<>
302string Resource<unsigned int>:: 303string FbTk::Resource<unsigned int>::
303getString() { 304getString() {
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
309template<> 310template<>
310void Resource<Fluxbox::Layer>:: 311void FbTk::Resource<Fluxbox::Layer>::
311setFromString(const char *strval) { 312setFromString(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
334template<> 335template<>
335string Resource<Fluxbox::Layer>:: 336string FbTk::Resource<Fluxbox::Layer>::
336getString() { 337getString() {
337 338
338 if (m_value.getNum() == Fluxbox::instance()->getMenuLayer()) 339 if (m_value.getNum() == Fluxbox::instance()->getMenuLayer())