Changed the pixmap to look like the windows default application icon.
[wine.git] / graphics / ttydrv / init.c
blob122b6d2f2e6efd37f3caa7836e6caf4082061310
1 /*
2 * TTY driver
4 * Copyright 1998 Patrik Stridvall
5 */
7 #include "gdi.h"
8 #include "bitmap.h"
9 #include "color.h"
10 #include "dc.h"
11 #include "debugtools.h"
12 #include "heap.h"
13 #include "palette.h"
14 #include "ttydrv.h"
16 DEFAULT_DEBUG_CHANNEL(ttydrv)
18 static const DC_FUNCTIONS TTYDRV_DC_Driver =
20 NULL, /* pAbortDoc */
21 NULL, /* pArc */
22 NULL, /* pBitBlt */
23 NULL, /* pBitmapBits */
24 NULL, /* pChord */
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 */
32 NULL, /* pEllipse */
33 NULL, /* pEndDoc */
34 NULL, /* pEndPage */
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 */
43 NULL, /* pGetPixel */
44 NULL, /* pGetTextExtentPoint */
45 NULL, /* pGetTextMetrics */
46 NULL, /* pIntersectClipRect */
47 NULL, /* pIntersectVisRect */
48 NULL, /* pLineTo */
49 NULL, /* pLoadOEMResource */
50 NULL, /* pMoveToEx */
51 NULL, /* pOffsetClipRgn */
52 NULL, /* pOffsetViewportOrg (optional) */
53 NULL, /* pOffsetWindowOrg (optional) */
54 NULL, /* pPaintRgn */
55 NULL, /* pPatBlt */
56 NULL, /* pPie */
57 NULL, /* pPolyPolygon */
58 NULL, /* pPolyPolyline */
59 NULL, /* pPolygon */
60 NULL, /* pPolyline */
61 NULL, /* pPolyBezier */
62 NULL, /* pRealizePalette */
63 NULL, /* pRectangle */
64 NULL, /* pRestoreDC */
65 NULL, /* pRoundRect */
66 NULL, /* pSaveDC */
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 */
78 NULL, /* pSetPixel */
79 NULL, /* pSetPolyFillMode */
80 NULL, /* pSetROP2 */
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) */
91 NULL, /* pStartDoc */
92 NULL, /* pStartPage */
93 NULL, /* pStretchBlt */
94 NULL /* pStretchDIBits */
98 GDI_DRIVER TTYDRV_GDI_Driver =
100 TTYDRV_GDI_Initialize,
101 TTYDRV_GDI_Finalize
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 = {
121 /* version */ 0,
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,
131 /* text caps */ 0,
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,
136 /* pad1 */ { 0 },
137 /* log pixels */ 0, 0,
138 /* pad2 */ { 0 },
139 /* palette size */ 0,
140 /* ..etc */ 0, 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())
165 return FALSE;
167 return DRIVER_RegisterDriver( "DISPLAY", &TTYDRV_DC_Driver );
170 /**********************************************************************
171 * TTYDRV_GDI_Finalize
173 void TTYDRV_GDI_Finalize(void)
175 TTYDRV_PALETTE_Finalize();
178 /**********************************************************************
179 * TTYDRV_DC_CreateDC
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) );
192 if(!dc->physDev) {
193 ERR("Can't allocate physDev\n");
194 return FALSE;
197 dc->w.devCaps = &TTYDRV_DC_DevCaps;
199 return TRUE;
203 /**********************************************************************
204 * TTYDRV_DC_DeleteDC
206 BOOL TTYDRV_DC_DeleteDC(DC *dc)
208 FIXME("(%p): semistub\n", dc);
210 HeapFree( GetProcessHeap(), 0, dc->physDev );
211 dc->physDev = NULL;
213 return TRUE;
216 /**********************************************************************
217 * TTYDRV_DC_Escape
219 INT TTYDRV_DC_Escape(DC *dc, INT nEscape, INT cbInput,
220 SEGPTR lpInData, SEGPTR lpOutData)
222 return 0;