aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc128
1 files changed, 126 insertions, 2 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 8c01402..a1a6dbc 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.270 2004/03/21 09:00:24 rathnor Exp $ 25// $Id: Screen.cc,v 1.271 2004/03/22 21:01:10 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -306,6 +306,113 @@ setFromString(char const *strval) {
306 setDefaultValue(); 306 setDefaultValue();
307} 307}
308 308
309template<>
310void FbTk::Resource<FbTk::GContext::LineStyle>::setDefaultValue() {
311 *(*this) = FbTk::GContext::LINESOLID;
312}
313
314template<>
315std::string FbTk::Resource<FbTk::GContext::LineStyle>::getString() {
316 switch(m_value) {
317 case FbTk::GContext::LINESOLID:
318 return "LineSolid";
319 break;
320 case FbTk::GContext::LINEONOFFDASH:
321 return "LineOnOffDash";
322 break;
323 case FbTk::GContext::LINEDOUBLEDASH:
324 return "LineDoubleDash";
325 break;
326 };
327}
328
329template<>
330void FbTk::Resource<FbTk::GContext::LineStyle>
331::setFromString(char const *strval) {
332
333 if (strcasecmp(strval, "LineSolid") == 0 )
334 m_value = FbTk::GContext::LINESOLID;
335 else if (strcasecmp(strval, "LineOnOffDash") == 0 )
336 m_value = FbTk::GContext::LINEONOFFDASH;
337 else if (strcasecmp(strval, "LineDoubleDash") == 0)
338 m_value = FbTk::GContext::LINEDOUBLEDASH;
339 else
340 setDefaultValue();
341}
342
343template<>
344void FbTk::Resource<FbTk::GContext::JoinStyle>::setDefaultValue() {
345 *(*this) = FbTk::GContext::JOINMITER;
346}
347
348template<>
349std::string FbTk::Resource<FbTk::GContext::JoinStyle>::getString() {
350 switch(m_value) {
351 case FbTk::GContext::JOINMITER:
352 return "JoinMiter";
353 break;
354 case FbTk::GContext::JOINBEVEL:
355 return "JoinBevel";
356 break;
357 case FbTk::GContext::JOINROUND:
358 return "JoinRound";
359 break;
360 };
361}
362
363template<>
364void FbTk::Resource<FbTk::GContext::JoinStyle>
365::setFromString(char const *strval) {
366
367 if (strcasecmp(strval, "JoinRound") == 0 )
368 m_value = FbTk::GContext::JOINROUND;
369 else if (strcasecmp(strval, "JoinMiter") == 0 )
370 m_value = FbTk::GContext::JOINMITER;
371 else if (strcasecmp(strval, "JoinBevel") == 0)
372 m_value = FbTk::GContext::JOINBEVEL;
373 else
374 setDefaultValue();
375}
376
377template<>
378void FbTk::Resource<FbTk::GContext::CapStyle>::setDefaultValue() {
379 *(*this) = FbTk::GContext::CAPNOTLAST;
380}
381
382template<>
383std::string FbTk::Resource<FbTk::GContext::CapStyle>::getString() {
384 switch(m_value) {
385 case FbTk::GContext::CAPNOTLAST:
386 return "CapNotLast";
387 break;
388 case FbTk::GContext::CAPBUTT:
389 return "CapButt";
390 break;
391 case FbTk::GContext::CAPROUND:
392 return "CapRound";
393 break;
394 case FbTk::GContext::CAPPROJECTING:
395 return "CapProjecting";
396 break;
397 };
398}
399
400template<>
401void FbTk::Resource<FbTk::GContext::CapStyle>
402::setFromString(char const *strval) {
403
404 if (strcasecmp(strval, "CapNotLast") == 0 )
405 m_value = FbTk::GContext::CAPNOTLAST;
406 else if (strcasecmp(strval, "CapProjecting") == 0 )
407 m_value = FbTk::GContext::CAPPROJECTING;
408 else if (strcasecmp(strval, "CapRound") == 0)
409 m_value = FbTk::GContext::CAPROUND;
410 else if (strcasecmp(strval, "CapButt" ) == 0)
411 m_value = FbTk::GContext::CAPBUTT;
412 else
413 setDefaultValue();
414}
415
309namespace { 416namespace {
310 417
311class StyleMenuItem: public FbTk::MenuItem { 418class StyleMenuItem: public FbTk::MenuItem {
@@ -378,7 +485,20 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
378 menu_mode(rm, FbTk::MenuTheme::DELAY_OPEN, scrname+".menuMode", altscrname+".MenuMode"), 485 menu_mode(rm, FbTk::MenuTheme::DELAY_OPEN, scrname+".menuMode", altscrname+".MenuMode"),
379 placement_policy(rm, ROWSMARTPLACEMENT, scrname+".windowPlacement", altscrname+".WindowPlacement"), 486 placement_policy(rm, ROWSMARTPLACEMENT, scrname+".windowPlacement", altscrname+".WindowPlacement"),
380 row_direction(rm, LEFTRIGHT, scrname+".rowPlacementDirection", altscrname+".RowPlacementDirection"), 487 row_direction(rm, LEFTRIGHT, scrname+".rowPlacementDirection", altscrname+".RowPlacementDirection"),
381 col_direction(rm, TOPBOTTOM, scrname+".colPlacementDirection", altscrname+".ColPlacementDirection") { 488 col_direction(rm, TOPBOTTOM, scrname+".colPlacementDirection", altscrname+".ColPlacementDirection"),
489 gc_line_width(rm, 1, scrname+".overlay.lineWidth", altscrname+".Overlay.LineWidth"),
490 gc_line_style(rm,
491 FbTk::GContext::LINESOLID,
492 scrname+".overlay.lineStyle",
493 altscrname+".Overlay.LineStyle"),
494 gc_join_style(rm,
495 FbTk::GContext::JOINMITER,
496 scrname+".overlay.joinStyle",
497 altscrname+".Overlay.JoinStyle"),
498 gc_cap_style(rm,
499 FbTk::GContext::CAPNOTLAST,
500 scrname+".overlay.capStyle",
501 altscrname+".overlay.CapStyle") {
382 502
383} 503}
384 504
@@ -584,6 +704,10 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
584 m_root_theme->lock(true); 704 m_root_theme->lock(true);
585 FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename()); 705 FbTk::ThemeManager::instance().load(Fluxbox::instance()->getStyleFilename());
586 m_root_theme->lock(false); 706 m_root_theme->lock(false);
707 m_root_theme->setLineAttributes(*resource.gc_line_width,
708 *resource.gc_line_style,
709 *resource.gc_cap_style,
710 *resource.gc_join_style);
587 711
588 int i; 712 int i;
589 unsigned int nchild; 713 unsigned int nchild;