-
Notifications
You must be signed in to change notification settings - Fork 2
/
PDrawPostscriptFile.h
53 lines (44 loc) · 1.83 KB
/
PDrawPostscriptFile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//==============================================================================
// File: PDrawPostscriptFile.h
//
// Copyright (c) 2017, Phil Harvey, Queen's University
//==============================================================================
/*
** Postscript file drawable - PH 09/22/99
*/
#ifndef __PDrawPostscriptFile_h__
#define __PDrawPostscriptFile_h__
#include <stdio.h>
#include "PDrawable.h"
const short kMaxPSNameLen = 256;
class PDrawPostscriptFile : public PDrawable
{
public:
PDrawPostscriptFile(char *filename, int landscape=0);
virtual ~PDrawPostscriptFile();
virtual int BeginDrawing(int width,int height);
virtual void EndDrawing();
virtual void SetForeground(int col_num, int alpha=0xffff);
virtual int EqualColours(int col1, int col2);
virtual void SetLineWidth(float width);
virtual void SetLineType(ELineType type);
virtual void SetFont(XFontStruct *font);
virtual int GetTextWidth(char *str);
virtual void Comment(char *str);
virtual void DrawSegments(XSegment *segments, int num, int smooth=1);
virtual void DrawLine(int x1,int y1,int x2,int y2);
virtual void FillRectangle(int x,int y,int w,int h);
virtual void FillPolygon(XPoint *point, int num);
virtual void DrawString(int x, int y, char *str, ETextAlign_q align);
virtual void DrawArc(int cx,int cy,int rx,int ry,float ang1,float ang2);
virtual void FillArc(int cx,int cy,int rx,int ry,float ang1,float ang2);
virtual EDevice GetDeviceType() { return kDevicePrinter; }
private:
char mFilename[kMaxPSNameLen];
char mBoundingBoxStr[256];
FILE * mFile;
XColor * mColours;
int mIsEPS;
int mIsLandscape;
};
#endif // __PDrawPostscriptFile_h__