2727#include <lua.h>
2828#include <lauxlib.h>
2929
30- typedef struct lua_class_property lua_class_property_t ;
31-
32- ARRAY_TYPE (lua_class_property_t , lua_class_property )
33-
3430#define LUA_OBJECT_HEADER \
3531 signal_array_t signals;
3632
@@ -49,6 +45,21 @@ typedef int (*lua_class_propfunc_t)(lua_State *, lua_object_t *);
4945
5046typedef bool (* lua_class_checker_t )(lua_object_t * );
5147
48+ typedef struct
49+ {
50+ /** Name of the property */
51+ const char * name ;
52+ /** Callback function called when the property is found in object creation. */
53+ lua_class_propfunc_t new ;
54+ /** Callback function called when the property is found in object __index. */
55+ lua_class_propfunc_t index ;
56+ /** Callback function called when the property is found in object __newindex. */
57+ lua_class_propfunc_t newindex ;
58+ }
59+ lua_class_property_t ;
60+
61+ ARRAY_TYPE (lua_class_property_t , lua_class_property )
62+
5263typedef struct lua_class_t lua_class_t ;
5364struct lua_class_t
5465{
@@ -97,6 +108,7 @@ void luaA_class_setup(lua_State *, lua_class_t *, const char *, lua_class_t *,
97108
98109void luaA_class_add_property (lua_class_t * , const char * ,
99110 lua_class_propfunc_t , lua_class_propfunc_t , lua_class_propfunc_t );
111+ void luaA_class_add_properties (lua_class_t * , lua_class_property_t [] , size_t );
100112
101113int luaA_usemetatable (lua_State * , int , int );
102114int luaA_class_index (lua_State * );
0 commit comments