4 * Copyright 1998 Patrik Stridvall
11 #include "debugtools.h"
16 DEFAULT_DEBUG_CHANNEL(ttydrv
)
18 static const DC_FUNCTIONS TTYDRV_DC_Driver
=
23 NULL
, /* pBitmapBits */
25 NULL
, /* pCreateBitmap */
26 TTYDRV_DC_CreateDC
, /* pCreateDC */
27 NULL
, /* pCreateDIBSection */
28 NULL
, /* pCreateDIBSection16 */
29 TTYDRV_DC_DeleteDC
, /* pDeleteDC */
30 NULL
, /* pDeleteObject */
31 NULL
, /* pDeviceCapabilities */
35 NULL
, /* pEnumDeviceFonts */
36 TTYDRV_DC_Escape
, /* pEscape */
37 NULL
, /* pExcludeClipRect */
38 NULL
, /* pExcludeVisRect */
39 NULL
, /* pExtDeviceMode */
40 NULL
, /* pExtFloodFill */
41 NULL
, /* pExtTextOut */
42 NULL
, /* pGetCharWidth */
44 NULL
, /* pGetTextExtentPoint */
45 NULL
, /* pGetTextMetrics */
46 NULL
, /* pIntersectClipRect */
47 NULL
, /* pIntersectVisRect */
49 NULL
, /* pLoadOEMResource */
51 NULL
, /* pOffsetClipRgn */
52 NULL
, /* pOffsetViewportOrg (optional) */
53 NULL
, /* pOffsetWindowOrg (optional) */
57 NULL
, /* pPolyPolygon */
58 NULL
, /* pPolyPolyline */
61 NULL
, /* pPolyBezier */
62 NULL
, /* pRealizePalette */
63 NULL
, /* pRectangle */
64 NULL
, /* pRestoreDC */
65 NULL
, /* pRoundRect */
67 NULL
, /* pScaleViewportExt (optional) */
68 NULL
, /* pScaleWindowExt (optional) */
69 NULL
, /* pSelectClipRgn */
70 NULL
, /* pSelectObject */
71 NULL
, /* pSelectPalette */
72 NULL
, /* pSetBkColor */
73 NULL
, /* pSetBkMode */
74 NULL
, /* pSetDeviceClipping */
75 NULL
, /* pSetDIBitsToDevice */
76 NULL
, /* pSetMapMode (optional) */
77 NULL
, /* pSetMapperFlags */
79 NULL
, /* pSetPolyFillMode */
81 NULL
, /* pSetRelAbs */
82 NULL
, /* pSetStretchBltMode */
83 NULL
, /* pSetTextAlign */
84 NULL
, /* pSetTextCharacterExtra */
85 NULL
, /* pSetTextColor */
86 NULL
, /* pSetTextJustification */
87 NULL
, /* pSetViewportExt (optional) */
88 NULL
, /* pSetViewportOrg (optional) */
89 NULL
, /* pSetWindowExt (optional) */
90 NULL
, /* pSetWindowOrg (optional) */
92 NULL
, /* pStartPage */
93 NULL
, /* pStretchBlt */
94 NULL
/* pStretchDIBits */
98 GDI_DRIVER TTYDRV_GDI_Driver
=
100 TTYDRV_GDI_Initialize
,
104 BITMAP_DRIVER TTYDRV_BITMAP_Driver
=
106 TTYDRV_BITMAP_SetDIBits
,
107 TTYDRV_BITMAP_GetDIBits
,
108 TTYDRV_BITMAP_DeleteDIBSection
111 PALETTE_DRIVER TTYDRV_PALETTE_Driver
=
113 TTYDRV_PALETTE_SetMapping
,
114 TTYDRV_PALETTE_UpdateMapping
,
115 TTYDRV_PALETTE_IsDark
118 /* FIXME: Adapt to the TTY driver. Copied from the X11 driver */
120 static DeviceCaps TTYDRV_DC_DevCaps
= {
122 /* technology */ DT_RASDISPLAY
,
123 /* size, resolution */ 0, 0, 0, 0, 0,
124 /* device objects */ 1, 16 + 6, 16, 0, 0, 100, 0,
125 /* curve caps */ CC_CIRCLES
| CC_PIE
| CC_CHORD
| CC_ELLIPSES
|
126 CC_WIDE
| CC_STYLED
| CC_WIDESTYLED
| CC_INTERIORS
| CC_ROUNDRECT
,
127 /* line caps */ LC_POLYLINE
| LC_MARKER
| LC_POLYMARKER
| LC_WIDE
|
128 LC_STYLED
| LC_WIDESTYLED
| LC_INTERIORS
,
129 /* polygon caps */ PC_POLYGON
| PC_RECTANGLE
| PC_WINDPOLYGON
|
130 PC_SCANLINE
| PC_WIDE
| PC_STYLED
| PC_WIDESTYLED
| PC_INTERIORS
,
132 /* regions */ CP_REGION
,
133 /* raster caps */ RC_BITBLT
| RC_BANDING
| RC_SCALING
| RC_BITMAP64
|
134 RC_DI_BITMAP
| RC_DIBTODEV
| RC_BIGFONT
| RC_STRETCHBLT
| RC_STRETCHDIB
| RC_DEVBITS
,
135 /* aspects */ 36, 36, 51,
137 /* log pixels */ 0, 0,
139 /* palette size */ 0,
143 /**********************************************************************
144 * TTYDRV_GDI_Initialize
146 BOOL
TTYDRV_GDI_Initialize(void)
148 BITMAP_Driver
= &TTYDRV_BITMAP_Driver
;
149 PALETTE_Driver
= &TTYDRV_PALETTE_Driver
;
151 TTYDRV_DC_DevCaps
.version
= 0x300;
152 TTYDRV_DC_DevCaps
.horzSize
= 0; /* FIXME: Screen width in mm */
153 TTYDRV_DC_DevCaps
.vertSize
= 0; /* FIXME: Screen height in mm */
154 TTYDRV_DC_DevCaps
.horzRes
= 640; /* FIXME: Screen width in pixel */
155 TTYDRV_DC_DevCaps
.vertRes
= 480; /* FIXME: Screen height in pixel */
156 TTYDRV_DC_DevCaps
.bitsPixel
= 1; /* FIXME: Bits per pixel */
157 TTYDRV_DC_DevCaps
.sizePalette
= 0; /* FIXME: ??? */
159 /* Resolution will be adjusted during the font init */
161 TTYDRV_DC_DevCaps
.logPixelsX
= (int) (TTYDRV_DC_DevCaps
.horzRes
* 25.4 / TTYDRV_DC_DevCaps
.horzSize
);
162 TTYDRV_DC_DevCaps
.logPixelsY
= (int) (TTYDRV_DC_DevCaps
.vertRes
* 25.4 / TTYDRV_DC_DevCaps
.vertSize
);
164 if(!TTYDRV_PALETTE_Initialize())
167 return DRIVER_RegisterDriver( "DISPLAY", &TTYDRV_DC_Driver
);
170 /**********************************************************************
171 * TTYDRV_GDI_Finalize
173 void TTYDRV_GDI_Finalize(void)
175 TTYDRV_PALETTE_Finalize();
178 /**********************************************************************
181 BOOL
TTYDRV_DC_CreateDC(DC
*dc
, LPCSTR driver
, LPCSTR device
,
182 LPCSTR output
, const DEVMODEA
*initData
)
184 FIXME("(%p, %s, %s, %s, %p): semistub\n",
185 dc
, debugstr_a(driver
), debugstr_a(device
),
186 debugstr_a(output
), initData
189 dc
->physDev
= HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY
,
190 sizeof(TTYDRV_PDEVICE
) );
193 ERR("Can't allocate physDev\n");
197 dc
->w
.devCaps
= &TTYDRV_DC_DevCaps
;
203 /**********************************************************************
206 BOOL
TTYDRV_DC_DeleteDC(DC
*dc
)
208 FIXME("(%p): semistub\n", dc
);
210 HeapFree( GetProcessHeap(), 0, dc
->physDev
);
216 /**********************************************************************
219 INT
TTYDRV_DC_Escape(DC
*dc
, INT nEscape
, INT cbInput
,
220 SEGPTR lpInData
, SEGPTR lpOutData
)