author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年08月21日 13:38:10 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年08月21日 19:15:11 +0200 |
commit | 0103cd7eefa668a02e3ab4349a36c1bd8f2a42bb (patch) | |
tree | 988133155d4b1610b7536c69c281b872e3364385 /agg-plot/lua-plot.cpp | |
parent | 5ae3556a85ec812736c5c68af6499c1350268e4e (diff) | |
download | gsl-shell-0103cd7eefa668a02e3ab4349a36c1bd8f2a42bb.tar.gz |
-rw-r--r-- | agg-plot/lua-plot.cpp | 21 |
diff --git a/agg-plot/lua-plot.cpp b/agg-plot/lua-plot.cpp index 9812668b..f5f13f4f 100644 --- a/agg-plot/lua-plot.cpp +++ b/agg-plot/lua-plot.cpp @@ -30,7 +30,7 @@ extern "C" { #include "window.h" #include "window-cpp.h" #include "gs-types.h" -#include "lua-utils.h" +#include "lua-properties.h" #include "window_registry.h" #include "lua-cpp-utils.h" #include "lua-draw.h" @@ -46,8 +46,6 @@ static int plot_add (lua_State *L); static int plot_update (lua_State *L); static int plot_flush (lua_State *L); static int plot_add_line (lua_State *L); -static int plot_index (lua_State *L); -static int plot_newindex (lua_State *L); static int plot_free (lua_State *L); static int plot_show (lua_State *L); static int plot_title_set (lua_State *L); @@ -92,8 +90,6 @@ static const struct luaL_Reg plot_functions[] = { }; static const struct luaL_Reg plot_metatable[] = { - {"__index", plot_index }, - {"__newindex", plot_newindex }, {"__gc", plot_free }, {NULL, NULL} }; @@ -471,20 +467,6 @@ plot_units_get (lua_State *L) return plot_bool_property_get(L, &sg_plot::use_units); } -int -plot_index (lua_State *L) -{ - return mlua_index_with_properties (L, - plot_properties_get, - plot_methods, false); -} - -int -plot_newindex (lua_State *L) -{ - return mlua_newindex_with_properties (L, plot_properties_set); -} - void plot_update_raw (lua_State *L, sg_plot *p, int plot_index) { @@ -790,6 +772,7 @@ plot_register (lua_State *L) { /* plot declaration */ luaL_newmetatable (L, GS_METATABLE(GS_PLOT)); + register_properties_index(L, plot_methods, plot_properties_get, plot_properties_set); luaL_register (L, NULL, plot_metatable); lua_pop (L, 1); |