diff -rc fvwm-2.0.43/Fvwm.tmpl fvwm.patched/Fvwm.tmpl *** fvwm-2.0.43/Fvwm.tmpl Thu Jun 27 07:57:21 1996 --- fvwm.patched/Fvwm.tmpl Sun Sep 22 11:06:08 1996 *************** *** 164,170 **** * ***************************************************************************/ ! OPTION_DEFINES = -DSHAPE -DPIXMAP_BUTTONS --- 164,170 ---- * ***************************************************************************/ ! OPTION_DEFINES = -DSHAPE -DPIXMAP_BUTTONS -DMINI_ICONS diff -rc fvwm-2.0.43/fvwm/add_window.c fvwm.patched/fvwm/add_window.c *** fvwm-2.0.43/fvwm/add_window.c Thu Apr 11 08:25:58 1996 --- fvwm.patched/fvwm/add_window.c Sat Sep 21 22:03:29 1996 *************** *** 65,70 **** --- 65,72 ---- {"-xrm", NULL, XrmoptionResArg, (caddr_t) NULL}, }; + extern char *IconPath, *PixmapPath; + /*********************************************************************** * * Procedure: *************** *** 85,91 **** XSetWindowAttributes attributes; /* attributes for create windows */ int i,width,height; int a,b; ! char *value; unsigned long tflag; int Desk, border_width, resize_width; extern Bool NeedToResizeToo; --- 87,93 ---- XSetWindowAttributes attributes; /* attributes for create windows */ int i,width,height; int a,b; ! char *value, *mini_value; unsigned long tflag; int Desk, border_width, resize_width; extern Bool NeedToResizeToo; *************** *** 109,114 **** --- 111,120 ---- tmp_win->w = w; tmp_win->cmap_windows = (Window *)NULL; + #ifdef MINI_ICONS + tmp_win->mini_pixmap_file = NULL; + tmp_win->mini_icon = NULL; + #endif if(!PPosOverride) if (XGetGeometry(dpy, tmp_win->w, &JunkRoot, &JunkX, &JunkY, *************** *** 177,183 **** tmp_win->flags |= TITLE; tmp_win->title_height = Scr.TitleHeight + tmp_win->bw; ! tflag = LookInList(Scr.TheList,tmp_win->name,&tmp_win->class, &value, &Desk, &border_width, &resize_width, &forecolor,&backcolor,&tmp_win->buttons, tmp_win->IconBox,&(tmp_win->BoxFillMethod)); --- 183,193 ---- tmp_win->flags |= TITLE; tmp_win->title_height = Scr.TitleHeight + tmp_win->bw; ! tflag = LookInList(Scr.TheList,tmp_win->name,&tmp_win->class, &value, ! #ifdef MINI_ICONS ! &mini_value, ! #endif ! &Desk, &border_width, &resize_width, &forecolor,&backcolor,&tmp_win->buttons, tmp_win->IconBox,&(tmp_win->BoxFillMethod)); *************** *** 206,211 **** --- 216,230 ---- tmp_win->icon_bitmap_file = Scr.DefaultIcon; } + #ifdef MINI_ICONS + if (tflag & MINIICON_FLAG) { + tmp_win->mini_pixmap_file = mini_value; + } + else { + tmp_win->mini_pixmap_file = NULL; + } + #endif + GetWindowSizeHints (tmp_win); /* Tentative size estimate */ *************** *** 406,411 **** --- 425,440 ---- else tmp_win->right_w[i] = None; } + #ifdef MINI_ICONS + if (tmp_win->mini_pixmap_file) { + tmp_win->mini_icon = CachePicture (dpy, Scr.Root, + IconPath, PixmapPath, + tmp_win->mini_pixmap_file); + } + else { + tmp_win->mini_icon = NULL; + } + #endif } if(tmp_win->flags & BORDER) *************** *** 521,526 **** --- 550,565 ---- (unsigned long)tmp_win,tmp_win->class.res_class); BroadcastName(M_RES_NAME,tmp_win->w,tmp_win->frame, (unsigned long)tmp_win,tmp_win->class.res_name); + #ifdef MINI_ICONS + if (tmp_win->mini_icon != NULL) + Broadcast(M_MINI_ICON, 6, + tmp_win->w, /* Watch Out ! : I reduced the set of infos... */ + tmp_win->mini_icon->picture, + tmp_win->mini_icon->mask, + tmp_win->mini_icon->width, + tmp_win->mini_icon->height, + tmp_win->mini_icon->depth, 0); + #endif FetchWmProtocols (tmp_win); FetchWmColormapWindows (tmp_win); *************** *** 800,813 **** * ***********************************************************************/ unsigned long LookInList(name_list *list, char *name, XClassHint *class, ! char **value, int *Desk, int *border_width, int *resize_width, char **forecolor, char **backcolor, ! unsigned long * buttons, int *IconBox, int *BoxFillMethod) { name_list *nptr; unsigned long retval = 0; *value = NULL; *forecolor = NULL; *backcolor = NULL; *Desk = 0; --- 839,861 ---- * ***********************************************************************/ unsigned long LookInList(name_list *list, char *name, XClassHint *class, ! char **value, ! #ifdef MINI_ICONS ! char **mini_value, ! #endif ! int *Desk, ! int *border_width, int *resize_width, char **forecolor, char **backcolor, ! unsigned long * buttons, int *IconBox, ! int *BoxFillMethod) { name_list *nptr; unsigned long retval = 0; *value = NULL; + #ifdef MINI_ICONS + *mini_value = NULL; + #endif *forecolor = NULL; *backcolor = NULL; *Desk = 0; *************** *** 829,834 **** --- 877,885 ---- if (matchWildcards(nptr->name,class->res_class) == TRUE) { if(nptr->value != NULL)*value = nptr->value; + #ifdef MINI_ICONS + if(nptr->mini_value != NULL) *mini_value = nptr->mini_value; + #endif if(nptr->off_flags & STARTSONDESK_FLAG) *Desk = nptr->Desk; if(nptr->off_flags & BW_FLAG) *************** *** 858,863 **** --- 909,917 ---- if (matchWildcards(nptr->name,class->res_name) == TRUE) { if(nptr->value != NULL)*value = nptr->value; + #ifdef MINI_ICONS + if(nptr->mini_value != NULL) *mini_value = nptr->mini_value; + #endif if(nptr->off_flags & STARTSONDESK_FLAG) *Desk = nptr->Desk; if(nptr->off_flags & FORE_COLOR_FLAG) *************** *** 887,892 **** --- 941,949 ---- if (matchWildcards(nptr->name,name) == TRUE) { if(nptr->value != NULL)*value = nptr->value; + #ifdef MINI_ICONS + if(nptr->mini_value != NULL) *mini_value = nptr->mini_value; + #endif if(nptr->off_flags & STARTSONDESK_FLAG) *Desk = nptr->Desk; if(nptr->off_flags & FORE_COLOR_FLAG) diff -rc fvwm-2.0.43/fvwm/borders.c fvwm.patched/fvwm/borders.c *** fvwm-2.0.43/fvwm/borders.c Thu Apr 11 08:27:10 1996 --- fvwm.patched/fvwm/borders.c Sat Sep 21 18:33:11 1996 *************** *** 196,201 **** --- 196,238 ---- t->title_height); break; + #ifdef MINI_ICONS + case MiniIconButton: + case FullMiniIconButton: + if (!t->mini_icon) + break; + pbf = *t->mini_icon; + if (Scr.button_style[button] == FullMiniIconButton) + { + /* button face max width/height */ + a = t->title_height; + x=(a - pbf.width) / 2; if (x < 0) x = 0; + y=(a - pbf.height) / 2; if (y < 0) y = 0; + if (pbf.width > a) pbf.width = a; + if (pbf.height > a) pbf.height = a; + XClearArea(dpy, t->left_w[i], 0, 0, a + 2, a + 2, False); + } + else + { + /* button face max width/height */ + a = t->title_height - 2; + x=(a - pbf.width) / 2 + 1; if (x < 1) x = 1; + y=(a - pbf.height) / 2 + 1; if (y < 1) y = 1; + if (pbf.width >= a) pbf.width = a - 1; + if (pbf.height >= a) pbf.height = a - 1; + XClearArea(dpy, t->left_w[i], 1, 1, a - 1, a - 1, False); + } + + /* set transparency mask */ + XSetClipMask(dpy, Scr.ButtonMaskGC, pbf.mask); + XSetClipOrigin(dpy, Scr.ButtonMaskGC, x, y); + + /* draw the new button face */ + XCopyArea(dpy, pbf.picture, t->left_w[i], Scr.ButtonMaskGC, + 0, 0, pbf.width, pbf.height, x, y); + break; + #endif + #ifdef XPM #ifdef PIXMAP_BUTTONS case PixmapButton: diff -rc fvwm-2.0.43/fvwm/builtins.c fvwm.patched/fvwm/builtins.c *** fvwm-2.0.43/fvwm/builtins.c Thu Jun 27 07:34:19 1996 --- fvwm.patched/fvwm/builtins.c Sat Sep 21 18:23:06 1996 *************** *** 599,606 **** if(tmp_win) RaiseWindow(tmp_win); ! if (LookInList(Scr.TheList,tmp_win->name, &tmp_win->class, &junk, &junkD, ! &junkD, &junkD, &junkC, &junkC, &junkN, BoxJunk, &method)& STAYSONTOP_FLAG) tmp_win->flags |= ONTOP; KeepOnTop(); --- 599,609 ---- if(tmp_win) RaiseWindow(tmp_win); ! if (LookInList(Scr.TheList,tmp_win->name, &tmp_win->class, &junk, ! #ifdef MINI_ICONS ! &junk, ! #endif ! &junkD, &junkD, &junkD, &junkC, &junkC, &junkN, BoxJunk, &method)& STAYSONTOP_FLAG) tmp_win->flags |= ONTOP; KeepOnTop(); *************** *** 970,975 **** --- 973,981 ---- { RaiseWindow(tmp_win); if (LookInList(Scr.TheList,tmp_win->name, &tmp_win->class,&junk, + #ifdef MINI_ICONS + &junk, + #endif &junkD,&junkD, &junkD, &junkC,&junkC,&junkN,BoxJunk, &method)&STAYSONTOP_FLAG) tmp_win->flags |= ONTOP; *************** *** 1725,1730 **** --- 1731,1754 ---- "Pixmap button style requires Xpm support -- line: %s",action); #endif /* XPM */ } + else if (!mystrncasecmp (button_style, "MiniIcon", 8)) { + #ifdef MINI_ICONS + Scr.button_style[button] = MiniIconButton; + #else /* !defined (MINI_ICONS) */ + fvwm_msg (ERR, "ButtonStyle", + "MiniIcon button style not supported -- line: %s", + action); + #endif /* MINI_ICONS */ + } + else if (!mystrncasecmp (button_style, "FullMiniIcon", 8)) { + #ifdef MINI_ICONS + Scr.button_style[button] = FullMiniIconButton; + #else /* !defined (MINI_ICONS) */ + fvwm_msg (ERR, "ButtonStyle", + "FullMiniIcon button style not supported -- line: %s", + action); + #endif /* MINI_ICONS */ + } else { fvwm_msg(ERR,"ButtonStyle", diff -rc fvwm-2.0.43/fvwm/fvwm.h fvwm.patched/fvwm/fvwm.h *** fvwm-2.0.43/fvwm/fvwm.h Thu Apr 11 08:22:24 1996 --- fvwm.patched/fvwm/fvwm.h Sat Sep 21 15:58:33 1996 *************** *** 118,123 **** --- 118,126 ---- Pixel back; } ColorPair; + #ifdef MINI_ICONS + #include "../libs/fvwmlib.h" + #endif /* for each window that is on the display, one of these structures * is allocated and linked into a list *************** *** 180,185 **** --- 183,192 ---- Window transientfor; unsigned long flags; + #ifdef MINI_ICONS + char *mini_pixmap_file; + Picture *mini_icon; + #endif char *icon_bitmap_file; int orig_x; /* unmaximized x coordinate */ diff -rc fvwm-2.0.43/fvwm/misc.h fvwm.patched/fvwm/misc.h *** fvwm-2.0.43/fvwm/misc.h Wed Jun 19 18:31:15 1996 --- fvwm.patched/fvwm/misc.h Sat Sep 21 17:03:09 1996 *************** *** 20,25 **** --- 20,28 ---- struct name_list_struct *next; /* pointer to the next name */ char *name; /* the name of the window */ char *value; /* icon name */ + #ifdef MINI_ICONS + char *mini_value; /* mini icon name */ + #endif int Desk; /* Desktop number */ unsigned long on_flags; unsigned long off_flags; *************** *** 96,101 **** --- 99,108 ---- #define NO_PPOSITION_FLAG (1<<29) #define OL_DECOR_FLAG (1<<30) + #ifdef MINI_ICONS + #define MINIICON_FLAG (1<<31) + #endif + /* some fancy font handling stuff */ #define NewFontAndColor(newfont,color,backcolor) {\ Globalgcv.font = newfont;\ *************** *** 121,127 **** extern char NoResource[]; extern unsigned long LookInList(name_list *, char *, XClassHint *, ! char **value, int *Desk, int *bw, int *nobw, char **forecolor, char **backcolor, unsigned long * buttons, int *IconBox, int *BoxFillMethod); --- 128,139 ---- extern char NoResource[]; extern unsigned long LookInList(name_list *, char *, XClassHint *, ! char **value, ! #ifdef MINI_ICONS ! char **mini_value, ! #endif ! int *Desk, ! int *bw, int *nobw, char **forecolor, char **backcolor, unsigned long * buttons, int *IconBox, int *BoxFillMethod); *************** *** 291,301 **** --- 303,323 ---- void ParseKeyEntry(XEvent *eventp,Window w,FvwmWindow *tmp_win, unsigned long context, char *tline,int* Module); void SetOneStyle(char *text,FILE *,char **,int *); + + #ifdef MINI_ICONS + void AddToList(char *name, char *icon_name, char *miniicon_name, + unsigned long off_flags, + unsigned long on_flags, int desk,int bw, int nobw, + char *forecolor, char *backcolor, + unsigned long off_buttons, unsigned long on_buttons, + int *IconBox, int BoxFillMethod); + #else void AddToList(char *name, char *icon_name, unsigned long off_flags, unsigned long on_flags, int desk,int bw, int nobw, char *forecolor, char *backcolor, unsigned long off_buttons, unsigned long on_buttons, int *IconBox, int BoxFillMethod); + #endif void ParseStyle(char *text,FILE *,char **,int *); void assign_string(char *text, FILE *fd, char **arg,int *); diff -rc fvwm-2.0.43/fvwm/module.c fvwm.patched/fvwm/module.c *** fvwm-2.0.43/fvwm/module.c Thu Jun 6 08:27:12 1996 --- fvwm.patched/fvwm/module.c Sat Sep 21 22:03:38 1996 *************** *** 762,767 **** --- 762,777 ---- if((t->flags & ICONIFIED) && (t->flags & ICON_UNMAPPED)) SendPacket(*Module,M_ICONIFY,7,t->w,t->frame, (unsigned long)t,0,0,0,0); + #ifdef MINI_ICONS + if (t->mini_icon != NULL) + SendPacket(*Module, M_MINI_ICON, 6, + t->w, + t->mini_icon->picture, + t->mini_icon->mask, + t->mini_icon->width, + t->mini_icon->height, + t->mini_icon->depth, 0); + #endif } if(Scr.Hilite == NULL) { diff -rc fvwm-2.0.43/fvwm/module.h fvwm.patched/fvwm/module.h *** fvwm-2.0.43/fvwm/module.h Mon May 27 17:12:33 1996 --- fvwm.patched/fvwm/module.h Sat Sep 21 22:03:53 1996 *************** *** 39,44 **** --- 39,45 ---- #define M_ICON_FILE (1<<20) #define M_DEFAULTICON (1<<21) #define M_STRING (1<<22) + #define M_MINI_ICON (1<<23) #define MAX_MESSAGES 23 #define MAX_MASK ((1< 0) + { + miniicon_name = safemalloc(len+1); + strncpy(miniicon_name,restofline,len); + miniicon_name[len] = 0; + off_flags |= MINIICON_FLAG; + } + restofline = tmp; + } + #endif else if(mystrncasecmp(restofline,"MWMBORDER",9)==0) { restofline +=9; *************** *** 568,573 **** --- 593,601 ---- on_flags = nptr->on_flags; off_flags = nptr->off_flags; icon_name = nptr->value; + #ifdef MINI_ICONS + miniicon_name = nptr->mini_value; + #endif desknumber = nptr->Desk; bw = nptr->border_width; nobw = nptr->resize_width; *************** *** 640,652 **** --- 668,688 ---- icon_name = NULL; } + #ifdef MINI_ICONS + AddToList(name,icon_name,miniicon_name,off_flags,on_flags,desknumber,bw,nobw, + forecolor,backcolor,off_buttons,on_buttons,IconBox,BoxFillMethod); + #else AddToList(name,icon_name,off_flags,on_flags,desknumber,bw,nobw, forecolor,backcolor,off_buttons,on_buttons,IconBox,BoxFillMethod); + #endif } void AddToList(char *name, char *icon_name, + #ifdef MINI_ICONS + char *miniicon_name, + #endif unsigned long off_flags, unsigned long on_flags, int desk, *************** *** 685,690 **** --- 721,729 ---- nptr->on_flags = on_flags; nptr->off_flags = off_flags; nptr->value = icon_name; + #ifdef MINI_ICONS + nptr->mini_value = miniicon_name; + #endif nptr->Desk = desk; nptr->border_width = bw; nptr->resize_width = nobw; diff -rc fvwm-2.0.43/fvwm/windows.c fvwm.patched/fvwm/windows.c *** fvwm-2.0.43/fvwm/windows.c Thu Jun 27 06:39:25 1996 --- fvwm.patched/fvwm/windows.c Sat Sep 21 18:46:20 1996 *************** *** 131,136 **** --- 131,145 ---- strcat(t_hot,"\t"); strcat(t_hot,tname); AddToMenu(mr, t_hot, tlabel); + + /* Add the title pixmap */ + if (t->mini_icon) { + mr->last->lpicture = t->mini_icon; + t->mini_icon->count++; /* increase the cache count!! + otherwise the pixmap will be + eventually removed from the + cache by DestroyMenu */ + } free(t_hot); free(tname); }