2 * TTY driver definitions
5 #ifndef __WINE_TTYDRV_H
6 #define __WINE_TTYDRV_H
13 #elif defined(HAVE_CURSES_H)
20 #include "wine/winuser16.h"
21 #include "wine/wingdi16.h"
31 struct tagCURSORICONINFO
;
32 struct tagCREATESTRUCTA
;
35 /**************************************************************************
39 extern struct tagGDI_DRIVER TTYDRV_GDI_Driver
;
41 extern BOOL
TTYDRV_GDI_Initialize(void);
42 extern void TTYDRV_GDI_Finalize(void);
44 /* TTY GDI bitmap driver */
46 extern HBITMAP
TTYDRV_BITMAP_CreateDIBSection(struct tagDC
*dc
, BITMAPINFO
*bmi
, UINT usage
, LPVOID
*bits
, HANDLE section
, DWORD offset
);
47 extern HBITMAP16
TTYDRV_BITMAP_CreateDIBSection16(struct tagDC
*dc
, BITMAPINFO
*bmi
, UINT16 usage
, SEGPTR
*bits
, HANDLE section
, DWORD offset
);
49 extern INT
TTYDRV_BITMAP_SetDIBits(struct tagBITMAPOBJ
*bmp
, struct tagDC
*dc
, UINT startscan
, UINT lines
, LPCVOID bits
, const BITMAPINFO
*info
, UINT coloruse
, HBITMAP hbitmap
);
50 extern INT
TTYDRV_BITMAP_GetDIBits(struct tagBITMAPOBJ
*bmp
, struct tagDC
*dc
, UINT startscan
, UINT lines
, LPVOID bits
, BITMAPINFO
*info
, UINT coloruse
, HBITMAP hbitmap
);
51 extern void TTYDRV_BITMAP_DeleteDIBSection(struct tagBITMAPOBJ
*bmp
);
56 #endif /* defined(HAVE_LIBCURSES) */
62 int dummy
; /* FIXME: Remove later */
65 extern BOOL
TTYDRV_DC_CreateBitmap(HBITMAP hbitmap
);
67 extern BOOL
TTYDRV_DC_Arc(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
, INT xstart
, INT ystart
, INT xend
, INT yend
);
68 extern LONG
TTYDRV_DC_BitmapBits(HBITMAP hbitmap
, void *bits
, LONG count
, WORD flags
);
69 extern BOOL
TTYDRV_DC_CreateBitmap(HBITMAP hbitmap
);
70 extern BOOL
TTYDRV_DC_CreateDC(struct tagDC
*dc
, LPCSTR driver
, LPCSTR device
, LPCSTR output
, const DEVMODEA
*initData
);
71 extern BOOL
TTYDRV_DC_DeleteDC(struct tagDC
*dc
);
72 extern BOOL
TTYDRV_DC_DeleteObject(HGDIOBJ handle
);
73 extern BOOL
TTYDRV_DC_BitBlt(struct tagDC
*dcDst
, INT xDst
, INT yDst
, INT width
, INT height
, struct tagDC
*dcSrc
, INT xSrc
, INT ySrc
, DWORD rop
);
74 extern BOOL
TTYDRV_DC_Chord(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
, INT xstart
, INT ystart
, INT xend
, INT yend
);
75 extern BOOL
TTYDRV_DC_Ellipse(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
);
76 extern INT
TTYDRV_DC_Escape(struct tagDC
*dc
, INT nEscape
, INT cbInput
, SEGPTR lpInData
, SEGPTR lpOutData
);
77 extern BOOL
TTYDRV_DC_ExtFloodFill(struct tagDC
*dc
, INT x
, INT y
, COLORREF color
, UINT fillType
);
78 extern BOOL
TTYDRV_DC_ExtTextOut(struct tagDC
*dc
, INT x
, INT y
, UINT flags
, const RECT
*lpRect
, LPCWSTR str
, UINT count
, const INT
*lpDx
);
79 extern BOOL
TTYDRV_DC_GetCharWidth(struct tagDC
*dc
, UINT firstChar
, UINT lastChar
, LPINT buffer
);
80 extern COLORREF
TTYDRV_DC_GetPixel(struct tagDC
*dc
, INT x
, INT y
);
82 extern BOOL
TTYDRV_DC_GetTextExtentPoint(struct tagDC
*dc
, LPCWSTR str
, INT count
, LPSIZE size
);
83 extern BOOL
TTYDRV_DC_GetTextMetrics(struct tagDC
*dc
, TEXTMETRICA
*metrics
);
84 extern BOOL
TTYDRV_DC_LineTo(struct tagDC
*dc
, INT x
, INT y
);
85 extern HANDLE
TTYDRV_DC_LoadOEMResource(WORD resid
, WORD type
);
86 extern BOOL
TTYDRV_DC_PaintRgn(struct tagDC
*dc
, HRGN hrgn
);
87 extern BOOL
TTYDRV_DC_PatBlt(struct tagDC
*dc
, INT left
, INT top
, INT width
, INT height
, DWORD rop
);
88 extern BOOL
TTYDRV_DC_Pie(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
, INT xstart
, INT ystart
, INT xend
, INT yend
);
89 extern BOOL
TTYDRV_DC_Polygon(struct tagDC
*dc
, const POINT
* pt
, INT count
);
90 extern BOOL
TTYDRV_DC_Polyline(struct tagDC
*dc
, const POINT
* pt
, INT count
);
91 extern BOOL
TTYDRV_DC_PolyPolygon(struct tagDC
*dc
, const POINT
* pt
, const INT
* counts
, UINT polygons
);
92 extern BOOL
TTYDRV_DC_PolyPolyline(struct tagDC
*dc
, const POINT
* pt
, const DWORD
* counts
, DWORD polylines
);
93 extern BOOL
TTYDRV_DC_Rectangle(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
);
94 extern BOOL
TTYDRV_DC_RoundRect(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
, INT ell_width
, INT ell_height
);
95 extern void TTYDRV_DC_SetDeviceClipping(struct tagDC
*dc
);
96 extern HGDIOBJ
TTYDRV_DC_SelectObject(struct tagDC
*dc
, HGDIOBJ handle
);
97 extern COLORREF
TTYDRV_DC_SetBkColor(struct tagDC
*dc
, COLORREF color
);
98 extern COLORREF
TTYDRV_DC_SetPixel(struct tagDC
*dc
, INT x
, INT y
, COLORREF color
);
99 extern COLORREF
TTYDRV_DC_SetTextColor(struct tagDC
*dc
, COLORREF color
);
100 extern BOOL
TTYDRV_DC_StretchBlt(struct tagDC
*dcDst
, INT xDst
, INT yDst
, INT widthDst
, INT heightDst
, struct tagDC
*dcSrc
, INT xSrc
, INT ySrc
, INT widthSrc
, INT heightSrc
, DWORD rop
);
101 INT
TTYDRV_DC_SetDIBitsToDevice(struct tagDC
*dc
, INT xDest
, INT yDest
, DWORD cx
, DWORD cy
, INT xSrc
, INT ySrc
, UINT startscan
, UINT lines
, LPCVOID bits
, const BITMAPINFO
*info
, UINT coloruse
);
103 /* TTY GDI palette driver */
105 extern struct tagPALETTE_DRIVER TTYDRV_PALETTE_Driver
;
107 extern BOOL
TTYDRV_PALETTE_Initialize(void);
108 extern void TTYDRV_PALETTE_Finalize(void);
110 extern int TTYDRV_PALETTE_SetMapping(struct tagPALETTEOBJ
*palPtr
, UINT uStart
, UINT uNum
, BOOL mapOnly
);
111 extern int TTYDRV_PALETTE_UpdateMapping(struct tagPALETTEOBJ
*palPtr
);
112 extern BOOL
TTYDRV_PALETTE_IsDark(int pixel
);
114 /**************************************************************************
118 extern struct tagUSER_DRIVER TTYDRV_USER_Driver
;
120 extern BOOL
TTYDRV_USER_Initialize(void);
121 extern void TTYDRV_USER_Finalize(void);
122 extern void TTYDRV_USER_BeginDebugging(void);
123 extern void TTYDRV_USER_EndDebugging(void);
125 /* TTY clipboard driver */
127 extern struct tagCLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver
;
129 extern void TTYDRV_CLIPBOARD_Acquire(void);
130 extern void TTYDRV_CLIPBOARD_Release(void);
131 extern void TTYDRV_CLIPBOARD_SetData(UINT wFormat
);
132 extern BOOL
TTYDRV_CLIPBOARD_GetData(UINT wFormat
);
133 extern BOOL
TTYDRV_CLIPBOARD_IsFormatAvailable(UINT wFormat
);
134 extern BOOL
TTYDRV_CLIPBOARD_RegisterFormat( LPCSTR FormatName
);
135 extern BOOL
TTYDRV_CLIPBOARD_IsSelectionowner();
136 extern void TTYDRV_CLIPBOARD_ResetOwner(struct tagWND
*pWnd
, BOOL bFooBar
);
138 /* TTY desktop driver */
140 extern struct tagDESKTOP_DRIVER TTYDRV_DESKTOP_Driver
;
142 #ifdef HAVE_LIBCURSES
143 extern WINDOW
*TTYDRV_DESKTOP_GetCursesRootWindow(struct tagDESKTOP
*pDesktop
);
144 #endif /* defined(HAVE_LIBCURSES) */
146 extern void TTYDRV_DESKTOP_Initialize(struct tagDESKTOP
*pDesktop
);
147 extern void TTYDRV_DESKTOP_Finalize(struct tagDESKTOP
*pDesktop
);
148 extern int TTYDRV_DESKTOP_GetScreenWidth(struct tagDESKTOP
*pDesktop
);
149 extern int TTYDRV_DESKTOP_GetScreenHeight(struct tagDESKTOP
*pDesktop
);
150 extern int TTYDRV_DESKTOP_GetScreenDepth(struct tagDESKTOP
*pDesktop
);
152 /* TTY event driver */
154 extern struct tagEVENT_DRIVER TTYDRV_EVENT_Driver
;
156 extern BOOL
TTYDRV_EVENT_Init(void);
157 extern void TTYDRV_EVENT_Synchronize(void);
158 extern BOOL
TTYDRV_EVENT_CheckFocus(void);
159 extern void TTYDRV_EVENT_UserRepaintDisable(BOOL bDisable
);
161 /* TTY keyboard driver */
163 extern struct tagKEYBOARD_DRIVER TTYDRV_KEYBOARD_Driver
;
165 extern void TTYDRV_KEYBOARD_Init(void);
166 extern WORD
TTYDRV_KEYBOARD_VkKeyScan(CHAR cChar
);
167 extern UINT16
TTYDRV_KEYBOARD_MapVirtualKey(UINT16 wCode
, UINT16 wMapType
);
168 extern INT16
TTYDRV_KEYBOARD_GetKeyNameText(LONG lParam
, LPSTR lpBuffer
, INT16 nSize
);
169 extern INT16
TTYDRV_KEYBOARD_ToAscii(UINT16 virtKey
, UINT16 scanCode
, LPBYTE lpKeyState
, LPVOID lpChar
, UINT16 flags
);
170 extern BOOL
TTYDRV_KEYBOARD_GetBeepActive(void);
171 extern void TTYDRV_KEYBOARD_SetBeepActive(BOOL bActivate
);
172 extern void TTYDRV_KEYBOARD_Beep(void);
173 extern BOOL
TTYDRV_KEYBOARD_GetDIState(DWORD len
, LPVOID ptr
);
174 extern BOOL
TTYDRV_KEYBOARD_GetDIData(BYTE
*keystate
, DWORD dodsize
, LPDIDEVICEOBJECTDATA dod
, LPDWORD entries
, DWORD flags
);
175 extern void TTYDRV_KEYBOARD_GetKeyboardConfig(KEYBOARD_CONFIG
*cfg
);
176 extern void TTYDRV_KEYBOARD_SetKeyboardConfig(KEYBOARD_CONFIG
*cfg
, DWORD mask
);
178 /* TTY monitor driver */
180 extern struct tagMONITOR_DRIVER TTYDRV_MONITOR_Driver
;
182 typedef struct tagTTYDRV_MONITOR_DATA
{
183 #ifdef HAVE_LIBCURSES
185 #endif /* defined(HAVE_LIBCURSES) */
191 } TTYDRV_MONITOR_DATA
;
195 #ifdef HAVE_LIBCURSES
196 extern WINDOW
*TTYDRV_MONITOR_GetCursesRootWindow(struct tagMONITOR
*pMonitor
);
197 #endif /* defined(HAVE_LIBCURSES) */
199 extern INT
TTYDRV_MONITOR_GetCellWidth(struct tagMONITOR
*pMonitor
);
200 extern INT
TTYDRV_MONITOR_GetCellHeight(struct tagMONITOR
*pMonitor
);
202 extern void TTYDRV_MONITOR_Initialize(struct tagMONITOR
*pMonitor
);
203 extern void TTYDRV_MONITOR_Finalize(struct tagMONITOR
*pMonitor
);
204 extern BOOL
TTYDRV_MONITOR_IsSingleWindow(struct tagMONITOR
*pMonitor
);
205 extern int TTYDRV_MONITOR_GetWidth(struct tagMONITOR
*pMonitor
);
206 extern int TTYDRV_MONITOR_GetHeight(struct tagMONITOR
*pMonitor
);
207 extern int TTYDRV_MONITOR_GetDepth(struct tagMONITOR
*pMonitor
);
208 extern BOOL
TTYDRV_MONITOR_GetScreenSaveActive(struct tagMONITOR
*pMonitor
);
209 extern void TTYDRV_MONITOR_SetScreenSaveActive(struct tagMONITOR
*pMonitor
, BOOL bActivate
);
210 extern int TTYDRV_MONITOR_GetScreenSaveTimeout(struct tagMONITOR
*pMonitor
);
211 extern void TTYDRV_MONITOR_SetScreenSaveTimeout(struct tagMONITOR
*pMonitor
, int nTimeout
);
213 /* TTY mouse driver */
215 extern struct tagMOUSE_DRIVER TTYDRV_MOUSE_Driver
;
217 extern void TTYDRV_MOUSE_Init();
218 extern void TTYDRV_MOUSE_SetCursor(struct tagCURSORICONINFO
*lpCursor
);
219 extern void TTYDRV_MOUSE_MoveCursor(WORD wAbsX
, WORD wAbsY
);
220 extern BOOL
TTYDRV_MOUSE_EnableWarpPointer(BOOL bEnable
);
222 /* TTY windows driver */
224 extern struct tagWND_DRIVER TTYDRV_WND_Driver
;
226 typedef struct tagTTYDRV_WND_DATA
{
227 #ifdef HAVE_LIBCURSES
229 #else /* defined(HAVE_LIBCURSES) */
230 int dummy
; /* FIXME: Remove later */
231 #endif /* defined(HAVE_LIBCURSES) */
234 #ifdef HAVE_LIBCURSES
235 WINDOW
*TTYDRV_WND_GetCursesWindow(struct tagWND
*wndPtr
);
236 WINDOW
*TTYDRV_WND_GetCursesRootWindow(struct tagWND
*wndPtr
);
237 #endif /* defined(HAVE_LIBCURSES) */
239 extern void TTYDRV_WND_Initialize(struct tagWND
*wndPtr
);
240 extern void TTYDRV_WND_Finalize(struct tagWND
*wndPtr
);
241 extern BOOL
TTYDRV_WND_CreateDesktopWindow(struct tagWND
*wndPtr
, struct tagCLASS
*classPtr
, BOOL bUnicode
);
242 extern BOOL
TTYDRV_WND_CreateWindow(struct tagWND
*wndPtr
, struct tagCLASS
*classPtr
, struct tagCREATESTRUCTA
*cs
, BOOL bUnicode
);
243 extern BOOL
TTYDRV_WND_DestroyWindow(struct tagWND
*pWnd
);
244 extern struct tagWND
*TTYDRV_WND_SetParent(struct tagWND
*wndPtr
, struct tagWND
*pWndParent
);
245 extern void TTYDRV_WND_ForceWindowRaise(struct tagWND
*pWnd
);
246 extern void TTYDRV_WND_SetWindowPos(struct tagWND
*wndPtr
, const struct tagWINDOWPOS
*winpos
, BOOL bSMC_SETXPOS
);
247 extern void TTYDRV_WND_SetText(struct tagWND
*wndPtr
, LPCSTR text
);
248 extern void TTYDRV_WND_SetFocus(struct tagWND
*wndPtr
);
249 extern void TTYDRV_WND_PreSizeMove(struct tagWND
*wndPtr
);
250 extern void TTYDRV_WND_PostSizeMove(struct tagWND
*wndPtr
);
251 extern void TTYDRV_WND_ScrollWindow(struct tagWND
*wndPtr
, struct tagDC
*dcPtr
, INT dx
, INT dy
, const RECT
*clipRect
, BOOL bUpdate
);
252 extern void TTYDRV_WND_SetDrawable(struct tagWND
*wndPtr
, struct tagDC
*dc
, WORD flags
, BOOL bSetClipOrigin
);
253 extern BOOL
TTYDRV_WND_SetHostAttr(struct tagWND
*wndPtr
, INT haKey
, INT value
);
254 extern BOOL
TTYDRV_WND_IsSelfClipping(struct tagWND
*wndPtr
);
256 #endif /* !defined(__WINE_TTYDRV_H) */