本文整理汇总了C++中Blackbox::screenCount方法的典型用法代码示例。如果您正苦于以下问题:C++ Blackbox::screenCount方法的具体用法?C++ Blackbox::screenCount怎么用?C++ Blackbox::screenCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blackbox
的用法示例。
在下文中一共展示了Blackbox::screenCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
void BlackboxResource::load(Blackbox& blackbox) {
if (screen_resources == 0) {
screen_resources = new ScreenResource[blackbox.screenCount()];
}
bt::Resource res(rc_file);
menu_file = bt::expandTilde(res.read("session.menuFile",
"Session.MenuFile",
DEFAULTMENU));
style_file = bt::expandTilde(res.read("session.styleFile",
"Session.StyleFile",
DEFAULTSTYLE));
unsigned int maxcolors = res.read("session.maximumColors",
"Session.MaximumColors",
~0u);
if (maxcolors != ~0u)
bt::Image::setMaximumColors(maxcolors);
double_click_interval = res.read("session.doubleClickInterval",
"Session.DoubleClickInterval",
250l);
auto_raise_delay.tv_usec = res.read("session.autoRaiseDelay",
"Session.AutoRaiseDelay",
400l);
auto_raise_delay.tv_sec = auto_raise_delay.tv_usec / 1000;
auto_raise_delay.tv_usec -= (auto_raise_delay.tv_sec * 1000);
auto_raise_delay.tv_usec *= 1000;
bt::DitherMode dither_mode;
std::string str = res.read("session.imageDither",
"Session.ImageDither",
"OrderedDither");
if (!strcasecmp("ordered", str.c_str()) ||
!strcasecmp("fast", str.c_str()) ||
!strcasecmp("ordereddither", str.c_str()) ||
!strcasecmp("fastdither", str.c_str())) {
dither_mode = bt::OrderedDither;
} else if (!strcasecmp("floydsteinberg", str.c_str()) ||
!strcasecmp("quality", str.c_str()) ||
!strcasecmp("diffuse", str.c_str()) ||
!strcasecmp("floydsteinbergdither", str.c_str()) ||
!strcasecmp("qualitydither", str.c_str()) ||
!strcasecmp("diffusedither", str.c_str())) {
dither_mode = bt::FloydSteinbergDither;
} else if (!strcasecmp("no", str.c_str()) ||
!strcasecmp("nodither", str.c_str()) ||
!strcasecmp("off", str.c_str())) {
dither_mode = bt::NoDither;
} else {
dither_mode = bt::OrderedDither;
}
bt::Image::setDitherMode(dither_mode);
_cursors.pointer =
XCreateFontCursor(blackbox.XDisplay(), XC_left_ptr);
_cursors.move =
XCreateFontCursor(blackbox.XDisplay(), XC_fleur);
_cursors.resize_top_left =
XCreateFontCursor(blackbox.XDisplay(), XC_top_left_corner);
_cursors.resize_bottom_left =
XCreateFontCursor(blackbox.XDisplay(), XC_bottom_left_corner);
_cursors.resize_top_right =
XCreateFontCursor(blackbox.XDisplay(), XC_top_right_corner);
_cursors.resize_bottom_right =
XCreateFontCursor(blackbox.XDisplay(), XC_bottom_right_corner);
// window options
str = res.read("session.focusModel",
"Session.FocusModel",
res.read("session.screen0.focusModel",
"Session.Screen0.FocusModel",
"ClickToFocus"));
if (str.find("ClickToFocus") != std::string::npos) {
focus_model = ClickToFocusModel;
auto_raise = false;
click_raise = false;
} else {
focus_model = SloppyFocusModel;
auto_raise = (str.find("AutoRaise") != std::string::npos);
click_raise = (str.find("ClickRaise") != std::string::npos);
}
str = res.read("session.windowPlacement",
"Session.WindowPlacement",
res.read("session.screen0.windowPlacement",
"Session.Screen0.WindowPlacement",
"RowSmartPlacement"));
if (strcasecmp(str.c_str(), "ColSmartPlacement") == 0)
window_placement_policy = ColSmartPlacement;
else if (strcasecmp(str.c_str(), "CenterPlacement") == 0)
window_placement_policy = CenterPlacement;
else if (strcasecmp(str.c_str(), "CascadePlacement") == 0)
window_placement_policy = CascadePlacement;
else
window_placement_policy = RowSmartPlacement;
//.........这里部分代码省略.........
示例2: save
void BlackboxResource::save(Blackbox& blackbox) {
bt::Resource res;
{
if (bt::Resource(rc_file).read("session.cacheLife",
"Session.CacheLife",
-1) == -1) {
res.merge(rc_file);
} else {
// we are converting from 0.65.0 to 0.70.0, let's take the liberty
// of generating a brand new rc file to make sure we throw out
// undeeded entries
}
}
res.write("session.menuFile", menuFilename());
res.write("session.styleFile", styleFilename());
res.write("session.maximumColors", bt::Image::maximumColors());
res.write("session.doubleClickInterval", double_click_interval);
res.write("session.autoRaiseDelay", ((auto_raise_delay.tv_sec * 1000ul) +
(auto_raise_delay.tv_usec / 1000ul)));
std::string str;
switch (bt::Image::ditherMode()) {
case bt::OrderedDither: str = "OrderedDither"; break;
case bt::FloydSteinbergDither: str = "FloydSteinbergDither"; break;
default: str = "NoDither"; break;
}
res.write("session.imageDither", str);
// window options
switch (focus_model) {
case SloppyFocusModel:
default:
str = "SloppyFocus";
if (auto_raise)
str += " AutoRaise";
if (click_raise)
str += " ClickRaise";
break;
case ClickToFocusModel:
str = "ClickToFocus";
break;
}
res.write("session.focusModel", str);
switch (window_placement_policy) {
case CascadePlacement:
str = "CascadePlacement";
break;
case CenterPlacement:
str = "CenterPlacement";
break;
case ColSmartPlacement:
str = "ColSmartPlacement";
break;
case RowSmartPlacement:
default:
str = "RowSmartPlacement";
break;
}
res.write("session.windowPlacement", str);
res.write("session.rowPlacementDirection",
(row_direction == LeftRight)
? "LeftToRight"
: "RightToLeft");
res.write("session.colPlacementDirection",
(col_direction == TopBottom)
? "TopToBottom"
: "BottomToTop");
res.write("session.placementIgnoresShaded", ignore_shaded);
res.write("session.opaqueMove", opaque_move);
res.write("session.opaqueResize", opaque_resize);
res.write("session.fullMaximization", full_max);
res.write("session.focusNewWindows", focus_new_windows);
res.write("session.focusLastWindow", focus_last_window_on_workspace);
res.write("session.changeWorkspaceWithMouseWheel",
change_workspace_with_mouse_wheel);
res.write("session.shadeWindowWithMouseWheel",
shade_window_with_mouse_wheel);
res.write("session.toolbarActionsWithMouseWheel",
toolbar_actions_with_mouse_wheel);
res.write("session.disableBindingsWithScrollLock", allow_scroll_lock);
res.write("session.edgeSnapThreshold", edge_snap_threshold);
res.write("session.windowSnapThreshold", window_snap_threshold);
for (unsigned int i = 0; i < blackbox.screenCount(); ++i)
screen_resources[i].save(res, blackbox.screenNumber(i));
res.save(rc_file);
}