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"
29 struct tagCURSORICONINFO
;
30 struct tagCREATESTRUCTA
;
33 /**************************************************************************
37 extern struct tagGDI_DRIVER TTYDRV_GDI_Driver
;
39 extern BOOL
TTYDRV_GDI_Initialize(void);
40 extern void TTYDRV_GDI_Finalize(void);
42 /* TTY GDI bitmap driver */
44 extern HBITMAP
TTYDRV_BITMAP_CreateDIBSection(struct tagDC
*dc
, BITMAPINFO
*bmi
, UINT usage
, LPVOID
*bits
, HANDLE section
, DWORD offset
);
45 extern HBITMAP16
TTYDRV_BITMAP_CreateDIBSection16(struct tagDC
*dc
, BITMAPINFO
*bmi
, UINT16 usage
, SEGPTR
*bits
, HANDLE section
, DWORD offset
);
47 extern INT
TTYDRV_BITMAP_SetDIBits(struct tagBITMAPOBJ
*bmp
, struct tagDC
*dc
, UINT startscan
, UINT lines
, LPCVOID bits
, const BITMAPINFO
*info
, UINT coloruse
, HBITMAP hbitmap
);
48 extern INT
TTYDRV_BITMAP_GetDIBits(struct tagBITMAPOBJ
*bmp
, struct tagDC
*dc
, UINT startscan
, UINT lines
, LPVOID bits
, BITMAPINFO
*info
, UINT coloruse
, HBITMAP hbitmap
);
49 extern void TTYDRV_BITMAP_DeleteDIBSection(struct tagBITMAPOBJ
*bmp
);
54 #endif /* defined(HAVE_LIBCURSES) */
59 extern BOOL
TTYDRV_DC_Arc(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
, INT xstart
, INT ystart
, INT xend
, INT yend
);
60 extern BOOL
TTYDRV_DC_CreateBitmap(HBITMAP hbitmap
);
61 extern BOOL
TTYDRV_DC_CreateDC(struct tagDC
*dc
, LPCSTR driver
, LPCSTR device
, LPCSTR output
, const DEVMODEA
*initData
);
62 extern BOOL
TTYDRV_DC_DeleteDC(struct tagDC
*dc
);
63 extern BOOL
TTYDRV_DC_DeleteObject(HGDIOBJ handle
);
64 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
);
65 extern BOOL
TTYDRV_DC_Chord(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
, INT xstart
, INT ystart
, INT xend
, INT yend
);
66 extern BOOL
TTYDRV_DC_Ellipse(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
);
67 extern INT
TTYDRV_DC_Escape(struct tagDC
*dc
, INT nEscape
, INT cbInput
, SEGPTR lpInData
, SEGPTR lpOutData
);
68 extern BOOL
TTYDRV_DC_ExtFloodFill(struct tagDC
*dc
, INT x
, INT y
, COLORREF color
, UINT fillType
);
69 extern BOOL
TTYDRV_DC_ExtTextOut(struct tagDC
*dc
, INT x
, INT y
, UINT flags
, const RECT
*lpRect
, LPCSTR str
, UINT count
, const INT
*lpDx
);
70 extern BOOL
TTYDRV_DC_GetCharWidth(struct tagDC
*dc
, UINT firstChar
, UINT lastChar
, LPINT buffer
);
71 extern COLORREF
TTYDRV_DC_GetPixel(struct tagDC
*dc
, INT x
, INT y
);
73 extern BOOL
TTYDRV_DC_GetTextExtentPoint(struct tagDC
*dc
, LPCSTR str
, INT count
, LPSIZE size
);
74 extern BOOL
TTYDRV_DC_GetTextMetrics(struct tagDC
*dc
, TEXTMETRICA
*metrics
);
75 extern BOOL
TTYDRV_DC_LineTo(struct tagDC
*dc
, INT x
, INT y
);
76 extern HANDLE
TTYDRV_DC_LoadOEMResource(WORD resid
, WORD type
);
77 extern BOOL
TTYDRV_DC_MoveToEx(struct tagDC
*dc
, INT x
, INT y
, LPPOINT pt
);
78 extern BOOL
TTYDRV_DC_PaintRgn(struct tagDC
*dc
, HRGN hrgn
);
79 extern BOOL
TTYDRV_DC_PatBlt(struct tagDC
*dc
, INT left
, INT top
, INT width
, INT height
, DWORD rop
);
80 extern BOOL
TTYDRV_DC_Pie(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
, INT xstart
, INT ystart
, INT xend
, INT yend
);
81 extern BOOL
TTYDRV_DC_PolyBezier(struct tagDC
*dc
, POINT start
, const POINT
* BezierPoints
, DWORD count
);
82 extern BOOL
TTYDRV_DC_Polygon(struct tagDC
*dc
, const POINT
* pt
, INT count
);
83 extern BOOL
TTYDRV_DC_Polyline(struct tagDC
*dc
, const POINT
* pt
, INT count
);
84 extern BOOL
TTYDRV_DC_PolyPolygon(struct tagDC
*dc
, const POINT
* pt
, const INT
* counts
, UINT polygons
);
85 extern BOOL
TTYDRV_DC_PolyPolyline(struct tagDC
*dc
, const POINT
* pt
, const DWORD
* counts
, DWORD polylines
);
86 extern BOOL
TTYDRV_DC_Rectangle(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
);
87 extern BOOL
TTYDRV_DC_RoundRect(struct tagDC
*dc
, INT left
, INT top
, INT right
, INT bottom
, INT ell_width
, INT ell_height
);
88 extern void TTYDRV_DC_SetDeviceClipping(struct tagDC
*dc
);
89 extern HGDIOBJ
TTYDRV_DC_SelectObject(struct tagDC
*dc
, HGDIOBJ handle
);
90 extern COLORREF
TTYDRV_DC_SetBkColor(struct tagDC
*dc
, COLORREF color
);
91 extern COLORREF
TTYDRV_DC_SetPixel(struct tagDC
*dc
, INT x
, INT y
, COLORREF color
);
92 extern COLORREF
TTYDRV_DC_SetTextColor(struct tagDC
*dc
, COLORREF color
);
93 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
);
95 /* TTY GDI palette driver */
97 extern struct tagPALETTE_DRIVER TTYDRV_PALETTE_Driver
;
99 extern BOOL
TTYDRV_PALETTE_Initialize(void);
100 extern void TTYDRV_PALETTE_Finalize(void);
102 extern int TTYDRV_PALETTE_SetMapping(struct tagPALETTEOBJ
*palPtr
, UINT uStart
, UINT uNum
, BOOL mapOnly
);
103 extern int TTYDRV_PALETTE_UpdateMapping(struct tagPALETTEOBJ
*palPtr
);
104 extern BOOL
TTYDRV_PALETTE_IsDark(int pixel
);
106 /**************************************************************************
110 extern struct tagUSER_DRIVER TTYDRV_USER_Driver
;
112 extern BOOL
TTYDRV_USER_Initialize(void);
113 extern void TTYDRV_USER_Finalize(void);
114 extern void TTYDRV_USER_BeginDebugging(void);
115 extern void TTYDRV_USER_EndDebugging(void);
117 /* TTY clipboard driver */
119 extern struct tagCLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver
;
121 extern void TTYDRV_CLIPBOARD_Acquire(void);
122 extern void TTYDRV_CLIPBOARD_Release(void);
123 extern void TTYDRV_CLIPBOARD_SetData(UINT wFormat
);
124 extern BOOL
TTYDRV_CLIPBOARD_GetData(UINT wFormat
);
125 extern BOOL
TTYDRV_CLIPBOARD_IsFormatAvailable(UINT wFormat
);
126 extern BOOL
TTYDRV_CLIPBOARD_RegisterFormat( LPCSTR FormatName
);
127 extern BOOL
TTYDRV_CLIPBOARD_IsSelectionowner();
128 extern void TTYDRV_CLIPBOARD_ResetOwner(struct tagWND
*pWnd
, BOOL bFooBar
);
130 /* TTY desktop driver */
132 extern struct tagDESKTOP_DRIVER TTYDRV_DESKTOP_Driver
;
134 #ifdef HAVE_LIBCURSES
135 extern WINDOW
*TTYDRV_DESKTOP_GetCursesRootWindow(struct tagDESKTOP
*pDesktop
);
136 #endif /* defined(HAVE_LIBCURSES) */
138 extern void TTYDRV_DESKTOP_Initialize(struct tagDESKTOP
*pDesktop
);
139 extern void TTYDRV_DESKTOP_Finalize(struct tagDESKTOP
*pDesktop
);
140 extern int TTYDRV_DESKTOP_GetScreenWidth(struct tagDESKTOP
*pDesktop
);
141 extern int TTYDRV_DESKTOP_GetScreenHeight(struct tagDESKTOP
*pDesktop
);
142 extern int TTYDRV_DESKTOP_GetScreenDepth(struct tagDESKTOP
*pDesktop
);
144 /* TTY event driver */
146 extern struct tagEVENT_DRIVER TTYDRV_EVENT_Driver
;
148 extern BOOL
TTYDRV_EVENT_Init(void);
149 extern void TTYDRV_EVENT_Synchronize(void);
150 extern BOOL
TTYDRV_EVENT_CheckFocus(void);
151 extern void TTYDRV_EVENT_UserRepaintDisable(BOOL bDisable
);
153 /* TTY keyboard driver */
155 extern struct tagKEYBOARD_DRIVER TTYDRV_KEYBOARD_Driver
;
157 extern void TTYDRV_KEYBOARD_Init(void);
158 extern WORD
TTYDRV_KEYBOARD_VkKeyScan(CHAR cChar
);
159 extern UINT16
TTYDRV_KEYBOARD_MapVirtualKey(UINT16 wCode
, UINT16 wMapType
);
160 extern INT16
TTYDRV_KEYBOARD_GetKeyNameText(LONG lParam
, LPSTR lpBuffer
, INT16 nSize
);
161 extern INT16
TTYDRV_KEYBOARD_ToAscii(UINT16 virtKey
, UINT16 scanCode
, LPBYTE lpKeyState
, LPVOID lpChar
, UINT16 flags
);
162 extern BOOL
TTYDRV_KEYBOARD_GetBeepActive(void);
163 extern void TTYDRV_KEYBOARD_SetBeepActive(BOOL bActivate
);
164 extern void TTYDRV_KEYBOARD_Beep(void);
165 extern BOOL
TTYDRV_KEYBOARD_GetDIState(DWORD len
, LPVOID ptr
);
166 extern BOOL
TTYDRV_KEYBOARD_GetDIData(BYTE
*keystate
, DWORD dodsize
, LPDIDEVICEOBJECTDATA dod
, LPDWORD entries
, DWORD flags
);
168 /* TTY monitor driver */
170 extern struct tagMONITOR_DRIVER TTYDRV_MONITOR_Driver
;
172 typedef struct tagTTYDRV_MONITOR_DATA
{
173 #ifdef HAVE_LIBCURSES
175 #endif /* defined(HAVE_LIBCURSES) */
181 } TTYDRV_MONITOR_DATA
;
185 #ifdef HAVE_LIBCURSES
186 extern WINDOW
*TTYDRV_MONITOR_GetCursesRootWindow(struct tagMONITOR
*pMonitor
);
187 #endif /* defined(HAVE_LIBCURSES) */
189 extern INT
TTYDRV_MONITOR_GetCellWidth(struct tagMONITOR
*pMonitor
);
190 extern INT
TTYDRV_MONITOR_GetCellHeight(struct tagMONITOR
*pMonitor
);
192 extern void TTYDRV_MONITOR_Initialize(struct tagMONITOR
*pMonitor
);
193 extern void TTYDRV_MONITOR_Finalize(struct tagMONITOR
*pMonitor
);
194 extern BOOL
TTYDRV_MONITOR_IsSingleWindow(struct tagMONITOR
*pMonitor
);
195 extern int TTYDRV_MONITOR_GetWidth(struct tagMONITOR
*pMonitor
);
196 extern int TTYDRV_MONITOR_GetHeight(struct tagMONITOR
*pMonitor
);
197 extern int TTYDRV_MONITOR_GetDepth(struct tagMONITOR
*pMonitor
);
198 extern BOOL
TTYDRV_MONITOR_GetScreenSaveActive(struct tagMONITOR
*pMonitor
);
199 extern void TTYDRV_MONITOR_SetScreenSaveActive(struct tagMONITOR
*pMonitor
, BOOL bActivate
);
200 extern int TTYDRV_MONITOR_GetScreenSaveTimeout(struct tagMONITOR
*pMonitor
);
201 extern void TTYDRV_MONITOR_SetScreenSaveTimeout(struct tagMONITOR
*pMonitor
, int nTimeout
);
203 /* TTY mouse driver */
205 extern struct tagMOUSE_DRIVER TTYDRV_MOUSE_Driver
;
207 extern void TTYDRV_MOUSE_Init();
208 extern void TTYDRV_MOUSE_SetCursor(struct tagCURSORICONINFO
*lpCursor
);
209 extern void TTYDRV_MOUSE_MoveCursor(WORD wAbsX
, WORD wAbsY
);
210 extern BOOL
TTYDRV_MOUSE_EnableWarpPointer(BOOL bEnable
);
212 /* TTY windows driver */
214 extern struct tagWND_DRIVER TTYDRV_WND_Driver
;
216 typedef struct tagTTYDRV_WND_DATA
{
217 #ifdef HAVE_LIBCURSES
219 #else /* defined(HAVE_LIBCURSES) */
220 int dummy
; /* FIXME: Remove later */
221 #endif /* defined(HAVE_LIBCURSES) */
224 #ifdef HAVE_LIBCURSES
225 WINDOW
*TTYDRV_WND_GetCursesWindow(struct tagWND
*wndPtr
);
226 WINDOW
*TTYDRV_WND_GetCursesRootWindow(struct tagWND
*wndPtr
);
227 #endif /* defined(HAVE_LIBCURSES) */
229 extern void TTYDRV_WND_Initialize(struct tagWND
*wndPtr
);
230 extern void TTYDRV_WND_Finalize(struct tagWND
*wndPtr
);
231 extern BOOL
TTYDRV_WND_CreateDesktopWindow(struct tagWND
*wndPtr
, struct tagCLASS
*classPtr
, BOOL bUnicode
);
232 extern BOOL
TTYDRV_WND_CreateWindow(struct tagWND
*wndPtr
, struct tagCLASS
*classPtr
, struct tagCREATESTRUCTA
*cs
, BOOL bUnicode
);
233 extern BOOL
TTYDRV_WND_DestroyWindow(struct tagWND
*pWnd
);
234 extern struct tagWND
*TTYDRV_WND_SetParent(struct tagWND
*wndPtr
, struct tagWND
*pWndParent
);
235 extern void TTYDRV_WND_ForceWindowRaise(struct tagWND
*pWnd
);
236 extern void TTYDRV_WND_SetWindowPos(struct tagWND
*wndPtr
, const struct tagWINDOWPOS
*winpos
, BOOL bSMC_SETXPOS
);
237 extern void TTYDRV_WND_SetText(struct tagWND
*wndPtr
, LPCSTR text
);
238 extern void TTYDRV_WND_SetFocus(struct tagWND
*wndPtr
);
239 extern void TTYDRV_WND_PreSizeMove(struct tagWND
*wndPtr
);
240 extern void TTYDRV_WND_PostSizeMove(struct tagWND
*wndPtr
);
241 extern void TTYDRV_WND_ScrollWindow(struct tagWND
*wndPtr
, struct tagDC
*dcPtr
, INT dx
, INT dy
, const RECT
*clipRect
, BOOL bUpdate
);
242 extern void TTYDRV_WND_SetDrawable(struct tagWND
*wndPtr
, struct tagDC
*dc
, WORD flags
, BOOL bSetClipOrigin
);
243 extern BOOL
TTYDRV_WND_SetHostAttr(struct tagWND
*wndPtr
, INT haKey
, INT value
);
244 extern BOOL
TTYDRV_WND_IsSelfClipping(struct tagWND
*wndPtr
);
246 #endif /* !defined(__WINE_TTYDRV_H) */