2 * X11 display driver definitions
5 #ifndef __WINE_X11DRV_H
6 #define __WINE_X11DRV_H
12 #include "xmalloc.h" /* for XCREATEIMAGE macro */
24 int type; /* GEOMETRIC || COSMETIC */
27 /* X physical brush */
37 typedef UINT32 X_PHYSFONT;
39 /* X physical device */
42 GC gc; /* X Window GC */
56 /* GCs used for B&W and color bitmap operations */
57 extern GC BITMAP_monoGC, BITMAP_colorGC;
59 #define BITMAP_GC(bmp) \
60 (((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
62 typedef INT32 (*DEVICEFONTENUMPROC)(LPENUMLOGFONT16,LPNEWTEXTMETRIC16,UINT16,LPARAM);
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_FONT_Init( struct tagDeviceCaps* );
147 extern XImage *X11DRV_BITMAP_GetXImage( const struct tagBITMAPOBJ *bmp );
148 extern int X11DRV_DIB_GetXImageWidthBytes( int width, int depth );
149 extern BOOL32 X11DRV_DIB_Init(void);
150 extern X11DRV_PHYSBITMAP *X11DRV_AllocBitmap( struct tagBITMAPOBJ *bmp );
152 /* Xlib critical section */
154 extern CRITICAL_SECTION X11DRV_CritSection;
156 extern void _XInitImageFuncPtrs(XImage *);
158 #define XCREATEIMAGE(image,width,height,bpp) \
160 int width_bytes = X11DRV_DIB_GetXImageWidthBytes( (width), (bpp) ); \
161 (image) = TSXCreateImage(display, DefaultVisualOfScreen(screen), \
162 (bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
163 (width), (height), 32, width_bytes ); \
166 #endif /* __WINE_X11DRV_H */