void XlibMenuInit(XlibMenu* menu) { FcitxXlibWindow* window = (FcitxXlibWindow*) menu; FcitxClassicUI* classicui = window->owner; FcitxSkin *sc = &classicui->skin; FcitxXlibWindowInit(&menu->parent, MENU_WINDOW_WIDTH, MENU_WINDOW_HEIGHT, 0, 0, "Fcitx Menu Window", FCITX_WINDOW_MENU, &menu->parent.owner->skin.skinMenu.background, KeyPressMask | ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | LeaveWindowMask, XlibMenuMoveWindow, XlibMenuCalculateContentSize, XlibMenuPaint ); int dpi = sc->skinFont.respectDPI? classicui->dpi: 0; FcitxCairoTextContext* ctc = FcitxCairoTextContextCreate(NULL); FcitxCairoTextContextSet(ctc, classicui->menuFont, sc->skinFont.menuFontSize, dpi); menu->fontheight = FcitxCairoTextContextFontHeight(ctc); FcitxCairoTextContextFree(ctc); }
void InputWindowInit(InputWindow* inputWindow) { FcitxXlibWindow* window = &inputWindow->parent; FcitxXlibWindowInit(window, INPUTWND_WIDTH, INPUTWND_HEIGHT, 0, 0, "Fcitx Input Window", FCITX_WINDOW_DOCK, &window->owner->skin.skinInputBar.background, ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ExposureMask | LeaveWindowMask, InputWindowMoveWindow, InputWindowCalculateContentSize, InputWindowPaint ); inputWindow->iOffsetX = 0; inputWindow->iOffsetY = 8; }