static EX_Cursor ECreatePixmapCursor(EX_Pixmap cpmap, EX_Pixmap cmask, unsigned int w __UNUSED__, unsigned int h __UNUSED__, int xh, int yh, unsigned int fg, unsigned int bg) { EX_Cursor curs; XColor fgxc, bgxc; COLOR32_TO_RGB16(fg, fgxc.red, fgxc.green, fgxc.blue); COLOR32_TO_RGB16(bg, bgxc.red, bgxc.green, bgxc.blue); XAllocColor(disp, WinGetCmap(VROOT), &fgxc); XAllocColor(disp, WinGetCmap(VROOT), &bgxc); curs = XCreatePixmapCursor(disp, cpmap, cmask, &fgxc, &bgxc, xh, yh); return curs; }
unsigned int EAllocColor(Colormap cmap, unsigned int argb) { XColor xc; COLOR32_TO_RGB16(argb, xc.red, xc.green, xc.blue); XAllocColor(disp, cmap, &xc); return xc.pixel; }