summaryrefslogtreecommitdiff
path: root/client/widgets/widget.h
diff options
context:
space:
mode:
Diffstat (limited to 'client/widgets/widget.h')
-rw-r--r--client/widgets/widget.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/client/widgets/widget.h b/client/widgets/widget.h
index 3d06ef3..bb7ce6c 100644
--- a/client/widgets/widget.h
+++ b/client/widgets/widget.h
@@ -124,4 +124,39 @@ protected:
QString onInitEventScript;
};
+int wdg_name(lua_State *L);
+int wdg_type(lua_State *L);
+int wdg_value(lua_State *L);
+int wdg_set_value(lua_State *L);
+int wdg_enabled(lua_State *L);
+int wdg_set_enabled(lua_State *L);
+int wdg_visible(lua_State *L);
+int wdg_set_visible(lua_State *L);
+int wdg_valid(lua_State *L);
+int wdg_set_valid(lua_State *L);
+
+#define WDG_METHS \
+ {"name", wdg_name},\
+ {"type", wdg_type},\
+ {"value", wdg_value},\
+ {"setValue", wdg_set_value},\
+ {"enabled", wdg_enabled},\
+ {"setEnabled", wdg_set_enabled},\
+ {"visible", wdg_visible},\
+ {"setVisible", wdg_set_visible},\
+ {"valid", wdg_valid},\
+ {"setValid", wdg_set_valid}
+
+const struct luaL_Reg wdg_meths[] =
+ { WDG_METHS, {NULL, NULL} };
+
+inline void register_widget(lua_State *L)
+{
+ luaL_newmetatable(L, "Widget");
+ lua_pushliteral(L, "__index");
+ lua_pushvalue(L, -2);
+ lua_rawset(L, -3);
+ luaL_register(L, NULL, wdg_meths);
+}
+
#endif/*__PRACRO_WIDGET_H__*/