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 DEVMODE16
* initData
);
15 static BOOL32
X11DRV_DeleteDC( DC
*dc
);
17 static const DC_FUNCTIONS X11DRV_Funcs
=
20 X11DRV_BitBlt
, /* pBitBlt */
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 */
45 X11DRV_PatBlt
, /* pPatBlt */
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 X11DRV_SetDeviceClipping
, /* pSetDeviceClipping */
63 NULL
, /* pSetDIBitsToDevice */
64 NULL
, /* pSetMapMode */
65 NULL
, /* pSetMapperFlags */
67 NULL
, /* pSetPolyFillMode */
69 NULL
, /* pSetRelAbs */
70 NULL
, /* pSetStretchBltMode */
71 NULL
, /* pSetTextAlign */
72 NULL
, /* pSetTextCharacterExtra */
73 NULL
, /* pSetTextColor */
74 NULL
, /* pSetTextJustification */
75 NULL
, /* pSetViewportExtEx */
76 NULL
, /* pSetViewportOrgEx */
77 NULL
, /* pSetWindowExtEx */
78 NULL
, /* pSetWindowOrgEx */
79 X11DRV_StretchBlt
, /* pStretchBlt */
80 NULL
, /* pStretchDIBits */
84 static DeviceCaps X11DRV_DevCaps
;
86 /**********************************************************************
89 BOOL32
X11DRV_Init(void)
91 return DRIVER_RegisterDriver( "DISPLAY", &X11DRV_Funcs
);
95 /**********************************************************************
98 static BOOL32
X11DRV_CreateDC( DC
*dc
, LPCSTR driver
, LPCSTR device
,
99 LPCSTR output
, const DEVMODE16
* initData
)
101 X11DRV_PDEVICE
*physDev
;
103 if (!X11DRV_DevCaps
.version
) DC_FillDevCaps( &X11DRV_DevCaps
);
105 physDev
= &dc
->u
.x
; /* for now */
107 memset( physDev
, 0, sizeof(*physDev
) );
108 dc
->physDev
= physDev
;
109 dc
->w
.devCaps
= &X11DRV_DevCaps
;
110 if (dc
->w
.flags
& DC_MEMORY
)
112 BITMAPOBJ
*bmp
= (BITMAPOBJ
*) GDI_GetObjPtr( dc
->w
.hBitmap
,
114 physDev
->drawable
= bmp
->pixmap
;
115 physDev
->gc
= XCreateGC( display
, physDev
->drawable
, 0, NULL
);
116 dc
->w
.bitsPerPixel
= bmp
->bitmap
.bmBitsPixel
;
117 dc
->w
.hVisRgn
= CreateRectRgn32( 0, 0, bmp
->bitmap
.bmWidth
,
118 bmp
->bitmap
.bmHeight
);
122 physDev
->drawable
= rootWindow
;
123 physDev
->gc
= XCreateGC( display
, physDev
->drawable
, 0, NULL
);
124 dc
->w
.bitsPerPixel
= screenDepth
;
125 dc
->w
.hVisRgn
= CreateRectRgn32( 0, 0, screenWidth
, screenHeight
);
130 XFreeGC( display
, physDev
->gc
);
134 XSetGraphicsExposures( display
, physDev
->gc
, False
);
135 XSetSubwindowMode( display
, physDev
->gc
, IncludeInferiors
);
141 /**********************************************************************
144 static BOOL32
X11DRV_DeleteDC( DC
*dc
)
146 X11DRV_PDEVICE
*physDev
= (X11DRV_PDEVICE
*)dc
->physDev
;
147 XFreeGC( display
, physDev
->gc
);