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

@ -8,7 +8,7 @@
* Copyright 1993, Robert Nation. No guarantees or warantees or anything
* are provided or implied in any way whatsoever. Use this program at your
* own risk. Permission to use this program for any purpose is given,
* as long as the copyright is kept intact.
* as long as the copyright is kept intact.
*/
/***********************************************************************
@ -93,22 +93,22 @@ void CreateIconWindow(button_info *b)
XGCValues gcv;
unsigned long gcm=0;
Pixmap temp;
gcm = GCForeground | GCBackground;
gcv.background=buttonBack(b);
gcv.foreground=buttonFore(b);
XChangeGC(Dpy,NormalGC,gcm,&gcv);
#ifdef SHAPE
XShapeCombineMask(Dpy,b->IconWin,ShapeBounding,0,0,
b->icon->picture,ShapeSet);
#endif
temp = XCreatePixmap(Dpy,Root,b->icon->width,
b->icon->height,d_depth);
XCopyPlane(Dpy,b->icon->picture,temp,NormalGC,
0,0,b->icon->width,b->icon->height,0,0,1);
XSetWindowBackgroundPixmap(Dpy,b->IconWin,temp);
XFreePixmap(Dpy,temp);
/* We won't use the icon pixmap anymore... but we still need it for
@ -177,7 +177,7 @@ void ConfigureIconWindow(button_info *b)
yoff=(BH-(h+font->ascent+font->descent))>>1;
else
yoff=(BH-h)>>1;
if(xoff < framew+xpad)
xoff = framew+xpad;
if(yoff < framew+ypad)
@ -188,7 +188,7 @@ void ConfigureIconWindow(button_info *b)
XMoveResizeWindow(Dpy, b->IconWin, x,y,w,h);
/* Doesn't this belong above?
/* Doesn't this belong above?
#ifdef XPM
#ifdef SHAPE
if (b->icon->mask!=None)
@ -205,5 +205,5 @@ void ConfigureIconWindow(button_info *b)
XSetWindowBackgroundPixmap(Dpy,b->IconWin,b->icon->picture);
*/
#endif
#endif
}

View file

@ -58,7 +58,7 @@ void ConstrainSize (XSizeHints *hints, int *widthp, int *heightp)
baseWidth = 1;
baseHeight = 1;
}
if(hints->flags & PMaxSize)
{
maxWidth = hints->max_width;
@ -79,24 +79,24 @@ void ConstrainSize (XSizeHints *hints, int *widthp, int *heightp)
xinc = 1;
yinc = 1;
}
/*
* First, clamp to min and max values
*/
if (dwidth < minWidth) dwidth = minWidth;
if (dheight < minHeight) dheight = minHeight;
if (dwidth > maxWidth) dwidth = maxWidth;
if (dheight > maxHeight) dheight = maxHeight;
/*
* Second, fit to base + N * inc
*/
dwidth = ((dwidth - baseWidth) / xinc * xinc) + baseWidth;
dheight = ((dheight - baseHeight) / yinc * yinc) + baseHeight;
/*
* Third, adjust for aspect ratio
*/
@ -116,16 +116,16 @@ void ConstrainSize (XSizeHints *hints, int *widthp, int *heightp)
*
* minAspectX * dheight > minAspectY * dwidth
* maxAspectX * dheight < maxAspectY * dwidth
*
*
*/
if (hints->flags & PAspect)
{
if (minAspectX * dheight > minAspectY * dwidth)
{
delta = makemult(minAspectX * dheight / minAspectY - dwidth,
xinc);
if (dwidth + delta <= maxWidth)
if (dwidth + delta <= maxWidth)
dwidth += delta;
else
{
@ -134,7 +134,7 @@ void ConstrainSize (XSizeHints *hints, int *widthp, int *heightp)
if (dheight - delta >= minHeight) dheight -= delta;
}
}
if (maxAspectX * dheight < maxAspectY * dwidth)
{
delta = makemult(dwidth * maxAspectY / maxAspectX - dheight,
@ -149,7 +149,7 @@ void ConstrainSize (XSizeHints *hints, int *widthp, int *heightp)
}
}
}
*widthp = dwidth;
*heightp = dheight;
return;

View file

@ -40,7 +40,7 @@ void DumpButtons(button_info *b)
else
fprintf(stderr,"0x%lx(%ix%i@,0x%04lx): ",(unsigned long)b,
b->BWidth,b->BHeight,b->flags);
if(b->flags&b_Font)
fprintf(stderr,"Font(%s,0x%lx) ",b->font_string,(unsigned long)b->font);
if(b->flags&b_Padding)
@ -267,7 +267,7 @@ void SaveButtons(button_info *b)
fprintf(stderr,")");
}
fprintf(stderr,"\n");
if(b->flags&b_Container)
{
i=0;