Removed some unnecessary #includes and dll dependencies.
[wine.git] / graphics / ttydrv / init.c
blobc08203696007f47c5509e9a04769caa7b675f980
1 /*
2 * TTY driver
4 * Copyright 1998-1999 Patrik Stridvall
5 */
7 #include "config.h"
9 #include "gdi.h"
10 #include "bitmap.h"
11 #include "color.h"
12 #include "dc.h"
13 #include "ttydrv.h"
14 #include "debugtools.h"
16 DEFAULT_DEBUG_CHANNEL(ttydrv)
18 static const DC_FUNCTIONS TTYDRV_DC_Driver =
20 NULL, /* pAbortDoc */
21 NULL, /* pAbortPath */
22 NULL, /* pAngleArc */
23 TTYDRV_DC_Arc, /* pArc */
24 NULL, /* pArcTo */
25 NULL, /* pBeginPath */
26 TTYDRV_DC_BitBlt, /* pBitBlt */
27 TTYDRV_DC_BitmapBits,/* pBitmapBits */
28 NULL, /* pChoosePixelFormat */
29 TTYDRV_DC_Chord, /* pChord */
30 NULL, /* pCloseFigure */
31 TTYDRV_DC_CreateBitmap, /* pCreateBitmap */
32 TTYDRV_DC_CreateDC, /* pCreateDC */
33 NULL, /* pCreateDIBSection */
34 NULL, /* pCreateDIBSection16 */
35 TTYDRV_DC_DeleteDC, /* pDeleteDC */
36 TTYDRV_DC_DeleteObject, /* pDeleteObject */
37 NULL, /* pDescribePixelFormat */
38 NULL, /* pDeviceCapabilities */
39 TTYDRV_DC_Ellipse, /* pEllipse */
40 NULL, /* pEndDoc */
41 NULL, /* pEndPage */
42 NULL, /* pEndPath */
43 NULL, /* pEnumDeviceFonts */
44 TTYDRV_DC_Escape, /* pEscape */
45 NULL, /* pExcludeClipRect */
46 NULL, /* pExtDeviceMode */
47 TTYDRV_DC_ExtFloodFill, /* pExtFloodFill */
48 TTYDRV_DC_ExtTextOut, /* pExtTextOut */
49 NULL, /* pFillPath */
50 NULL, /* pFillRgn */
51 NULL, /* pFlattenPath */
52 NULL, /* pFrameRgn */
53 TTYDRV_DC_GetCharWidth, /* pGetCharWidth */
54 NULL, /* pGetDCOrgEx */
55 TTYDRV_DC_GetPixel, /* pGetPixel */
56 NULL, /* pGetPixelFormat */
57 TTYDRV_DC_GetTextExtentPoint, /* pGetTextExtentPoint */
58 TTYDRV_DC_GetTextMetrics, /* pGetTextMetrics */
59 NULL, /* pIntersectClipRect */
60 NULL, /* pIntersectVisRect */
61 TTYDRV_DC_LineTo, /* pLineTo */
62 NULL, /* pMoveToEx */
63 NULL, /* pOffsetClipRgn */
64 NULL, /* pOffsetViewportOrg (optional) */
65 NULL, /* pOffsetWindowOrg (optional) */
66 TTYDRV_DC_PaintRgn, /* pPaintRgn */
67 TTYDRV_DC_PatBlt, /* pPatBlt */
68 TTYDRV_DC_Pie, /* pPie */
69 NULL, /* pPolyBezier */
70 NULL, /* pPolyBezierTo */
71 NULL, /* pPolyDraw */
72 TTYDRV_DC_PolyPolygon, /* pPolyPolygon */
73 TTYDRV_DC_PolyPolyline, /* pPolyPolyline */
74 TTYDRV_DC_Polygon, /* pPolygon */
75 TTYDRV_DC_Polyline, /* pPolyline */
76 NULL, /* pPolylineTo */
77 NULL, /* pRealizePalette */
78 TTYDRV_DC_Rectangle, /* pRectangle */
79 NULL, /* pRestoreDC */
80 TTYDRV_DC_RoundRect, /* pRoundRect */
81 NULL, /* pSaveDC */
82 NULL, /* pScaleViewportExt (optional) */
83 NULL, /* pScaleWindowExt (optional) */
84 NULL, /* pSelectClipPath */
85 NULL, /* pSelectClipRgn */
86 TTYDRV_DC_SelectObject, /* pSelectObject */
87 NULL, /* pSelectPalette */
88 TTYDRV_DC_SetBkColor, /* pSetBkColor */
89 NULL, /* pSetBkMode */
90 TTYDRV_DC_SetDeviceClipping, /* pSetDeviceClipping */
91 TTYDRV_DC_SetDIBitsToDevice, /* pSetDIBitsToDevice */
92 NULL, /* pSetMapMode (optional) */
93 NULL, /* pSetMapperFlags */
94 TTYDRV_DC_SetPixel, /* pSetPixel */
95 NULL, /* pSetPixelFormat */
96 NULL, /* pSetPolyFillMode */
97 NULL, /* pSetROP2 */
98 NULL, /* pSetRelAbs */
99 NULL, /* pSetStretchBltMode */
100 NULL, /* pSetTextAlign */
101 NULL, /* pSetTextCharacterExtra */
102 TTYDRV_DC_SetTextColor, /* pSetTextColor */
103 NULL, /* pSetTextJustification */
104 NULL, /* pSetViewportExt (optional) */
105 NULL, /* pSetViewportOrg (optional) */
106 NULL, /* pSetWindowExt (optional) */
107 NULL, /* pSetWindowOrg (optional) */
108 NULL, /* pStartDoc */
109 NULL, /* pStartPage */
110 TTYDRV_DC_StretchBlt, /* pStretchBlt */
111 NULL, /* pStretchDIBits */
112 NULL, /* pStrokeAndFillPath */
113 NULL, /* pStrokePath */
114 NULL, /* pSwapBuffers */
115 NULL /* pWidenPath */
119 BITMAP_DRIVER TTYDRV_BITMAP_Driver =
121 TTYDRV_BITMAP_SetDIBits,
122 TTYDRV_BITMAP_GetDIBits,
123 TTYDRV_BITMAP_DeleteDIBSection
126 PALETTE_DRIVER TTYDRV_PALETTE_Driver =
128 TTYDRV_PALETTE_SetMapping,
129 TTYDRV_PALETTE_UpdateMapping,
130 TTYDRV_PALETTE_IsDark
133 /* FIXME: Adapt to the TTY driver. Copied from the X11 driver */
135 DeviceCaps TTYDRV_DC_DevCaps = {
136 /* version */ 0,
137 /* technology */ DT_RASDISPLAY,
138 /* size, resolution */ 0, 0, 0, 0, 0,
139 /* device objects */ 1, 16 + 6, 16, 0, 0, 100, 0,
140 /* curve caps */ CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES |
141 CC_WIDE | CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT,
142 /* line caps */ LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE |
143 LC_STYLED | LC_WIDESTYLED | LC_INTERIORS,
144 /* polygon caps */ PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON |
145 PC_SCANLINE | PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS,
146 /* text caps */ 0,
147 /* regions */ CP_REGION,
148 /* raster caps */ RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 |
149 RC_DI_BITMAP | RC_DIBTODEV | RC_BIGFONT | RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS,
150 /* aspects */ 36, 36, 51,
151 /* pad1 */ { 0 },
152 /* log pixels */ 0, 0,
153 /* pad2 */ { 0 },
154 /* palette size */ 0,
155 /* ..etc */ 0, 0
158 /**********************************************************************
159 * TTYDRV_GDI_Initialize
161 BOOL TTYDRV_GDI_Initialize(void)
163 BITMAP_Driver = &TTYDRV_BITMAP_Driver;
164 PALETTE_Driver = &TTYDRV_PALETTE_Driver;
166 TTYDRV_DC_DevCaps.version = 0x300;
167 TTYDRV_DC_DevCaps.horzSize = 0; /* FIXME: Screen width in mm */
168 TTYDRV_DC_DevCaps.vertSize = 0; /* FIXME: Screen height in mm */
169 TTYDRV_DC_DevCaps.horzRes = 640; /* FIXME: Screen width in pixel */
170 TTYDRV_DC_DevCaps.vertRes = 480; /* FIXME: Screen height in pixel */
171 TTYDRV_DC_DevCaps.bitsPixel = 1; /* FIXME: Bits per pixel */
172 TTYDRV_DC_DevCaps.sizePalette = 0; /* FIXME: ??? */
174 /* Resolution will be adjusted during the font init */
176 TTYDRV_DC_DevCaps.logPixelsX = (int) (TTYDRV_DC_DevCaps.horzRes * 25.4 / TTYDRV_DC_DevCaps.horzSize);
177 TTYDRV_DC_DevCaps.logPixelsY = (int) (TTYDRV_DC_DevCaps.vertRes * 25.4 / TTYDRV_DC_DevCaps.vertSize);
179 if(!TTYDRV_PALETTE_Initialize())
180 return FALSE;
182 return DRIVER_RegisterDriver( "DISPLAY", &TTYDRV_DC_Driver );
185 /**********************************************************************
186 * TTYDRV_GDI_Finalize
188 void TTYDRV_GDI_Finalize(void)
190 TTYDRV_PALETTE_Finalize();