4 * Copyright 1999 Patrik Stridvall
15 #include "debugtools.h"
17 DEFAULT_DEBUG_CHANNEL(ttydrv)
19 /**********************************************************************/
21 extern DeviceCaps TTYDRV_DC_DevCaps;
23 /***********************************************************************
26 BOOL TTYDRV_DC_CreateDC(DC *dc, LPCSTR driver, LPCSTR device,
27 LPCSTR output, const DEVMODEA *initData)
29 TTYDRV_PDEVICE *physDev;
32 TRACE("(%p, %s, %s, %s, %p)\n",
33 dc, debugstr_a(driver), debugstr_a(device),
34 debugstr_a(output), initData);
36 dc->physDev = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
37 sizeof(TTYDRV_PDEVICE));
39 ERR("Can't allocate physDev\n");
42 physDev = (TTYDRV_PDEVICE *) dc->physDev;
44 dc->w.devCaps = &TTYDRV_DC_DevCaps;
46 if(dc->w.flags & DC_MEMORY){
48 physDev->window = NULL;
49 #endif /* defined(HAVE_LIBCURSES) */
50 physDev->cellWidth = 1;
51 physDev->cellHeight = 1;
53 TTYDRV_DC_CreateBitmap(dc->w.hBitmap);
54 bmp = (BITMAPOBJ *) GDI_GetObjPtr(dc->w.hBitmap, BITMAP_MAGIC);
56 dc->w.bitsPerPixel = bmp->bitmap.bmBitsPixel;
58 dc->w.totalExtent.left = 0;
59 dc->w.totalExtent.top = 0;
60 dc->w.totalExtent.right = bmp->bitmap.bmWidth;
61 dc->w.totalExtent.bottom = bmp->bitmap.bmHeight;
62 dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent );
64 GDI_HEAP_UNLOCK( dc->w.hBitmap );
67 physDev->window = TTYDRV_MONITOR_GetCursesRootWindow(&MONITOR_PrimaryMonitor);
68 #endif /* defined(HAVE_LIBCURSES) */
69 physDev->cellWidth = TTYDRV_MONITOR_GetCellWidth(&MONITOR_PrimaryMonitor);
70 physDev->cellHeight = TTYDRV_MONITOR_GetCellHeight(&MONITOR_PrimaryMonitor);
72 dc->w.bitsPerPixel = MONITOR_GetDepth(&MONITOR_PrimaryMonitor);
74 dc->w.totalExtent.left = 0;
75 dc->w.totalExtent.top = 0;
76 dc->w.totalExtent.right = MONITOR_GetWidth(&MONITOR_PrimaryMonitor);
77 dc->w.totalExtent.bottom = MONITOR_GetHeight(&MONITOR_PrimaryMonitor);
78 dc->w.hVisRgn = CreateRectRgnIndirect( &dc->w.totalExtent );
84 /***********************************************************************
87 BOOL TTYDRV_DC_DeleteDC(DC *dc)
91 HeapFree( GetProcessHeap(), 0, dc->physDev );
97 /***********************************************************************
100 INT TTYDRV_DC_Escape(DC *dc, INT nEscape, INT cbInput,
101 SEGPTR lpInData, SEGPTR lpOutData)