aboutsummaryrefslogtreecommitdiff
path: root/src/Resources.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2006-02-20 21:04:35 (GMT)
committerfluxgen <fluxgen>2006-02-20 21:04:35 (GMT)
commit369b4e1b92491aa57b0bf430b89bf732b80fa6a4 (patch)
tree2bf00a93ad1c195ef7d446e8989069f218a2cd47 /src/Resources.cc
parent2566d84561ce9f5ecaf1adcce97eb578747034e3 (diff)
downloadfluxbox-369b4e1b92491aa57b0bf430b89bf732b80fa6a4.zip
fluxbox-369b4e1b92491aa57b0bf430b89bf732b80fa6a4.tar.bz2
moved class Layer from class Fluxbox and thus reduces some dependecies
Diffstat (limited to 'src/Resources.cc')
-rw-r--r--src/Resources.cc58
1 files changed, 31 insertions, 27 deletions
diff --git a/src/Resources.cc b/src/Resources.cc
index 7ecb017..fbf6a24 100644
--- a/src/Resources.cc
+++ b/src/Resources.cc
@@ -24,8 +24,11 @@
24 24
25// holds main resource functions 25// holds main resource functions
26 26
27#include "fluxbox.hh"
28#include "FbTk/StringUtil.hh" 27#include "FbTk/StringUtil.hh"
28#include "FbTk/Resource.hh"
29#include "fluxbox.hh"
30
31#include "Layer.hh"
29 32
30#include <stdio.h> 33#include <stdio.h>
31#include <string> 34#include <string>
@@ -188,54 +191,55 @@ getString() const {
188} 191}
189 192
190template<> 193template<>
191void FbTk::Resource<Fluxbox::Layer>:: 194void FbTk::Resource<Layer>::
192setFromString(const char *strval) { 195setFromString(const char *strval) {
193 int tempnum = 0; 196 int tempnum = 0;
194 if (sscanf(strval, "%d", &tempnum) == 1) 197 if (sscanf(strval, "%d", &tempnum) == 1)
195 m_value = tempnum; 198 m_value = tempnum;
196 else if (strcasecmp(strval, "Menu") == 0) 199 else if (strcasecmp(strval, "Menu") == 0)
197 m_value = Fluxbox::instance()->getMenuLayer(); 200 m_value = ::Layer::MENU;
198 else if (strcasecmp(strval, "AboveDock") == 0) 201 else if (strcasecmp(strval, "AboveDock") == 0)
199 m_value = Fluxbox::instance()->getAboveDockLayer(); 202 m_value = ::Layer::ABOVE_DOCK;
200 else if (strcasecmp(strval, "Dock") == 0) 203 else if (strcasecmp(strval, "Dock") == 0)
201 m_value = Fluxbox::instance()->getDockLayer(); 204 m_value = ::Layer::DOCK;
202 else if (strcasecmp(strval, "Top") == 0) 205 else if (strcasecmp(strval, "Top") == 0)
203 m_value = Fluxbox::instance()->getTopLayer(); 206 m_value = ::Layer::TOP;
204 else if (strcasecmp(strval, "Normal") == 0) 207 else if (strcasecmp(strval, "Normal") == 0)
205 m_value = Fluxbox::instance()->getNormalLayer(); 208 m_value = ::Layer::NORMAL;
206 else if (strcasecmp(strval, "Bottom") == 0) 209 else if (strcasecmp(strval, "Bottom") == 0)
207 m_value = Fluxbox::instance()->getBottomLayer(); 210 m_value = ::Layer::BOTTOM;
208 else if (strcasecmp(strval, "Desktop") == 0) 211 else if (strcasecmp(strval, "Desktop") == 0)
209 m_value = Fluxbox::instance()->getDesktopLayer(); 212 m_value = ::Layer::DESKTOP;
210 else 213 else
211 setDefaultValue(); 214 setDefaultValue();
212} 215}
213 216
214 217
215template<> 218template<>
216string FbTk::Resource<Fluxbox::Layer>:: 219std::string FbTk::Resource<Layer>::
217getString() const { 220getString() const {
218 221 switch (m_value.getNum()) {
219 if (m_value.getNum() == Fluxbox::instance()->getMenuLayer()) 222 case Layer::MENU:
220 return string("Menu"); 223 return std::string("Menu");
221 else if (m_value.getNum() == Fluxbox::instance()->getAboveDockLayer()) 224 case Layer::ABOVE_DOCK:
222 return string("AboveDock"); 225 return std::string("AboveDock");
223 else if (m_value.getNum() == Fluxbox::instance()->getDockLayer()) 226 case Layer::DOCK:
224 return string("Dock"); 227 return std::string("Dock");
225 else if (m_value.getNum() == Fluxbox::instance()->getTopLayer()) 228 case Layer::TOP:
226 return string("Top"); 229 return std::string("Top");
227 else if (m_value.getNum() == Fluxbox::instance()->getNormalLayer()) 230 case Layer::NORMAL:
228 return string("Normal"); 231 return std::string("Normal");
229 else if (m_value.getNum() == Fluxbox::instance()->getBottomLayer()) 232 case Layer::BOTTOM:
230 return string("Bottom"); 233 return std::string("Bottom");
231 else if (m_value.getNum() == Fluxbox::instance()->getDesktopLayer()) 234 case Layer::DESKTOP:
232 return string("Desktop"); 235 return std::string("Desktop");
233 else { 236 default:
234 char tmpstr[128]; 237 char tmpstr[128];
235 sprintf(tmpstr, "%d", m_value.getNum()); 238 sprintf(tmpstr, "%d", m_value.getNum());
236 return string(tmpstr); 239 return std::string(tmpstr);
237 } 240 }
238} 241}
242
239template<> 243template<>
240void FbTk::Resource<long>:: 244void FbTk::Resource<long>::
241setFromString(const char *strval) { 245setFromString(const char *strval) {