2 * X11 graphics driver initialisation functions
4 * Copyright 1996 Alexandre Julliard
13 static BOOL32
X11DRV_CreateDC( DC
*dc
, LPCSTR driver
, LPCSTR device
,
14 LPCSTR output
, const DEVMODE
* initData
);
15 static BOOL32
X11DRV_DeleteDC( DC
*dc
);
17 static const DC_FUNCTIONS X11DRV_Funcs
=
22 X11DRV_CreateDC
, /* pCreateDC */
23 X11DRV_DeleteDC
, /* pDeleteDC */
24 NULL
, /* pDeleteObject */
27 NULL
, /* pExcludeClipRect */
28 NULL
, /* pExcludeVisRect */
29 NULL
, /* pExtFloodFill */
30 NULL
, /* pExtTextOut */
32 NULL
, /* pFloodFill */
34 X11DRV_GetTextExtentPoint
, /* pGetTextExtentPoint */
35 NULL
, /* pGetTextMetrics */
36 NULL
, /* pIntersectClipRect */
37 NULL
, /* pIntersectVisRect */
38 NULL
, /* pInvertRgn */
41 NULL
, /* pOffsetClipRgn */
42 NULL
, /* pOffsetViewportOrgEx */
43 NULL
, /* pOffsetWindowOrgEx */
47 NULL
, /* pPolyPolygon */
50 NULL
, /* pRealizePalette */
51 NULL
, /* pRectangle */
52 NULL
, /* pRestoreDC */
53 NULL
, /* pRoundRect */
55 NULL
, /* pScaleViewportExtEx */
56 NULL
, /* pScaleWindowExtEx */
57 NULL
, /* pSelectClipRgn */
58 NULL
, /* pSelectObject */
59 NULL
, /* pSelectPalette */
60 NULL
, /* pSetBkColor */
61 NULL
, /* pSetBkMode */
62 NULL
, /* pSetDIBitsToDevice */
63 NULL
, /* pSetMapMode */
64 NULL
, /* pSetMapperFlags */
66 NULL
, /* pSetPolyFillMode */
68 NULL
, /* pSetRelAbs */
69 NULL
, /* pSetStretchBltMode */
70 NULL
, /* pSetTextAlign */
71 NULL
, /* pSetTextCharacterExtra */
72 NULL
, /* pSetTextColor */
73 NULL
, /* pSetTextJustification */
74 NULL
, /* pSetViewportExtEx */
75 NULL
, /* pSetViewportOrgEx */
76 NULL
, /* pSetWindowExtEx */
77 NULL
, /* pSetWindowOrgEx */
78 NULL
, /* pStretchBlt */
79 NULL
, /* pStretchDIBits */
83 static DeviceCaps X11DRV_DevCaps
;
85 /**********************************************************************
88 BOOL32
X11DRV_Init(void)
90 return DRIVER_RegisterDriver( "DISPLAY", &X11DRV_Funcs
);
94 /**********************************************************************
97 static BOOL32
X11DRV_CreateDC( DC
*dc
, LPCSTR driver
, LPCSTR device
,
98 LPCSTR output
, const DEVMODE
* initData
)
100 X11DRV_PDEVICE
*physDev
;
102 if (!X11DRV_DevCaps
.version
) DC_FillDevCaps( &X11DRV_DevCaps
);
104 physDev
= &dc
->u
.x
; /* for now */
106 memset( physDev
, 0, sizeof(*physDev
) );
107 dc
->physDev
= physDev
;
108 dc
->w
.devCaps
= &X11DRV_DevCaps
;
109 if (dc
->w
.flags
& DC_MEMORY
)
111 BITMAPOBJ
*bmp
= (BITMAPOBJ
*) GDI_GetObjPtr( dc
->w
.hBitmap
,
113 physDev
->drawable
= bmp
->pixmap
;
114 physDev
->gc
= XCreateGC( display
, physDev
->drawable
, 0, NULL
);
115 dc
->w
.bitsPerPixel
= bmp
->bitmap
.bmBitsPixel
;
116 dc
->w
.hVisRgn
= CreateRectRgn( 0, 0, bmp
->bitmap
.bmWidth
,
117 bmp
->bitmap
.bmHeight
);
121 physDev
->drawable
= rootWindow
;
122 physDev
->gc
= XCreateGC( display
, physDev
->drawable
, 0, NULL
);
123 dc
->w
.bitsPerPixel
= screenDepth
;
124 dc
->w
.hVisRgn
= CreateRectRgn( 0, 0, screenWidth
, screenHeight
);
129 XFreeGC( display
, physDev
->gc
);
133 XSetGraphicsExposures( display
, physDev
->gc
, False
);
134 XSetSubwindowMode( display
, physDev
->gc
, IncludeInferiors
);
140 /**********************************************************************
143 static BOOL32
X11DRV_DeleteDC( DC
*dc
)
145 X11DRV_PDEVICE
*physDev
= (X11DRV_PDEVICE
*)dc
->physDev
;
146 XFreeGC( display
, physDev
->gc
);