4 * Copyright 1998-1999 Patrik Stridvall
14 #include "debugtools.h"
16 DEFAULT_DEBUG_CHANNEL(ttydrv)
18 static const DC_FUNCTIONS TTYDRV_DC_Driver =
21 NULL, /* pAbortPath */
23 TTYDRV_DC_Arc, /* pArc */
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 */
43 NULL, /* pEnumDeviceFonts */
44 TTYDRV_DC_Escape, /* pEscape */
45 NULL, /* pExcludeClipRect */
46 NULL, /* pExtDeviceMode */
47 TTYDRV_DC_ExtFloodFill, /* pExtFloodFill */
48 TTYDRV_DC_ExtTextOut, /* pExtTextOut */
51 NULL, /* pFlattenPath */
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 TTYDRV_DC_LoadOEMResource, /* pLoadOEMResource */
64 NULL, /* pOffsetClipRgn */
65 NULL, /* pOffsetViewportOrg (optional) */
66 NULL, /* pOffsetWindowOrg (optional) */
67 TTYDRV_DC_PaintRgn, /* pPaintRgn */
68 TTYDRV_DC_PatBlt, /* pPatBlt */
69 TTYDRV_DC_Pie, /* pPie */
70 NULL, /* pPolyBezier */
71 NULL, /* pPolyBezierTo */
73 TTYDRV_DC_PolyPolygon, /* pPolyPolygon */
74 TTYDRV_DC_PolyPolyline, /* pPolyPolyline */
75 TTYDRV_DC_Polygon, /* pPolygon */
76 TTYDRV_DC_Polyline, /* pPolyline */
77 NULL, /* pPolylineTo */
78 NULL, /* pRealizePalette */
79 TTYDRV_DC_Rectangle, /* pRectangle */
80 NULL, /* pRestoreDC */
81 TTYDRV_DC_RoundRect, /* pRoundRect */
83 NULL, /* pScaleViewportExt (optional) */
84 NULL, /* pScaleWindowExt (optional) */
85 NULL, /* pSelectClipPath */
86 NULL, /* pSelectClipRgn */
87 TTYDRV_DC_SelectObject, /* pSelectObject */
88 NULL, /* pSelectPalette */
89 TTYDRV_DC_SetBkColor, /* pSetBkColor */
90 NULL, /* pSetBkMode */
91 TTYDRV_DC_SetDeviceClipping, /* pSetDeviceClipping */
92 TTYDRV_DC_SetDIBitsToDevice, /* pSetDIBitsToDevice */
93 NULL, /* pSetMapMode (optional) */
94 NULL, /* pSetMapperFlags */
95 TTYDRV_DC_SetPixel, /* pSetPixel */
96 NULL, /* pSetPixelFormat */
97 NULL, /* pSetPolyFillMode */
99 NULL, /* pSetRelAbs */
100 NULL, /* pSetStretchBltMode */
101 NULL, /* pSetTextAlign */
102 NULL, /* pSetTextCharacterExtra */
103 TTYDRV_DC_SetTextColor, /* pSetTextColor */
104 NULL, /* pSetTextJustification */
105 NULL, /* pSetViewportExt (optional) */
106 NULL, /* pSetViewportOrg (optional) */
107 NULL, /* pSetWindowExt (optional) */
108 NULL, /* pSetWindowOrg (optional) */
109 NULL, /* pStartDoc */
110 NULL, /* pStartPage */
111 TTYDRV_DC_StretchBlt, /* pStretchBlt */
112 NULL, /* pStretchDIBits */
113 NULL, /* pStrokeAndFillPath */
114 NULL, /* pStrokePath */
115 NULL, /* pSwapBuffers */
116 NULL /* pWidenPath */
120 BITMAP_DRIVER TTYDRV_BITMAP_Driver =
122 TTYDRV_BITMAP_SetDIBits,
123 TTYDRV_BITMAP_GetDIBits,
124 TTYDRV_BITMAP_DeleteDIBSection
127 PALETTE_DRIVER TTYDRV_PALETTE_Driver =
129 TTYDRV_PALETTE_SetMapping,
130 TTYDRV_PALETTE_UpdateMapping,
131 TTYDRV_PALETTE_IsDark
134 /* FIXME: Adapt to the TTY driver. Copied from the X11 driver */
136 DeviceCaps TTYDRV_DC_DevCaps = {
138 /* technology */ DT_RASDISPLAY,
139 /* size, resolution */ 0, 0, 0, 0, 0,
140 /* device objects */ 1, 16 + 6, 16, 0, 0, 100, 0,
141 /* curve caps */ CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES |
142 CC_WIDE | CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT,
143 /* line caps */ LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE |
144 LC_STYLED | LC_WIDESTYLED | LC_INTERIORS,
145 /* polygon caps */ PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON |
146 PC_SCANLINE | PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS,
148 /* regions */ CP_REGION,
149 /* raster caps */ RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 |
150 RC_DI_BITMAP | RC_DIBTODEV | RC_BIGFONT | RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS,
151 /* aspects */ 36, 36, 51,
153 /* log pixels */ 0, 0,
155 /* palette size */ 0,
159 /**********************************************************************
160 * TTYDRV_GDI_Initialize
162 BOOL TTYDRV_GDI_Initialize(void)
164 BITMAP_Driver = &TTYDRV_BITMAP_Driver;
165 PALETTE_Driver = &TTYDRV_PALETTE_Driver;
167 TTYDRV_DC_DevCaps.version = 0x300;
168 TTYDRV_DC_DevCaps.horzSize = 0; /* FIXME: Screen width in mm */
169 TTYDRV_DC_DevCaps.vertSize = 0; /* FIXME: Screen height in mm */
170 TTYDRV_DC_DevCaps.horzRes = 640; /* FIXME: Screen width in pixel */
171 TTYDRV_DC_DevCaps.vertRes = 480; /* FIXME: Screen height in pixel */
172 TTYDRV_DC_DevCaps.bitsPixel = 1; /* FIXME: Bits per pixel */
173 TTYDRV_DC_DevCaps.sizePalette = 0; /* FIXME: ??? */
175 /* Resolution will be adjusted during the font init */
177 TTYDRV_DC_DevCaps.logPixelsX = (int) (TTYDRV_DC_DevCaps.horzRes * 25.4 / TTYDRV_DC_DevCaps.horzSize);
178 TTYDRV_DC_DevCaps.logPixelsY = (int) (TTYDRV_DC_DevCaps.vertRes * 25.4 / TTYDRV_DC_DevCaps.vertSize);
180 if(!TTYDRV_PALETTE_Initialize())
183 return DRIVER_RegisterDriver( "DISPLAY", &TTYDRV_DC_Driver );
186 /**********************************************************************
187 * TTYDRV_GDI_Finalize
189 void TTYDRV_GDI_Finalize(void)
191 TTYDRV_PALETTE_Finalize();