author | francesco-ST <francesco.abbate@st.com> | 2010年08月25日 11:09:52 +0200 |
---|---|---|
committer | francesco-ST <francesco.abbate@st.com> | 2010年08月25日 11:09:52 +0200 |
commit | 29a9dbd5af79c3c80749efaf09fb8240482ff5b5 (patch) | |
tree | 649b5ca2d64736acaef19ba9025e88ae872c54b3 | |
parent | e175b9208a1e5a2eaa1889c1f3a3bab6897a4aff (diff) | |
download | gsl-shell-29a9dbd5af79c3c80749efaf09fb8240482ff5b5.tar.gz |
-rw-r--r-- | agg-plot/lua-plot-cpp.h | 4 | ||||
-rw-r--r-- | agg-plot/lua-plot.cpp | 2 | ||||
-rw-r--r-- | object-index.c | 12 | ||||
-rw-r--r-- | object-index.h | 6 |
diff --git a/agg-plot/lua-plot-cpp.h b/agg-plot/lua-plot-cpp.h index a9cfb45a..1c3f52c0 100644 --- a/agg-plot/lua-plot-cpp.h +++ b/agg-plot/lua-plot-cpp.h @@ -19,7 +19,7 @@ private: plot_type m_plot; public: - lua_plot() : m_plot(), window_id(-1), id(-1) { }; + lua_plot() : m_plot(), window_id(-1) { }; void update_window(lua_State *L); @@ -29,8 +29,6 @@ public: int window_id; int slot_id; - - int id; }; #endif diff --git a/agg-plot/lua-plot.cpp b/agg-plot/lua-plot.cpp index cdde089c..0f28020b 100644 --- a/agg-plot/lua-plot.cpp +++ b/agg-plot/lua-plot.cpp @@ -124,8 +124,6 @@ plot_new (lua_State *L) p->self().set_title(title); } - p->id = object_index_add (L, OBJECT_PLOT, -1); - return 1; } diff --git a/object-index.c b/object-index.c index 7fb1e262..fab7830e 100644 --- a/object-index.c +++ b/object-index.c @@ -4,22 +4,13 @@ #include "object-index.h" -#warning OBJECT_PLOT is no longer used -static const char *table_name[] = {"GSL.reg.wins", "GSL.reg.plts"}; +static const char *table_name[] = {"GSL.reg.wins"}; void object_index_prepare (lua_State *L) { lua_newtable (L); lua_setfield (L, LUA_REGISTRYINDEX, table_name[OBJECT_WINDOW]); - - lua_newtable (L); - /* the metatable to define it as a weak table */ - lua_newtable (L); - lua_pushstring (L, "v"); - lua_setfield (L, -2, "__mode"); - lua_setmetatable (L, -2); - lua_setfield (L, LUA_REGISTRYINDEX, table_name[OBJECT_PLOT]); } int @@ -66,7 +57,6 @@ object_index_apply_all (lua_State *L, int obj_class, lua_CFunction f) lua_pushnil (L); /* first key */ while (lua_next(L, -2) != 0) { - /* lua_pushcfunction (L, canvas_window_close_protected); */ lua_pushcfunction (L, f); lua_insert (L, -2); lua_call (L, 1, 0); diff --git a/object-index.h b/object-index.h index db1db84f..dd19c3f6 100644 --- a/object-index.h +++ b/object-index.h @@ -7,9 +7,13 @@ __BEGIN_DECLS #include "lua.h" +/* We have currently just one class of objects that have a unique ID, windows. + At some moments during development this machinary was also used for plots. + Because we have just one object type that get an id the code could be + potentially simplified. */ enum object_class_e { OBJECT_WINDOW = 0, - OBJECT_PLOT, + /* OBJECT_PLOT, */ }; extern void object_index_prepare (lua_State *L); |