From b55a4cf705a06ef2c9995da4d2784e8d5969ee3e Mon Sep 17 00:00:00 2001 From: francesco-ST Date: 2010年8月12日 11:51:29 +0200 Subject: added object index to manage both plot and windows Now both plot and windows gets an id which is used to manage userdata cross-references. --- agg-plot/window-cpp.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'agg-plot/window-cpp.h') diff --git a/agg-plot/window-cpp.h b/agg-plot/window-cpp.h index 44beaa30..e5d6292e 100644 --- a/agg-plot/window-cpp.h +++ b/agg-plot/window-cpp.h @@ -19,9 +19,17 @@ extern "C" { class window : public canvas_window { typedef plot plot_type; - split::node* m_tree; + struct ref { + plot_type *plot; + int id; - void draw_rec(split::node *n); + ref() : plot(0), id(-1) {}; + ref(plot_type *p, int _id) : plot(p), id(_id) {}; + }; + + split::node* m_tree; + + void draw_rec(split::node *n); public: window(agg::rgba& bgcol) : canvas_window(bgcol), m_tree(0) {}; @@ -31,7 +39,7 @@ public: static window *check (lua_State *L, int index); void split(const char *spec); - bool attach(lua_plot *plot, const char *spec); + int attach(lua_plot *plot, const char *spec, int id); void on_draw_unprotected(); virtual void on_draw(); -- cgit v1.2.3

AltStyle によって変換されたページ (->オリジナル) /