2 * X11 display driver definitions
5 #ifndef __WINE_X11DRV_H
6 #define __WINE_X11DRV_H
13 #include "xmalloc.h" /* for XCREATEIMAGE macro */
25 int type
; /* GEOMETRIC || COSMETIC */
28 /* X physical brush */
38 typedef UINT32 X_PHYSFONT
;
40 /* X physical device */
43 GC gc
; /* X Window GC */
57 /* GCs used for B&W and color bitmap operations */
58 extern GC BITMAP_monoGC
, BITMAP_colorGC
;
60 #define BITMAP_GC(bmp) \
61 (((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
64 /* Wine driver X11 functions */
69 extern BOOL32
X11DRV_Init(void);
70 extern BOOL32
X11DRV_BitBlt( struct tagDC
*dcDst
, INT32 xDst
, INT32 yDst
,
71 INT32 width
, INT32 height
, struct tagDC
*dcSrc
,
72 INT32 xSrc
, INT32 ySrc
, DWORD rop
);
73 extern BOOL32
X11DRV_EnumDeviceFonts( struct tagDC
*dc
, LPLOGFONT16 plf
,
74 DEVICEFONTENUMPROC dfeproc
, LPARAM lp
);
75 extern BOOL32
X11DRV_GetCharWidth( struct tagDC
*dc
, UINT32 firstChar
,
76 UINT32 lastChar
, LPINT32 buffer
);
77 extern BOOL32
X11DRV_GetTextExtentPoint( struct tagDC
*dc
, LPCSTR str
,
78 INT32 count
, LPSIZE32 size
);
79 extern BOOL32
X11DRV_GetTextMetrics(struct tagDC
*dc
, TEXTMETRIC32A
*metrics
);
80 extern BOOL32
X11DRV_PatBlt( struct tagDC
*dc
, INT32 left
, INT32 top
,
81 INT32 width
, INT32 height
, DWORD rop
);
82 extern VOID
X11DRV_SetDeviceClipping(struct tagDC
*dc
);
83 extern BOOL32
X11DRV_StretchBlt( struct tagDC
*dcDst
, INT32 xDst
, INT32 yDst
,
84 INT32 widthDst
, INT32 heightDst
,
85 struct tagDC
*dcSrc
, INT32 xSrc
, INT32 ySrc
,
86 INT32 widthSrc
, INT32 heightSrc
, DWORD rop
);
87 extern BOOL32
X11DRV_MoveToEx( struct tagDC
*dc
, INT32 x
, INT32 y
,LPPOINT32 pt
);
88 extern BOOL32
X11DRV_LineTo( struct tagDC
*dc
, INT32 x
, INT32 y
);
89 extern BOOL32
X11DRV_Arc( struct tagDC
*dc
, INT32 left
, INT32 top
, INT32 right
,
90 INT32 bottom
, INT32 xstart
, INT32 ystart
, INT32 xend
,
92 extern BOOL32
X11DRV_Pie( struct tagDC
*dc
, INT32 left
, INT32 top
, INT32 right
,
93 INT32 bottom
, INT32 xstart
, INT32 ystart
, INT32 xend
,
95 extern BOOL32
X11DRV_Chord( struct tagDC
*dc
, INT32 left
, INT32 top
,
96 INT32 right
, INT32 bottom
, INT32 xstart
,
97 INT32 ystart
, INT32 xend
, INT32 yend
);
98 extern BOOL32
X11DRV_Ellipse( struct tagDC
*dc
, INT32 left
, INT32 top
,
99 INT32 right
, INT32 bottom
);
100 extern BOOL32
X11DRV_Rectangle(struct tagDC
*dc
, INT32 left
, INT32 top
,
101 INT32 right
, INT32 bottom
);
102 extern BOOL32
X11DRV_RoundRect( struct tagDC
*dc
, INT32 left
, INT32 top
,
103 INT32 right
, INT32 bottom
, INT32 ell_width
,
105 extern COLORREF
X11DRV_SetPixel( struct tagDC
*dc
, INT32 x
, INT32 y
,
107 extern COLORREF
X11DRV_GetPixel( struct tagDC
*dc
, INT32 x
, INT32 y
);
108 extern BOOL32
X11DRV_PaintRgn( struct tagDC
*dc
, HRGN32 hrgn
);
109 extern BOOL32
X11DRV_Polyline( struct tagDC
*dc
,const POINT32
* pt
,INT32 count
);
110 extern BOOL32
X11DRV_PolyBezier( struct tagDC
*dc
, const POINT32 start
, const POINT32
* lppt
, DWORD cPoints
);
111 extern BOOL32
X11DRV_Polygon( struct tagDC
*dc
, const POINT32
* pt
, INT32 count
);
112 extern BOOL32
X11DRV_PolyPolygon( struct tagDC
*dc
, const POINT32
* pt
,
113 const INT32
* counts
, UINT32 polygons
);
114 extern BOOL32
X11DRV_PolyPolyline( struct tagDC
*dc
, const POINT32
* pt
,
115 const DWORD
* counts
, DWORD polylines
);
117 extern HGDIOBJ32
X11DRV_SelectObject( struct tagDC
*dc
, HGDIOBJ32 handle
);
119 extern COLORREF
X11DRV_SetBkColor( struct tagDC
*dc
, COLORREF color
);
120 extern COLORREF
X11DRV_SetTextColor( struct tagDC
*dc
, COLORREF color
);
121 extern BOOL32
X11DRV_ExtFloodFill( struct tagDC
*dc
, INT32 x
, INT32 y
,
122 COLORREF color
, UINT32 fillType
);
123 extern BOOL32
X11DRV_ExtTextOut( struct tagDC
*dc
, INT32 x
, INT32 y
,
124 UINT32 flags
, const RECT32
*lprect
,
125 LPCSTR str
, UINT32 count
, const INT32
*lpDx
);
126 extern BOOL32
X11DRV_CreateBitmap( HBITMAP32 hbitmap
);
127 extern BOOL32
X11DRV_DeleteObject( HGDIOBJ32 handle
);
128 extern LONG
X11DRV_BitmapBits( HBITMAP32 hbitmap
, void *bits
, LONG count
,
130 extern INT32
X11DRV_SetDIBitsToDevice( struct tagDC
*dc
, INT32 xDest
,
131 INT32 yDest
, DWORD cx
, DWORD cy
,
132 INT32 xSrc
, INT32 ySrc
,
133 UINT32 startscan
, UINT32 lines
,
134 LPCVOID bits
, const BITMAPINFO
*info
,
136 extern INT32
X11DRV_DeviceBitmapBits( struct tagDC
*dc
, HBITMAP32 hbitmap
,
137 WORD fGet
, UINT32 startscan
,
138 UINT32 lines
, LPSTR bits
,
139 LPBITMAPINFO info
, UINT32 coloruse
);
140 /* X11 driver internal functions */
142 extern BOOL32
X11DRV_BITMAP_Init(void);
143 extern BOOL32
X11DRV_BRUSH_Init(void);
144 extern BOOL32
X11DRV_DIB_Init(void);
145 extern BOOL32
X11DRV_FONT_Init( struct tagDeviceCaps
* );
148 extern XImage
*X11DRV_BITMAP_GetXImage( const struct tagBITMAPOBJ
*bmp
);
149 extern int X11DRV_DIB_GetXImageWidthBytes( int width
, int depth
);
150 extern BOOL32
X11DRV_DIB_Init(void);
151 extern X11DRV_PHYSBITMAP
*X11DRV_AllocBitmap( struct tagBITMAPOBJ
*bmp
);
153 extern BOOL32
X11DRV_SetupGCForPatBlt( struct tagDC
*dc
, GC gc
,
155 extern BOOL32
X11DRV_SetupGCForBrush( struct tagDC
*dc
);
156 extern BOOL32
X11DRV_SetupGCForPen( struct tagDC
*dc
);
157 extern BOOL32
X11DRV_SetupGCForText( struct tagDC
*dc
);
159 extern const int X11DRV_XROPfunction
[];
161 extern Display
* display
;
162 extern Screen
* screen
;
163 extern Window rootWindow
;
164 extern int screenWidth
, screenHeight
, screenDepth
;
167 /* Xlib critical section */
169 extern CRITICAL_SECTION X11DRV_CritSection
;
171 extern void _XInitImageFuncPtrs(XImage
*);
173 #define XCREATEIMAGE(image,width,height,bpp) \
175 int width_bytes = X11DRV_DIB_GetXImageWidthBytes( (width), (bpp) ); \
176 (image) = TSXCreateImage(display, DefaultVisualOfScreen(screen), \
177 (bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
178 (width), (height), 32, width_bytes ); \
182 /* exported dib functions for now */
184 /* This structure holds the arguments for DIB_SetImageBits() */
205 } DIB_SETIMAGEBITS_DESCR
;
207 extern int X11DRV_DIB_GetImageBits( const DIB_SETIMAGEBITS_DESCR
*descr
);
208 extern int X11DRV_DIB_SetImageBits( const DIB_SETIMAGEBITS_DESCR
*descr
);
209 extern int *X11DRV_DIB_BuildColorMap( struct tagDC
*dc
, WORD coloruse
,
210 WORD depth
, const BITMAPINFO
*info
,
214 #endif /* __WINE_X11DRV_H */