]> Shamusworld >> Repos - ttedit/blobdiff - src/global.h
Added rectangle point selection, canvas zooming.
[ttedit] / src / global.h
diff --git a/src/global.h b/src/global.h
new file mode 100644 (file)
index 0000000..64422da
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef __GLOBALS_H__
+#define __GLOBALS_H__
+
+// Global variable class. Note that all vars are class vars, so we don't have
+// to do any instantiation shite--it's treated as a namespace.
+
+#include <stdint.h>
+#include <vector>
+#include <QRectF>
+#include "vector.h"
+
+class QFont;
+
+enum LineStyle { LSNone, LSSolid, LSDash, LSDot, LSDashDot, LSDashDotDot };
+
+
+class Global
+{
+       public:
+               static double gridSpacing;
+               static bool selectionInProgress;
+               static QRectF selection;
+               static int currentLayer;
+               static QFont * font;
+               static Point snapPoint;
+               static bool snapPointIsValid;
+
+               static bool fixedAngle;
+               static bool fixedLength;
+               static int viewportHeight;
+               static bool deleteActive;
+               static bool dimensionActive;
+
+               static bool snapToGrid;
+               static bool ignoreClicks;
+               static bool dontMove;
+               static uint32_t objectID;
+               static int tool;
+               static int toolState;
+
+               static Point origin;
+               static double zoom;
+               static Vector screenSize;
+
+               static float scale;
+
+               static Point intersectPoint[16]; // Overkill, yes
+               static double intersectParam[16]; // Ditto
+               static int numIntersectPoints;
+               static int numIntersectParams;
+
+               static int activeLayer;
+               static int numLayers;
+               static std::vector<bool> layerHidden;
+               static std::vector<bool> layerLocked;
+};
+
+#endif // __GLOBALS_H__
+