36#include "functions_defs.h"
75 if(
Scr->NoIconManagers) {
86 if(
Scr->use3Diconmanagers) {
99 ws =
Scr->workSpaceMgr.workSpaceList;
111 if(!
p->geometry || !strlen(
p->geometry)) {
112 p->geometry =
"+0+0";
116 (
unsigned int *) &
p->width, (
unsigned int *)&
p->height);
119 (
Scr->ThreeDBorderWidth ?
Scr->ThreeDBorderWidth :
Scr->BorderWidth);
122 gx +=
Scr->rootw -
p->width - 2 *
bw;
129 gy +=
Scr->rooth -
p->height - 2 *
bw;
143 gx,
gy,
p->width,
p->height, 1,
156 icon_name =
strdup(
p->icon_name);
159 asprintf(&icon_name,
"%s Icons",
p->name);
163 wmhints.input =
True;
167 clhints.res_class =
"TwmIconManager";
182 p->twm_win->occupation = 1 <<
ws->number;
186 if(
ws->number !=
Scr->currentvs->wsw->currentwspc->number) {
187 p->twm_win->vs =
NULL;
191 p->twm_win->occupation = 1;
196 "CreateIconManagers: IconMgr %p: twm_win=%p win=0x%lx "
197 "name='%s' x=%d y=%d w=%d h=%d occupation=%x\n",
198 p,
p->twm_win,
p->twm_win->w,
p->name,
199 gx,
gy,
p->width,
p->height,
p->twm_win->occupation);
210 p->twm_win->mapped =
false;
212 if(
p->twm_win && (
p->twm_win->wmhints->initial_state ==
IconicState)) {
213 p->twm_win->isicon =
true;
215 else if(!
Scr->NoIconManagers &&
Scr->ShowIconManager) {
216 p->twm_win->isicon =
false;
219 p->twm_win->isicon =
true;
227 if(
Scr->workSpaceManagerActive) {
228 Scr->workSpaceMgr.workSpaceList->iconmgr =
Scr->iconmgr;
273 fprintf(
stderr,
" name=\"%s\" icon_name=\"%s\", geom=\"%s\", col=%d\n",
274 name, icon_name,
geom, columns);
277 if(
Scr->NoIconManagers) {
286 p->icon_name = icon_name;
288 p->columns = columns;
295 Scr->iconmgr->lasti =
p;
298 Scr->iconmgr->lasti->next =
p;
299 p->prev =
Scr->iconmgr->lasti;
300 Scr->iconmgr->lasti =
p;
322 if(!
Scr->workSpaceManagerActive) {
327 ws =
Scr->workSpaceMgr.workSpaceList;
344 ws->iconmgr->nextv =
NULL;
493 "%s: unable to find window (%d, %d) in icon manager\n",
503 if(
ip->twm_win->mapped) {
508 if(
tmp->twm->title_height) {
509 int tbx =
Scr->TBInfo.titlex;
510 int x =
tmp->twm->highlightxr;
513 Scr->TitleHeight / 4);
571 if(
tmp->twm->mapped) {
581 fprintf(
stderr,
"%s: unable to find open window in icon manager\n",
591 if(
ip->twm_win->mapped) {
596 if(
tmp->twm->title_height) {
598 tmp->twm->title_width / 2,
599 Scr->TitleHeight / 4);
633#define ITER(i) (dir == F_NEXTICONMGR ? (i)->next : (i)->prev)
634#define IPOFSP(sp) (dir == F_NEXTICONMGR ? sp->iconmgr : sp->iconmgr->lasti)
635#define TEST(ip) if ((ip)->count != 0 && (ip)->twm_win->mapped) \
636 { got_it = true; break; }
651 else if(screen < 0) {
704 ||
tmp_win->w ==
Scr->workSpaceMgr.occupyWindow->w) {
709 if(
Scr->NoIconManagers) {
717 if(
Scr->IconManagerDontShow
725 if(
Scr->workSpaceManagerActive) {
726 ip =
Scr->workSpaceMgr.workSpaceList->iconmgr;
742 if((
tmp_win->occupation &
ip->twm_win->occupation) == 0) {
756 tmp->cp.fore =
Scr->IconManagerC.fore;
757 tmp->cp.back =
Scr->IconManagerC.back;
758 tmp->highlight =
Scr->IconManagerHighlight;
773 if(
Scr->use3Diconmanagers) {
774 if(!
Scr->BeNiceToColormap) {
781 h =
Scr->IconManagerFont.avg_height
787 ip->height = h *
ip->count;
801 if(
Scr->IconManagerFocus) {
832 if(
Scr->WindowMask) {
842 if(!
ip->twm_win->isicon) {
848 ip->twm_win->mapped =
true;
888 return tmp_win->iconmanagerlist;
916 else if(
Scr->SortIconMgr) {
919 if(
Scr->CaseSensitive) {
942 ip->last->next =
tmp;
943 tmp->prev =
ip->last;
951 ip->first =
tmp->next;
954 tmp->prev->next =
tmp->next;
958 ip->last =
tmp->prev;
961 tmp->next->prev =
tmp->prev;
996 if((
tmp_win->occupation &
ip->twm_win->occupation) != 0) {
1013 if(
ip->count == 0) {
1015 ip->twm_win->mapped =
false;
1052 if(
Scr->use3Diconmanagers) {
1054 Scr->IconManagerShadowDepth,
tmp->cp,
1064 (
tmp->active &&
Scr->Highlight
1065 ?
tmp->highlight :
tmp->cp.back));
1102 if(
Scr->CaseSensitive) {
1136 for(twm_win =
Scr->FirstWindow; twm_win !=
NULL; twm_win = twm_win->
next) {
1151 wheight =
Scr->IconManagerFont.avg_height
1167 if(++col >=
ip->columns) {
1180 tmp->width != wwidth ||
tmp->height != wheight) {
1182 if(
tmp->height != wheight)
1190 tmp->width = wwidth;
1191 tmp->height = wheight;
1199 if(
ip->height == 0) {
1212 ip->twm_win->frame_x +=
ip->twm_win->frame_width -
newwidth -
1213 2 *
ip->twm_win->frame_bw3D;
1216 ip->twm_win->frame_y +=
ip->twm_win->frame_height -
ip->height -
1217 2 *
ip->twm_win->frame_bw3D -
ip->twm_win->title_height;
1222 ip->twm_win->frame_x,
ip->twm_win->frame_y,
1224 ip->height +
ip->twm_win->title_height + 2 *
ip->twm_win->frame_bw3D, -1);
1235 fprintf(
stderr,
"next = %p, prev = %p, lasti = %p, nextv = %p\n",
1264 ((
Scr->use3Diconmanagers && (
Scr->Monochrome !=
COLOR)) ?
1268 Scr->IconManagerFont.font_set,
1298 if(
Scr->use3Diconmanagers && iconmanagerlist->
iconifypm) {
1300 iconmanagerlist->
icon,
1301 Scr->NormalGC, 0, 0,
1307 Scr->NormalGC, 0, 0,
void GrabButtons(TwmWindow *tmp_win)
void GrabKeys(TwmWindow *tmp_win)
TwmWindow * AddWindow(Window w, AWType wtype, IconMgr *iconp, VirtualScreen *vs)
#define FB(fix_fore, fix_back)
int NumScreens
How many Screens are on our display.
ScreenInfo ** ScreenList
List of ScreenInfo structs for each Screen.
void Draw3DBorder(Window w, int x, int y, int width, int height, int bw, ColorPair cp, ButtonState state, bool fill, bool forcebw)
void NotActiveIconManager(WList *active)
IconMgr * AllocateIconManager(char *name, char *icon_name, char *geom, int columns)
void JumpIconManager(int dir)
void PackIconManagers(void)
void AllocateOtherIconManagers(void)
void MoveIconManager(int dir)
void DrawIconManagerBorder(WList *tmp, bool fill)
void CreateIconManagers(void)
void RemoveIconManager(TwmWindow *tmp_win)
void ActiveIconManager(WList *active)
void InsertInIconManager(IconMgr *ip, WList *tmp, TwmWindow *tmp_win)
void RemoveFromIconManager(IconMgr *ip, WList *tmp)
void dump_iconmanager(IconMgr *mgr, char *label)
void ShowIconifiedIcon(TwmWindow *tmp_win)
void CurrentIconManagerEntry(WList *current)
void DrawIconManagerIconName(TwmWindow *tmp_win)
void SortIconManager(IconMgr *ip)
WList * AddIconManager(TwmWindow *tmp_win)
void MoveMappedIconManager(int dir)
void PackIconManager(IconMgr *ip)
const unsigned int im_iconified_icon_width
Pixmap Create2DIconManagerIcon(void)
Pixmap Create3DIconManagerIcon(ColorPair cp)
const unsigned int im_iconified_icon_height
bool GetColorFromList(name_list *list_head, char *name, XClassHint *class, Pixel *ptr)
void * LookInList(name_list *list_head, const char *name, XClassHint *class)
void OtpRaise(TwmWindow *twm_win, WinType wintype)
struct IconMgr * nextv
Next workspace's icon manager head.
struct IconMgr * next
Next iconmgr in this workspace.
Info and control for each X Screen we control.
Info and control for every X Window we take over.
struct TwmWindow * next
Next TwmWindow on the Screen.
struct IconMgr * iconmgrp
Pointer to the icon manager structure, for windows that are icon managers.
bool UpdateFont(MyFont *font, int height)
Try adjusting a font's height.
void GetShadeColors(ColorPair *cp)
Try and create a 'shaded' version of a color for prettier UI.
void SetupWindow(TwmWindow *tmp_win, int x, int y, int w, int h, int bw)
bool visible(const TwmWindow *tmp_win)
void SetMapStateProp(TwmWindow *tmp_win, int state)
int RLayoutXParseGeometry(RLayout *layout, const char *geometry, int *x, int *y, unsigned int *width, unsigned int *height)
Parse an X Geometry out to get the positions and sizes.