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) */
25 struct tagCREATESTRUCTA
;
27 struct tagCURSORICONINFO
;
39 int type
; /* GEOMETRIC || COSMETIC */
42 /* X physical brush */
52 typedef UINT X_PHYSFONT
;
54 /* X physical device */
57 GC gc
; /* X Window GC */
71 /* GCs used for B&W and color bitmap operations */
72 extern GC BITMAP_monoGC
, BITMAP_colorGC
;
74 #define BITMAP_GC(bmp) \
75 (((bmp)->bitmap.bmBitsPixel == 1) ? BITMAP_monoGC : BITMAP_colorGC)
78 /* Wine driver X11 functions */
80 extern BOOL
X11DRV_Init(void);
81 extern BOOL
X11DRV_BitBlt( struct tagDC
*dcDst
, INT xDst
, INT yDst
,
82 INT width
, INT height
, struct tagDC
*dcSrc
,
83 INT xSrc
, INT ySrc
, DWORD rop
);
84 extern BOOL
X11DRV_EnumDeviceFonts( struct tagDC
*dc
, LPLOGFONT16 plf
,
85 DEVICEFONTENUMPROC dfeproc
, LPARAM lp
);
86 extern BOOL
X11DRV_GetCharWidth( struct tagDC
*dc
, UINT firstChar
,
87 UINT lastChar
, LPINT buffer
);
88 extern BOOL
X11DRV_GetTextExtentPoint( struct tagDC
*dc
, LPCSTR str
,
89 INT count
, LPSIZE size
);
90 extern BOOL
X11DRV_GetTextMetrics(struct tagDC
*dc
, TEXTMETRICA
*metrics
);
91 extern BOOL
X11DRV_PatBlt( struct tagDC
*dc
, INT left
, INT top
,
92 INT width
, INT height
, DWORD rop
);
93 extern VOID
X11DRV_SetDeviceClipping(struct tagDC
*dc
);
94 extern BOOL
X11DRV_StretchBlt( struct tagDC
*dcDst
, INT xDst
, INT yDst
,
95 INT widthDst
, INT heightDst
,
96 struct tagDC
*dcSrc
, INT xSrc
, INT ySrc
,
97 INT widthSrc
, INT heightSrc
, DWORD rop
);
98 extern BOOL
X11DRV_MoveToEx( struct tagDC
*dc
, INT x
, INT y
,LPPOINT pt
);
99 extern BOOL
X11DRV_LineTo( struct tagDC
*dc
, INT x
, INT y
);
100 extern BOOL
X11DRV_Arc( struct tagDC
*dc
, INT left
, INT top
, INT right
,
101 INT bottom
, INT xstart
, INT ystart
, INT xend
,
103 extern BOOL
X11DRV_Pie( struct tagDC
*dc
, INT left
, INT top
, INT right
,
104 INT bottom
, INT xstart
, INT ystart
, INT xend
,
106 extern BOOL
X11DRV_Chord( struct tagDC
*dc
, INT left
, INT top
,
107 INT right
, INT bottom
, INT xstart
,
108 INT ystart
, INT xend
, INT yend
);
109 extern BOOL
X11DRV_Ellipse( struct tagDC
*dc
, INT left
, INT top
,
110 INT right
, INT bottom
);
111 extern BOOL
X11DRV_Rectangle(struct tagDC
*dc
, INT left
, INT top
,
112 INT right
, INT bottom
);
113 extern BOOL
X11DRV_RoundRect( struct tagDC
*dc
, INT left
, INT top
,
114 INT right
, INT bottom
, INT ell_width
,
116 extern COLORREF
X11DRV_SetPixel( struct tagDC
*dc
, INT x
, INT y
,
118 extern COLORREF
X11DRV_GetPixel( struct tagDC
*dc
, INT x
, INT y
);
119 extern BOOL
X11DRV_PaintRgn( struct tagDC
*dc
, HRGN hrgn
);
120 extern BOOL
X11DRV_Polyline( struct tagDC
*dc
,const POINT
* pt
,INT count
);
121 extern BOOL
X11DRV_PolyBezier( struct tagDC
*dc
, const POINT start
, const POINT
* lppt
, DWORD cPoints
);
122 extern BOOL
X11DRV_Polygon( struct tagDC
*dc
, const POINT
* pt
, INT count
);
123 extern BOOL
X11DRV_PolyPolygon( struct tagDC
*dc
, const POINT
* pt
,
124 const INT
* counts
, UINT polygons
);
125 extern BOOL
X11DRV_PolyPolyline( struct tagDC
*dc
, const POINT
* pt
,
126 const DWORD
* counts
, DWORD polylines
);
128 extern HGDIOBJ
X11DRV_SelectObject( struct tagDC
*dc
, HGDIOBJ handle
);
130 extern COLORREF
X11DRV_SetBkColor( struct tagDC
*dc
, COLORREF color
);
131 extern COLORREF
X11DRV_SetTextColor( struct tagDC
*dc
, COLORREF color
);
132 extern BOOL
X11DRV_ExtFloodFill( struct tagDC
*dc
, INT x
, INT y
,
133 COLORREF color
, UINT fillType
);
134 extern BOOL
X11DRV_ExtTextOut( struct tagDC
*dc
, INT x
, INT y
,
135 UINT flags
, const RECT
*lprect
,
136 LPCSTR str
, UINT count
, const INT
*lpDx
);
137 extern BOOL
X11DRV_CreateBitmap( HBITMAP hbitmap
);
138 extern BOOL
X11DRV_DeleteObject( HGDIOBJ handle
);
139 extern LONG
X11DRV_BitmapBits( HBITMAP hbitmap
, void *bits
, LONG count
,
141 extern INT
X11DRV_SetDIBitsToDevice( struct tagDC
*dc
, INT xDest
,
142 INT yDest
, DWORD cx
, DWORD cy
,
144 UINT startscan
, UINT lines
,
145 LPCVOID bits
, const BITMAPINFO
*info
,
147 extern INT
X11DRV_DeviceBitmapBits( struct tagDC
*dc
, HBITMAP hbitmap
,
148 WORD fGet
, UINT startscan
,
149 UINT lines
, LPSTR bits
,
150 LPBITMAPINFO info
, UINT coloruse
);
151 extern HANDLE
X11DRV_LoadOEMResource( WORD id
, WORD type
);
153 /* X11 driver internal functions */
155 extern BOOL
X11DRV_BITMAP_Init(void);
156 extern BOOL
X11DRV_BRUSH_Init(void);
157 extern BOOL
X11DRV_DIB_Init(void);
158 extern BOOL
X11DRV_FONT_Init( struct tagDeviceCaps
* );
159 extern BOOL
X11DRV_OBM_Init(void);
162 extern XImage
*X11DRV_BITMAP_GetXImage( const struct tagBITMAPOBJ
*bmp
);
163 extern int X11DRV_DIB_GetXImageWidthBytes( int width
, int depth
);
164 extern BOOL
X11DRV_DIB_Init(void);
165 extern X11DRV_PHYSBITMAP
*X11DRV_AllocBitmap( struct tagBITMAPOBJ
*bmp
);
167 extern BOOL
X11DRV_SetupGCForPatBlt( struct tagDC
*dc
, GC gc
,
169 extern BOOL
X11DRV_SetupGCForBrush( struct tagDC
*dc
);
170 extern BOOL
X11DRV_SetupGCForPen( struct tagDC
*dc
);
171 extern BOOL
X11DRV_SetupGCForText( struct tagDC
*dc
);
173 extern const int X11DRV_XROPfunction
[];
175 /* Xlib critical section */
177 extern CRITICAL_SECTION X11DRV_CritSection
;
179 extern void _XInitImageFuncPtrs(XImage
*);
181 #define XCREATEIMAGE(image,width,height,bpp) \
183 int width_bytes = X11DRV_DIB_GetXImageWidthBytes( (width), (bpp) ); \
184 (image) = TSXCreateImage(display, DefaultVisualOfScreen(X11DRV_GetXScreen()), \
185 (bpp), ZPixmap, 0, xcalloc( (height)*width_bytes ),\
186 (width), (height), 32, width_bytes ); \
189 /* exported dib functions for now */
191 /* This structure holds the arguments for DIB_SetImageBits() */
212 } DIB_SETIMAGEBITS_DESCR
;
214 extern int X11DRV_DIB_GetImageBits( const DIB_SETIMAGEBITS_DESCR
*descr
);
215 extern int X11DRV_DIB_SetImageBits( const DIB_SETIMAGEBITS_DESCR
*descr
);
216 extern int *X11DRV_DIB_BuildColorMap( struct tagDC
*dc
, WORD coloruse
,
217 WORD depth
, const BITMAPINFO
*info
,
220 /* X11 clipboard driver */
222 extern struct _CLIPBOARD_DRIVER X11DRV_CLIPBOARD_Driver
;
224 extern void X11DRV_CLIPBOARD_EmptyClipboard(void);
225 extern void X11DRV_CLIPBOARD_SetClipboardData(UINT wFormat
);
226 extern BOOL
X11DRV_CLIPBOARD_RequestSelection(void);
227 extern void X11DRV_CLIPBOARD_ResetOwner(struct tagWND
*pWnd
, BOOL bFooBar
);
229 void X11DRV_CLIPBOARD_ReadSelection(Window w
, Atom prop
);
230 void X11DRV_CLIPBOARD_ReleaseSelection(Window w
, HWND hwnd
);
232 /* X11 color driver */
234 extern Colormap
X11DRV_COLOR_GetColormap(void);
236 /* X11 desktop driver */
238 extern struct _DESKTOP_DRIVER X11DRV_DESKTOP_Driver
;
240 typedef struct _X11DRV_DESKTOP_DATA
{
241 } X11DRV_DESKTOP_DATA
;
245 extern Screen
*X11DRV_DESKTOP_GetXScreen(struct tagDESKTOP
*pDesktop
);
246 extern Window
X11DRV_DESKTOP_GetXRootWindow(struct tagDESKTOP
*pDesktop
);
248 extern void X11DRV_DESKTOP_Initialize(struct tagDESKTOP
*pDesktop
);
249 extern void X11DRV_DESKTOP_Finalize(struct tagDESKTOP
*pDesktop
);
250 extern int X11DRV_DESKTOP_GetScreenWidth(struct tagDESKTOP
*pDesktop
);
251 extern int X11DRV_DESKTOP_GetScreenHeight(struct tagDESKTOP
*pDesktop
);
252 extern int X11DRV_DESKTOP_GetScreenDepth(struct tagDESKTOP
*pDesktop
);
254 /* X11 event driver */
256 extern struct _EVENT_DRIVER X11DRV_EVENT_Driver
;
258 extern BOOL
X11DRV_EVENT_Init(void);
259 extern void X11DRV_EVENT_AddIO(int fd
, unsigned flag
);
260 extern void X11DRV_EVENT_DeleteIO(int fd
, unsigned flag
);
261 extern BOOL
X11DRV_EVENT_WaitNetEvent(BOOL sleep
, BOOL peek
);
262 extern void X11DRV_EVENT_Synchronize(void);
263 extern BOOL
X11DRV_EVENT_CheckFocus( void );
264 extern BOOL
X11DRV_EVENT_QueryPointer(DWORD
*posX
, DWORD
*posY
, DWORD
*state
);
265 extern void X11DRV_EVENT_DummyMotionNotify(void);
266 extern BOOL
X11DRV_EVENT_Pending(void);
267 extern BOOL16
X11DRV_EVENT_IsUserIdle(void);
268 extern void X11DRV_EVENT_WakeUp(void);
270 /* X11 keyboard driver */
272 extern struct _KEYBOARD_DRIVER X11DRV_KEYBOARD_Driver
;
274 extern void X11DRV_KEYBOARD_Init(void);
275 extern WORD
X11DRV_KEYBOARD_VkKeyScan(CHAR cChar
);
276 extern UINT16
X11DRV_KEYBOARD_MapVirtualKey(UINT16 wCode
, UINT16 wMapType
);
277 extern INT16
X11DRV_KEYBOARD_GetKeyNameText(LONG lParam
, LPSTR lpBuffer
, INT16 nSize
);
278 extern INT16
X11DRV_KEYBOARD_ToAscii(UINT16 virtKey
, UINT16 scanCode
, LPBYTE lpKeyState
, LPVOID lpChar
, UINT16 flags
);
279 extern void KEYBOARD_HandleEvent( struct tagWND
*pWnd
, XKeyEvent
*event
);
280 extern void KEYBOARD_UpdateState ( void );
282 /* X11 main driver */
284 extern Display
*display
;
285 extern Screen
*X11DRV_GetXScreen(void);
286 extern Window
X11DRV_GetXRootWindow(void);
288 extern void X11DRV_MAIN_Finalize(void);
289 extern void X11DRV_MAIN_Initialize(void);
290 extern void X11DRV_MAIN_ParseOptions(int *argc
, char *argv
[]);
291 extern void X11DRV_MAIN_Create(void);
292 extern void X11DRV_MAIN_SaveSetup(void);
293 extern void X11DRV_MAIN_RestoreSetup(void);
295 /* X11 monitor driver */
297 extern struct tagMONITOR_DRIVER X11DRV_MONITOR_Driver
;
299 typedef struct _X11DRV_MONITOR_DATA
{
305 } X11DRV_MONITOR_DATA
;
309 extern Screen
*X11DRV_MONITOR_GetXScreen(struct tagMONITOR
*pMonitor
);
310 extern Window
X11DRV_MONITOR_GetXRootWindow(struct tagMONITOR
*pMonitor
);
312 extern void X11DRV_MONITOR_Initialize(struct tagMONITOR
*pMonitor
);
313 extern void X11DRV_MONITOR_Finalize(struct tagMONITOR
*pMonitor
);
314 extern int X11DRV_MONITOR_GetWidth(struct tagMONITOR
*pMonitor
);
315 extern int X11DRV_MONITOR_GetHeight(struct tagMONITOR
*pMonitor
);
316 extern int X11DRV_MONITOR_GetDepth(struct tagMONITOR
*pMonitor
);
318 /* X11 mouse driver */
320 extern struct _MOUSE_DRIVER X11DRV_MOUSE_Driver
;
322 extern void X11DRV_MOUSE_SetCursor(struct tagCURSORICONINFO
*lpCursor
);
323 extern void X11DRV_MOUSE_MoveCursor(WORD wAbsX
, WORD wAbsY
);
325 /* X11 windows driver */
327 extern struct _WND_DRIVER X11DRV_WND_Driver
;
329 typedef struct _X11DRV_WND_DATA
{
333 extern Window
X11DRV_WND_GetXWindow(struct tagWND
*wndPtr
);
334 extern Window
X11DRV_WND_FindXWindow(struct tagWND
*wndPtr
);
335 extern Screen
*X11DRV_WND_GetXScreen(struct tagWND
*wndPtr
);
336 extern Window
X11DRV_WND_GetXRootWindow(struct tagWND
*wndPtr
);
338 extern void X11DRV_WND_Initialize(struct tagWND
*wndPtr
);
339 extern void X11DRV_WND_Finalize(struct tagWND
*wndPtr
);
340 extern BOOL
X11DRV_WND_CreateDesktopWindow(struct tagWND
*wndPtr
, struct tagCLASS
*classPtr
, BOOL bUnicode
);
341 extern BOOL
X11DRV_WND_CreateWindow(struct tagWND
*wndPtr
, struct tagCLASS
*classPtr
, struct tagCREATESTRUCTA
*cs
, BOOL bUnicode
);
342 extern BOOL
X11DRV_WND_DestroyWindow(struct tagWND
*pWnd
);
343 extern struct tagWND
*X11DRV_WND_SetParent(struct tagWND
*wndPtr
, struct tagWND
*pWndParent
);
344 extern void X11DRV_WND_ForceWindowRaise(struct tagWND
*pWnd
);
345 extern void X11DRV_WND_SetWindowPos(struct tagWND
*wndPtr
, const struct tagWINDOWPOS
*winpos
, BOOL bSMC_SETXPOS
);
346 extern void X11DRV_WND_SetText(struct tagWND
*wndPtr
, LPCSTR text
);
347 extern void X11DRV_WND_SetFocus(struct tagWND
*wndPtr
);
348 extern void X11DRV_WND_PreSizeMove(struct tagWND
*wndPtr
);
349 extern void X11DRV_WND_PostSizeMove(struct tagWND
*wndPtr
);
350 extern void X11DRV_WND_ScrollWindow(struct tagWND
*wndPtr
, struct tagDC
*dcPtr
, INT dx
, INT dy
, const RECT
*clipRect
, BOOL bUpdate
);
351 extern void X11DRV_WND_SetDrawable(struct tagWND
*wndPtr
, struct tagDC
*dc
, WORD flags
, BOOL bSetClipOrigin
);
352 extern BOOL
X11DRV_WND_IsSelfClipping(struct tagWND
*wndPtr
);
354 #endif /* __WINE_X11DRV_H */