author | Francesco Abbate <francesco.bbt@gmail.com> | 2010年08月19日 00:19:58 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2010年08月19日 00:19:58 +0200 |
commit | bef124c9c9e081062a457f6d0b2ab1eda6283a3e (patch) | |
tree | 5a757e1c2a84900feb642a9790dad5d61f870509 /agg-plot/window-cpp.h | |
parent | 7cdb95a74e7f352620cd500940b73bf221f9e91a (diff) | |
download | gsl-shell-bef124c9c9e081062a457f6d0b2ab1eda6283a3e.tar.gz |
-rw-r--r-- | agg-plot/window-cpp.h | 36 |
diff --git a/agg-plot/window-cpp.h b/agg-plot/window-cpp.h index ede02c45..be6a8f92 100644 --- a/agg-plot/window-cpp.h +++ b/agg-plot/window-cpp.h @@ -14,27 +14,39 @@ extern "C" { #include "agg_color_rgba.h" #include "agg_trans_affine.h" -#include "split-spec-parser.h" +#include "split-parser.h" class window : public canvas_window { +public: typedef plot<drawable, lua_management> plot_type; + typedef agg::trans_affine bmatrix; + struct ref { + typedef tree::node<ref, direction_e> node; + plot_type *plot; - int id; + int plot_id; + int slot_id; - ref() : plot(0), id(-1) {}; - ref(plot_type *p, int _id) : plot(p), id(_id) {}; - }; + bmatrix matrix; - typedef split::node<ref> node_type; - typedef split::node<ref>::list list_type; + ref() : plot(0), plot_id(-1), matrix() {}; + ref(plot_type *p, int _id) : plot(p), plot_id(_id), matrix() {}; - node_type* m_tree; + static void compose(bmatrix& a, const bmatrix& b); + static int calculate(node *t, const bmatrix& m, int id); + }; + +private: + void clear_box(const agg::trans_affine& box_mtx); + void draw_rec(ref::node *n); + void cleanup_tree_rec (lua_State *L, int window_index, ref::node* n); - void draw_rec(node_type *n); - void cleanup_tree_rec (lua_State *L, int window_index, node_type* n); + static ref *ref_lookup (ref::node *p, int slot_id); + ref::node* m_tree; + public: window(agg::rgba& bgcol) : canvas_window(bgcol), m_tree(0) { @@ -46,13 +58,15 @@ public: static window *check (lua_State *L, int index); void split(const char *spec); - int attach(lua_plot *plot, const char *spec, int id); + int attach(lua_plot *plot, const char *spec, int plot_id, int& slot_id); void cleanup_refs(lua_State *L, int window_index) { cleanup_tree_rec (L, window_index, m_tree); }; + void draw_slot(int slot_id); + void on_draw_unprotected(); virtual void on_draw(); }; |