LOCAL void fb_openfont(WINDISPLAY *mod, struct TVRequest *req) { req->tvr_Op.OpenFont.Font = fb_hostopenfont(mod, req->tvr_Op.OpenFont.Tags); TDBPRINTF(TDB_INFO,("font opened: %p\n", req->tvr_Op.OpenFont.Font)); }
static TBOOL fb_initinstance(TAPTR task) { struct TExecBase *TExecBase = TGetExecBase(task); WINDISPLAY *mod = TGetTaskData(task); for (;;) { // TTAGITEM *opentags = mod->fbd_OpenTags; TTAGITEM ftags[3]; WNDCLASSEX wclass, pclass; mod->fbd_HInst = GetModuleHandle(NULL); if (mod->fbd_HInst == TNULL) break; wclass.cbSize = sizeof(wclass); wclass.style = 0; wclass.lpfnWndProc = win_wndproc; wclass.cbClsExtra = 0; wclass.cbWndExtra = 0; wclass.hInstance = mod->fbd_HInst; wclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); wclass.hCursor = LoadCursor(NULL, IDC_ARROW); wclass.hbrBackground = NULL; wclass.lpszMenuName = NULL; wclass.lpszClassName = FB_DISPLAY_CLASSNAME; wclass.hIconSm = NULL; mod->fbd_ClassAtom = RegisterClassEx(&wclass); if (mod->fbd_ClassAtom == 0) break; pclass.cbSize = sizeof(pclass); pclass.style = CS_NOCLOSE; pclass.lpfnWndProc = win_wndproc; pclass.cbClsExtra = 0; pclass.cbWndExtra = 0; pclass.hInstance = mod->fbd_HInst; pclass.hIcon = NULL; pclass.hCursor = LoadCursor(NULL, IDC_ARROW); pclass.hbrBackground = NULL; pclass.lpszMenuName = NULL; pclass.lpszClassName = FB_DISPLAY_CLASSNAME_POPUP; pclass.hIconSm = NULL; mod->fbd_ClassAtomPopup = RegisterClassEx(&pclass); if (mod->fbd_ClassAtomPopup == 0) break; /* Create invisible window for this device: */ mod->fbd_DeviceHWnd = CreateWindowEx(0, FB_DISPLAY_CLASSNAME, NULL, 0, 0, 0, 0, 0, (HWND) NULL, (HMENU) NULL, mod->fbd_HInst, (LPVOID) NULL); if (mod->fbd_DeviceHWnd == NULL) break; mod->fbd_DeviceHDC = GetDC(mod->fbd_DeviceHWnd); /* list of free input messages: */ TInitList(&mod->fbd_IMsgPool); /* list of all open visuals: */ TInitList(&mod->fbd_VisualList); /* init fontmanager and default font */ TInitList(&mod->fbd_FontManager.openfonts); ftags[0].tti_Tag = TVisual_FontName; ftags[0].tti_Value = (TTAG) FNT_DEFNAME; ftags[1].tti_Tag = TVisual_FontPxSize; ftags[1].tti_Value = (TTAG) FNT_DEFPXSIZE; ftags[2].tti_Tag = TTAG_DONE; mod->fbd_FontManager.deffont = fb_hostopenfont(mod, ftags); if (mod->fbd_FontManager.deffont == TNULL) break; TDBPRINTF(TDB_TRACE,("Instance init successful\n")); return TTRUE; } fb_exitinstance(mod); return TFALSE; }