CDropbox::CDropbox() { PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE }; pd.szName = MODULE; pd.type = PROTOTYPE_VIRTUAL; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); HookEventObj(ME_PROTO_ACK, OnProtoAck, this); HookEventObj(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown, this); HookEventObj(ME_SYSTEM_MODULESLOADED, OnModulesLoaded, this); hFileSentEventHook = CreateHookableEvent(ME_DROPBOX_SENT); CreateServiceFunctionObj(MS_DROPBOX_SEND_FILE, SendFileToDropbox, this); CreateProtoServiceFunction(MODULE, PS_GETCAPS, ProtoGetCaps); CreateProtoServiceFunctionObj(PSS_FILEW, ProtoSendFile, this); CreateProtoServiceFunctionObj(PSS_MESSAGE, ProtoSendMessage, this); CreateProtoServiceFunctionObj(PSR_MESSAGE, ProtoReceiveMessage, this); InitializeIcons(); InitializeMenus(); commands["help"] = CDropbox::CommandHelp; commands["content"] = CDropbox::CommandContent; commands["share"] = CDropbox::CommandShare; commands["delete"] = CDropbox::CommandDelete; hFileProcess = hMessageProcess = 1; hDefaultContact = hTransferContact = 0; }
//========================================================= // instantiate the proper game rules object //========================================================= void InstallGameRules() { InitializeMenus(); // teamplay CreateGameRulesObject( "CTeamFortress" ); }
CDropbox::CDropbox() : transfers(1, HandleKeySortT) { PROTOCOLDESCRIPTOR pd = { 0 }; pd.cbSize = sizeof(pd); pd.szName = MODULE; pd.type = PROTOTYPE_VIRTUAL; Proto_RegisterModule(&pd); HookEvent(ME_PROTO_ACK, OnProtoAck); HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown); HookEventObj(ME_SYSTEM_MODULESLOADED, GlobalEvent<&CDropbox::OnModulesLoaded>, this); hFileSentEventHook = CreateHookableEvent(ME_DROPBOX_SENT); CreateServiceFunctionObj(MS_DROPBOX_SEND_FILE, GlobalService<&CDropbox::SendFileToDropbox>, this); CreateProtoServiceFunction(MODULE, PS_GETCAPS, ProtoGetCaps); CreateProtoServiceFunction(MODULE, PS_GETNAME, ProtoGetName); CreateProtoServiceFunction(MODULE, PS_LOADICON, ProtoLoadIcon); CreateProtoServiceFunctionObj(PS_GETSTATUS, GlobalService<&CDropbox::ProtoGetStatus>, this); CreateProtoServiceFunctionObj(PSS_FILE, GlobalService<&CDropbox::ProtoSendFile>, this); CreateProtoServiceFunctionObj(PSS_FILECANCEL, GlobalService<&CDropbox::ProtoCancelFile>, this); CreateProtoServiceFunctionObj(PSS_MESSAGE, GlobalService<&CDropbox::ProtoSendMessage>, this); CreateProtoServiceFunction(MODULE, PSR_MESSAGE, ProtoReceiveMessage); InitializeMenus(); hFileProcess = hMessageProcess = 1; }
void CSiteGroupsTree::Initialize(CSiteCheckDlg::Hook & checkHook, CSiteList & siteList) { // Initialize settings XML::CXML params; WebWatch::Store::Instance().GetSiteGroupsTreeSettings(params); ASSERT(strcmp(params.GetTagName(), GetXMLName()) == 0); // Color initialization XML::CXML *colors = params.FindFirstChild(Colors::GetXMLName()); if (colors) m_colors.reset(new Colors(*colors)); else m_colors.reset(new Colors); // NOTE: SetTextColor() not really needed SetTextColor(m_colors->regular.color); // Rest of initialization... m_siteList = &siteList; m_siteListHook.reset(new SiteListHook(*this)); m_siteList->AttachHook(*m_siteListHook); m_checkHook = &checkHook; WebWatch::SiteItemGroup & defaultGroup = BuildTree(); SelectGroup(defaultGroup); InitializeMenus(); }
int glutCreateWindow (const char *title) { if(Initialized == 0) { int argc = 0; char *argv[] = {NULL}; glutInit(&argc, argv); } if(Context) return 0; if(DisplayMode & GLUT_INDEX) VarInfo.bits_per_pixel = 8; else if(VarInfo.bits_per_pixel == 8) VarInfo.bits_per_pixel = 32; if (DesiredDepth) VarInfo.bits_per_pixel = DesiredDepth; VarInfo.xoffset = 0; VarInfo.yoffset = 0; VarInfo.nonstd = 0; VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */ SetVideoMode(); CreateVisual(); CreateBuffer(); if(!(Context = glFBDevCreateContext(Visual, NULL))) { sprintf(exiterror, "Failure to create Context\n"); exit(0); } if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { sprintf(exiterror, "Failure to Make Current\n"); exit(0); } InitializeCursor(); InitializeMenus(); glutSetWindowTitle(title); signal(SIGWINCH, SignalWinch); Visible = 1; VisibleSwitch = 1; Redisplay = 1; return 1; }
void MainFrame::InitializeFrame(){ _frameManager.SetFrame(this); #ifdef __WXMSW_ _frameManager.SetFlags(_frameManager.GetFlags() ^ wxAUI_MGR_TRANSPARENT_DRAG); #else //workaround for bug //http://trac.wxwidgets.org/ticket/4841 _frameManager.SetFlags(wxAUI_MGR_ALLOW_FLOATING | wxAUI_MGR_NO_VENETIAN_BLINDS_FADE | wxAUI_MGR_RECTANGLE_HINT ); #endif CreateStatusBar(3); InitializeComponents(); InitializeMenus(); LoadInitialPerspective(); InitDragDrop(); }
void glutMainLoop(void) { int idleiters; if(ReshapeFunc) ReshapeFunc(VarInfo.xres, VarInfo.yres); if(!DisplayFunc) { sprintf(exiterror, "Fatal Error: No Display Function registered\n"); exit(0); } for(;;) { ProcessTimers(); if(Active) ReceiveInput(); else if(VisiblePoll) TestVisible(); if(IdleFunc) IdleFunc(); if(VisibleSwitch) { VisibleSwitch = 0; if(VisibilityFunc) VisibilityFunc(Visible ? GLUT_VISIBLE : GLUT_NOT_VISIBLE); } if(Resized) { SetVideoMode(); CreateBuffer(); if(!glFBDevMakeCurrent( Context, Buffer, Buffer )) { sprintf(exiterror, "Failure to Make Current\n"); exit(0); } InitializeMenus(); if(ReshapeFunc) ReshapeFunc(VarInfo.xres, VarInfo.yres); Redisplay = 1; Resized = 0; } if(Visible && Redisplay) { Redisplay = 0; EraseCursor(); DisplayFunc(); if(!(DisplayMode & GLUT_DOUBLE)) { if(ActiveMenu) DrawMenus(); DrawCursor(); } idleiters = 0; } else { /* we sleep if not receiving redisplays, and the main loop is running faster than 2khz */ static int lasttime; int time = glutGet(GLUT_ELAPSED_TIME); if(time > lasttime) { if(idleiters >= 2) usleep(100); idleiters = 0; lasttime = time; } idleiters++; } } }