Widgets Additions and sketch3d new gui
This commit is contained in:
parent
afad2c80e5
commit
e10a494223
44 changed files with 1015 additions and 322 deletions
|
|
@ -5,12 +5,56 @@
|
|||
#include <set>
|
||||
|
||||
namespace tp {
|
||||
class DebugTimeline {
|
||||
enum {
|
||||
STEP = 10,
|
||||
LEN = 200,
|
||||
};
|
||||
|
||||
public:
|
||||
DebugTimeline() = default;
|
||||
|
||||
void addSample(time_ms time) {
|
||||
samples[end] = time;
|
||||
start++;
|
||||
end++;
|
||||
shift();
|
||||
}
|
||||
|
||||
[[nodiscard]] int size() const {
|
||||
return LEN - STEP;
|
||||
}
|
||||
|
||||
[[nodiscard]] const time_ms* get() const {
|
||||
return samples + start;
|
||||
}
|
||||
|
||||
private:
|
||||
void shift() {
|
||||
if (end >= LEN) {
|
||||
for (ualni i = STEP; i < LEN; i++) {
|
||||
samples[i - STEP] = samples[i];
|
||||
}
|
||||
start = 0;
|
||||
end = LEN - STEP;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
ualni start = 0;
|
||||
ualni end = LEN - STEP;
|
||||
|
||||
time_ms samples[LEN + 1] {};
|
||||
};
|
||||
|
||||
class DebugManager {
|
||||
public:
|
||||
DebugManager() = default;
|
||||
|
||||
bool isRedrawAlways() const { return mDebugRedrawAlways; }
|
||||
bool update(RootWidget* rootWidget, EventHandler& events);
|
||||
[[nodiscard]] bool isFrozen() const { return mDebugStopProcessing; }
|
||||
[[nodiscard]] bool isRedrawAlways() const { return mDebugRedrawAlways; }
|
||||
|
||||
void update(RootWidget* rootWidget, EventHandler& events);
|
||||
void drawDebug(RootWidget* rootWidget, Canvas& canvas);
|
||||
|
||||
void checkProcBreakPoints(Widget* widget) {
|
||||
|
|
@ -32,6 +76,7 @@ namespace tp {
|
|||
private:
|
||||
void recursiveDraw(Canvas& canvas, Widget* active, const Vec2F& pos, int depthOrder);
|
||||
|
||||
void drawPerformance();
|
||||
static void widgetMenu(Widget*);
|
||||
void drawLayoutOrder();
|
||||
|
||||
|
|
@ -42,10 +87,17 @@ namespace tp {
|
|||
bool mDebug = false;
|
||||
bool mDebugStopProcessing = false;
|
||||
bool mDebugRedrawAlways = false;
|
||||
bool mSlowMotion = false;
|
||||
bool mDetailed = false;
|
||||
|
||||
std::set<Widget*> mProcBreakpoints;
|
||||
std::set<Widget*> mLayBreakpoints;
|
||||
|
||||
public:
|
||||
DebugTimeline mProcTime;
|
||||
DebugTimeline mUpdManager;
|
||||
DebugTimeline mLayManager;
|
||||
|
||||
DebugTimeline mDrawTime;
|
||||
};
|
||||
|
||||
extern DebugManager gDebugWidget;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue