X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fdebugscript.h;h=9895ddc39c09a68743fdeba14440184e249dc51a;hp=369720106507f695ea2c5b26011b96f79a326ed9;hb=326f04a375ce3120f7e8957e3d7cd5f296f513e3;hpb=3917214a11bf76381ddc528e3fe51de9ec038d42;ds=sidebyside diff --git a/src/debugscript.h b/src/debugscript.h index 3697201..9895ddc 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,13 @@ private: AT_EnableLazyRendering, AT_DisableLazyRendering, AT_LoadSVG, + AT_Label, + AT_Goto, + AT_Debug, + AT_ClearDocument, + AT_ClearPerformance, + AT_PrintPerformance, + AT_RecordPerformance, AT_Quit }; @@ -42,14 +51,30 @@ 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) {} + 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; + 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(); };