#ifndef _CUTICLE_FRAME_H #define _CUTICLE_FRAME_H #include #include #include #include #include #include #include #include #include #include #include #include struct NodeGraph; struct ImageViewer; struct Timeline; struct ctTimeCtrl; struct Frame : wxFrame { wxAuiManager aui; ImageViewer *viewer; NodeGraph *graph; Timeline *timeline; wxStatusBar *stba; wxToolBar *tlba; struct { ctTimeCtrl *duration; wxCheckBox *durationEnable; wxButton *btnPerform; } toolbar; Frame(); virtual ~Frame(); }; struct GrNode : wxPanel { struct Port { wxString name; enum class Type { NONE, FILE_OPEN, COLOR, VEC1, VEC2, VEC3, VEC4, TEXT, SAMPLE, FILE_SAVE, MIC_SOURCE, WINDOW_SOURCE } type; }; std::vector sinks; std::vector sources; wxString name; CHiPubNode *logical; GrNode(NodeGraph*); virtual ~GrNode(); bool MouseOverPort(wxPoint p, bool &source, int &i); void MakeKeyframe(int i); virtual void Fit() override; }; struct ImageViewer : wxPanel { wxPoint pos; wxImage img; wxBitmap bm; size_t bufW, bufH; uint8_t *buf = nullptr; float siez = 512; wxPoint drag; ImageViewer(Frame*); virtual ~ImageViewer() = default; void SetImage(CHiImage *img); void ResizeImage(float); }; struct NodeGraph : wxPanel { struct Link { GrNode *input; int i; GrNode *output; int o; struct Comparator { bool operator ()(const Link &a, const Link &b) { if(a.input != b.input) return a.input < b.input; else if(a.i != b.i) return a.i < b.i; else if(a.output != b.output) return a.output < b.output; else return a.o < b.o; } }; }; GrNode *attacheeNode = NULL; int attacheePort; int attacheePortIsSource; GrNode *dragged = NULL; wxPoint dragPos; CHiNodeGraph *backendNG = NULL; std::vector gnodes; std::vector links; NodeGraph(Frame*); virtual ~NodeGraph(); void Alinken(Link l); void Dirtify(GrNode *g); bool DetectCycles(GrNode*); }; #endif