4 * Copyright 1999 Patrik Stridvall
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.
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.
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
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
30 /**********************************************************************/
32 const DC_FUNCTIONS *TTYDRV_DC_Funcs = NULL; /* hack */
34 /**********************************************************************
35 * TTYDRV_GDI_Initialize
37 BOOL TTYDRV_GDI_Initialize(void)
39 return TTYDRV_PALETTE_Initialize();
42 /***********************************************************************
45 BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device,
46 LPCSTR output, const DEVMODEA *initData)
48 TTYDRV_PDEVICE *physDev;
50 TRACE("(%p, %s, %s, %s, %p)\n",
51 dc, debugstr_a(driver), debugstr_a(device),
52 debugstr_a(output), initData);
54 if (!TTYDRV_DC_Funcs) TTYDRV_DC_Funcs = dc->funcs; /* hack */
56 dc->physDev = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
57 sizeof(TTYDRV_PDEVICE));
59 ERR("Can't allocate physDev\n");
62 physDev = (TTYDRV_PDEVICE *) dc->physDev;
63 physDev->hdc = dc->hSelf;
66 if(dc->flags & DC_MEMORY){
67 physDev->window = NULL;
68 physDev->cellWidth = 1;
69 physDev->cellHeight = 1;
71 TTYDRV_DC_CreateBitmap(dc->hBitmap);
73 physDev->window = root_window;
74 physDev->cellWidth = cell_width;
75 physDev->cellHeight = cell_height;
83 /***********************************************************************
86 BOOL TTYDRV_DC_DeleteDC(TTYDRV_PDEVICE *physDev)
88 TRACE("(%x)\n", physDev->hdc);
90 physDev->dc->physDev = NULL;
91 HeapFree( GetProcessHeap(), 0, physDev );
96 /***********************************************************************
97 * GetDeviceCaps (TTYDRV.@)
99 INT TTYDRV_GetDeviceCaps( TTYDRV_PDEVICE *physDev, INT cap )
106 return DT_RASDISPLAY;
108 return 0; /* FIXME: Screen width in mm */
110 return 0; /* FIXME: Screen height in mm */
112 return cell_width * screen_cols;
114 return cell_height * screen_rows;
116 return 1; /* FIXME */
130 return sizeof(TTYDRV_PDEVICE);
132 return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE |
133 CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT);
135 return (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE |
136 LC_STYLED | LC_WIDESTYLED | LC_INTERIORS);
138 return (PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON |
139 PC_SCANLINE | PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS);
145 return (RC_BITBLT | RC_BANDING | RC_SCALING | RC_BITMAP64 | RC_DI_BITMAP |
146 RC_DIBTODEV | RC_BIGFONT | RC_STRETCHBLT | RC_STRETCHDIB | RC_DEVBITS);
154 return 72; /* FIXME */
156 return 256; /* FIXME */
163 case PHYSICALOFFSETX:
164 case PHYSICALOFFSETY:
173 FIXME("(%04x): unsupported capability %d, will return 0\n", physDev->hdc, cap );