BScreen::BScreen(Openbox &ob, int scrn, Resource &conf) : ScreenInfo(ob, scrn),
openbox(ob), config(conf)
{
- // default values
- resource.full_max = false;
- resource.focus_new = false;
- resource.focus_last = false;
- resource.row_direction = LeftRight;
- resource.col_direction = TopBottom;
- resource.workspaces = 1;
- resource.sloppy_focus = true;
- resource.auto_raise = false;
- resource.zones = 1;
- resource.placement_policy = CascadePlacement;
-#ifdef HAVE_STRFTIME
- resource.strftime_format = bstrdup("%I:%M %p");
-#else // !have_strftime
- resource.date_format = B_AmericanDate;
- resource.clock24hour = false;
-#endif // HAVE_STRFTIME
- resource.edge_snap_threshold = 4;
- resource.image_dither = true;
- resource.root_command = NULL;
- resource.opaque_move = false;
-
event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask |
SubstructureRedirectMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask;
rclass << rscreen.str() << "HideToolbar" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.hide_toolbar = b;
+ else
+ resource.hide_toolbar = false;
Toolbar *t = getToolbar();
if (t != NULL) {
if (resource.hide_toolbar)
rclass << rscreen.str() << "FullMaximization" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.full_max = b;
+ else
+ resource.full_max = false;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "focusNewWindows" << ends;
rclass << rscreen.str() << "FocusNewWindows" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.focus_new = b;
+ else
+ resource.focus_new = false;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "focusLastWindow" << ends;
rclass << rscreen.str() << "FocusLastWindow" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.focus_last = b;
+ else
+ resource.focus_last = false;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "rowPlacementDirection" << ends;
resource.row_direction = RightLeft;
else if (0 == strncasecmp(s.c_str(), "LeftToRight", s.length()))
resource.row_direction = LeftRight;
- }
+ } else
+ resource.row_direction = LeftRight;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "colPlacementDirection" << ends;
resource.col_direction = BottomTop;
else if (0 == strncasecmp(s.c_str(), "TopToBottom", s.length()))
resource.col_direction = TopBottom;
- }
+ } else
+ resource.col_direction = TopBottom;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "workspaces" << ends;
rclass << rscreen.str() << "Workspaces" << ends;
if (config.getValue(rname.str(), rclass.str(), l))
resource.workspaces = l;
+ else
+ resource.workspaces = 1;
removeWorkspaceNames();
rname.seekp(0); rclass.seekp(0);
resource.sloppy_focus = true;
resource.auto_raise = false;
}
+ } else {
+ resource.sloppy_focus = true;
+ resource.auto_raise = false;
}
rname.seekp(0); rclass.seekp(0);
rclass << rscreen.str() << "WindowZones" << ends;
if (config.getValue(rname.str(), rclass.str(), l))
resource.zones = (l == 1 || l == 2 || l == 4) ? l : 1;
+ else
+ resource.zones = 4;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "windowPlacement" << ends;
resource.placement_policy = BestFitPlacement;
else if (0 == strncasecmp(s.c_str(), "CascadePlacement", s.length()))
resource.placement_policy = CascadePlacement;
- }
+ } else
+ resource.placement_policy = CascadePlacement;
#ifdef HAVE_STRFTIME
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "strftimeFormat" << ends;
rclass << rscreen.str() << "StrftimeFormat" << ends;
- if (resource.strftime_format != NULL){
+ if (resource.strftime_format != NULL)
delete [] resource.strftime_format;
- resource.strftime_format=NULL;
- }
- if (config.getValue(rname.str(), rclass.str(), s)) {
+ if (config.getValue(rname.str(), rclass.str(), s))
resource.strftime_format = bstrdup(s.c_str());
- }
+ else
+ resource.strftime_format = bstrdup("%I:%M %p");
#else // !HAVE_STRFTIME
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "dateFormat" << ends;
resource.date_format = B_EuropeanDate;
else if (strncasecmp(s.c_str(), "American", s.length()))
resource.date_format = B_AmericanDate;
- }
+ } else
+ resource.date_format = B_AmericanDate;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "clockFormat" << ends;
resource.clock24hour = true;
else if (clock == 12)
resource.clock24hour = false;
+ } else
+ resource.clock24hour = false;
#endif // HAVE_STRFTIME
rname.seekp(0); rclass.seekp(0);
rclass << rscreen.str() << "EdgeSnapThreshold" << ends;
if (config.getValue(rname.str(), rclass.str(), l))
resource.edge_snap_threshold = l;
+ else
+ resource.edge_snap_threshold = 4;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "imageDither" << ends;
rclass << rscreen.str() << "ImageDither" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.image_dither = b;
+ else
+ resource.image_dither = true;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "rootCommand" << ends;
rclass << rscreen.str() << "RootCommand" << ends;
- if (resource.root_command != NULL){
+ if (resource.root_command != NULL)
delete [] resource.root_command;
- resource.root_command=NULL;
- }
- if (config.getValue(rname.str(), rclass.str(), s)) {
+
+ if (config.getValue(rname.str(), rclass.str(), s))
resource.root_command = bstrdup(s.c_str());
- }
+ else
+ resource.root_command = NULL;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "opaqueMove" << ends;
rclass << rscreen.str() << "OpaqueMove" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
resource.opaque_move = b;
+ else
+ resource.opaque_move = false;
+
rscreen.rdbuf()->freeze(0);
rname.rdbuf()->freeze(0);
rclass.rdbuf()->freeze(0);
Slit::Slit(BScreen &scr, Resource &conf) : screen(scr),
openbox(scr.getOpenbox()), config(conf)
{
- // default values
- m_placement = CenterRight;
- m_direction = Vertical;
- m_ontop = false;
- m_hidden = m_autohide = false;
load();
display = screen.getBaseDisplay().getXDisplay();
m_placement = BottomRight;
else if (0 == strncasecmp(s.c_str(), "CenterRight", s.length()))
m_placement = CenterRight;
- }
+ } else
+ m_placement = CenterRight;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "slit.direction" << ends;
m_direction = Horizontal;
else if (0 == strncasecmp(s.c_str(), "Vertical", s.length()))
m_direction = Vertical;
- }
+ } else
+ m_direction = Vertical;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "slit.onTop" << ends;
rclass << rscreen.str() << "Slit.OnTop" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
m_ontop = b;
+ else
+ m_ontop = false;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "slit.autoHide" << ends;
rclass << rscreen.str() << "Slit.AutoHide" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
m_hidden = m_autohide = b;
+ else
+ m_hidden = m_autohide = false;
+
rscreen.rdbuf()->freeze(0);
rname.rdbuf()->freeze(0);
rclass.rdbuf()->freeze(0);
Toolbar::Toolbar(BScreen &scrn, Resource &conf) : screen(scrn),
openbox(scrn.getOpenbox()), config(conf)
{
- // default values
- m_width_percent =66;
- m_placement = BottomCenter;
- m_ontop = false;
- m_hidden = m_autohide = false;
load();
// get the clock updating every minute
rclass << rscreen.str() << "Toolbar.WidthPercent" << ends;
if (config.getValue(rname.str(), rclass.str(), l) && (l > 0 && l <= 100))
m_width_percent = l;
+ else
+ m_width_percent =66;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "toolbar.placement" << ends;
m_placement = BottomRight;
else if ( 0 == strncasecmp(s.c_str(), "BottomCenter", s.length()))
m_placement = BottomCenter;
- }
+ } else
+ m_placement = BottomCenter;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "toolbar.onTop" << ends;
rclass << rscreen.str() << "Toolbar.OnTop" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
m_ontop = b;
+ else
+ m_ontop = false;
rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "toolbar.autoHide" << ends;
rclass << rscreen.str() << "Toolbar.AutoHide" << ends;
if (config.getValue(rname.str(), rclass.str(), b))
m_hidden = m_autohide = b;
+ else
+ m_hidden = m_autohide = false;
+
rscreen.rdbuf()->freeze(0);
rname.rdbuf()->freeze(0);
rclass.rdbuf()->freeze(0);