Implement a simpler way to lookup for methods and properties - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/lua-plot.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年08月21日 13:38:10 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年08月21日 19:15:11 +0200
commit0103cd7eefa668a02e3ab4349a36c1bd8f2a42bb (patch)
tree988133155d4b1610b7536c69c281b872e3364385 /agg-plot/lua-plot.cpp
parent5ae3556a85ec812736c5c68af6499c1350268e4e (diff)
downloadgsl-shell-0103cd7eefa668a02e3ab4349a36c1bd8f2a42bb.tar.gz
Implement a simpler way to lookup for methods and properties
Remove also a lot of no longer used code in lua-utils.c.
Diffstat (limited to 'agg-plot/lua-plot.cpp')
-rw-r--r--agg-plot/lua-plot.cpp 21
1 files changed, 2 insertions, 19 deletions
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);
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月13日 20:53:15 +0000

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