4 * Copyright 1999 Patrik Stridvall
10 #include "debugtools.h"
13 DEFAULT_DEBUG_CHANNEL(ttydrv
)
15 /***********************************************************************
18 BOOL
TTYDRV_DC_Arc(DC
*dc
, INT left
, INT top
, INT right
, INT bottom
,
19 INT xstart
, INT ystart
, INT xend
, INT yend
)
21 FIXME("(%p, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
22 dc
, left
, top
, right
, bottom
, xstart
, ystart
, xend
, yend
);
27 /***********************************************************************
30 BOOL
TTYDRV_DC_Chord(DC
*dc
, INT left
, INT top
, INT right
, INT bottom
,
31 INT xstart
, INT ystart
, INT xend
, INT yend
)
33 FIXME("(%p, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
34 dc
, left
, top
, right
, bottom
, xstart
, ystart
, xend
, yend
);
39 /***********************************************************************
42 BOOL
TTYDRV_DC_Ellipse(DC
*dc
, INT left
, INT top
, INT right
, INT bottom
)
44 FIXME("(%p, %d, %d, %d, %d): stub\n",
45 dc
, left
, top
, right
, bottom
);
50 /***********************************************************************
51 * TTYDRV_DC_ExtFloodFill
53 BOOL
TTYDRV_DC_ExtFloodFill(DC
*dc
, INT x
, INT y
,
54 COLORREF color
, UINT fillType
)
56 FIXME("(%p, %d, %d, 0x%08lx, %u): stub\n", dc
, x
, y
, color
, fillType
);
61 /***********************************************************************
64 COLORREF
TTYDRV_DC_GetPixel(DC
*dc
, INT x
, INT y
)
66 FIXME("(%p, %d, %d): stub\n", dc
, x
, y
);
68 return RGB(0,0,0); /* FIXME: Always returns black */
71 /***********************************************************************
74 BOOL
TTYDRV_DC_LineTo(DC
*dc
, INT x
, INT y
)
77 TTYDRV_PDEVICE
*physDev
= (TTYDRV_PDEVICE
*) dc
->physDev
;
78 INT row1
, col1
, row2
, col2
;
80 TRACE("(%p, %d, %d)\n", dc
, x
, y
);
85 row1
= (dc
->w
.DCOrgY
+ XLPTODP(dc
, dc
->w
.CursPosY
)) / physDev
->cellHeight
;
86 col1
= (dc
->w
.DCOrgX
+ XLPTODP(dc
, dc
->w
.CursPosX
)) / physDev
->cellWidth
;
87 row2
= (dc
->w
.DCOrgY
+ XLPTODP(dc
, y
)) / physDev
->cellHeight
;
88 col2
= (dc
->w
.DCOrgX
+ XLPTODP(dc
, x
)) / physDev
->cellWidth
;
102 wmove(physDev
->window
, row1
, col1
);
104 wvline(physDev
->window
, ACS_VLINE
, row2
-row1
);
105 } else if(row1
== row2
) {
106 whline(physDev
->window
, ACS_HLINE
, col2
-col1
);
108 FIXME("Diagonal line drawing not yet supported\n");
110 wrefresh(physDev
->window
);
113 #else /* defined(HAVE_LIBCURSES) */
114 FIXME("(%p, %d, %d): stub\n", dc
, x
, y
);
117 #endif /* defined(HAVE_LIBCURSES) */
120 /***********************************************************************
123 BOOL
TTYDRV_DC_PaintRgn(DC
*dc
, HRGN hrgn
)
125 FIXME("(%p, 0x%04x): stub\n", dc
, hrgn
);
130 /***********************************************************************
133 BOOL
TTYDRV_DC_Pie(DC
*dc
, INT left
, INT top
, INT right
, INT bottom
,
134 INT xstart
, INT ystart
, INT xend
, INT yend
)
136 FIXME("(%p, %d, %d, %d, %d, %d, %d, %d, %d): stub\n",
137 dc
, left
, top
, right
, bottom
, xstart
, ystart
, xend
, yend
);
142 /***********************************************************************
143 * TTYDRV_DC_PolyBezier
145 BOOL
TTYDRV_DC_PolyBezier(DC
*dc
, const POINT
* BezierPoints
, DWORD count
)
147 FIXME("(%p, %p, %lu): stub\n", dc
, BezierPoints
, count
);
152 /***********************************************************************
155 BOOL
TTYDRV_DC_Polygon(DC
*dc
, const POINT
* pt
, INT count
)
157 FIXME("(%p, %p, %d): stub\n", dc
, pt
, count
);
162 /***********************************************************************
165 BOOL
TTYDRV_DC_Polyline(DC
*dc
, const POINT
* pt
, INT count
)
167 FIXME("(%p, %p, %d): stub\n", dc
, pt
, count
);
172 /***********************************************************************
173 * TTYDRV_DC_PolyPolygon
175 BOOL
TTYDRV_DC_PolyPolygon(DC
*dc
, const POINT
* pt
, const INT
* counts
, UINT polygons
)
177 FIXME("(%p, %p, %p, %u): stub\n", dc
, pt
, counts
, polygons
);
182 /***********************************************************************
183 * TTYDRV_DC_PolyPolyline
185 BOOL
TTYDRV_DC_PolyPolyline(DC
*dc
, const POINT
* pt
, const DWORD
* counts
, DWORD polylines
)
187 FIXME("(%p, %p, %p, %lu): stub\n", dc
, pt
, counts
, polylines
);
192 /***********************************************************************
193 * TTYDRV_DC_Rectangle
195 BOOL
TTYDRV_DC_Rectangle(DC
*dc
, INT left
, INT top
, INT right
, INT bottom
)
197 #ifdef HAVE_LIBCURSES
198 TTYDRV_PDEVICE
*physDev
= (TTYDRV_PDEVICE
*) dc
->physDev
;
199 INT row1
, col1
, row2
, col2
;
201 TRACE("(%p, %d, %d, %d, %d)\n", dc
, left
, top
, right
, bottom
);
206 row1
= (dc
->w
.DCOrgY
+ XLPTODP(dc
, top
)) / physDev
->cellHeight
;
207 col1
= (dc
->w
.DCOrgX
+ XLPTODP(dc
, left
)) / physDev
->cellWidth
;
208 row2
= (dc
->w
.DCOrgY
+ XLPTODP(dc
, bottom
)) / physDev
->cellHeight
;
209 col2
= (dc
->w
.DCOrgX
+ XLPTODP(dc
, right
)) / physDev
->cellWidth
;
222 wmove(physDev
->window
, row1
, col1
);
223 whline(physDev
->window
, ACS_HLINE
, col2
-col1
);
225 wmove(physDev
->window
, row1
, col2
);
226 wvline(physDev
->window
, ACS_VLINE
, row2
-row1
);
228 wmove(physDev
->window
, row2
, col1
);
229 whline(physDev
->window
, ACS_HLINE
, col2
-col1
);
231 wmove(physDev
->window
, row1
, col1
);
232 wvline(physDev
->window
, ACS_VLINE
, row2
-row1
);
234 mvwaddch(physDev
->window
, row1
, col1
, ACS_ULCORNER
);
235 mvwaddch(physDev
->window
, row1
, col2
, ACS_URCORNER
);
236 mvwaddch(physDev
->window
, row2
, col2
, ACS_LRCORNER
);
237 mvwaddch(physDev
->window
, row2
, col1
, ACS_LLCORNER
);
239 wrefresh(physDev
->window
);
242 #else /* defined(HAVE_LIBCURSES) */
243 FIXME("(%p, %d, %d, %d, %d): stub\n", dc
, left
, top
, right
, bottom
);
246 #endif /* defined(HAVE_LIBCURSES) */
249 /***********************************************************************
250 * TTYDRV_DC_RoundRect
252 BOOL
TTYDRV_DC_RoundRect(DC
*dc
, INT left
, INT top
, INT right
,
253 INT bottom
, INT ell_width
, INT ell_height
)
255 FIXME("(%p, %d, %d, %d, %d, %d, %d): stub\n",
256 dc
, left
, top
, right
, bottom
, ell_width
, ell_height
);
261 /***********************************************************************
262 * TTYDRV_DC_SetBkColor
264 COLORREF
TTYDRV_DC_SetBkColor(DC
*dc
, COLORREF color
)
268 TRACE("(%p, 0x%08lx)\n", dc
, color
);
270 oldColor
= dc
->w
.backgroundColor
;
271 dc
->w
.backgroundColor
= color
;
276 /***********************************************************************
279 COLORREF
TTYDRV_DC_SetPixel(DC
*dc
, INT x
, INT y
, COLORREF color
)
281 #ifdef HAVE_LIBCURSES
282 TTYDRV_PDEVICE
*physDev
= (TTYDRV_PDEVICE
*) dc
->physDev
;
285 TRACE("(%p, %d, %d, 0x%08lx)\n", dc
, x
, y
, color
);
290 row
= (dc
->w
.DCOrgY
+ XLPTODP(dc
, y
)) / physDev
->cellHeight
;
291 col
= (dc
->w
.DCOrgX
+ XLPTODP(dc
, x
)) / physDev
->cellWidth
;
293 mvwaddch(physDev
->window
, row
, col
, ACS_BULLET
);
294 wrefresh(physDev
->window
);
296 return RGB(0,0,0); /* FIXME: Always returns black */
297 #else /* defined(HAVE_LIBCURSES) */
298 FIXME("(%p, %d, %d, 0x%08lx): stub\n", dc
, x
, y
, color
);
300 return RGB(0,0,0); /* FIXME: Always returns black */
301 #endif /* defined(HAVE_LIBCURSES) */
304 /***********************************************************************
305 * TTYDRV_DC_SetTextColor
307 COLORREF
TTYDRV_DC_SetTextColor(DC
*dc
, COLORREF color
)
311 TRACE("(%p, 0x%08lx)\n", dc
, color
);
313 oldColor
= dc
->w
.textColor
;
314 dc
->w
.textColor
= color
;