]> Shamusworld >> Repos - ttedit/blobdiff - src/glyphpoints.h
Set the eol style on the project to native, to avoid line ending chaos.
[ttedit] / src / glyphpoints.h
index 2348d1e48f28f08aa398ba60fa78451de5495de4..2384d7cf963a05920e9e16d68269ca7fba1ad652 100755 (executable)
@@ -1,85 +1,85 @@
-//\r
-// glyphpoints.h\r
-//\r
-// by James L. Hammons\r
-//\r
-// This class encapsulates the data associated with a TrueType glyph.\r
-// Data is dynamically allocated.\r
-//\r
-\r
-#ifndef __GLYPHPOINTS_H__\r
-#define __GLYPHPOINTS_H__\r
-\r
-#include "types.h"\r
-\r
-\r
-struct IPoint\r
-{\r
-       int32 x, y;\r
-       bool onCurve;\r
-\r
-       IPoint(int32 xx=0, int32 yy=0, bool oc=true): x(xx), y(yy), onCurve(oc) {}\r
-};\r
-\r
-// Throws the following exceptions:\r
-#define GP_OUT_OF_RANGE  1\r
-\r
-class GlyphPoints\r
-{\r
-       public:\r
-//For some reason, gcc barfs here when something tries to use the copy\r
-//constructor because it gets confused between the optional arguments (which\r
-//start with an INT for cryin' out loud) and the GlyphPoints & argument. So,\r
-//Let's try making it a non-optional first param, and go from there...\r
-//Turns out the compiler barfs regardless...\r
-//Turns out the problem was that the copy ctor wasn't declared as CONST...\r
-               GlyphPoints(int nPts = 0, int nPlys = 0, int * xa = NULL, int * ya = NULL,\r
-                       bool * oca = NULL, uint16 * pa = NULL);\r
-//             GlyphPoints(void);// And now *this* is needed... Bleah!\r
-//             GlyphPoints(int nPts, int nPlys = 0, int * xa = NULL, int * ya = NULL,\r
-//                     bool * oca = NULL, uint16 * pa = NULL);\r
-               GlyphPoints(int xx, int yy, bool oc);\r
-//             GlyphPoints(GlyphPoints &);                             // Copy constructor\r
-               GlyphPoints(const GlyphPoints &);                               // Copy constructor\r
-               ~GlyphPoints();\r
-               GlyphPoints& operator=(const GlyphPoints &);\r
-               GlyphPoints operator+(const GlyphPoints &);\r
-               GlyphPoints operator+(const IPoint &);\r
-               GlyphPoints& operator+=(const IPoint &);\r
-               void InsertPoint(uint16, int, int, bool);\r
-               void InsertPoint(uint16, const IPoint &);\r
-               void DeletePoint(uint16);\r
-               uint16 GetNumPoints(void);\r
-               uint16 GetNumPoints(uint16);\r
-               uint16 GetNumPolys(void);\r
-               int GetX(uint16);\r
-               int GetY(uint16);\r
-               bool GetOnCurve(uint16);\r
-               int GetX(uint16, uint16);\r
-               int GetY(uint16, uint16);\r
-               bool GetOnCurve(uint16, uint16);\r
-               uint16 GetPolyEnd(uint16);\r
-               void OffsetPoints(int, int);\r
-               void OffsetPoly(uint16, int32, int32);\r
-               void ScalePoints(float);\r
-               void SetXY(uint16, int, int);\r
-               void SetOnCurve(uint16, bool);\r
-               uint16 GetPrev(uint16);\r
-               uint16 GetNext(uint16);\r
-               uint16 GetPrev(uint16, uint16);\r
-               uint16 GetNext(uint16, uint16);\r
-               uint16 GetPoly(uint16);\r
-               void AddNewPolyAtEnd(void);\r
-\r
-       private:\r
-               void AllocateAndCopy(int, int, int *, int *, bool *, uint16 *);\r
-\r
-       private:\r
-               int numPoints, numPolys;\r
-               int * x, * y;\r
-               bool * onCurve;\r
-               uint16 * polyEnd;\r
-               uint16 pointsAllocated, polysAllocated;\r
-};\r
-\r
-#endif // __GLYPHPOINTS_H__\r
+//
+// glyphpoints.h
+//
+// by James L. Hammons
+//
+// This class encapsulates the data associated with a TrueType glyph.
+// Data is dynamically allocated.
+//
+
+#ifndef __GLYPHPOINTS_H__
+#define __GLYPHPOINTS_H__
+
+#include "types.h"
+
+
+struct IPoint
+{
+       int32 x, y;
+       bool onCurve;
+
+       IPoint(int32 xx=0, int32 yy=0, bool oc=true): x(xx), y(yy), onCurve(oc) {}
+};
+
+// Throws the following exceptions:
+#define GP_OUT_OF_RANGE  1
+
+class GlyphPoints
+{
+       public:
+//For some reason, gcc barfs here when something tries to use the copy
+//constructor because it gets confused between the optional arguments (which
+//start with an INT for cryin' out loud) and the GlyphPoints & argument. So,
+//Let's try making it a non-optional first param, and go from there...
+//Turns out the compiler barfs regardless...
+//Turns out the problem was that the copy ctor wasn't declared as CONST...
+               GlyphPoints(int nPts = 0, int nPlys = 0, int * xa = NULL, int * ya = NULL,
+                       bool * oca = NULL, uint16 * pa = NULL);
+//             GlyphPoints(void);// And now *this* is needed... Bleah!
+//             GlyphPoints(int nPts, int nPlys = 0, int * xa = NULL, int * ya = NULL,
+//                     bool * oca = NULL, uint16 * pa = NULL);
+               GlyphPoints(int xx, int yy, bool oc);
+//             GlyphPoints(GlyphPoints &);                             // Copy constructor
+               GlyphPoints(const GlyphPoints &);                               // Copy constructor
+               ~GlyphPoints();
+               GlyphPoints& operator=(const GlyphPoints &);
+               GlyphPoints operator+(const GlyphPoints &);
+               GlyphPoints operator+(const IPoint &);
+               GlyphPoints& operator+=(const IPoint &);
+               void InsertPoint(uint16, int, int, bool);
+               void InsertPoint(uint16, const IPoint &);
+               void DeletePoint(uint16);
+               uint16 GetNumPoints(void);
+               uint16 GetNumPoints(uint16);
+               uint16 GetNumPolys(void);
+               int GetX(uint16);
+               int GetY(uint16);
+               bool GetOnCurve(uint16);
+               int GetX(uint16, uint16);
+               int GetY(uint16, uint16);
+               bool GetOnCurve(uint16, uint16);
+               uint16 GetPolyEnd(uint16);
+               void OffsetPoints(int, int);
+               void OffsetPoly(uint16, int32, int32);
+               void ScalePoints(float);
+               void SetXY(uint16, int, int);
+               void SetOnCurve(uint16, bool);
+               uint16 GetPrev(uint16);
+               uint16 GetNext(uint16);
+               uint16 GetPrev(uint16, uint16);
+               uint16 GetNext(uint16, uint16);
+               uint16 GetPoly(uint16);
+               void AddNewPolyAtEnd(void);
+
+       private:
+               void AllocateAndCopy(int, int, int *, int *, bool *, uint16 *);
+
+       private:
+               int numPoints, numPolys;
+               int * x, * y;
+               bool * onCurve;
+               uint16 * polyEnd;
+               uint16 pointsAllocated, polysAllocated;
+};
+
+#endif // __GLYPHPOINTS_H__