mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-21 13:28:05 +01:00
Remove unused functions from src/pixmap.c
In case someone needs them in the future for some reason, they can be restored from the git logs. Pointed out by Nicolas Bonifas.
This commit is contained in:
104
src/pixmap.c
104
src/pixmap.c
@@ -101,63 +101,6 @@ WPixmap *wPixmapCreateFromXBMData(WScreen * scr, char *data, char *mask,
|
||||
return pix;
|
||||
}
|
||||
|
||||
#ifdef unused
|
||||
WPixmap *wPixmapCreateFromBitmap(WScreen * scr, Pixmap bitmap, Pixmap mask, unsigned long fg, unsigned long bg)
|
||||
{
|
||||
WPixmap *pix;
|
||||
XImage *img, *img2;
|
||||
Window foo;
|
||||
int bar, x, y;
|
||||
Pixmap pixmap;
|
||||
unsigned int width, height, baz, d;
|
||||
|
||||
if (!XGetGeometry(dpy, bitmap, &foo, &bar, &bar, &width, &height, &baz, &d) || d != 1) {
|
||||
return NULL;
|
||||
}
|
||||
img = XGetImage(dpy, bitmap, 0, 0, width, height, AllPlanes, XYPixmap);
|
||||
if (!img)
|
||||
return NULL;
|
||||
|
||||
img2 = XCreateImage(dpy, scr->w_visual, scr->w_depth, ZPixmap, 0, NULL, width, height, 8, 0);
|
||||
if (!img2) {
|
||||
XDestroyImage(img);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pixmap = XCreatePixmap(dpy, scr->w_win, width, height, scr->w_depth);
|
||||
if (pixmap == None) {
|
||||
XDestroyImage(img);
|
||||
XDestroyImage(img2);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
img2->data = wmalloc(height * img2->bytes_per_line);
|
||||
|
||||
for (y = 0; y < height; y++) {
|
||||
for (x = 0; x < width; x++) {
|
||||
if (XGetPixel(img, x, y) == 0) {
|
||||
XPutPixel(img2, x, y, bg);
|
||||
} else {
|
||||
XPutPixel(img2, x, y, fg);
|
||||
}
|
||||
}
|
||||
}
|
||||
XSetClipMask(dpy, scr->copy_gc, None);
|
||||
XPutImage(dpy, pixmap, scr->copy_gc, img2, 0, 0, 0, 0, width, height);
|
||||
XDestroyImage(img);
|
||||
XDestroyImage(img2);
|
||||
|
||||
pix = wmalloc(sizeof(WPixmap));
|
||||
memset(pix, 0, sizeof(WPixmap));
|
||||
pix->image = pixmap;
|
||||
pix->mask = mask;
|
||||
pix->width = width;
|
||||
pix->height = height;
|
||||
pix->depth = scr->w_depth;
|
||||
return pix;
|
||||
}
|
||||
#endif /* unused */
|
||||
|
||||
WPixmap *wPixmapCreate(WScreen * scr, Pixmap image, Pixmap mask)
|
||||
{
|
||||
WPixmap *pix;
|
||||
@@ -180,53 +123,6 @@ WPixmap *wPixmapCreate(WScreen * scr, Pixmap image, Pixmap mask)
|
||||
return pix;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* wPixmapLoadXBMFile--
|
||||
* Creates a WPixmap structure and loads a XBM file into it with
|
||||
* an optional mask file. If a mask is not wanted, mask_path should be
|
||||
* NULL.
|
||||
*
|
||||
* Returns:
|
||||
* A WPixmap structure or NULL on failure.
|
||||
*
|
||||
* Notes:
|
||||
* If the mask bitmap is not successfully loaded the operation
|
||||
* continues as no mask was supplied.
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
WPixmap *wPixmapLoadXBMFile(WScreen * scr, char *path, char *mask_path)
|
||||
{
|
||||
WPixmap *pix;
|
||||
int junk;
|
||||
|
||||
if (!path)
|
||||
return NULL;
|
||||
|
||||
pix = wmalloc(sizeof(WPixmap));
|
||||
memset(pix, 0, sizeof(WPixmap));
|
||||
|
||||
if (XReadBitmapFile(dpy, scr->w_win, path, (unsigned *)&(pix->width),
|
||||
(unsigned *)&(pix->height), &(pix->image), &junk, &junk) != BitmapSuccess) {
|
||||
wfree(pix);
|
||||
return NULL;
|
||||
}
|
||||
if (mask_path != NULL) {
|
||||
if (XReadBitmapFile(dpy, scr->w_win, path, (unsigned *)&junk,
|
||||
(unsigned *)&junk, &(pix->mask), &junk, &junk) != BitmapSuccess) {
|
||||
wwarning(_("could not load mask bitmap file \"%s\". Won't use mask"), mask_path);
|
||||
pix->mask = None;
|
||||
}
|
||||
} else {
|
||||
pix->mask = None;
|
||||
}
|
||||
pix->depth = 1;
|
||||
return pix;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
* wPixmapDestroy--
|
||||
|
||||
Reference in New Issue
Block a user