Removed extra includes from ole.h and wingdi.h.
[wine/testsucceed.git] / graphics / ttydrv / text.c
blobb1b271302bb64e42b8e8218bc903c40a57f7d334
1 /*
2 * TTY DC text
4 * Copyright 1999 Patrik Stridvall
5 */
7 #include "config.h"
9 #include "windef.h"
10 #include "wingdi.h"
11 #include "dc.h"
12 #include "debugtools.h"
13 #include "gdi.h"
14 #include "ttydrv.h"
16 DEFAULT_DEBUG_CHANNEL(ttydrv);
18 /***********************************************************************
19 * TTYDRV_DC_ExtTextOut
21 BOOL TTYDRV_DC_ExtTextOut(DC *dc, INT x, INT y, UINT flags,
22 const RECT *lpRect, LPCWSTR str, UINT count,
23 const INT *lpDx)
25 #ifdef HAVE_LIBCURSES
26 TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
27 INT row, col;
28 LPSTR ascii;
30 TRACE("(%p, %d, %d, 0x%08x, %p, %s, %d, %p)\n",
31 dc, x, y, flags, lpRect, debugstr_wn(str, count), count, lpDx);
33 if(!physDev->window)
34 return FALSE;
36 /* FIXME: Is this really correct? */
37 if(dc->w.textAlign & TA_UPDATECP) {
38 x = dc->w.CursPosX;
39 y = dc->w.CursPosY;
42 x = XLPTODP(dc, x);
43 y = YLPTODP(dc, y);
45 row = (dc->w.DCOrgY + y) / physDev->cellHeight;
46 col = (dc->w.DCOrgX + x) / physDev->cellWidth;
47 ascii = HeapAlloc( GetProcessHeap(), 0, count+1 );
48 lstrcpynWtoA(ascii, str, count+1);
49 mvwaddnstr(physDev->window, row, col, ascii, count);
50 HeapFree( GetProcessHeap(), 0, ascii );
51 wrefresh(physDev->window);
53 if(dc->w.textAlign & TA_UPDATECP) {
54 dc->w.CursPosX += count * physDev->cellWidth;
55 dc->w.CursPosY += physDev->cellHeight;
58 return TRUE;
59 #else /* defined(HAVE_LIBCURSES) */
60 FIXME("(%p, %d, %d, 0x%08x, %p, %s, %d, %p): stub\n",
61 dc, x, y, flags, lpRect, debugstr_wn(str,count), count, lpDx);
63 return TRUE;
64 #endif /* defined(HAVE_LIBCURSES) */