4 * Copyright 1993 Alexandre Julliard
10 #include <X11/Xutil.h>
19 /***********************************************************************
22 BOOL32
X11DRV_BITMAP_Init(void)
26 /* Create the necessary GCs */
28 if ((tmpPixmap
= XCreatePixmap( display
, rootWindow
, 1, 1, 1 )))
30 BITMAP_monoGC
= XCreateGC( display
, tmpPixmap
, 0, NULL
);
31 XSetGraphicsExposures( display
, BITMAP_monoGC
, False
);
32 XFreePixmap( display
, tmpPixmap
);
37 if ((tmpPixmap
= XCreatePixmap(display
, rootWindow
, 1,1,screenDepth
)))
39 BITMAP_colorGC
= XCreateGC( display
, tmpPixmap
, 0, NULL
);
40 XSetGraphicsExposures( display
, BITMAP_colorGC
, False
);
41 XFreePixmap( display
, tmpPixmap
);
47 /***********************************************************************
48 * X11DRV_BITMAP_SelectObject
50 HBITMAP32
X11DRV_BITMAP_SelectObject( DC
* dc
, HBITMAP32 hbitmap
,
54 HBITMAP32 prevHandle
= dc
->w
.hBitmap
;
56 if (!(dc
->w
.flags
& DC_MEMORY
)) return 0;
59 SetRectRgn32( dc
->w
.hVisRgn
, 0, 0,
60 bmp
->bitmap
.bmWidth
, bmp
->bitmap
.bmHeight
);
63 hrgn
= CreateRectRgn32(0, 0, bmp
->bitmap
.bmWidth
, bmp
->bitmap
.bmHeight
);
68 dc
->u
.x
.drawable
= bmp
->pixmap
;
69 dc
->w
.hBitmap
= hbitmap
;
71 /* Change GC depth if needed */
73 if (dc
->w
.bitsPerPixel
!= bmp
->bitmap
.bmBitsPixel
)
75 XFreeGC( display
, dc
->u
.x
.gc
);
76 dc
->u
.x
.gc
= XCreateGC( display
, dc
->u
.x
.drawable
, 0, NULL
);
77 dc
->w
.bitsPerPixel
= bmp
->bitmap
.bmBitsPixel
;
80 else CLIPPING_UpdateGCRegion( dc
); /* Just update GC clip region */