1999-11-24 00:43:29 +01:00
|
|
|
/*
|
|
|
|
* TTY DC text
|
|
|
|
*
|
|
|
|
* Copyright 1999 Patrik Stridvall
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2000-02-10 20:39:48 +01:00
|
|
|
#include "windef.h"
|
2000-03-30 21:26:44 +02:00
|
|
|
#include "winbase.h"
|
2000-02-10 20:39:48 +01:00
|
|
|
#include "wingdi.h"
|
1999-11-24 00:43:29 +01:00
|
|
|
#include "dc.h"
|
|
|
|
#include "debugtools.h"
|
|
|
|
#include "gdi.h"
|
|
|
|
#include "ttydrv.h"
|
|
|
|
|
2000-02-10 20:39:48 +01:00
|
|
|
DEFAULT_DEBUG_CHANNEL(ttydrv);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_ExtTextOut
|
|
|
|
*/
|
|
|
|
BOOL TTYDRV_DC_ExtTextOut(DC *dc, INT x, INT y, UINT flags,
|
1999-12-26 01:47:03 +01:00
|
|
|
const RECT *lpRect, LPCWSTR str, UINT count,
|
1999-11-24 00:43:29 +01:00
|
|
|
const INT *lpDx)
|
|
|
|
{
|
2000-03-30 21:26:44 +02:00
|
|
|
#ifdef WINE_CURSES
|
1999-11-24 00:43:29 +01:00
|
|
|
TTYDRV_PDEVICE *physDev = (TTYDRV_PDEVICE *) dc->physDev;
|
|
|
|
INT row, col;
|
1999-12-26 01:47:03 +01:00
|
|
|
LPSTR ascii;
|
1999-11-24 00:43:29 +01:00
|
|
|
|
1999-12-12 00:08:48 +01:00
|
|
|
TRACE("(%p, %d, %d, 0x%08x, %p, %s, %d, %p)\n",
|
1999-12-26 01:47:03 +01:00
|
|
|
dc, x, y, flags, lpRect, debugstr_wn(str, count), count, lpDx);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
1999-12-12 00:08:48 +01:00
|
|
|
if(!physDev->window)
|
|
|
|
return FALSE;
|
|
|
|
|
1999-11-24 00:43:29 +01:00
|
|
|
/* FIXME: Is this really correct? */
|
|
|
|
if(dc->w.textAlign & TA_UPDATECP) {
|
|
|
|
x = dc->w.CursPosX;
|
|
|
|
y = dc->w.CursPosY;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = XLPTODP(dc, x);
|
|
|
|
y = YLPTODP(dc, y);
|
|
|
|
|
|
|
|
row = (dc->w.DCOrgY + y) / physDev->cellHeight;
|
|
|
|
col = (dc->w.DCOrgX + x) / physDev->cellWidth;
|
1999-12-26 01:47:03 +01:00
|
|
|
ascii = HeapAlloc( GetProcessHeap(), 0, count+1 );
|
|
|
|
lstrcpynWtoA(ascii, str, count+1);
|
|
|
|
mvwaddnstr(physDev->window, row, col, ascii, count);
|
|
|
|
HeapFree( GetProcessHeap(), 0, ascii );
|
1999-11-24 00:43:29 +01:00
|
|
|
wrefresh(physDev->window);
|
|
|
|
|
|
|
|
if(dc->w.textAlign & TA_UPDATECP) {
|
|
|
|
dc->w.CursPosX += count * physDev->cellWidth;
|
1999-12-26 01:47:03 +01:00
|
|
|
dc->w.CursPosY += physDev->cellHeight;
|
1999-11-24 00:43:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2000-03-30 21:26:44 +02:00
|
|
|
#else /* defined(WINE_CURSES) */
|
1999-11-24 00:43:29 +01:00
|
|
|
FIXME("(%p, %d, %d, 0x%08x, %p, %s, %d, %p): stub\n",
|
1999-12-26 01:47:03 +01:00
|
|
|
dc, x, y, flags, lpRect, debugstr_wn(str,count), count, lpDx);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
return TRUE;
|
2000-03-30 21:26:44 +02:00
|
|
|
#endif /* defined(WINE_CURSES) */
|
1999-11-24 00:43:29 +01:00
|
|
|
}
|