Use "CALL" and "RET" in capital letters for distinction.
[wine.git] / include / ttydrv.h
blobba866667f2218e0caccbeb0413960566c883dcd4
1 /*
2 * TTY driver definitions
3 */
5 #ifndef __WINE_TTYDRV_H
6 #define __WINE_TTYDRV_H
8 #include "config.h"
10 #undef ERR
11 #ifdef HAVE_NCURSES_H
12 # include <ncurses.h>
13 #elif defined(HAVE_CURSES_H)
14 # include <curses.h>
15 #endif
17 #include "windef.h"
18 #include "wingdi.h"
19 #include "wine/winuser16.h"
20 #include "wine/wingdi16.h"
22 struct tagBITMAPOBJ;
23 struct tagCLASS;
24 struct tagDC;
25 struct tagDESKTOP;
26 struct tagPALETTEOBJ;
27 struct tagWND;
28 struct tagCURSORICONINFO;
29 struct tagCREATESTRUCTA;
30 struct tagWINDOWPOS;
31 struct tagKEYBOARD_CONFIG;
32 struct DIDEVICEOBJECTDATA;
34 #if defined(HAVE_LIBCURSES) || defined(HAVE_LIBNCURSES)
35 #define WINE_CURSES
36 #endif
38 /**************************************************************************
39 * TTY GDI driver
42 extern struct tagGDI_DRIVER TTYDRV_GDI_Driver;
44 extern BOOL TTYDRV_GDI_Initialize(void);
45 extern void TTYDRV_GDI_Finalize(void);
47 /* TTY GDI bitmap driver */
49 extern HBITMAP TTYDRV_BITMAP_CreateDIBSection(struct tagDC *dc, BITMAPINFO *bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset);
50 extern HBITMAP16 TTYDRV_BITMAP_CreateDIBSection16(struct tagDC *dc, BITMAPINFO *bmi, UINT16 usage, SEGPTR *bits, HANDLE section, DWORD offset);
52 extern INT TTYDRV_BITMAP_SetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap);
53 extern INT TTYDRV_BITMAP_GetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan, UINT lines, LPVOID bits, BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap);
54 extern void TTYDRV_BITMAP_DeleteDIBSection(struct tagBITMAPOBJ *bmp);
56 #ifndef WINE_CURSES
57 typedef struct { int dummy; } WINDOW;
58 #endif
60 typedef struct {
61 WINDOW *window;
62 int cellWidth;
63 int cellHeight;
64 } TTYDRV_PDEVICE;
66 typedef struct {
67 int dummy; /* FIXME: Remove later */
68 } TTYDRV_PHYSBITMAP;
70 extern BOOL TTYDRV_DC_CreateBitmap(HBITMAP hbitmap);
72 extern BOOL TTYDRV_DC_Arc(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
73 extern LONG TTYDRV_DC_BitmapBits(HBITMAP hbitmap, void *bits, LONG count, WORD flags);
74 extern BOOL TTYDRV_DC_CreateBitmap(HBITMAP hbitmap);
75 extern BOOL TTYDRV_DC_CreateDC(struct tagDC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODEA *initData);
76 extern BOOL TTYDRV_DC_DeleteDC(struct tagDC *dc);
77 extern BOOL TTYDRV_DC_DeleteObject(HGDIOBJ handle);
78 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);
79 extern BOOL TTYDRV_DC_Chord(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
80 extern BOOL TTYDRV_DC_Ellipse(struct tagDC *dc, INT left, INT top, INT right, INT bottom);
81 extern INT TTYDRV_DC_Escape(struct tagDC *dc, INT nEscape, INT cbInput, SEGPTR lpInData, SEGPTR lpOutData);
82 extern BOOL TTYDRV_DC_ExtFloodFill(struct tagDC *dc, INT x, INT y, COLORREF color, UINT fillType);
83 extern BOOL TTYDRV_DC_ExtTextOut(struct tagDC *dc, INT x, INT y, UINT flags, const RECT *lpRect, LPCWSTR str, UINT count, const INT *lpDx);
84 extern BOOL TTYDRV_DC_GetCharWidth(struct tagDC *dc, UINT firstChar, UINT lastChar, LPINT buffer);
85 extern COLORREF TTYDRV_DC_GetPixel(struct tagDC *dc, INT x, INT y);
87 extern BOOL TTYDRV_DC_GetTextExtentPoint(struct tagDC *dc, LPCWSTR str, INT count, LPSIZE size);
88 extern BOOL TTYDRV_DC_GetTextMetrics(struct tagDC *dc, TEXTMETRICA *metrics);
89 extern BOOL TTYDRV_DC_LineTo(struct tagDC *dc, INT x, INT y);
90 extern HANDLE TTYDRV_DC_LoadOEMResource(WORD resid, WORD type);
91 extern BOOL TTYDRV_DC_PaintRgn(struct tagDC *dc, HRGN hrgn);
92 extern BOOL TTYDRV_DC_PatBlt(struct tagDC *dc, INT left, INT top, INT width, INT height, DWORD rop);
93 extern BOOL TTYDRV_DC_Pie(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
94 extern BOOL TTYDRV_DC_Polygon(struct tagDC *dc, const POINT* pt, INT count);
95 extern BOOL TTYDRV_DC_Polyline(struct tagDC *dc, const POINT* pt, INT count);
96 extern BOOL TTYDRV_DC_PolyPolygon(struct tagDC *dc, const POINT* pt, const INT* counts, UINT polygons);
97 extern BOOL TTYDRV_DC_PolyPolyline(struct tagDC *dc, const POINT* pt, const DWORD* counts, DWORD polylines);
98 extern BOOL TTYDRV_DC_Rectangle(struct tagDC *dc, INT left, INT top, INT right, INT bottom);
99 extern BOOL TTYDRV_DC_RoundRect(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height);
100 extern void TTYDRV_DC_SetDeviceClipping(struct tagDC *dc);
101 extern HGDIOBJ TTYDRV_DC_SelectObject(struct tagDC *dc, HGDIOBJ handle);
102 extern COLORREF TTYDRV_DC_SetBkColor(struct tagDC *dc, COLORREF color);
103 extern COLORREF TTYDRV_DC_SetPixel(struct tagDC *dc, INT x, INT y, COLORREF color);
104 extern COLORREF TTYDRV_DC_SetTextColor(struct tagDC *dc, COLORREF color);
105 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);
106 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);
108 /* TTY GDI palette driver */
110 extern struct tagPALETTE_DRIVER TTYDRV_PALETTE_Driver;
112 extern BOOL TTYDRV_PALETTE_Initialize(void);
113 extern void TTYDRV_PALETTE_Finalize(void);
115 extern int TTYDRV_PALETTE_SetMapping(struct tagPALETTEOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly);
116 extern int TTYDRV_PALETTE_UpdateMapping(struct tagPALETTEOBJ *palPtr);
117 extern BOOL TTYDRV_PALETTE_IsDark(int pixel);
119 /**************************************************************************
120 * TTY USER driver
123 extern int cell_width;
124 extern int cell_height;
125 static inline int TTYDRV_GetCellWidth(void) { return cell_width; }
126 static inline int TTYDRV_GetCellHeight(void) { return cell_height; }
128 extern WINDOW *root_window;
129 static inline WINDOW *TTYDRV_GetRootWindow(void) { return root_window; }
131 extern BOOL TTYDRV_GetScreenSaveActive(void);
132 extern void TTYDRV_SetScreenSaveActive(BOOL bActivate);
133 extern int TTYDRV_GetScreenSaveTimeout(void);
134 extern void TTYDRV_SetScreenSaveTimeout(int nTimeout);
135 extern BOOL TTYDRV_IsSingleWindow(void);
137 /* TTY clipboard driver */
139 extern struct tagCLIPBOARD_DRIVER TTYDRV_CLIPBOARD_Driver;
141 extern void TTYDRV_CLIPBOARD_Acquire(void);
142 extern void TTYDRV_CLIPBOARD_Release(void);
143 extern void TTYDRV_CLIPBOARD_SetData(UINT wFormat);
144 extern BOOL TTYDRV_CLIPBOARD_GetData(UINT wFormat);
145 extern BOOL TTYDRV_CLIPBOARD_IsFormatAvailable(UINT wFormat);
146 extern BOOL TTYDRV_CLIPBOARD_RegisterFormat( LPCSTR FormatName );
147 extern BOOL TTYDRV_CLIPBOARD_IsSelectionowner();
148 extern void TTYDRV_CLIPBOARD_ResetOwner(struct tagWND *pWnd, BOOL bFooBar);
150 /* TTY event driver */
152 extern void TTYDRV_EVENT_Synchronize(void);
153 extern BOOL TTYDRV_EVENT_CheckFocus(void);
154 extern void TTYDRV_EVENT_UserRepaintDisable(BOOL bDisable);
156 /* TTY keyboard driver */
158 extern void TTYDRV_KEYBOARD_Init(void);
159 extern WORD TTYDRV_KEYBOARD_VkKeyScan(CHAR cChar);
160 extern UINT16 TTYDRV_KEYBOARD_MapVirtualKey(UINT16 wCode, UINT16 wMapType);
161 extern INT16 TTYDRV_KEYBOARD_GetKeyNameText(LONG lParam, LPSTR lpBuffer, INT16 nSize);
162 extern INT16 TTYDRV_KEYBOARD_ToAscii(UINT16 virtKey, UINT16 scanCode, LPBYTE lpKeyState, LPVOID lpChar, UINT16 flags);
163 extern BOOL TTYDRV_KEYBOARD_GetBeepActive(void);
164 extern void TTYDRV_KEYBOARD_SetBeepActive(BOOL bActivate);
165 extern void TTYDRV_KEYBOARD_Beep(void);
166 extern BOOL TTYDRV_KEYBOARD_GetDIState(DWORD len, LPVOID ptr);
167 extern BOOL TTYDRV_KEYBOARD_GetDIData(BYTE *keystate, DWORD dodsize, struct DIDEVICEOBJECTDATA *dod, LPDWORD entries, DWORD flags);
168 extern void TTYDRV_KEYBOARD_GetKeyboardConfig(struct tagKEYBOARD_CONFIG *cfg);
169 extern void TTYDRV_KEYBOARD_SetKeyboardConfig(struct tagKEYBOARD_CONFIG *cfg, DWORD mask);
171 /* TTY mouse driver */
173 extern void TTYDRV_MOUSE_Init();
174 extern void TTYDRV_MOUSE_SetCursor(struct tagCURSORICONINFO *lpCursor);
175 extern void TTYDRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY);
176 extern LONG TTYDRV_MOUSE_EnableWarpPointer(BOOL bEnable);
178 /* TTY windows driver */
180 extern struct tagWND_DRIVER TTYDRV_WND_Driver;
182 typedef struct tagTTYDRV_WND_DATA {
183 WINDOW *window;
184 } TTYDRV_WND_DATA;
186 WINDOW *TTYDRV_WND_GetCursesWindow(struct tagWND *wndPtr);
188 extern void TTYDRV_WND_Initialize(struct tagWND *wndPtr);
189 extern void TTYDRV_WND_Finalize(struct tagWND *wndPtr);
190 extern BOOL TTYDRV_WND_CreateDesktopWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, BOOL bUnicode);
191 extern BOOL TTYDRV_WND_CreateWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, struct tagCREATESTRUCTA *cs, BOOL bUnicode);
192 extern BOOL TTYDRV_WND_DestroyWindow(struct tagWND *pWnd);
193 extern struct tagWND *TTYDRV_WND_SetParent(struct tagWND *wndPtr, struct tagWND *pWndParent);
194 extern void TTYDRV_WND_ForceWindowRaise(struct tagWND *pWnd);
195 extern void TTYDRV_WND_SetWindowPos(struct tagWND *wndPtr, const struct tagWINDOWPOS *winpos, BOOL bSMC_SETXPOS);
196 extern void TTYDRV_WND_SetText(struct tagWND *wndPtr, LPCSTR text);
197 extern void TTYDRV_WND_SetFocus(struct tagWND *wndPtr);
198 extern void TTYDRV_WND_PreSizeMove(struct tagWND *wndPtr);
199 extern void TTYDRV_WND_PostSizeMove(struct tagWND *wndPtr);
200 extern void TTYDRV_WND_ScrollWindow(struct tagWND *wndPtr, struct tagDC *dcPtr, INT dx, INT dy, const RECT *clipRect, BOOL bUpdate);
201 extern void TTYDRV_WND_SetDrawable(struct tagWND *wndPtr, struct tagDC *dc, WORD flags, BOOL bSetClipOrigin);
202 extern BOOL TTYDRV_WND_SetHostAttr(struct tagWND *wndPtr, INT haKey, INT value);
203 extern BOOL TTYDRV_WND_IsSelfClipping(struct tagWND *wndPtr);
205 #endif /* !defined(__WINE_TTYDRV_H) */