2 * X11 display driver definitions
5 #ifndef __WINE_X11DRV_H
6 #define __WINE_X11DRV_H
10 #ifndef X_DISPLAY_MISSING
12 #include <X11/Xresource.h>
13 #include <X11/Xutil.h>
14 #include <X11/Xatom.h>
15 #endif /* !defined(X_DISPLAY_MISSING) */
19 #include "wine/winuser16.h"
36 int type; /* GEOMETRIC || COSMETIC */
39 /* X physical brush */
49 typedef UINT32 X_PHYSFONT;
51 /* X physical device */
54 GC gc; /* X Window GC */
68 /* GCs used for B&W and color bitmap operations */
69 extern GC BITMAP_monoGC, BITMAP_colorGC;
71 #define BITMAP_GC(bmp) \
72 (((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
75 /* Wine driver X11 functions */
77 extern BOOL32 X11DRV_Init(void);
78 extern BOOL32 X11DRV_BitBlt( struct tagDC *dcDst, INT32 xDst, INT32 yDst,
79 INT32 width, INT32 height, struct tagDC *dcSrc,
80 INT32 xSrc, INT32 ySrc, DWORD rop );
81 extern BOOL32 X11DRV_EnumDeviceFonts( struct tagDC *dc, LPLOGFONT16 plf,
82 DEVICEFONTENUMPROC dfeproc, LPARAM lp );
83 extern BOOL32 X11DRV_GetCharWidth( struct tagDC *dc, UINT32 firstChar,
84 UINT32 lastChar, LPINT32 buffer );
85 extern BOOL32 X11DRV_GetTextExtentPoint( struct tagDC *dc, LPCSTR str,
86 INT32 count, LPSIZE32 size );
87 extern BOOL32 X11DRV_GetTextMetrics(struct tagDC *dc, TEXTMETRIC32A *metrics);
88 extern BOOL32 X11DRV_PatBlt( struct tagDC *dc, INT32 left, INT32 top,
89 INT32 width, INT32 height, DWORD rop );
90 extern VOID X11DRV_SetDeviceClipping(struct tagDC *dc);
91 extern BOOL32 X11DRV_StretchBlt( struct tagDC *dcDst, INT32 xDst, INT32 yDst,
92 INT32 widthDst, INT32 heightDst,
93 struct tagDC *dcSrc, INT32 xSrc, INT32 ySrc,
94 INT32 widthSrc, INT32 heightSrc, DWORD rop );
95 extern BOOL32 X11DRV_MoveToEx( struct tagDC *dc, INT32 x, INT32 y,LPPOINT32 pt);
96 extern BOOL32 X11DRV_LineTo( struct tagDC *dc, INT32 x, INT32 y);
97 extern BOOL32 X11DRV_Arc( struct tagDC *dc, INT32 left, INT32 top, INT32 right,
98 INT32 bottom, INT32 xstart, INT32 ystart, INT32 xend,
100 extern BOOL32 X11DRV_Pie( struct tagDC *dc, INT32 left, INT32 top, INT32 right,
101 INT32 bottom, INT32 xstart, INT32 ystart, INT32 xend,
103 extern BOOL32 X11DRV_Chord( struct tagDC *dc, INT32 left, INT32 top,
104 INT32 right, INT32 bottom, INT32 xstart,
105 INT32 ystart, INT32 xend, INT32 yend );
106 extern BOOL32 X11DRV_Ellipse( struct tagDC *dc, INT32 left, INT32 top,
107 INT32 right, INT32 bottom );
108 extern BOOL32 X11DRV_Rectangle(struct tagDC *dc, INT32 left, INT32 top,
109 INT32 right, INT32 bottom);
110 extern BOOL32 X11DRV_RoundRect( struct tagDC *dc, INT32 left, INT32 top,
111 INT32 right, INT32 bottom, INT32 ell_width,
113 extern COLORREF X11DRV_SetPixel( struct tagDC *dc, INT32 x, INT32 y,
115 extern COLORREF X11DRV_GetPixel( struct tagDC *dc, INT32 x, INT32 y);
116 extern BOOL32 X11DRV_PaintRgn( struct tagDC *dc, HRGN32 hrgn );
117 extern BOOL32 X11DRV_Polyline( struct tagDC *dc,const POINT32* pt,INT32 count);
118 extern BOOL32 X11DRV_PolyBezier( struct tagDC *dc, const POINT32 start, const POINT32* lppt, DWORD cPoints);
119 extern BOOL32 X11DRV_Polygon( struct tagDC *dc, const POINT32* pt, INT32 count );
120 extern BOOL32 X11DRV_PolyPolygon( struct tagDC *dc, const POINT32* pt,
121 const INT32* counts, UINT32 polygons);
122 extern BOOL32 X11DRV_PolyPolyline( struct tagDC *dc, const POINT32* pt,
123 const DWORD* counts, DWORD polylines);
125 extern HGDIOBJ32 X11DRV_SelectObject( struct tagDC *dc, HGDIOBJ32 handle );
127 extern COLORREF X11DRV_SetBkColor( struct tagDC *dc, COLORREF color );
128 extern COLORREF X11DRV_SetTextColor( struct tagDC *dc, COLORREF color );
129 extern BOOL32 X11DRV_ExtFloodFill( struct tagDC *dc, INT32 x, INT32 y,
130 COLORREF color, UINT32 fillType );
131 extern BOOL32 X11DRV_ExtTextOut( struct tagDC *dc, INT32 x, INT32 y,
132 UINT32 flags, const RECT32 *lprect,
133 LPCSTR str, UINT32 count, const INT32 *lpDx );
134 extern BOOL32 X11DRV_CreateBitmap( HBITMAP32 hbitmap );
135 extern BOOL32 X11DRV_DeleteObject( HGDIOBJ32 handle );
136 extern LONG X11DRV_BitmapBits( HBITMAP32 hbitmap, void *bits, LONG count,
138 extern INT32 X11DRV_SetDIBitsToDevice( struct tagDC *dc, INT32 xDest,
139 INT32 yDest, DWORD cx, DWORD cy,
140 INT32 xSrc, INT32 ySrc,
141 UINT32 startscan, UINT32 lines,
142 LPCVOID bits, const BITMAPINFO *info,
144 extern INT32 X11DRV_DeviceBitmapBits( struct tagDC *dc, HBITMAP32 hbitmap,
145 WORD fGet, UINT32 startscan,
146 UINT32 lines, LPSTR bits,
147 LPBITMAPINFO info, UINT32 coloruse );
148 extern HANDLE32 X11DRV_LoadOEMResource( WORD id, WORD type );
150 /* X11 driver internal functions */
152 extern BOOL32 X11DRV_BITMAP_Init(void);
153 extern BOOL32 X11DRV_BRUSH_Init(void);
154 extern BOOL32 X11DRV_DIB_Init(void);
155 extern BOOL32 X11DRV_FONT_Init( struct tagDeviceCaps* );
156 extern BOOL32 X11DRV_OBM_Init(void);
159 extern XImage *X11DRV_BITMAP_GetXImage( const struct tagBITMAPOBJ *bmp );
160 extern int X11DRV_DIB_GetXImageWidthBytes( int width, int depth );
161 extern BOOL32 X11DRV_DIB_Init(void);
162 extern X11DRV_PHYSBITMAP *X11DRV_AllocBitmap( struct tagBITMAPOBJ *bmp );
164 extern BOOL32 X11DRV_SetupGCForPatBlt( struct tagDC *dc, GC gc,
166 extern BOOL32 X11DRV_SetupGCForBrush( struct tagDC *dc );
167 extern BOOL32 X11DRV_SetupGCForPen( struct tagDC *dc );
168 extern BOOL32 X11DRV_SetupGCForText( struct tagDC *dc );
170 extern const int X11DRV_XROPfunction[];
172 /* Xlib critical section */
174 extern CRITICAL_SECTION X11DRV_CritSection;
176 extern void _XInitImageFuncPtrs(XImage *);
178 #define XCREATEIMAGE(image,width,height,bpp) \
180 int width_bytes = X11DRV_DIB_GetXImageWidthBytes( (width), (bpp) ); \
181 (image) = TSXCreateImage(display, DefaultVisualOfScreen(X11DRV_GetXScreen()), \
182 (bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
183 (width), (height), 32, width_bytes ); \
186 /* exported dib functions for now */
188 /* This structure holds the arguments for DIB_SetImageBits() */
209 } DIB_SETIMAGEBITS_DESCR;
211 extern int X11DRV_DIB_GetImageBits( const DIB_SETIMAGEBITS_DESCR *descr );
212 extern int X11DRV_DIB_SetImageBits( const DIB_SETIMAGEBITS_DESCR *descr );
213 extern int *X11DRV_DIB_BuildColorMap( struct tagDC *dc, WORD coloruse,
214 WORD depth, const BITMAPINFO *info,
217 /* X11 clipboard driver */
219 extern struct _CLIPBOARD_DRIVER X11DRV_CLIPBOARD_Driver;
221 extern void X11DRV_CLIPBOARD_EmptyClipboard(void);
222 extern void X11DRV_CLIPBOARD_SetClipboardData(UINT32 wFormat);
223 extern BOOL32 X11DRV_CLIPBOARD_RequestSelection(void);
224 extern void X11DRV_CLIPBOARD_ResetOwner(struct tagWND *pWnd, BOOL32 bFooBar);
226 void X11DRV_CLIPBOARD_ReadSelection(Window w, Atom prop);
227 void X11DRV_CLIPBOARD_ReleaseSelection(Window w, HWND32 hwnd);
229 /* X11 color driver */
231 extern Colormap X11DRV_COLOR_GetColormap(void);
233 /* X11 desktop driver */
235 extern struct _DESKTOP_DRIVER X11DRV_DESKTOP_Driver;
237 typedef struct _X11DRV_DESKTOP_DATA {
238 } X11DRV_DESKTOP_DATA;
242 extern Screen *X11DRV_DESKTOP_GetXScreen(struct tagDESKTOP *pDesktop);
243 extern Window X11DRV_DESKTOP_GetXRootWindow(struct tagDESKTOP *pDesktop);
245 extern void X11DRV_DESKTOP_Initialize(struct tagDESKTOP *pDesktop);
246 extern void X11DRV_DESKTOP_Finalize(struct tagDESKTOP *pDesktop);
247 extern int X11DRV_DESKTOP_GetScreenWidth(struct tagDESKTOP *pDesktop);
248 extern int X11DRV_DESKTOP_GetScreenHeight(struct tagDESKTOP *pDesktop);
249 extern int X11DRV_DESKTOP_GetScreenDepth(struct tagDESKTOP *pDesktop);
251 /* X11 event driver */
253 extern struct _EVENT_DRIVER X11DRV_EVENT_Driver;
255 extern BOOL32 X11DRV_EVENT_Init(void);
256 extern void X11DRV_EVENT_AddIO(int fd, unsigned flag);
257 extern void X11DRV_EVENT_DeleteIO(int fd, unsigned flag);
258 extern BOOL32 X11DRV_EVENT_WaitNetEvent(BOOL32 sleep, BOOL32 peek);
259 extern void X11DRV_EVENT_Synchronize(void);
260 extern BOOL32 X11DRV_EVENT_CheckFocus( void );
261 extern BOOL32 X11DRV_EVENT_QueryPointer(DWORD *posX, DWORD *posY, DWORD *state);
262 extern void X11DRV_EVENT_DummyMotionNotify(void);
263 extern BOOL32 X11DRV_EVENT_Pending(void);
264 extern BOOL16 X11DRV_EVENT_IsUserIdle(void);
266 /* X11 keyboard driver */
268 extern struct _KEYBOARD_DRIVER X11DRV_KEYBOARD_Driver;
270 extern void X11DRV_KEYBOARD_Init(void);
271 extern WORD X11DRV_KEYBOARD_VkKeyScan(CHAR cChar);
272 extern UINT16 X11DRV_KEYBOARD_MapVirtualKey(UINT16 wCode, UINT16 wMapType);
273 extern INT16 X11DRV_KEYBOARD_GetKeyNameText(LONG lParam, LPSTR lpBuffer, INT16 nSize);
274 extern INT16 X11DRV_KEYBOARD_ToAscii(UINT16 virtKey, UINT16 scanCode, LPBYTE lpKeyState, LPVOID lpChar, UINT16 flags);
275 extern void KEYBOARD_HandleEvent( struct tagWND *pWnd, XKeyEvent *event );
276 extern void KEYBOARD_UpdateState ( void );
278 /* X11 main driver */
280 extern Display *display;
281 extern Screen *X11DRV_GetXScreen(void);
282 extern Window X11DRV_GetXRootWindow(void);
284 extern void X11DRV_MAIN_Finalize(void);
285 extern void X11DRV_MAIN_Initialize(void);
286 extern void X11DRV_MAIN_ParseOptions(int *argc, char *argv[]);
287 extern void X11DRV_MAIN_Create(void);
288 extern void X11DRV_MAIN_SaveSetup(void);
289 extern void X11DRV_MAIN_RestoreSetup(void);
291 /* X11 monitor driver */
293 extern struct tagMONITOR_DRIVER X11DRV_MONITOR_Driver;
295 typedef struct _X11DRV_MONITOR_DATA {
301 } X11DRV_MONITOR_DATA;
305 extern Screen *X11DRV_MONITOR_GetXScreen(struct tagMONITOR *pMonitor);
306 extern Window X11DRV_MONITOR_GetXRootWindow(struct tagMONITOR *pMonitor);
308 extern void X11DRV_MONITOR_Initialize(struct tagMONITOR *pMonitor);
309 extern void X11DRV_MONITOR_Finalize(struct tagMONITOR *pMonitor);
310 extern int X11DRV_MONITOR_GetWidth(struct tagMONITOR *pMonitor);
311 extern int X11DRV_MONITOR_GetHeight(struct tagMONITOR *pMonitor);
312 extern int X11DRV_MONITOR_GetDepth(struct tagMONITOR *pMonitor);
314 /* X11 mouse driver */
316 extern struct _MOUSE_DRIVER X11DRV_MOUSE_Driver;
318 extern void X11DRV_MOUSE_SetCursor(CURSORICONINFO *lpCursor);
319 extern void X11DRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY);
321 /* X11 windows driver */
323 extern struct _WND_DRIVER X11DRV_WND_Driver;
325 typedef struct _X11DRV_WND_DATA {
329 extern Window X11DRV_WND_GetXWindow(struct tagWND *wndPtr);
330 extern Window X11DRV_WND_FindXWindow(struct tagWND *wndPtr);
331 extern Screen *X11DRV_WND_GetXScreen(struct tagWND *wndPtr);
332 extern Window X11DRV_WND_GetXRootWindow(struct tagWND *wndPtr);
334 extern void X11DRV_WND_Initialize(struct tagWND *wndPtr);
335 extern void X11DRV_WND_Finalize(struct tagWND *wndPtr);
336 extern BOOL32 X11DRV_WND_CreateDesktopWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, BOOL32 bUnicode);
337 extern BOOL32 X11DRV_WND_CreateWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, CREATESTRUCT32A *cs, BOOL32 bUnicode);
338 extern BOOL32 X11DRV_WND_DestroyWindow(struct tagWND *pWnd);
339 extern struct tagWND *X11DRV_WND_SetParent(struct tagWND *wndPtr, struct tagWND *pWndParent);
340 extern void X11DRV_WND_ForceWindowRaise(struct tagWND *pWnd);
341 extern void X11DRV_WND_SetWindowPos(struct tagWND *wndPtr, const WINDOWPOS32 *winpos, BOOL32 bSMC_SETXPOS);
342 extern void X11DRV_WND_SetText(struct tagWND *wndPtr, LPCSTR text);
343 extern void X11DRV_WND_SetFocus(struct tagWND *wndPtr);
344 extern void X11DRV_WND_PreSizeMove(struct tagWND *wndPtr);
345 extern void X11DRV_WND_PostSizeMove(struct tagWND *wndPtr);
346 extern void X11DRV_WND_ScrollWindow(struct tagWND *wndPtr, struct tagDC *dcPtr, INT32 dx, INT32 dy, const RECT32 *clipRect, BOOL32 bUpdate);
347 extern void X11DRV_WND_SetDrawable(struct tagWND *wndPtr, struct tagDC *dc, WORD flags, BOOL32 bSetClipOrigin);
348 extern BOOL32 X11DRV_WND_IsSelfClipping(struct tagWND *wndPtr);
350 #endif /* __WINE_X11DRV_H */