1 #include <ddk/winddi.h>
2 #include <include/inteng.h>
3 #include <include/dib.h>
5 #include "../dib/dib.h"
8 #include <include/mouse.h>
9 #include <include/object.h>
10 #include <include/surface.h>
13 EngLineTo(SURFOBJ *DestObj,
23 LONG x, y, deltax, deltay, i, xchange, ychange, error, hx, vy;
24 ULONG Pixel = Brush->iSolidColor;
29 INTENG_ENTER_LEAVE EnterLeave;
38 DestRect.right = x2 + 1;
47 DestRect.bottom = y2 + 1;
50 if (! IntEngEnter(&EnterLeave, DestObj, &DestRect, FALSE, &Translate, &OutputObj))
60 OutputGDI = AccessInternalObjectFromUserObject(OutputObj);
62 // FIXME: Implement clipping
96 OutputGDI->DIB_HLine(OutputObj, hx, hx + deltax, y1, Pixel);
100 OutputGDI->DIB_VLine(OutputObj, x1, vy, vy + deltay, Pixel);
108 for (i = 0; i < deltay; i++)
110 OutputGDI->DIB_PutPixel(OutputObj, x, y, Pixel);
112 error = error + deltax;
117 error = error - deltay;
123 for (i = 0; i < deltax; i++)
125 OutputGDI->DIB_PutPixel(OutputObj, x, y, Pixel);
127 error = error + deltay;
131 error = error - deltax;
137 return IntEngLeave(&EnterLeave);
141 IntEngLineTo(SURFOBJ *DestSurf,
156 SurfGDI = (SURFGDI*)AccessInternalObjectFromUserObject(DestSurf);
158 MouseSafetyOnDrawStart(DestSurf, SurfGDI, x1, y1, x2, y2);
160 if (NULL != SurfGDI->LineTo) {
161 /* Call the driver's DrvLineTo */
162 ret = SurfGDI->LineTo(DestSurf, Clip, Brush, x1, y1, x2, y2, RectBounds, mix);
166 if (! ret && NULL != SurfGDI->StrokePath) {
167 /* FIXME: Emulate LineTo using drivers DrvStrokePath and set ret on success */
172 ret = EngLineTo(DestSurf, Clip, Brush, x1, y1, x2, y2, RectBounds, mix);
175 MouseSafetyOnDrawEnd(DestSurf, SurfGDI);
181 IntEngPolyline(SURFOBJ *DestSurf,
192 //Draw the Polyline with a call to IntEngLineTo for each segment.
193 for (i=1; i<dCount; i++)
195 rect.left = MIN(pt[i-1].x, pt[i].x);
196 rect.top = MIN(pt[i-1].y, pt[i].y);
197 rect.right = MAX(pt[i-1].x, pt[i].x);
198 rect.bottom = MAX(pt[i-1].y, pt[i].y);
199 ret = IntEngLineTo(DestSurf,