2 * PostScript driver graphics functions
4 * Copyright 1998 Huw D M Davies
13 /**********************************************************************
16 BOOL32
PSDRV_MoveToEx(DC
*dc
, INT32 x
, INT32 y
, LPPOINT32 pt
)
18 TRACE(psdrv
, "%d %d\n", x
, y
);
21 pt
->x
= dc
->w
.CursPosX
;
22 pt
->y
= dc
->w
.CursPosY
;
30 /***********************************************************************
33 BOOL32
PSDRV_LineTo(DC
*dc
, INT32 x
, INT32 y
)
35 TRACE(psdrv
, "%d %d\n", x
, y
);
38 PSDRV_WriteMoveTo(dc
, XLPTODP(dc
, dc
->w
.CursPosX
),
39 YLPTODP(dc
, dc
->w
.CursPosY
));
40 PSDRV_WriteLineTo(dc
, XLPTODP(dc
, x
), YLPTODP(dc
, y
));
41 PSDRV_WriteStroke(dc
);
48 /***********************************************************************
51 BOOL32
PSDRV_Rectangle(DC
*dc
, INT32 left
, INT32 top
, INT32 right
,
54 INT32 width
= XLSTODS(dc
, right
- left
);
55 INT32 height
= YLSTODS(dc
, bottom
- top
);
58 TRACE(psdrv
, "%d %d - %d %d\n", left
, top
, right
, bottom
);
60 PSDRV_WriteRectangle(dc
, XLPTODP(dc
, left
), YLPTODP(dc
, top
),
66 PSDRV_Writegrestore(dc
);
68 PSDRV_WriteStroke(dc
);
73 /***********************************************************************
76 BOOL32
PSDRV_Ellipse( DC
*dc
, INT32 left
, INT32 top
, INT32 right
, INT32 bottom
)
80 TRACE(psdrv
, "%d %d - %d %d\n", left
, top
, right
, bottom
);
82 x
= XLPTODP(dc
, (left
+ right
)/2);
83 y
= YLPTODP(dc
, (top
+ bottom
)/2);
85 a
= XLSTODS(dc
, (right
- left
)/2);
86 b
= YLSTODS(dc
, (bottom
- top
)/2);
88 PSDRV_WriteEllispe(dc
, x
, y
, a
, b
);
92 PSDRV_Writegrestore(dc
);
94 PSDRV_WriteStroke(dc
);
99 /***********************************************************************
102 BOOL32
PSDRV_Polyline( DC
*dc
, const LPPOINT32 pt
, INT32 count
)
105 TRACE(psdrv
, "count = %d\n", count
);
108 PSDRV_WriteMoveTo(dc
, XLPTODP(dc
, pt
[0].x
), YLPTODP(dc
, pt
[0].y
));
109 for(i
= 1; i
< count
; i
++)
110 PSDRV_WriteLineTo(dc
, XLPTODP(dc
, pt
[i
].x
), YLPTODP(dc
, pt
[i
].y
));
111 PSDRV_WriteStroke(dc
);
116 /***********************************************************************
119 BOOL32
PSDRV_Polygon( DC
*dc
, LPPOINT32 pt
, INT32 count
)
122 TRACE(psdrv
, "count = %d\n", count
);
123 FIXME(psdrv
, "Hack!\n");
126 PSDRV_WriteMoveTo(dc
, XLPTODP(dc
, pt
[0].x
), YLPTODP(dc
, pt
[0].y
));
127 for(i
= 1; i
< count
; i
++)
128 PSDRV_WriteLineTo(dc
, XLPTODP(dc
, pt
[i
].x
), YLPTODP(dc
, pt
[i
].y
));
130 if(pt
[0].x
!= pt
[count
-1].x
|| pt
[0].y
!= pt
[count
-1].y
)
131 PSDRV_WriteLineTo(dc
, XLPTODP(dc
, pt
[0].x
), YLPTODP(dc
, pt
[0].y
));
133 PSDRV_WriteStroke(dc
);