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 /***********************************************************************
145 BOOL
TTYDRV_DC_Polygon(DC
*dc
, const POINT
* pt
, INT count
)
147 FIXME("(%p, %p, %d): stub\n", dc
, pt
, count
);
152 /***********************************************************************
155 BOOL
TTYDRV_DC_Polyline(DC
*dc
, const POINT
* pt
, INT count
)
157 FIXME("(%p, %p, %d): stub\n", dc
, pt
, count
);
162 /***********************************************************************
163 * TTYDRV_DC_PolyPolygon
165 BOOL
TTYDRV_DC_PolyPolygon(DC
*dc
, const POINT
* pt
, const INT
* counts
, UINT polygons
)
167 FIXME("(%p, %p, %p, %u): stub\n", dc
, pt
, counts
, polygons
);
172 /***********************************************************************
173 * TTYDRV_DC_PolyPolyline
175 BOOL
TTYDRV_DC_PolyPolyline(DC
*dc
, const POINT
* pt
, const DWORD
* counts
, DWORD polylines
)
177 FIXME("(%p, %p, %p, %lu): stub\n", dc
, pt
, counts
, polylines
);
182 /***********************************************************************
183 * TTYDRV_DC_Rectangle
185 BOOL
TTYDRV_DC_Rectangle(DC
*dc
, INT left
, INT top
, INT right
, INT bottom
)
187 #ifdef HAVE_LIBCURSES
188 TTYDRV_PDEVICE
*physDev
= (TTYDRV_PDEVICE
*) dc
->physDev
;
189 INT row1
, col1
, row2
, col2
;
191 TRACE("(%p, %d, %d, %d, %d)\n", dc
, left
, top
, right
, bottom
);
196 row1
= (dc
->w
.DCOrgY
+ XLPTODP(dc
, top
)) / physDev
->cellHeight
;
197 col1
= (dc
->w
.DCOrgX
+ XLPTODP(dc
, left
)) / physDev
->cellWidth
;
198 row2
= (dc
->w
.DCOrgY
+ XLPTODP(dc
, bottom
)) / physDev
->cellHeight
;
199 col2
= (dc
->w
.DCOrgX
+ XLPTODP(dc
, right
)) / physDev
->cellWidth
;
212 wmove(physDev
->window
, row1
, col1
);
213 whline(physDev
->window
, ACS_HLINE
, col2
-col1
);
215 wmove(physDev
->window
, row1
, col2
);
216 wvline(physDev
->window
, ACS_VLINE
, row2
-row1
);
218 wmove(physDev
->window
, row2
, col1
);
219 whline(physDev
->window
, ACS_HLINE
, col2
-col1
);
221 wmove(physDev
->window
, row1
, col1
);
222 wvline(physDev
->window
, ACS_VLINE
, row2
-row1
);
224 mvwaddch(physDev
->window
, row1
, col1
, ACS_ULCORNER
);
225 mvwaddch(physDev
->window
, row1
, col2
, ACS_URCORNER
);
226 mvwaddch(physDev
->window
, row2
, col2
, ACS_LRCORNER
);
227 mvwaddch(physDev
->window
, row2
, col1
, ACS_LLCORNER
);
229 wrefresh(physDev
->window
);
232 #else /* defined(HAVE_LIBCURSES) */
233 FIXME("(%p, %d, %d, %d, %d): stub\n", dc
, left
, top
, right
, bottom
);
236 #endif /* defined(HAVE_LIBCURSES) */
239 /***********************************************************************
240 * TTYDRV_DC_RoundRect
242 BOOL
TTYDRV_DC_RoundRect(DC
*dc
, INT left
, INT top
, INT right
,
243 INT bottom
, INT ell_width
, INT ell_height
)
245 FIXME("(%p, %d, %d, %d, %d, %d, %d): stub\n",
246 dc
, left
, top
, right
, bottom
, ell_width
, ell_height
);
251 /***********************************************************************
252 * TTYDRV_DC_SetBkColor
254 COLORREF
TTYDRV_DC_SetBkColor(DC
*dc
, COLORREF color
)
258 TRACE("(%p, 0x%08lx)\n", dc
, color
);
260 oldColor
= dc
->w
.backgroundColor
;
261 dc
->w
.backgroundColor
= color
;
266 /***********************************************************************
269 COLORREF
TTYDRV_DC_SetPixel(DC
*dc
, INT x
, INT y
, COLORREF color
)
271 #ifdef HAVE_LIBCURSES
272 TTYDRV_PDEVICE
*physDev
= (TTYDRV_PDEVICE
*) dc
->physDev
;
275 TRACE("(%p, %d, %d, 0x%08lx)\n", dc
, x
, y
, color
);
280 row
= (dc
->w
.DCOrgY
+ XLPTODP(dc
, y
)) / physDev
->cellHeight
;
281 col
= (dc
->w
.DCOrgX
+ XLPTODP(dc
, x
)) / physDev
->cellWidth
;
283 mvwaddch(physDev
->window
, row
, col
, ACS_BULLET
);
284 wrefresh(physDev
->window
);
286 return RGB(0,0,0); /* FIXME: Always returns black */
287 #else /* defined(HAVE_LIBCURSES) */
288 FIXME("(%p, %d, %d, 0x%08lx): stub\n", dc
, x
, y
, color
);
290 return RGB(0,0,0); /* FIXME: Always returns black */
291 #endif /* defined(HAVE_LIBCURSES) */
294 /***********************************************************************
295 * TTYDRV_DC_SetTextColor
297 COLORREF
TTYDRV_DC_SetTextColor(DC
*dc
, COLORREF color
)
301 TRACE("(%p, 0x%08lx)\n", dc
, color
);
303 oldColor
= dc
->w
.textColor
;
304 dc
->w
.textColor
= color
;