4 * Copyright 1993 Alexandre Julliard
18 /***********************************************************************
21 BOOL32
X11DRV_BITMAP_Init(void)
25 /* Create the necessary GCs */
27 if ((tmpPixmap
= TSXCreatePixmap( display
, rootWindow
, 1, 1, 1 )))
29 BITMAP_monoGC
= TSXCreateGC( display
, tmpPixmap
, 0, NULL
);
30 TSXSetGraphicsExposures( display
, BITMAP_monoGC
, False
);
31 TSXFreePixmap( display
, tmpPixmap
);
36 if ((tmpPixmap
= TSXCreatePixmap(display
, rootWindow
, 1,1,screenDepth
)))
38 BITMAP_colorGC
= TSXCreateGC( display
, tmpPixmap
, 0, NULL
);
39 TSXSetGraphicsExposures( display
, BITMAP_colorGC
, False
);
40 TSXFreePixmap( display
, tmpPixmap
);
46 /***********************************************************************
47 * X11DRV_BITMAP_SelectObject
49 HBITMAP32
X11DRV_BITMAP_SelectObject( DC
* dc
, HBITMAP32 hbitmap
,
53 HBITMAP32 prevHandle
= dc
->w
.hBitmap
;
55 if (!(dc
->w
.flags
& DC_MEMORY
)) return 0;
57 dc
->w
.totalExtent
.left
= 0;
58 dc
->w
.totalExtent
.top
= 0;
59 dc
->w
.totalExtent
.right
= bmp
->bitmap
.bmWidth
;
60 dc
->w
.totalExtent
.bottom
= bmp
->bitmap
.bmHeight
;
63 SetRectRgn32( dc
->w
.hVisRgn
, 0, 0,
64 bmp
->bitmap
.bmWidth
, bmp
->bitmap
.bmHeight
);
67 hrgn
= CreateRectRgn32(0, 0, bmp
->bitmap
.bmWidth
, bmp
->bitmap
.bmHeight
);
72 dc
->u
.x
.drawable
= bmp
->pixmap
;
73 dc
->w
.hBitmap
= hbitmap
;
75 /* Change GC depth if needed */
77 if (dc
->w
.bitsPerPixel
!= bmp
->bitmap
.bmBitsPixel
)
79 TSXFreeGC( display
, dc
->u
.x
.gc
);
80 dc
->u
.x
.gc
= TSXCreateGC( display
, dc
->u
.x
.drawable
, 0, NULL
);
81 dc
->w
.bitsPerPixel
= bmp
->bitmap
.bmBitsPixel
;
84 else CLIPPING_UpdateGCRegion( dc
); /* Just update GC clip region */