static void WarpShapeDraw(EWin * ewin) { static ShapeWin *shape_win = NULL; int bl, br, bt, bb; if (!ewin) { ShapewinDestroy(shape_win); shape_win = NULL; return; } if (!shape_win) shape_win = ShapewinCreate(MR_BOX); if (!shape_win) return; EwinBorderGetSize(ewin, &bl, &br, &bt, &bb); ShapewinShapeSet(shape_win, MR_BOX, EoGetX(ewin), EoGetY(ewin), ewin->client.w, ewin->client.h, bl, br, bt, bb, 0); EoMap(shape_win, 0); }
static void _ShapeDrawNograb_tech_box(EWin * ewin, int md, int firstlast, int xn, int yn, int wn, int hn, int seqno) { ShapeData *psd = (ShapeData *) ewin->shape_data; if (firstlast == 0 && !psd->shwin) psd->shwin = ShapewinCreate(md); if (!psd->shwin) return; ShapewinShapeSet(psd->shwin, md, xn, yn, wn, hn, psd->bl, psd->br, psd->bt, psd->bb, seqno); EoMap(psd->shwin, 0); CoordsShow(ewin); if (firstlast == 2) { ShapewinDestroy(psd->shwin); psd->shwin = NULL; } }
static void WarpFocusWinShow(WarpFocusWin * fw) { WarplistItem *wi; EImageBorder *pad; EWin *ewin; int i, x, y, w, h, ww, hh; char s[1024], ss[32]; const char *fmt; w = 0; h = 0; pad = ImageclassGetPadding(fw->ic); for (i = 0; i < warplist_num; i++) { wi = warplist + i; wi->win = ECreateWindow(EoGetWin(fw), 0, 0, 1, 1, 0); EMapWindow(wi->win); ewin = wi->ewin; if (ewin->state.iconified) fmt = "%s[%s]"; else if (ewin->state.shaded) fmt = "%s=%s="; else fmt = "%s%s"; ss[0] = '\0'; if (Conf.warplist.showalldesks) { if (EoIsSticky(ewin) || ewin->state.iconified) strcpy(ss, "[-] "); else Esnprintf(ss, sizeof(ss), "[%d] ", EoGetDeskNum(ewin)); } Esnprintf(s, sizeof(s), fmt, ss, EwinGetTitle(ewin)); wi->txt = strdup(s); TextSize(fw->tc, 0, 0, 0, wi->txt, &ww, &hh, 17); if (ww > w) w = ww; if (hh > h) h = hh; } fw->tw = w; /* Text size */ fw->th = h; w += pad->left + pad->right; h += pad->top + pad->bottom; if (Conf.warplist.icon_mode != 0) { if (Conf.warplist.icon_mode != EWIN_ICON_MODE_APP_IMG && Conf.warplist.icon_mode != EWIN_ICON_MODE_IMG_APP) Conf.warplist.icon_mode = EWIN_ICON_MODE_APP_IMG; w += h; } fw->mw = w; /* Focus list item size */ fw->mh = h; /* Reset shape */ EShapeSetMask(EoGetWin(fw), 0, 0, None); ScreenGetAvailableAreaByPointer(&x, &y, &ww, &hh, Conf.place.ignore_struts); x += (ww - w) / 2; y += (hh - h * warplist_num) / 2; EoMoveResize(fw, x, y, w, h * warplist_num); for (i = 0; i < warplist_num; i++) EMoveResizeWindow(warplist[i].win, 0, (h * i), fw->mw, fw->mh); EoMap(fw, 0); /* * Grab the keyboard. The grab is automatically released when * WarpFocusHide unmaps warpFocusWindow. */ GrabKeyboardSet(EoGetWin(fw)); GrabPointerSet(EoGetWin(fw), None, 0); TooltipsEnable(0); }