X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fdebugscript.h;h=fd1a1959526918b91d6865ed7edbad1e6f1f4111;hp=822819ae5d14b8bfb10cf19169430c748215923e;hb=e08b7671a4592481aa73d68b30b7bd1d96e75002;hpb=35bc799125eec0d0c839af56fd136c8e85793a56 diff --git a/src/debugscript.h b/src/debugscript.h index 822819a..fd1a195 100644 --- a/src/debugscript.h +++ b/src/debugscript.h @@ -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,19 @@ 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_DebugFont, AT_Quit }; @@ -37,13 +52,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 m_actions; + std::map m_labels; + unsigned m_index; + + struct PerformanceData + { + clock_t clock; + unsigned object_count; + VRect view_bounds; + }; + + PerformanceData m_perf_start; + PerformanceData m_perf_last; + + void PrintPerformance(View * view, Screen * scr); + void ClearPerformance(View * view, Screen * scr); + void ParseAction(); };