Totally FITH everything
[ipdf/code.git] / src / debugscript.h
index 822819a..9895ddc 100644 (file)
@@ -13,6 +13,8 @@ namespace IPDF
 class DebugScript
 {
 public:
+       DebugScript() : inp(), currentAction(), m_actions(), m_labels(), m_index(0) {}
+       virtual ~DebugScript() {}
        void Load(const char *filename)
        {
                inp.open(filename);
@@ -26,6 +28,18 @@ private:
                AT_Zoom,
                AT_TranslatePx,
                AT_ZoomPx,
+               AT_SetCPURendering,
+               AT_SetGPURendering,
+               AT_EnableLazyRendering,
+               AT_DisableLazyRendering,
+               AT_LoadSVG,
+               AT_Label,
+               AT_Goto,
+               AT_Debug,
+               AT_ClearDocument,
+               AT_ClearPerformance,
+               AT_PrintPerformance,
+               AT_RecordPerformance,
                AT_Quit
        };
 
@@ -37,13 +51,30 @@ private:
                Real z;
                int iz;
                int loops;
-               Action() : type(AT_WaitFrame), x(0), y(0), ix(0), iy(0), z(0), loops(0) {}
+               std::string textargs;
+               Action() : type(AT_WaitFrame), x(0), y(0), ix(0), iy(0), z(0), loops(0), textargs("") {}
        };
 
        std::ifstream inp;
 
        Action currentAction;
-
+       std::vector<Action> m_actions;
+       std::map<std::string, int> m_labels;
+       unsigned m_index;
+       
+       struct PerformanceData
+       {
+               clock_t clock;
+               unsigned object_count;
+               Rect view_bounds;
+       };
+       
+       PerformanceData m_perf_start;
+       PerformanceData m_perf_last;
+       
+       void PrintPerformance(View * view, Screen * scr);
+       void ClearPerformance(View * view, Screen * scr);
+       
        void ParseAction();
 };
 

UCC git Repository :: git.ucc.asn.au