aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-04-16 16:18:06 (GMT)
committerrathnor <rathnor>2003-04-16 16:18:06 (GMT)
commite48f7836fdaca03e0626b3e7ac4d37c99dd35dc9 (patch)
treedd5421ed6b26c0d882dd34a91dfc01eb1ae3ee85 /src/Screen.cc
parent9163668e98e1683b95fb5cc44c19b3695c7857c4 (diff)
downloadfluxbox_pavel-e48f7836fdaca03e0626b3e7ac4d37c99dd35dc9.zip
fluxbox_pavel-e48f7836fdaca03e0626b3e7ac4d37c99dd35dc9.tar.bz2
fix saving of various slit params (Simon)
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc91
1 files changed, 89 insertions, 2 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index c25de83..196170e 100644
--- a/src/Screen.cc
+++ b/src/Screen.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: Screen.cc,v 1.125 2003/04/16 14:43:01 rathnor Exp $ 25// $Id: Screen.cc,v 1.126 2003/04/16 16:17:56 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -193,6 +193,29 @@ setFromString(const char *strval) {
193} 193}
194 194
195template<> 195template<>
196void Resource<Slit::Placement>::
197setFromString(const char *strval) {
198 if (strcasecmp(strval, "TopLeft")==0)
199 m_value = Slit::TOPLEFT;
200 else if (strcasecmp(strval, "CenterLeft")==0)
201 m_value = Slit::CENTERLEFT;
202 else if (strcasecmp(strval, "BottomLeft")==0)
203 m_value = Slit::BOTTOMLEFT;
204 else if (strcasecmp(strval, "TopCenter")==0)
205 m_value = Slit::TOPCENTER;
206 else if (strcasecmp(strval, "BottomCenter")==0)
207 m_value = Slit::BOTTOMCENTER;
208 else if (strcasecmp(strval, "TopRight")==0)
209 m_value = Slit::TOPRIGHT;
210 else if (strcasecmp(strval, "CenterRight")==0)
211 m_value = Slit::CENTERRIGHT;
212 else if (strcasecmp(strval, "BottomRight")==0)
213 m_value = Slit::BOTTOMRIGHT;
214 else
215 setDefaultValue();
216}
217
218template<>
196void Resource<ToolbarHandler::ToolbarMode>:: 219void Resource<ToolbarHandler::ToolbarMode>::
197setFromString(const char *strval) { 220setFromString(const char *strval) {
198 if (strcasecmp(strval, "Off") == 0) 221 if (strcasecmp(strval, "Off") == 0)
@@ -212,6 +235,16 @@ setFromString(const char *strval) {
212} 235}
213 236
214template<> 237template<>
238void Resource<Slit::Direction>::
239setFromString(const char *strval) {
240 if (strcasecmp(strval, "Vertical") == 0)
241 m_value = Slit::VERTICAL;
242 else if (strcasecmp(strval, "Horizontal") == 0)
243 m_value = Slit::HORIZONTAL;
244 else
245 setDefaultValue();
246}
247
215string Resource<Toolbar::Placement>:: 248string Resource<Toolbar::Placement>::
216getString() { 249getString() {
217 switch (m_value) { 250 switch (m_value) {
@@ -256,6 +289,39 @@ getString() {
256 return string("BottomCenter"); 289 return string("BottomCenter");
257} 290}
258 291
292
293string Resource<Slit::Placement>::
294getString() {
295 switch (m_value) {
296 case Slit::TOPLEFT:
297 return string("TopLeft");
298 break;
299 case Slit::CENTERLEFT:
300 return string("CenterLeft");
301 break;
302 case Slit::BOTTOMLEFT:
303 return string("BottomLeft");
304 break;
305 case Slit::TOPCENTER:
306 return string("TopCenter");
307 break;
308 case Slit::BOTTOMCENTER:
309 return string("BottomCenter");
310 break;
311 case Slit::TOPRIGHT:
312 return string("TopRight");
313 break;
314 case Slit::CENTERRIGHT:
315 return string("CenterRight");
316 break;
317 case Slit::BOTTOMRIGHT:
318 return string("BottomRight");
319 break;
320 }
321 //default string
322 return string("BottomRight");
323}
324
259template<> 325template<>
260string Resource<ToolbarHandler::ToolbarMode>:: 326string Resource<ToolbarHandler::ToolbarMode>::
261getString() { 327getString() {
@@ -284,6 +350,22 @@ getString() {
284 return string("Icons"); 350 return string("Icons");
285} 351}
286 352
353template<>
354string Resource<Slit::Direction>::
355getString() {
356 switch (m_value) {
357 case Slit::VERTICAL:
358 return string("Vertical");
359 break;
360 case Slit::HORIZONTAL:
361 return string("Horizontal");
362 break;
363 }
364 // default string
365 return string("Vertical");
366}
367
368
287namespace { 369namespace {
288 370
289class AddWorkspaceCmd:public FbTk::Command { 371class AddWorkspaceCmd:public FbTk::Command {
@@ -400,7 +482,12 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm,
400 toolbar_mode(rm, ToolbarHandler::ICONS, scrname+".toolbar.mode", altscrname+".Toolbar.Mode"), 482 toolbar_mode(rm, ToolbarHandler::ICONS, scrname+".toolbar.mode", altscrname+".Toolbar.Mode"),
401 toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead"), 483 toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead"),
402 toolbar_placement(rm, Toolbar::BOTTOMCENTER, 484 toolbar_placement(rm, Toolbar::BOTTOMCENTER,
403 scrname+".toolbar.placement", altscrname+".Toolbar.Placement") 485 scrname+".toolbar.placement", altscrname+".Toolbar.Placement"),
486 slit_auto_hide(rm, false, scrname+".slit.autoHide", altscrname+".Slit.AutoHide"),
487 slit_placement(rm, Slit::BOTTOMRIGHT,
488 scrname+".slit.placement", altscrname+".Slit.Placement"),
489 slit_direction(rm, Slit::VERTICAL, scrname+".slit.direction", altscrname+".Slit.Direction")
490
404{ 491{
405 492
406}; 493};