Implement ResetDC and PHYSICALOFFSET[X|Y] devcaps.
[wine] / dlls / ttydrv / ttydrv.h
1 /*
2  * TTY driver definitions
3  *
4  * Copyright 1998 Patrik Stridvall
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_TTYDRV_H
22 #define __WINE_TTYDRV_H
23
24 #ifndef __WINE_CONFIG_H 
25 # error You must include config.h to use this header 
26 #endif 
27
28 #undef ERR
29 #ifdef HAVE_NCURSES_H
30 # include <ncurses.h>
31 #elif defined(HAVE_CURSES_H)
32 # include <curses.h>
33 #endif
34
35 #include "windef.h"
36 #include "wingdi.h"
37 #include "wine/winuser16.h"
38 #include "wine/wingdi16.h"
39 #include "user.h"
40
41 struct tagBITMAPOBJ;
42 struct tagCLASS;
43 struct tagDESKTOP;
44 struct tagPALETTEOBJ;
45 struct tagWND;
46 struct tagCURSORICONINFO;
47 struct tagCREATESTRUCTA;
48 struct tagWINDOWPOS;
49
50 #if defined(HAVE_LIBCURSES) || defined(HAVE_LIBNCURSES)
51 #define WINE_CURSES
52 #endif
53
54 /**************************************************************************
55  * TTY GDI driver
56  */
57
58 #ifndef WINE_CURSES
59 typedef struct { int dummy; } WINDOW;
60 #endif
61
62 typedef struct {
63   HDC hdc;
64   DC *dc;
65   WINDOW *window;
66   int cellWidth;
67   int cellHeight;
68 } TTYDRV_PDEVICE;
69
70 typedef struct {
71   int dummy; /* FIXME: Remove later */
72 } TTYDRV_PHYSBITMAP;
73
74 extern BOOL TTYDRV_GDI_Initialize(void);
75
76 /* TTY GDI bitmap driver */
77
78 extern HBITMAP TTYDRV_BITMAP_CreateDIBSection(TTYDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage, LPVOID *bits, HANDLE section, DWORD offset);
79 extern void TTYDRV_BITMAP_DeleteDIBSection(struct tagBITMAPOBJ *bmp);
80
81 extern BOOL TTYDRV_DC_CreateBitmap(HBITMAP hbitmap);
82
83 extern BOOL TTYDRV_DC_Arc(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
84 extern LONG TTYDRV_DC_BitmapBits(HBITMAP hbitmap, void *bits, LONG count, WORD flags);
85 extern BOOL TTYDRV_DC_CreateBitmap(HBITMAP hbitmap);
86 extern BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device, LPCSTR output, const DEVMODEA *initData);
87 extern BOOL TTYDRV_DC_DeleteDC(TTYDRV_PDEVICE *physDev);
88 extern BOOL TTYDRV_DC_DeleteObject(HGDIOBJ handle);
89 extern BOOL TTYDRV_DC_BitBlt(TTYDRV_PDEVICE *physDevDst, INT xDst, INT yDst, INT width, INT height, TTYDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, DWORD rop);
90 extern BOOL TTYDRV_DC_Chord(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
91 extern BOOL TTYDRV_DC_Ellipse(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom);
92 extern INT TTYDRV_DC_Escape(TTYDRV_PDEVICE *physDev, INT nEscape, INT cbInput, SEGPTR lpInData, SEGPTR lpOutData);
93 extern BOOL TTYDRV_DC_ExtFloodFill(TTYDRV_PDEVICE *physDev, INT x, INT y, COLORREF color, UINT fillType);
94 extern BOOL TTYDRV_DC_ExtTextOut(TTYDRV_PDEVICE *physDev, INT x, INT y, UINT flags, const RECT *lpRect, LPCWSTR str, UINT count, const INT *lpDx);
95 extern BOOL TTYDRV_DC_GetCharWidth(TTYDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar, LPINT buffer);
96 extern COLORREF TTYDRV_DC_GetPixel(TTYDRV_PDEVICE *physDev, INT x, INT y);
97
98 extern BOOL TTYDRV_DC_GetTextExtentPoint(TTYDRV_PDEVICE *physDev, LPCWSTR str, INT count, LPSIZE size);
99 extern BOOL TTYDRV_DC_GetTextMetrics(TTYDRV_PDEVICE *physDev, TEXTMETRICW *metrics);
100 extern BOOL TTYDRV_DC_LineTo(TTYDRV_PDEVICE *physDev, INT x, INT y);
101 extern BOOL TTYDRV_DC_PaintRgn(TTYDRV_PDEVICE *physDev, HRGN hrgn);
102 extern BOOL TTYDRV_DC_PatBlt(TTYDRV_PDEVICE *physDev, INT left, INT top, INT width, INT height, DWORD rop);
103 extern BOOL TTYDRV_DC_Pie(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
104 extern BOOL TTYDRV_DC_Polygon(TTYDRV_PDEVICE *physDev, const POINT* pt, INT count);
105 extern BOOL TTYDRV_DC_Polyline(TTYDRV_PDEVICE *physDev, const POINT* pt, INT count);
106 extern BOOL TTYDRV_DC_PolyPolygon(TTYDRV_PDEVICE *physDev, const POINT* pt, const INT* counts, UINT polygons);
107 extern BOOL TTYDRV_DC_PolyPolyline(TTYDRV_PDEVICE *physDev, const POINT* pt, const DWORD* counts, DWORD polylines);
108 extern BOOL TTYDRV_DC_Rectangle(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom);
109 extern BOOL TTYDRV_DC_RoundRect(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height);
110 extern void TTYDRV_DC_SetDeviceClipping(TTYDRV_PDEVICE *physDev);
111 extern COLORREF TTYDRV_DC_SetPixel(TTYDRV_PDEVICE *physDev, INT x, INT y, COLORREF color);
112 extern BOOL TTYDRV_DC_StretchBlt(TTYDRV_PDEVICE *physDevDst, INT xDst, INT yDst, INT widthDst, INT heightDst, TTYDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, DWORD rop);
113 INT TTYDRV_DC_SetDIBitsToDevice(TTYDRV_PDEVICE *physDev, INT xDest, INT yDest, DWORD cx, DWORD cy, INT xSrc, INT ySrc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse);
114
115 /* TTY GDI palette driver */
116
117 extern struct tagPALETTE_DRIVER TTYDRV_PALETTE_Driver;
118
119 extern BOOL TTYDRV_PALETTE_Initialize(void);
120 extern int TTYDRV_PALETTE_SetMapping(struct tagPALETTEOBJ *palPtr, UINT uStart, UINT uNum, BOOL mapOnly);
121 extern int TTYDRV_PALETTE_UpdateMapping(struct tagPALETTEOBJ *palPtr);
122 extern BOOL TTYDRV_PALETTE_IsDark(int pixel);
123
124 /**************************************************************************
125  * TTY USER driver
126  */
127
128 extern int cell_width;
129 extern int cell_height;
130 extern int screen_rows;
131 extern int screen_cols;
132 extern WINDOW *root_window;
133
134 #endif /* !defined(__WINE_TTYDRV_H) */