This commit is contained in:
purplerain 2024-10-06 22:00:57 +00:00
parent 50c8bafd9f
commit ac06c97e30
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
820 changed files with 467502 additions and 386453 deletions

View file

@ -11,7 +11,7 @@ FvwmIconBox is spawned by fvwm, so no command line invocation will work.
.SH DESCRIPTION
The FvwmIconBox module provides an icon manager. The user can do
operations, like iconify and deiconify, for each icon shown in the
module via mouse and keyboard.
module via mouse and keyboard.
FvwmIconBox reads the same .fvwmrc file as fvwm reads when it starts up,
and looks for lines similar to "*FvwmIconBoxFore green".

View file

@ -67,22 +67,22 @@ void CreateIconWindow(struct icon_info *item)
/* pixmap */
if (max_icon_height != 0){
item->icon_pixmap_w =
XCreateWindow(dpy, icon_win, 0, 0,
item->icon_pixmap_w =
XCreateWindow(dpy, icon_win, 0, 0,
max(max_icon_width,item->icon_w),
max(max_icon_height,item->icon_h),
max(max_icon_height,item->icon_h),
0,CopyFromParent,CopyFromParent,
CopyFromParent,valuemask,&attributes);
CopyFromParent,valuemask,&attributes);
XSelectInput(dpy, item->icon_pixmap_w, ICON_EVENTS);
}
/* label */
item->IconWin =
XCreateWindow(dpy, icon_win, 0, 0,
XCreateWindow(dpy, icon_win, 0, 0,
max_icon_width,
max_icon_height + 10,
max_icon_height + 10,
0,CopyFromParent,CopyFromParent,
CopyFromParent,valuemask,&attributes);
CopyFromParent,valuemask,&attributes);
XSelectInput(dpy, item->IconWin, ICON_EVENTS);
}
@ -104,10 +104,10 @@ void ConfigureIconWindow(struct icon_info *item)
if (item->icon_file != NULL && (!(item->extra_flags & DEFAULTICON) || !(item->wmhints &&
item->wmhints->flags &
(IconPixmapHint|IconWindowHint)))){
(IconPixmapHint|IconWindowHint)))){
/* monochrome bitmap */
GetBitmapFile(item);
/* color pixmap */
if((item->icon_w == 0)&&(item->icon_h == 0))
GetXPMFile(item);
@ -117,7 +117,7 @@ void ConfigureIconWindow(struct icon_info *item)
for his patch to handle icon windows */
if((item->icon_h == 0)&&(item->icon_w == 0)&&
(item->wmhints) && (item->wmhints->flags & IconWindowHint))
GetIconWindow(item);
GetIconWindow(item);
/* icon bitmap from the application */
if((item->icon_h == 0)&&(item->icon_w == 0)&&
@ -128,7 +128,7 @@ void ConfigureIconWindow(struct icon_info *item)
#ifdef SHAPE
if (item->icon_maskPixmap != None)
{
XShapeCombineMask(dpy, item->icon_pixmap_w, ShapeBounding,
XShapeCombineMask(dpy, item->icon_pixmap_w, ShapeBounding,
hr, hr, item->icon_maskPixmap, ShapeSet);
}
#endif
@ -137,7 +137,7 @@ void ConfigureIconWindow(struct icon_info *item)
if(item->icon_depth == -1)
{
temp = item->iconPixmap;
item->iconPixmap =
item->iconPixmap =
XCreatePixmap(dpy, Root, item->icon_w,
item->icon_h,d_depth);
XCopyPlane(dpy,temp,item->iconPixmap,NormalGC,
@ -148,11 +148,11 @@ void ConfigureIconWindow(struct icon_info *item)
void AdjustIconWindow(struct icon_info *item, int n)
{
int x=0,y=0,w,h,h2,h3,w3;
w3 = w = max_icon_width + icon_relief;
h3 = h2 = max_icon_height + icon_relief;
h = h2 + 6 + font->ascent + font->descent;
switch (primary){
case LEFT:
case RIGHT:
@ -181,7 +181,7 @@ void AdjustIconWindow(struct icon_info *item, int n)
default:
break;
}
item->x = x;
item->y = y;
@ -208,10 +208,10 @@ void GetBitmapFile(struct icon_info *item)
path = findIconFile(item->icon_file, iconPath,R_OK);
if(path == NULL)return;
if(XReadBitmapFile (dpy, Root,path,(unsigned int *)&item->icon_w,
if(XReadBitmapFile (dpy, Root,path,(unsigned int *)&item->icon_w,
(unsigned int *)&item->icon_h,
&item->iconPixmap,
(int *)&HotX,
(int *)&HotX,
(int *)&HotY) != BitmapSuccess)
{
item->icon_w = 0;
@ -242,7 +242,7 @@ void GetXPMFile(struct icon_info *item)
XpmImage my_image;
path = findIconFile(item->icon_file, pixmapPath,R_OK);
if(path == NULL)return;
if(path == NULL)return;
XGetWindowAttributes(dpy,Root,&root_attr);
xpm_attributes.colormap = root_attr.colormap;
@ -257,7 +257,7 @@ void GetXPMFile(struct icon_info *item)
color_reduce_pixmap(&my_image,save_color_limit);
rc = XpmCreatePixmapFromXpmImage(dpy,Root, &my_image,
&item->iconPixmap,
&item->icon_maskPixmap,
&item->icon_maskPixmap,
&xpm_attributes);
if (rc != XpmSuccess) {
fprintf(stderr, "Problem creating pixmap from image, rc %d\n", rc);
@ -284,9 +284,9 @@ void GetIconWindow(struct icon_info *item)
unsigned int bw;
Window Junkroot;
if(!XGetGeometry(dpy, item->wmhints->icon_window, &Junkroot,
&x, &y, (unsigned int *)&item->icon_w,
(unsigned int *)&item->icon_h,
if(!XGetGeometry(dpy, item->wmhints->icon_window, &Junkroot,
&x, &y, (unsigned int *)&item->icon_w,
(unsigned int *)&item->icon_h,
&bw, (unsigned int *)&item->icon_depth))
return;
@ -301,7 +301,7 @@ void GetIconWindow(struct icon_info *item)
}
#endif
item->icon_w = min(max_icon_width + icon_relief, item->icon_w);
item->icon_w = min(max_icon_width + icon_relief, item->icon_w);
item->icon_h = min(max_icon_height + icon_relief, item->icon_h);
XReparentWindow(dpy, item->icon_pixmap_w, icon_win, 0, 0);
@ -324,7 +324,7 @@ void GetIconBitmap(struct icon_info *item)
GC gc;
if (!XGetGeometry(dpy, item->wmhints->icon_pixmap, &Junkroot, &x, &y,
(unsigned int *)&item->icon_w,
(unsigned int *)&item->icon_w,
(unsigned int *)&item->icon_h, &bw, &depth))
return;
@ -343,7 +343,7 @@ void GetIconBitmap(struct icon_info *item)
item->icon_h = min(max_icon_height, item->icon_h);
item->iconPixmap = XCreatePixmap(dpy, Root, item->icon_w,
item->icon_h, depth);
item->icon_h, depth);
gc = XCreateGC(dpy, item->iconPixmap, 0, NULL);
XCopyArea(dpy, item->wmhints->icon_pixmap, item->iconPixmap,
gc, 0, 0, item->icon_w, item->icon_h, 0, 0);
@ -372,16 +372,16 @@ Bool GetBackPixmap(void)
else{
IconwinPixmap = XCreatePixmap(dpy, Root, w, h, d_depth);
XCopyPlane(dpy, tmp_bitmap, IconwinPixmap, NormalGC, 0, 0, w, h,
0, 0, 1);
0, 0, 1);
XFreePixmap(dpy, tmp_bitmap);
}
free(path);
}
#ifdef XPM
if ( w == 0 && h == 0 && (path = findIconFile(IconwinPixmapFile,
pixmapPath,R_OK)) != NULL)
{
{
XGetWindowAttributes(dpy,Root,&root_attr);
xpm_attributes.colormap = root_attr.colormap;
xpm_attributes.closeness = 40000; /* same closeness used elsewhere */