+ rname.seekp(0); rclass.seekp(0);
+ rname << rscreen.str() << "focusLastWindow";
+ rclass << rscreen.str() << "FocusLastWindow";
+ 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";
+ rclass << rscreen.str() << "RowPlacementDirection";
+ if (config.getValue(rname.str(), rclass.str(), s)) {
+ if (0 == strncasecmp(s.c_str(), "RightToLeft", s.length()))
+ 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";
+ rclass << rscreen.str() << "ColPlacementDirection";
+ if (config.getValue(rname.str(), rclass.str(), s)) {
+ if (0 == strncasecmp(s.c_str(), "BottomToTop", s.length()))
+ 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";
+ rclass << rscreen.str() << "Workspaces";
+ if (config.getValue(rname.str(), rclass.str(), l))
+ resource.workspaces = l;
+ else
+ resource.workspaces = 1;
+
+ removeWorkspaceNames();
+ rname.seekp(0); rclass.seekp(0);
+ rname << rscreen.str() << "workspaceNames";
+ rclass << rscreen.str() << "WorkspaceNames";
+ if (config.getValue(rname.str(), rclass.str(), s)) {
+ std::string::const_iterator it = s.begin(), end = s.end();
+ while(1) {
+ std::string::const_iterator tmp = it;// current string.begin()
+ it = std::find(tmp, end, ','); // look for comma between tmp and end
+ std::string name(tmp, it); // name = s[tmp:it]
+ addWorkspaceName(name.c_str());
+ if (it == end)
+ break;
+ ++it;
+ }
+ }
+
+ rname.seekp(0); rclass.seekp(0);
+ rname << rscreen.str() << "focusModel";
+ rclass << rscreen.str() << "FocusModel";
+ if (config.getValue(rname.str(), rclass.str(), s)) {
+ if (0 == strncasecmp(s.c_str(), "ClickToFocus", s.length())) {
+ resource.auto_raise = false;
+ resource.sloppy_focus = false;
+ } else if (0 == strncasecmp(s.c_str(), "AutoRaiseSloppyFocus",
+ s.length())) {
+ resource.sloppy_focus = true;
+ resource.auto_raise = true;
+ } else { //if (0 == strncasecmp(s.c_str(), "SloppyFocus", s.length())) {
+ resource.sloppy_focus = true;
+ resource.auto_raise = false;
+ }
+ } else {
+ resource.sloppy_focus = true;
+ resource.auto_raise = false;
+ }
+
+ rname.seekp(0); rclass.seekp(0);
+ rname << rscreen.str() << "windowZones";
+ rclass << rscreen.str() << "WindowZones";
+ 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";
+ rclass << rscreen.str() << "WindowPlacement";
+ if (config.getValue(rname.str(), rclass.str(), s)) {
+ if (0 == strncasecmp(s.c_str(), "RowSmartPlacement", s.length()))
+ resource.placement_policy = RowSmartPlacement;
+ else if (0 == strncasecmp(s.c_str(), "ColSmartPlacement", s.length()))
+ resource.placement_policy = ColSmartPlacement;
+ else if (0 == strncasecmp(s.c_str(), "BestFitPlacement", s.length()))
+ resource.placement_policy = BestFitPlacement;
+ else if (0 == strncasecmp(s.c_str(), "UnderMousePlacement", s.length()))
+ resource.placement_policy = UnderMousePlacement;
+ else if (0 == strncasecmp(s.c_str(), "ClickMousePlacement", s.length()))
+ resource.placement_policy = ClickMousePlacement;
+ 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";
+ rclass << rscreen.str() << "StrftimeFormat";
+
+ if (resource.strftime_format != NULL)
+ delete [] resource.strftime_format;
+
+ 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";
+ rclass << rscreen.str() << "DateFormat";
+ if (config.getValue(rname.str(), rclass.str(), s)) {
+ if (strncasecmp(s.c_str(), "European", s.length()))
+ 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";
+ rclass << rscreen.str() << "ClockFormat";
+ if (config.getValue(rname.str(), rclass.str(), l)) {
+ if (clock == 24)
+ resource.clock24hour = true;
+ else if (clock == 12)
+ resource.clock24hour = false;
+ } else
+ resource.clock24hour = false;
+#endif // HAVE_STRFTIME
+
+ rname.seekp(0); rclass.seekp(0);
+ rname << rscreen.str() << "edgeSnapThreshold";
+ rclass << rscreen.str() << "EdgeSnapThreshold";
+ 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";
+ rclass << rscreen.str() << "ImageDither";
+ 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";
+ rclass << rscreen.str() << "RootCommand";
+
+ if (resource.root_command != NULL)
+ delete [] resource.root_command;
+
+ 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";
+ rclass << rscreen.str() << "OpaqueMove";
+ if (config.getValue(rname.str(), rclass.str(), b))
+ resource.opaque_move = b;
+ else
+ resource.opaque_move = false;