1999-11-24 00:43:29 +01:00
|
|
|
/*
|
|
|
|
* TTY DC graphics
|
|
|
|
*
|
|
|
|
* Copyright 1999 Patrik Stridvall
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1999-11-24 00:43:29 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
2003-08-20 20:22:31 +02:00
|
|
|
#include "winbase.h"
|
2000-11-28 23:40:56 +01:00
|
|
|
#include "winnls.h"
|
2000-11-05 03:05:07 +01:00
|
|
|
#include "gdi.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1999-11-24 00:43:29 +01:00
|
|
|
#include "ttydrv.h"
|
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_Arc
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_Arc(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
1999-11-24 00:43:29 +01:00
|
|
|
INT xstart, INT ystart, INT xend, INT yend)
|
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
|
2002-03-28 23:22:05 +01:00
|
|
|
physDev->hdc, left, top, right, bottom, xstart, ystart, xend, yend);
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_Chord
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_Chord(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
1999-11-24 00:43:29 +01:00
|
|
|
INT xstart, INT ystart, INT xend, INT yend)
|
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
|
2002-03-28 23:22:05 +01:00
|
|
|
physDev->hdc, left, top, right, bottom, xstart, ystart, xend, yend);
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_Ellipse
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_Ellipse(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom)
|
1999-11-24 00:43:29 +01:00
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %d, %d, %d, %d): stub\n", physDev->hdc, left, top, right, bottom);
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_ExtFloodFill
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_ExtFloodFill(TTYDRV_PDEVICE *physDev, INT x, INT y,
|
1999-11-24 00:43:29 +01:00
|
|
|
COLORREF color, UINT fillType)
|
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %d, %d, 0x%08lx, %u): stub\n", physDev->hdc, x, y, color, fillType);
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_GetPixel
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
COLORREF TTYDRV_DC_GetPixel(TTYDRV_PDEVICE *physDev, INT x, INT y)
|
1999-11-24 00:43:29 +01:00
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %d, %d): stub\n", physDev->hdc, x, y);
|
1999-11-24 00:43:29 +01:00
|
|
|
return RGB(0,0,0); /* FIXME: Always returns black */
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_LineTo
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_LineTo(TTYDRV_PDEVICE *physDev, INT x, INT y)
|
1999-11-24 00:43:29 +01:00
|
|
|
{
|
2000-03-30 21:26:44 +02:00
|
|
|
#ifdef WINE_CURSES
|
1999-11-24 00:43:29 +01:00
|
|
|
INT row1, col1, row2, col2;
|
2002-06-11 00:52:47 +02:00
|
|
|
POINT pt[2];
|
1999-11-24 00:43:29 +01:00
|
|
|
|
2002-10-25 21:00:49 +02:00
|
|
|
TRACE("(%p, %d, %d)\n", physDev->hdc, x, y);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
1999-12-12 00:08:48 +01:00
|
|
|
if(!physDev->window)
|
|
|
|
return FALSE;
|
|
|
|
|
2002-06-11 00:52:47 +02:00
|
|
|
GetCurrentPositionEx( physDev->hdc, &pt[0] );
|
|
|
|
pt[1].x = x;
|
|
|
|
pt[1].y = y;
|
|
|
|
LPtoDP( physDev->hdc, pt, 2 );
|
|
|
|
|
|
|
|
row1 = (physDev->org.y + pt[0].y) / physDev->cellHeight;
|
|
|
|
col1 = (physDev->org.x + pt[0].x) / physDev->cellWidth;
|
|
|
|
row2 = (physDev->org.y + pt[1].y) / physDev->cellHeight;
|
|
|
|
col2 = (physDev->org.x + pt[1].x) / physDev->cellWidth;
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
if(row1 > row2) {
|
|
|
|
INT tmp = row1;
|
|
|
|
row1 = row2;
|
2002-06-01 01:06:46 +02:00
|
|
|
row2 = tmp;
|
|
|
|
}
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
if(col1 > col2) {
|
|
|
|
INT tmp = col1;
|
|
|
|
col1 = col2;
|
2002-06-01 01:06:46 +02:00
|
|
|
col2 = tmp;
|
|
|
|
}
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
wmove(physDev->window, row1, col1);
|
|
|
|
if(col1 == col2) {
|
1999-12-12 00:08:48 +01:00
|
|
|
wvline(physDev->window, ACS_VLINE, row2-row1);
|
1999-11-24 00:43:29 +01:00
|
|
|
} else if(row1 == row2) {
|
1999-12-12 00:08:48 +01:00
|
|
|
whline(physDev->window, ACS_HLINE, col2-col1);
|
1999-11-24 00:43:29 +01:00
|
|
|
} else {
|
|
|
|
FIXME("Diagonal line drawing not yet supported\n");
|
|
|
|
}
|
|
|
|
wrefresh(physDev->window);
|
|
|
|
|
|
|
|
return TRUE;
|
2000-03-30 21:26:44 +02:00
|
|
|
#else /* defined(WINE_CURSES) */
|
2002-03-28 23:22:05 +01:00
|
|
|
FIXME("(%x, %d, %d): stub\n", physDev->hdc, x, y);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_PaintRgn
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_PaintRgn(TTYDRV_PDEVICE *physDev, HRGN hrgn)
|
1999-11-24 00:43:29 +01:00
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %p): stub\n", physDev->hdc, hrgn);
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_Pie
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_Pie(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom,
|
1999-11-24 00:43:29 +01:00
|
|
|
INT xstart, INT ystart, INT xend, INT yend)
|
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
|
2002-03-28 23:22:05 +01:00
|
|
|
physDev->hdc, left, top, right, bottom, xstart, ystart, xend, yend);
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_Polygon
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_Polygon(TTYDRV_PDEVICE *physDev, const POINT* pt, INT count)
|
1999-11-24 00:43:29 +01:00
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %p, %d): stub\n", physDev->hdc, pt, count);
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_Polyline
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_Polyline(TTYDRV_PDEVICE *physDev, const POINT* pt, INT count)
|
1999-11-24 00:43:29 +01:00
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %p, %d): stub\n", physDev->hdc, pt, count);
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_PolyPolygon
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_PolyPolygon(TTYDRV_PDEVICE *physDev, const POINT* pt, const INT* counts, UINT polygons)
|
1999-11-24 00:43:29 +01:00
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %p, %p, %u): stub\n", physDev->hdc, pt, counts, polygons);
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_PolyPolyline
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_PolyPolyline(TTYDRV_PDEVICE *physDev, const POINT* pt, const DWORD* counts, DWORD polylines)
|
1999-11-24 00:43:29 +01:00
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %p, %p, %lu): stub\n", physDev->hdc, pt, counts, polylines);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_Rectangle
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_Rectangle(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom)
|
1999-11-24 00:43:29 +01:00
|
|
|
{
|
2000-03-30 21:26:44 +02:00
|
|
|
#ifdef WINE_CURSES
|
1999-11-24 00:43:29 +01:00
|
|
|
INT row1, col1, row2, col2;
|
2002-06-11 00:52:47 +02:00
|
|
|
RECT rect;
|
1999-11-24 00:43:29 +01:00
|
|
|
|
2002-10-25 21:00:49 +02:00
|
|
|
TRACE("(%p, %d, %d, %d, %d)\n", physDev->hdc, left, top, right, bottom);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
1999-12-12 00:08:48 +01:00
|
|
|
if(!physDev->window)
|
|
|
|
return FALSE;
|
|
|
|
|
2002-06-11 00:52:47 +02:00
|
|
|
rect.left = left;
|
|
|
|
rect.top = top;
|
|
|
|
rect.right = right;
|
|
|
|
rect.bottom = bottom;
|
|
|
|
LPtoDP( physDev->hdc, (POINT *)&rect, 2 );
|
|
|
|
row1 = (physDev->org.y + rect.top) / physDev->cellHeight;
|
|
|
|
col1 = (physDev->org.x + rect.left) / physDev->cellWidth;
|
|
|
|
row2 = (physDev->org.y + rect.bottom) / physDev->cellHeight;
|
|
|
|
col2 = (physDev->org.x + rect.right) / physDev->cellWidth;
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
if(row1 > row2) {
|
|
|
|
INT tmp = row1;
|
|
|
|
row1 = row2;
|
2002-06-01 01:06:46 +02:00
|
|
|
row2 = tmp;
|
|
|
|
}
|
1999-11-24 00:43:29 +01:00
|
|
|
if(col1 > col2) {
|
|
|
|
INT tmp = col1;
|
|
|
|
col1 = col2;
|
2002-06-01 01:06:46 +02:00
|
|
|
col2 = tmp;
|
|
|
|
}
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
wmove(physDev->window, row1, col1);
|
1999-12-12 00:08:48 +01:00
|
|
|
whline(physDev->window, ACS_HLINE, col2-col1);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
wmove(physDev->window, row1, col2);
|
1999-12-12 00:08:48 +01:00
|
|
|
wvline(physDev->window, ACS_VLINE, row2-row1);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
wmove(physDev->window, row2, col1);
|
1999-12-12 00:08:48 +01:00
|
|
|
whline(physDev->window, ACS_HLINE, col2-col1);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
wmove(physDev->window, row1, col1);
|
1999-12-12 00:08:48 +01:00
|
|
|
wvline(physDev->window, ACS_VLINE, row2-row1);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
1999-12-12 00:08:48 +01:00
|
|
|
mvwaddch(physDev->window, row1, col1, ACS_ULCORNER);
|
|
|
|
mvwaddch(physDev->window, row1, col2, ACS_URCORNER);
|
|
|
|
mvwaddch(physDev->window, row2, col2, ACS_LRCORNER);
|
|
|
|
mvwaddch(physDev->window, row2, col1, ACS_LLCORNER);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
wrefresh(physDev->window);
|
|
|
|
|
|
|
|
return TRUE;
|
2000-03-30 21:26:44 +02:00
|
|
|
#else /* defined(WINE_CURSES) */
|
2002-03-28 23:22:05 +01:00
|
|
|
FIXME("(%x, %d, %d, %d, %d): stub\n", physDev->hdc, left, top, right, bottom);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_RoundRect
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_RoundRect(TTYDRV_PDEVICE *physDev, INT left, INT top, INT right,
|
1999-11-24 00:43:29 +01:00
|
|
|
INT bottom, INT ell_width, INT ell_height)
|
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %d, %d, %d, %d, %d, %d): stub\n",
|
2002-03-28 23:22:05 +01:00
|
|
|
physDev->hdc, left, top, right, bottom, ell_width, ell_height);
|
2002-06-01 01:06:46 +02:00
|
|
|
|
1999-11-24 00:43:29 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_SetPixel
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
COLORREF TTYDRV_DC_SetPixel(TTYDRV_PDEVICE *physDev, INT x, INT y, COLORREF color)
|
1999-11-24 00:43:29 +01:00
|
|
|
{
|
2000-03-30 21:26:44 +02:00
|
|
|
#ifdef WINE_CURSES
|
1999-11-24 00:43:29 +01:00
|
|
|
INT row, col;
|
2002-06-11 00:52:47 +02:00
|
|
|
POINT pt;
|
1999-11-24 00:43:29 +01:00
|
|
|
|
2002-10-25 21:00:49 +02:00
|
|
|
TRACE("(%p, %d, %d, 0x%08lx)\n", physDev->hdc, x, y, color);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
1999-12-12 00:08:48 +01:00
|
|
|
if(!physDev->window)
|
|
|
|
return FALSE;
|
|
|
|
|
2002-06-11 00:52:47 +02:00
|
|
|
pt.x = x;
|
|
|
|
pt.y = y;
|
|
|
|
LPtoDP( physDev->hdc, &pt, 1 );
|
|
|
|
row = (physDev->org.y + pt.y) / physDev->cellHeight;
|
|
|
|
col = (physDev->org.x + pt.x) / physDev->cellWidth;
|
1999-11-24 00:43:29 +01:00
|
|
|
|
1999-12-12 00:08:48 +01:00
|
|
|
mvwaddch(physDev->window, row, col, ACS_BULLET);
|
1999-11-24 00:43:29 +01:00
|
|
|
wrefresh(physDev->window);
|
|
|
|
|
|
|
|
return RGB(0,0,0); /* FIXME: Always returns black */
|
2000-03-30 21:26:44 +02:00
|
|
|
#else /* defined(WINE_CURSES) */
|
2002-03-28 23:22:05 +01:00
|
|
|
FIXME("(%x, %d, %d, 0x%08lx): stub\n", physDev->hdc, x, y, color);
|
1999-11-24 00:43:29 +01:00
|
|
|
|
|
|
|
return RGB(0,0,0); /* FIXME: Always returns black */
|
2000-03-30 21:26:44 +02:00
|
|
|
#endif /* defined(WINE_CURSES) */
|
1999-11-24 00:43:29 +01:00
|
|
|
}
|
|
|
|
|
2000-08-10 03:16:19 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_BitBlt
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_BitBlt(TTYDRV_PDEVICE *physDevDst, INT xDst, INT yDst,
|
|
|
|
INT width, INT height, TTYDRV_PDEVICE *physDevSrc,
|
2000-08-10 03:16:19 +02:00
|
|
|
INT xSrc, INT ySrc, DWORD rop)
|
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %d, %d, %d, %d, %p, %d, %d, %lu): stub\n",
|
2002-03-28 23:22:05 +01:00
|
|
|
physDevDst->hdc, xDst, yDst, width, height, physDevSrc->hdc, xSrc, ySrc, rop );
|
2000-08-10 03:16:19 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_PatBlt
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_PatBlt(TTYDRV_PDEVICE *physDev, INT left, INT top,
|
2000-08-10 03:16:19 +02:00
|
|
|
INT width, INT height, DWORD rop)
|
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %d, %d, %d, %d, %lu): stub\n", physDev->hdc, left, top, width, height, rop );
|
2000-08-10 03:16:19 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_StretchBlt
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_StretchBlt(TTYDRV_PDEVICE *physDevDst, INT xDst, INT yDst,
|
2000-08-10 03:16:19 +02:00
|
|
|
INT widthDst, INT heightDst,
|
2002-03-28 23:22:05 +01:00
|
|
|
TTYDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc,
|
2000-08-10 03:16:19 +02:00
|
|
|
INT widthSrc, INT heightSrc, DWORD rop)
|
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %d, %d, %d, %d, %p, %d, %d, %d, %d, %lu): stub\n",
|
2002-03-28 23:22:05 +01:00
|
|
|
physDevDst->hdc, xDst, yDst, widthDst, heightDst,
|
|
|
|
physDevSrc->hdc, xSrc, ySrc, widthSrc, heightSrc, rop );
|
2000-08-10 03:16:19 +02:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_ExtTextOut
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_ExtTextOut(TTYDRV_PDEVICE *physDev, INT x, INT y, UINT flags,
|
2000-08-10 03:16:19 +02:00
|
|
|
const RECT *lpRect, LPCWSTR str, UINT count,
|
|
|
|
const INT *lpDx)
|
|
|
|
{
|
|
|
|
#ifdef WINE_CURSES
|
|
|
|
INT row, col;
|
|
|
|
LPSTR ascii;
|
2000-11-28 23:40:56 +01:00
|
|
|
DWORD len;
|
2002-06-11 00:52:47 +02:00
|
|
|
POINT pt;
|
|
|
|
UINT text_align = GetTextAlign( physDev->hdc );
|
2000-08-10 03:16:19 +02:00
|
|
|
|
2002-10-25 21:00:49 +02:00
|
|
|
TRACE("(%p, %d, %d, 0x%08x, %p, %s, %d, %p)\n",
|
2002-03-28 23:22:05 +01:00
|
|
|
physDev->hdc, x, y, flags, lpRect, debugstr_wn(str, count), count, lpDx);
|
2000-08-10 03:16:19 +02:00
|
|
|
|
|
|
|
if(!physDev->window)
|
|
|
|
return FALSE;
|
|
|
|
|
2002-06-11 00:52:47 +02:00
|
|
|
pt.x = x;
|
|
|
|
pt.y = y;
|
2000-08-10 03:16:19 +02:00
|
|
|
/* FIXME: Is this really correct? */
|
2002-06-11 00:52:47 +02:00
|
|
|
if(text_align & TA_UPDATECP) GetCurrentPositionEx( physDev->hdc, &pt );
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2002-06-11 00:52:47 +02:00
|
|
|
LPtoDP( physDev->hdc, &pt, 1 );
|
|
|
|
row = (physDev->org.y + pt.y) / physDev->cellHeight;
|
|
|
|
col = (physDev->org.x + pt.x) / physDev->cellWidth;
|
2000-11-28 23:40:56 +01:00
|
|
|
len = WideCharToMultiByte( CP_ACP, 0, str, count, NULL, 0, NULL, NULL );
|
|
|
|
ascii = HeapAlloc( GetProcessHeap(), 0, len );
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, str, count, ascii, len, NULL, NULL );
|
|
|
|
mvwaddnstr(physDev->window, row, col, ascii, len);
|
2000-08-10 03:16:19 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, ascii );
|
|
|
|
wrefresh(physDev->window);
|
|
|
|
|
2002-06-11 00:52:47 +02:00
|
|
|
if(text_align & TA_UPDATECP)
|
|
|
|
{
|
|
|
|
pt.x += count * physDev->cellWidth;
|
|
|
|
pt.y += physDev->cellHeight;
|
|
|
|
DPtoLP( physDev->hdc, &pt, 1 );
|
|
|
|
MoveToEx( physDev->hdc, pt.x, pt.y, NULL );
|
2000-08-10 03:16:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
#else /* defined(WINE_CURSES) */
|
2002-03-28 23:22:05 +01:00
|
|
|
FIXME("(%x, %d, %d, 0x%08x, %p, %s, %d, %p): stub\n",
|
|
|
|
physDev->hdc, x, y, flags, lpRect, debugstr_wn(str,count), count, lpDx);
|
2000-08-10 03:16:19 +02:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
#endif /* defined(WINE_CURSES) */
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_GetCharWidth
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_GetCharWidth(TTYDRV_PDEVICE *physDev, UINT firstChar, UINT lastChar,
|
2000-08-10 03:16:19 +02:00
|
|
|
LPINT buffer)
|
|
|
|
{
|
|
|
|
UINT c;
|
|
|
|
|
2002-10-25 21:00:49 +02:00
|
|
|
FIXME("(%p, %u, %u, %p): semistub\n", physDev->hdc, firstChar, lastChar, buffer);
|
2000-08-10 03:16:19 +02:00
|
|
|
|
|
|
|
for(c=firstChar; c<=lastChar; c++) {
|
|
|
|
buffer[c-firstChar] = physDev->cellWidth;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_GetTextExtentPoint
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_GetTextExtentPoint(TTYDRV_PDEVICE *physDev, LPCWSTR str, INT count,
|
2000-08-10 03:16:19 +02:00
|
|
|
LPSIZE size)
|
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
TRACE("(%p, %s, %d, %p)\n", physDev->hdc, debugstr_wn(str, count), count, size);
|
2000-08-10 03:16:19 +02:00
|
|
|
|
|
|
|
size->cx = count * physDev->cellWidth;
|
|
|
|
size->cy = physDev->cellHeight;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* TTYDRV_DC_GetTextMetrics
|
|
|
|
*/
|
2002-03-28 23:22:05 +01:00
|
|
|
BOOL TTYDRV_DC_GetTextMetrics(TTYDRV_PDEVICE *physDev, LPTEXTMETRICW lptm)
|
2000-08-10 03:16:19 +02:00
|
|
|
{
|
2002-10-25 21:00:49 +02:00
|
|
|
TRACE("(%p, %p)\n", physDev->hdc, lptm);
|
2000-08-10 03:16:19 +02:00
|
|
|
|
|
|
|
lptm->tmHeight = physDev->cellHeight;
|
|
|
|
lptm->tmAscent = 0;
|
|
|
|
lptm->tmDescent = 0;
|
|
|
|
lptm->tmInternalLeading = 0;
|
|
|
|
lptm->tmExternalLeading = 0;
|
2002-06-01 01:06:46 +02:00
|
|
|
lptm->tmAveCharWidth = physDev->cellWidth;
|
2000-08-10 03:16:19 +02:00
|
|
|
lptm->tmMaxCharWidth = physDev->cellWidth;
|
|
|
|
lptm->tmWeight = FW_MEDIUM;
|
|
|
|
lptm->tmOverhang = 0;
|
|
|
|
lptm->tmDigitizedAspectX = physDev->cellWidth;
|
|
|
|
lptm->tmDigitizedAspectY = physDev->cellHeight;
|
|
|
|
lptm->tmFirstChar = 32;
|
|
|
|
lptm->tmLastChar = 255;
|
|
|
|
lptm->tmDefaultChar = 0;
|
|
|
|
lptm->tmBreakChar = 32;
|
|
|
|
lptm->tmItalic = FALSE;
|
|
|
|
lptm->tmUnderlined = FALSE;
|
|
|
|
lptm->tmStruckOut = FALSE;
|
|
|
|
lptm->tmPitchAndFamily = TMPF_FIXED_PITCH|TMPF_DEVICE;
|
|
|
|
lptm->tmCharSet = ANSI_CHARSET;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|