X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fdebugscript.h;h=9e85b51d9098758f72ce3e686c150f44c79b0f5c;hp=369720106507f695ea2c5b26011b96f79a326ed9;hb=180d764223a3568f734434a15d56f18e9ddc012b;hpb=3917214a11bf76381ddc528e3fe51de9ec038d42 diff --git a/src/debugscript.h b/src/debugscript.h index 3697201..9e85b51 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); @@ -31,6 +33,19 @@ private: AT_EnableLazyRendering, AT_DisableLazyRendering, AT_LoadSVG, + AT_Label, + AT_Goto, + AT_Debug, + AT_ClearDocument, + AT_ClearPerformance, + AT_PrintPerformance, + AT_RecordPerformance, + AT_DebugFont, + AT_ApproachBoundsZeno, + AT_ApproachBoundsLinear, + AT_SetBounds, + AT_QueryGPUBounds, // query bounds of Beziers when transformed to GPU + AT_ScreenShot, // take screenshot AT_Quit }; @@ -42,15 +57,32 @@ private: Real z; int iz; int loops; - std::string filename; - Action() : type(AT_WaitFrame), x(0), y(0), ix(0), iy(0), z(0), loops(0) {} + Real w, h; + 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; - - void ParseAction(); + 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(View * view, Screen * scr); }; }