Fill in some more HAL fields. Flip some of them when appropriate.
[wine] / dlls / ttydrv / ttydrv.h
1 /*
2  * TTY driver definitions
3  */
4
5 #ifndef __WINE_TTYDRV_H
6 #define __WINE_TTYDRV_H
7
8 #include "config.h"
9
10 #undef ERR
11 #ifdef HAVE_NCURSES_H
12 # include <ncurses.h>
13 #elif defined(HAVE_CURSES_H)
14 # include <curses.h>
15 #endif
16
17 #include "windef.h"
18 #include "wingdi.h"
19 #include "wine/winuser16.h"
20 #include "wine/wingdi16.h"
21 #include "user.h"
22
23 struct tagBITMAPOBJ;
24 struct tagCLASS;
25 struct tagDC;
26 struct tagDESKTOP;
27 struct tagPALETTEOBJ;
28 struct tagWND;
29 struct tagCURSORICONINFO;
30 struct tagCREATESTRUCTA;
31 struct tagWINDOWPOS;
32 struct tagKEYBOARD_CONFIG;
33 struct DIDEVICEOBJECTDATA;
34
35 #if defined(HAVE_LIBCURSES) || defined(HAVE_LIBNCURSES)
36 #define WINE_CURSES
37 #endif
38
39 /**************************************************************************
40  * TTY GDI driver
41  */
42
43 extern BOOL TTYDRV_GDI_Initialize(void);
44 extern void TTYDRV_GDI_Finalize(void);
45
46 /* TTY GDI bitmap driver */
47
48 extern HBITMAP TTYDRV_BITMAP_CreateDIBSection(struct tagDC *dc, BITMAPINFO *bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset);
49 extern HBITMAP16 TTYDRV_BITMAP_CreateDIBSection16(struct tagDC *dc, BITMAPINFO *bmi, UINT16 usage, SEGPTR *bits, HANDLE section, DWORD offset);
50
51 extern INT TTYDRV_BITMAP_SetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap);
52 extern INT TTYDRV_BITMAP_GetDIBits(struct tagBITMAPOBJ *bmp, struct tagDC *dc, UINT startscan, UINT lines, LPVOID bits, BITMAPINFO *info, UINT coloruse, HBITMAP hbitmap);
53 extern void TTYDRV_BITMAP_DeleteDIBSection(struct tagBITMAPOBJ *bmp);
54 extern UINT TTYDRV_BITMAP_SetDIBColorTable(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,const RGBQUAD *);
55 extern UINT TTYDRV_BITMAP_GetDIBColorTable(struct tagBITMAPOBJ *,struct tagDC *,UINT,UINT,RGBQUAD *);
56 extern INT TTYDRV_BITMAP_Lock(struct tagBITMAPOBJ *,INT,BOOL);
57 extern void TTYDRV_BITMAP_Unlock(struct tagBITMAPOBJ *,BOOL);
58
59 #ifndef WINE_CURSES
60 typedef struct { int dummy; } WINDOW;
61 #endif
62
63 typedef struct {
64   WINDOW *window;
65   int cellWidth;
66   int cellHeight;
67 } TTYDRV_PDEVICE;
68
69 typedef struct {
70   int dummy; /* FIXME: Remove later */
71 } TTYDRV_PHYSBITMAP;
72
73 extern BOOL TTYDRV_DC_CreateBitmap(HBITMAP hbitmap);
74
75 extern BOOL TTYDRV_DC_Arc(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
76 extern LONG TTYDRV_DC_BitmapBits(HBITMAP hbitmap, void *bits, LONG count, WORD flags);
77 extern BOOL TTYDRV_DC_CreateBitmap(HBITMAP hbitmap);
78 extern BOOL TTYDRV_DC_CreateDC(struct tagDC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODEA *initData);
79 extern BOOL TTYDRV_DC_DeleteDC(struct tagDC *dc);
80 extern BOOL TTYDRV_DC_DeleteObject(HGDIOBJ handle);
81 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);
82 extern BOOL TTYDRV_DC_Chord(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
83 extern BOOL TTYDRV_DC_Ellipse(struct tagDC *dc, INT left, INT top, INT right, INT bottom);
84 extern INT TTYDRV_DC_Escape(struct tagDC *dc, INT nEscape, INT cbInput, SEGPTR lpInData, SEGPTR lpOutData);
85 extern BOOL TTYDRV_DC_ExtFloodFill(struct tagDC *dc, INT x, INT y, COLORREF color, UINT fillType);
86 extern BOOL TTYDRV_DC_ExtTextOut(struct tagDC *dc, INT x, INT y, UINT flags, const RECT *lpRect, LPCWSTR str, UINT count, const INT *lpDx);
87 extern BOOL TTYDRV_DC_GetCharWidth(struct tagDC *dc, UINT firstChar, UINT lastChar, LPINT buffer);
88 extern COLORREF TTYDRV_DC_GetPixel(struct tagDC *dc, INT x, INT y);
89
90 extern BOOL TTYDRV_DC_GetTextExtentPoint(struct tagDC *dc, LPCWSTR str, INT count, LPSIZE size);
91 extern BOOL TTYDRV_DC_GetTextMetrics(struct tagDC *dc, TEXTMETRICW *metrics);
92 extern BOOL TTYDRV_DC_LineTo(struct tagDC *dc, INT x, INT y);
93 extern BOOL TTYDRV_DC_PaintRgn(struct tagDC *dc, HRGN hrgn);
94 extern BOOL TTYDRV_DC_PatBlt(struct tagDC *dc, INT left, INT top, INT width, INT height, DWORD rop);
95 extern BOOL TTYDRV_DC_Pie(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
96 extern BOOL TTYDRV_DC_Polygon(struct tagDC *dc, const POINT* pt, INT count);
97 extern BOOL TTYDRV_DC_Polyline(struct tagDC *dc, const POINT* pt, INT count);
98 extern BOOL TTYDRV_DC_PolyPolygon(struct tagDC *dc, const POINT* pt, const INT* counts, UINT polygons);
99 extern BOOL TTYDRV_DC_PolyPolyline(struct tagDC *dc, const POINT* pt, const DWORD* counts, DWORD polylines);
100 extern BOOL TTYDRV_DC_Rectangle(struct tagDC *dc, INT left, INT top, INT right, INT bottom);
101 extern BOOL TTYDRV_DC_RoundRect(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height);
102 extern void TTYDRV_DC_SetDeviceClipping(struct tagDC *dc);
103 extern HGDIOBJ TTYDRV_DC_SelectObject(struct tagDC *dc, HGDIOBJ handle);
104 extern COLORREF TTYDRV_DC_SetBkColor(struct tagDC *dc, COLORREF color);
105 extern COLORREF TTYDRV_DC_SetPixel(struct tagDC *dc, INT x, INT y, COLORREF color);
106 extern COLORREF TTYDRV_DC_SetTextColor(struct tagDC *dc, COLORREF color);
107 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);
108 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);
109
110 /* TTY GDI palette driver */
111
112 extern struct tagPALETTE_DRIVER TTYDRV_PALETTE_Driver;
113
114 extern BOOL TTYDRV_PALETTE_Initialize(void);
115 extern void TTYDRV_PALETTE_Finalize(void);
116
117 extern int TTYDRV_PALETTE_SetMapping(struct tagPALETTEOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly);
118 extern int TTYDRV_PALETTE_UpdateMapping(struct tagPALETTEOBJ *palPtr);
119 extern BOOL TTYDRV_PALETTE_IsDark(int pixel);
120
121 /**************************************************************************
122  * TTY USER driver
123  */
124
125 extern int cell_width;
126 extern int cell_height;
127 extern int screen_rows;
128 extern int screen_cols;
129 extern WINDOW *root_window;
130 static inline WINDOW *TTYDRV_GetRootWindow(void) { return root_window; }
131
132 /* TTY windows driver */
133
134 extern struct tagWND_DRIVER TTYDRV_WND_Driver;
135
136 typedef struct tagTTYDRV_WND_DATA {
137   WINDOW *window;
138 } TTYDRV_WND_DATA;
139
140 WINDOW *TTYDRV_WND_GetCursesWindow(struct tagWND *wndPtr);
141
142 extern HANDLE TTYDRV_LoadOEMResource(WORD resid, WORD type);
143
144 extern void TTYDRV_WND_Initialize(struct tagWND *wndPtr);
145 extern void TTYDRV_WND_Finalize(struct tagWND *wndPtr);
146 extern BOOL TTYDRV_WND_CreateDesktopWindow(struct tagWND *wndPtr);
147 extern BOOL TTYDRV_WND_CreateWindow(struct tagWND *wndPtr, struct tagCREATESTRUCTA *cs, BOOL bUnicode);
148 extern BOOL TTYDRV_WND_DestroyWindow(struct tagWND *pWnd);
149 extern struct tagWND *TTYDRV_WND_SetParent(struct tagWND *wndPtr, struct tagWND *pWndParent);
150 extern void TTYDRV_WND_ForceWindowRaise(struct tagWND *pWnd);
151 extern void TTYDRV_WND_SetWindowPos(struct tagWND *wndPtr, const struct tagWINDOWPOS *winpos, BOOL bSMC_SETXPOS);
152 extern void TTYDRV_WND_SetText(struct tagWND *wndPtr, LPCWSTR text);
153 extern void TTYDRV_WND_SetFocus(struct tagWND *wndPtr);
154 extern void TTYDRV_WND_PreSizeMove(struct tagWND *wndPtr);
155 extern void TTYDRV_WND_PostSizeMove(struct tagWND *wndPtr);
156 extern void TTYDRV_WND_ScrollWindow(struct tagWND *wndPtr, HDC hdc, INT dx, INT dy, const RECT *clipRect, BOOL bUpdate);
157 extern void TTYDRV_WND_SetDrawable(struct tagWND *wndPtr, HDC hdc, WORD flags, BOOL bSetClipOrigin);
158 extern BOOL TTYDRV_WND_SetHostAttr(struct tagWND *wndPtr, INT haKey, INT value);
159 extern BOOL TTYDRV_WND_IsSelfClipping(struct tagWND *wndPtr);
160 extern void TTYDRV_WND_SetWindowRgn(struct tagWND *wndPtr, HRGN hrgnWnd);
161
162 #endif /* !defined(__WINE_TTYDRV_H) */