WMII Reforge  Artifact [4c1c39647f]

Artifact 4c1c39647f9be8c46ddb368b5edc6e61c21d470c04f574a4f9a06515bdeda1c2:

  • File lib/libstuff/x11/images/allocimage.c — part of check-in [15eae1e8e6] at 2019-06-20 16:42:23 on branch trunk — Import sources to have something to work with (user: KhazAkar size: 518)

/* Copyright ©2007-2010 Kris Maglione <maglione.k at Gmail>
 * See LICENSE file for license details.
 */
#include "../x11.h"

Image*
allocimage(int w, int h, int depth) {
	Image *img;

	img = emallocz(sizeof *img);
	img->type = WImage;
	img->xid = XCreatePixmap(display, scr.root.xid, w, h, depth);
	img->gc = XCreateGC(display, img->xid, 0, nil);
	img->colormap = scr.colormap;
	img->visual = scr.visual;
	if(depth == 32)
		img->visual = scr.visual32;
	img->depth = depth;
	img->r = Rect(0, 0, w, h);
	return img;
}