BOOL InitApplication (HINSTANCE hInstance, char* szAppName) { WNDCLASS wndclass; InitClass (&wndclass, hInstance, szAppName); return RegisterClass (&wndclass); }
CustomFrameView::CustomFrameView(Widget* frame) : close_button_(new ImageButton(this)), restore_button_(new ImageButton(this)), maximize_button_(new ImageButton(this)), minimize_button_(new ImageButton(this)), window_icon_(NULL), should_show_minmax_buttons_(false), should_show_client_edge_(false), frame_(frame) { InitClass(); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); close_button_->SetAccessibleName( ui::GetStringUTF16(IDS_APP_ACCNAME_CLOSE)); // Close button images will be set in LayoutWindowControls(). AddChildView(close_button_); restore_button_->SetAccessibleName( ui::GetStringUTF16(IDS_APP_ACCNAME_RESTORE)); restore_button_->SetImage(CustomButton::BS_NORMAL, rb.GetBitmapNamed(IDR_RESTORE)); restore_button_->SetImage(CustomButton::BS_HOT, rb.GetBitmapNamed(IDR_RESTORE_H)); restore_button_->SetImage(CustomButton::BS_PUSHED, rb.GetBitmapNamed(IDR_RESTORE_P)); AddChildView(restore_button_); maximize_button_->SetAccessibleName( ui::GetStringUTF16(IDS_APP_ACCNAME_MAXIMIZE)); maximize_button_->SetImage(CustomButton::BS_NORMAL, rb.GetBitmapNamed(IDR_MAXIMIZE)); maximize_button_->SetImage(CustomButton::BS_HOT, rb.GetBitmapNamed(IDR_MAXIMIZE_H)); maximize_button_->SetImage(CustomButton::BS_PUSHED, rb.GetBitmapNamed(IDR_MAXIMIZE_P)); AddChildView(maximize_button_); minimize_button_->SetAccessibleName( ui::GetStringUTF16(IDS_APP_ACCNAME_MINIMIZE)); minimize_button_->SetImage(CustomButton::BS_NORMAL, rb.GetBitmapNamed(IDR_MINIMIZE)); minimize_button_->SetImage(CustomButton::BS_HOT, rb.GetBitmapNamed(IDR_MINIMIZE_H)); minimize_button_->SetImage(CustomButton::BS_PUSHED, rb.GetBitmapNamed(IDR_MINIMIZE_P)); AddChildView(minimize_button_); should_show_minmax_buttons_ = frame_->widget_delegate()->CanMaximize(); should_show_client_edge_ = frame_->widget_delegate()->ShouldShowClientEdge(); if(frame_->widget_delegate()->ShouldShowWindowIcon()) { window_icon_ = new ImageButton(this); AddChildView(window_icon_); } }
Shape::Shape(HString name): _name(name), _verticesCount(0), _indicesCount(0), _vertices(nullptr), _indices(nullptr) { InitClass(); };
BOOL InitApplication (HINSTANCE hInstance, char* szAppName, char*szChildName) { WNDCLASS wndclass, childwndclass; InitClass (&wndclass, hInstance, szAppName); InitChildClass (&childwndclass, hInstance, szChildName); return (RegisterClass (&wndclass) && RegisterClass (&childwndclass)); }
bool Class::SetValue(std::string sValue, std::string sClassname, std::string sMembername, void* pInstance) { InitClass(sClassname); std::map<std::string, Members>::iterator it = GetInstanceMap().find(sClassname); if (it == GetInstanceMap().end()) return false; return (*it).second.SetValue(sValue, sMembername, pInstance); }
bool Class::GetMembers(std::string sBaseClass, Members& oMembers) { InitClass(sBaseClass); std::map<std::string, Members>::iterator it = GetInstanceMap().find(sBaseClass); if (it == GetInstanceMap().end()) return false; oMembers = (*it).second; return true; }
std::string Class::GetValue(std::string sClassname, std::string sMembername, void* pInstance) { InitClass(sClassname); std::map<std::string, Members>::iterator it = GetInstanceMap().find(sClassname); if (it == GetInstanceMap().end()) return std::string(); // return empty value! return (*it).second.GetValue(sMembername, pInstance); }
DialogClientView::DialogClientView(Widget* owner, View* contents_view) : ClientView(owner, contents_view), ok_button_(NULL), cancel_button_(NULL), default_button_(NULL), extra_view_(NULL), size_extra_view_height_to_buttons_(false), notified_delegate_(false), listening_to_focus_(false), saved_focus_manager_(NULL), bottom_view_(NULL) { InitClass(); }
/* * Class: sun_java2d_SurfaceData * Method: initIDs * Signature: ()V */ JNIEXPORT void JNICALL Java_sun_java2d_SurfaceData_initIDs(JNIEnv *env, jclass sd) { jclass pICMClass; InitGlobalClassRef(pInvalidPipeClass, env, "sun/java2d/InvalidPipeException"); InitGlobalClassRef(pNullSurfaceDataClass, env, "sun/java2d/NullSurfaceData"); InitField(pDataID, env, sd, "pData", "J"); InitField(validID, env, sd, "valid", "Z"); InitClass(pICMClass, env, "java/awt/image/IndexColorModel"); InitField(allGrayID, env, pICMClass, "allgrayopaque", "Z"); }
bool Class::GetVariable(std::string sBaseClass, std::string sMember, Variable& outVar) { InitClass(sBaseClass); std::map<std::string, Members>::iterator it = GetInstanceMap().find(sBaseClass); if (it == GetInstanceMap().end()) return false; Members& oMembers = (*it).second; std::list< std::pair<std::string, Access::Variable> >::iterator varit = _FindVariable(oMembers.GetVariableMap(),sMember); if (varit == oMembers.GetVariableMap().end()) return false; outVar = (*varit).second; return true; }
CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto): m_pItems(3, CJabberInfoFrameItem::cmp), m_compact(false) { m_proto = proto; m_clickedItem = -1; InitClass(); CLISTFrame frame = { sizeof(frame) }; HWND hwndClist = pcli->hwndContactList; frame.hWnd = CreateWindowEx(0, _T("JabberInfoFrameClass"), NULL, WS_CHILD|WS_VISIBLE, 0, 0, 100, 100, hwndClist, NULL, hInst, this); frame.align = alBottom; frame.height = 2 * SZ_FRAMEPADDING + GetSystemMetrics(SM_CYSMICON) + SZ_LINEPADDING; // compact height by default frame.Flags = F_VISIBLE|F_LOCKED|F_NOBORDER|F_TCHAR; frame.tname = mir_a2t(proto->m_szModuleName); frame.TBtname = proto->m_tszUserName; m_frameId = CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0); mir_free(frame.tname); if (m_frameId == -1) { DestroyWindow(frame.hWnd); return; } m_hhkFontsChanged = HookEventMessage(ME_FONT_RELOAD, m_hwnd, WM_APP); ReloadFonts(); m_hwndToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, m_hwnd, NULL, hInst, NULL); SetWindowPos(m_hwndToolTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); CreateInfoItem("$", true); UpdateInfoItem("$", proto->GetIconHandle(IDI_JABBER), proto->m_tszUserName); CreateInfoItem("$/JID", true); UpdateInfoItem("$/JID", Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS), _T("Offline")); SetInfoItemCallback("$/JID", &CJabberProto::InfoFrame_OnSetup); }
void Class::ToXML(std::ostream& stream, std::string sClassname, void* pInstance, bool bHeader) { InitClass(sClassname); std::map<std::string, Members>::iterator it = GetInstanceMap().find(sClassname); if (it == GetInstanceMap().end()) return; std::string sRet; sRet += (*it).second.ToXML(pInstance); if (bHeader) { stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << "\n"; stream << "<!-- Created by i3D OpenWebGlobe XML Serializer Version 2.1 -->\n"; } stream << sRet; }
/* Init function called when window application starts. Inits instance and * application together, since in Win32 they're essentially the same. * * Function then goes into a loop handling user interface messages. Most are * used to handle redrawing the icon. */ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, char *lpCmdLine, int nCmdShow) { MSG msg; int i; afsd_SetUnhandledExceptionFilter(); #ifdef _DEBUG afsd_DbgBreakAllocInit(); _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF /* | _CRTDBG_CHECK_ALWAYS_DF */ | _CRTDBG_CHECK_CRT_DF | _CRTDBG_DELAY_FREE_MEM_DF ); if (lpCmdLine) { char *allocRequest = strtok(lpCmdLine, " \t"); while (allocRequest) { afsd_DbgBreakAdd(atoi(allocRequest)); allocRequest = strtok(NULL, " \t"); } } #endif if (!InitClass(hInstance)) return (FALSE); if (!InitInstance(hInstance, nCmdShow)) return (FALSE); while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return (msg.wParam); }
void MainServer() { InitInterfaceLocks(); InitInterface(); /* starts a thread with the window */ WrapInit(); InitMemory(); /* memory needs channels in general, but need to start before config, so just be careful. */ InitConfig(); LoadConfig(); /* must be nearly first since channels use it */ InitDebug(); InitChannelBuffer(); OpenDefaultChannels(); lprintf("Starting %s\n",BlakServLongVersionString()); InitClass(); InitMessage(); InitObject(); InitList(); InitTimer(); InitSession(); InitResource(); InitRoomData(); InitString(); InitUser(); InitAccount(); InitNameID(); InitDLlist(); InitSysTimer(); InitMotd(); InitLoadBof(); InitTime(); InitGameLock(); InitBkodInterpret(); InitBufferPool(); InitTable(); AddBuiltInDLlist(); LoadMotd(); LoadBof(); LoadRsc(); LoadKodbase(); LoadAdminConstants(); PauseTimers(); if (LoadAll() == True) { /* this loaded_game_msg tells it to disconnect all blakod info about sessions, * that were logged on when we saved */ SendTopLevelBlakodMessage(GetSystemObjectID(),LOADED_GAME_MSG,0,NULL); DoneLoadAccounts(); } /* these must be after LoadAll and ClearList */ InitCommCli(); InitParseClient(); InitProfiling(); InitAsyncConnections(); UpdateSecurityRedbook(); UnpauseTimers(); ServiceTimers(); /* returns if server termiated */ MainExitServer(); WrapShutdown(); }
inline void Binder::CheckInit(MethodTable *pMT) { if (!pMT->IsClassInited()) InitClass(pMT); }
int KGWin32App::Init(HINSTANCE hInstance, LPCSTR szAppName, int nIcon) { int nRetCode = false; int nResult = false; BOOL bInitClass = FALSE; BOOL bInitWindow = FALSE; BOOL bInit = FALSE; m_nIcon = nIcon; m_hInstance = hInstance; strncpy_s(m_szTitle, szAppName, _TRUNCATE); strncpy_s(m_szClass, szAppName, _TRUNCATE); strncat_s(m_szClass, "_Class", _TRUNCATE); m_Events[EVENT_TIMER] = CreateWaitableTimer(NULL, FALSE, NULL); m_Events[EVENT_RENDER] = CreateEvent(NULL, FALSE, FALSE, NULL); nRetCode = InitClass(); KGLOG_PROCESS_ERROR(nRetCode); bInitClass = TRUE; nRetCode = InitWindow(); KGLOG_PROCESS_ERROR(nRetCode); bInitWindow = TRUE; nRetCode = OnInit(); KGLOG_PROCESS_ERROR(nRetCode); bInit = TRUE; nResult = true; Exit0: if (!nResult) { if (bInit) { OnExit(); } if (bInitWindow) { nRetCode = DestroyWindow(m_hWnd); KGLOG_CHECK_ERROR(nRetCode); m_hWnd = NULL; } if (bInitClass) { ExitClass(); } for (int nIndex = 0; nIndex < EVENT_TOTAL; ++nIndex) { if (m_Events[nIndex]) { CloseHandle(m_Events[nIndex]); m_Events[nIndex] = NULL; } } m_hInstance = NULL; m_szTitle[0] = '\0'; } return nResult; }