当前位置: 首页>>代码示例>>C++>>正文


C++ MessageManager::open方法代码示例

本文整理汇总了C++中MessageManager::open方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageManager::open方法的具体用法?C++ MessageManager::open怎么用?C++ MessageManager::open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MessageManager的用法示例。


在下文中一共展示了MessageManager::open方法的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;
}
开发者ID:KrisLee,项目名称:N900-3d-desktop,代码行数:101,代码来源:3ddesk.cpp


注:本文中的MessageManager::open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。