6 // This class encapsulates the data associated with a TrueType glyph.
7 // Data is dynamically allocated.
10 #ifndef __GLYPHPOINTS_H__
11 #define __GLYPHPOINTS_H__
21 IPoint(int32 xx=0, int32 yy=0, bool oc=true): x(xx), y(yy), onCurve(oc) {}
24 // Throws the following exceptions:
25 #define GP_OUT_OF_RANGE 1
30 //For some reason, gcc barfs here when something tries to use the copy
31 //constructor because it gets confused between the optional arguments (which
32 //start with an INT for cryin' out loud) and the GlyphPoints & argument. So,
33 //Let's try making it a non-optional first param, and go from there...
34 //Turns out the compiler barfs regardless...
35 //Turns out the problem was that the copy ctor wasn't declared as CONST...
36 GlyphPoints(int nPts = 0, int nPlys = 0, int * xa = NULL, int * ya = NULL,
37 bool * oca = NULL, uint16 * pa = NULL);
38 // GlyphPoints(void);// And now *this* is needed... Bleah!
39 // GlyphPoints(int nPts, int nPlys = 0, int * xa = NULL, int * ya = NULL,
40 // bool * oca = NULL, uint16 * pa = NULL);
41 GlyphPoints(int xx, int yy, bool oc);
42 // GlyphPoints(GlyphPoints &); // Copy constructor
43 GlyphPoints(const GlyphPoints &); // Copy constructor
45 GlyphPoints& operator=(const GlyphPoints &);
46 GlyphPoints operator+(const GlyphPoints &);
47 GlyphPoints operator+(const IPoint &);
48 GlyphPoints& operator+=(const IPoint &);
49 void InsertPoint(uint16, int, int, bool);
50 void InsertPoint(uint16, const IPoint &);
51 void DeletePoint(uint16);
52 uint16 GetNumPoints(void);
53 uint16 GetNumPoints(uint16);
54 uint16 GetNumPolys(void);
57 bool GetOnCurve(uint16);
58 int GetX(uint16, uint16);
59 int GetY(uint16, uint16);
60 bool GetOnCurve(uint16, uint16);
61 uint16 GetPolyEnd(uint16);
62 void OffsetPoints(int, int);
63 void OffsetPoly(uint16, int32, int32);
64 void ScalePoints(float);
65 void SetXY(uint16, int, int);
66 void SetOnCurve(uint16, bool);
67 uint16 GetPrev(uint16);
68 uint16 GetNext(uint16);
69 uint16 GetPrev(uint16, uint16);
70 uint16 GetNext(uint16, uint16);
71 uint16 GetPoly(uint16);
72 void AddNewPolyAtEnd(void);
75 void AllocateAndCopy(int, int, int *, int *, bool *, uint16 *);
78 int numPoints, numPolys;
82 uint16 pointsAllocated, polysAllocated;
85 #endif // __GLYPHPOINTS_H__