2 * Windows 16 bit device driver graphics functions
4 * Copyright 1997 John Harvey
10 /**********************************************************************
14 WIN16DRV_MoveToEx(DC *dc,INT32 x,INT32 y,LPPOINT32 pt)
18 pt->x = dc->w.CursPosX;
19 pt->y = dc->w.CursPosY;
26 /***********************************************************************
30 WIN16DRV_LineTo( DC *dc, INT32 x, INT32 y )
33 WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
35 points[0].x = dc->w.DCOrgX + XLPTODP( dc, dc->w.CursPosX );
36 points[0].y = dc->w.DCOrgY + YLPTODP( dc, dc->w.CursPosY );
37 points[1].x = dc->w.DCOrgX + XLPTODP( dc, x );
38 points[1].y = dc->w.DCOrgY + YLPTODP( dc, y );
39 bRet = PRTDRV_Output(physDev->segptrPDEVICE,
40 OS_POLYLINE, 2, points,
41 physDev->segptrPenInfo,
43 win16drv_SegPtr_DrawMode, NULL);
51 /***********************************************************************
55 WIN16DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom)
57 WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
60 printf("In WIN16drv_Rectangle, x %d y %d DCOrgX %d y %d\n",
61 left, top, dc->w.DCOrgX, dc->w.DCOrgY);
62 printf("In WIN16drv_Rectangle, VPortOrgX %d y %d\n",
63 dc->vportOrgX, dc->vportOrgY);
64 points[0].x = XLPTODP(dc, left);
65 points[0].y = YLPTODP(dc, top);
67 points[1].x = XLPTODP(dc, right);
68 points[1].y = YLPTODP(dc, bottom);
69 bRet = PRTDRV_Output(physDev->segptrPDEVICE,
70 OS_RECTANGLE, 2, points,
71 physDev->segptrPenInfo,
72 physDev->segptrBrushInfo,
73 win16drv_SegPtr_DrawMode, NULL);
80 /***********************************************************************
84 WIN16DRV_Polygon(DC *dc, LPPOINT32 pt, INT32 count )
86 WIN16DRV_PDEVICE *physDev = (WIN16DRV_PDEVICE *)dc->physDev;
90 points = HEAP_xalloc( GetProcessHeap(), 0, count * sizeof(POINT16) );
91 for (i = 0; i<count ; i++)
93 points[i].x = ((pt[i].x - dc->wndOrgX) * dc->vportExtX/ dc->wndExtX) + dc->vportOrgX;
94 points[i].y = ((pt[i].y - dc->wndOrgY) * dc->vportExtY/ dc->wndExtY) + dc->vportOrgY;
96 bRet = PRTDRV_Output(physDev->segptrPDEVICE,
97 OS_WINDPOLYGON, 2, points,
98 physDev->segptrPenInfo,
99 physDev->segptrBrushInfo,
100 win16drv_SegPtr_DrawMode, NULL);
101 HeapFree( GetProcessHeap(), 0, points );