Fixed some LPPOINT/LPSIZE mismatches and some missing "const" in the
[wine] / include / x11drv.h
1 /*
2  * X11 display driver definitions
3  */
4
5 #ifndef __WINE_X11DRV_H
6 #define __WINE_X11DRV_H
7
8 #include "ts_xlib.h"
9 #include "ts_xutil.h"
10 #include "winbase.h"
11 #include "windows.h"
12 #include "xmalloc.h" /* for XCREATEIMAGE macro */
13
14   /* X physical pen */
15 typedef struct
16 {
17     int          style;
18     int          endcap;
19     int          linejoin;
20     int          pixel;
21     int          width;
22     char *       dashes;
23     int          dash_len;
24     int          type;          /* GEOMETRIC || COSMETIC */
25 } X_PHYSPEN;
26
27   /* X physical brush */
28 typedef struct
29 {
30     int          style;
31     int          fillStyle;
32     int          pixel;
33     Pixmap       pixmap;
34 } X_PHYSBRUSH;
35
36   /* X physical font */
37 typedef UINT32   X_PHYSFONT;
38
39   /* X physical device */
40 typedef struct
41 {
42     GC            gc;          /* X Window GC */
43     Drawable      drawable;
44     X_PHYSFONT    font;
45     X_PHYSPEN     pen;
46     X_PHYSBRUSH   brush;
47     int           backgroundPixel;
48     int           textPixel;
49 } X11DRV_PDEVICE;
50
51
52 typedef struct {
53     Pixmap      pixmap;
54 } X11DRV_PHYSBITMAP;
55
56   /* GCs used for B&W and color bitmap operations */
57 extern GC BITMAP_monoGC, BITMAP_colorGC;
58
59 #define BITMAP_GC(bmp) \
60   (((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
61
62 typedef INT32 (*DEVICEFONTENUMPROC)(LPENUMLOGFONT16,LPNEWTEXTMETRIC16,UINT16,LPARAM);
63
64 /* Wine driver X11 functions */
65
66 struct tagDC;
67 struct tagDeviceCaps;
68
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,
91                           INT32 yend );
92 extern BOOL32 X11DRV_Pie( struct tagDC *dc, INT32 left, INT32 top, INT32 right,
93                           INT32 bottom, INT32 xstart, INT32 ystart, INT32 xend,
94                           INT32 yend );
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,
104                                 INT32 ell_height );
105 extern COLORREF X11DRV_SetPixel( struct tagDC *dc, INT32 x, INT32 y,
106                                  COLORREF color );
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);
116
117 extern HGDIOBJ32 X11DRV_SelectObject( struct tagDC *dc, HGDIOBJ32 handle );
118
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,
129                                WORD flags );
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,
135                                        UINT32 coloruse );
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 */
141
142 extern BOOL32 X11DRV_BITMAP_Init(void);
143 extern BOOL32 X11DRV_BRUSH_Init(void);
144 extern BOOL32 X11DRV_FONT_Init( struct tagDeviceCaps* );
145
146 struct tagBITMAPOBJ;
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 );
151
152 /* Xlib critical section */
153
154 extern CRITICAL_SECTION X11DRV_CritSection;
155
156 extern void _XInitImageFuncPtrs(XImage *);
157
158 #define XCREATEIMAGE(image,width,height,bpp) \
159 { \
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 ); \
164 }
165
166 #endif  /* __WINE_X11DRV_H */
167