本文整理汇总了C++中MessageManager::send方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageManager::send方法的具体用法?C++ MessageManager::send怎么用?C++ MessageManager::send使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageManager
的用法示例。
在下文中一共展示了MessageManager::send方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
break;
case 11: // 'gotorow'
msgmgr.msg.goto_row = atoi (optarg);
if (msgmgr.msg.goto_row < 1)
usage_and_bye();
break;
case 12: // 'view'
strcpy(msgmgr.msg.view, optarg);
break;
case 13: // 'zoom'
msgmgr.msg.zoom = 1;
break;
case 14: // 'reload'
msgmgr.msg.reload = 1;
break;
case 15: // 'changespeed'
tmp = atof(optarg);
if (tmp >= 1.0 && tmp <= 300.0) {
msgmgr.msg.face_change_steps = tmp;
}
break;
case 16: // 'zoomspeed'
tmp = atof(optarg);
if (tmp >= 1.0 && tmp <= 300.0) {
msgmgr.msg.zoom_steps = tmp;
}
break;
case 17: // 'dontexit'
msgmgr.msg.disable_exit_after_goto = 1;
break;
case 18: // 'noautofun'
msgmgr.msg.disable_random_fun = 1;
break;
case 19: // 'revmousewheel'
msgmgr.msg.reverse_mousewheel = 1;
break;
case 20: // 'swapmousebuttons'
msgmgr.msg.swap_mousebuttons = 1;
break;
case 21: // 'altmousebuttons'
msgmgr.msg.alt_mousebuttons = 1;
break;
case 22: // 'justswitch'
msgmgr.msg.mtype = MTYPE_JUSTSWITCH;
break;
case 23: // 'version'
printf("3ddesktop %s (3ddesk client)\nWritten by Brad Wasson.\n\nCopyright (C) 2002 - 2005 Brad Wasson.\n"
"This is free software; see the source for copying conditions. There is NO\n"
"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
"This binary compiled %s %s.\n\n",
VERSION, __DATE__, __TIME__);
exit(0);
break;
}
break;
case 'v':
verbose = 1;
break;
default:
usage_and_bye();
break;
}
}
if (msgmgr.open() < 0 || !server_running()) {
if (msgmgr.msg.mtype == MTYPE_STOP) {
// already stopped...
fprintf(stderr, "Server not running.\n");
exit (1);
}
fprintf(stderr, "Attempting to start 3ddesktop server.\n");
if (start_daemon() < 0) {
fprintf(stderr, "Could not start server.\n"
"Try starting manually (3ddeskd)\n\n");
exit(1);
}
if (wait_for_server_to_start() == 0) {
if (msgmgr.open() < 0) {
fprintf(stderr, "Can't get message queue: %s\n", strerror(errno));
fprintf(stderr, "Maybe 3ddeskd server not started?\n");
exit (1);
}
} else {
fprintf(stderr, "Could not find server.\n"
"Try starting manually (3ddeskd)\n\n");
exit (1);
}
}
if (msgmgr.send() < 0) {
fprintf(stderr, "Failed to send server a message\n");
exit (1);
}
return 0;
}