#include "scripting/lua_widget.hpp"
#include "scripting/lua_widget_attributes.hpp"
#include "log.hpp"
#include "gui/widgets/widget.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/lua_unit.hpp"
#include "scripting/lua_unit_type.hpp"
#include "scripting/lua_ptr.hpp"
#include "scripting/push_check.hpp"
#include "lua/lauxlib.h"
#include "lua/lua.h"
#include <type_traits>
Go to the source code of this file.
Namespaces | |
lua_widget | |
Variables | |
static const char | widgetKey [] = "widget" |
static char | widgetdataKey [] = "widgetdata" |
|
static |
Definition at line 183 of file lua_widget.cpp.
References luaL_checkudata(), w, and widgetKey.
Referenced by lua_widget::register_metatable().
void luaW_callwidgetcallback | ( | lua_State * | L, |
gui2::widget * | wg, | ||
gui2::window * | owner, | ||
utils::string_view | name | ||
) |
callas a widgets callback [-0, +0, e]
Definition at line 174 of file lua_widget.cpp.
References lua_call, lua_isfunction, luaW_getwidgetcallback(), and luaW_pushwidget().
Referenced by intf_remove_dialog_item(), and WIDGET_GETTER().
gui2::widget& luaW_checkwidget | ( | lua_State * | L, |
int | n | ||
) |
Definition at line 41 of file lua_widget.cpp.
References lua_ptr< T >::get_ptr(), luaL_argerror(), luaL_checkudata(), and widgetKey.
Referenced by lua_widget::impl_widget_get(), lua_widget::impl_widget_set(), intf_add_dialog_item(), intf_add_item_of_type(), intf_dialog_close(), intf_find_widget(), intf_remove_dialog_item(), intf_set_dialog_canvas(), and intf_set_dialog_focus().
lua_ptr<gui2::widget>& luaW_checkwidget_ptr | ( | lua_State * | L, |
int | n | ||
) |
Definition at line 51 of file lua_widget.cpp.
References lua_ptr< T >::get_ptr(), luaL_argerror(), luaL_checkudata(), and widgetKey.
Referenced by intf_set_dialog_callback().
void luaW_clearwindowtable | ( | lua_State * | L, |
gui2::window * | owner | ||
) |
[-0, +0, -]
Definition at line 103 of file lua_widget.cpp.
References lua_pop, lua_pushlightuserdata(), lua_pushnil(), lua_rawset(), and luaW_pushwidgettablecontainer().
Referenced by intf_show_dialog().
void luaW_getwidgetcallback | ( | lua_State * | L, |
gui2::widget * | wg, | ||
gui2::window * | owner, | ||
utils::string_view | name | ||
) |
pushed ther callback function onoto the stack [-0, +1, -]
Definition at line 162 of file lua_widget.cpp.
References lua_absindex(), lua_push(), lua_rawget(), lua_remove, and luaW_pushwidgettable().
Referenced by luaW_callwidgetcallback().
bool luaW_iswidget | ( | lua_State * | L, |
int | index | ||
) |
Definition at line 62 of file lua_widget.cpp.
References luaL_testudata(), and widgetKey.
void luaW_pushwidget | ( | lua_State * | L, |
gui2::widget & | w | ||
) |
Definition at line 35 of file lua_widget.cpp.
References luaL_setmetatable(), and widgetKey.
Referenced by lua_widget::impl_widget_get(), intf_add_dialog_item(), intf_add_item_of_type(), intf_find_widget(), intf_show_dialog(), lua_check_impl::lua_push(), luaW_callwidgetcallback(), luaW_pushwidgettable(), and WIDGET_SETTER().
void luaW_pushwidgettable | ( | lua_State * | L, |
gui2::widget * | wg, | ||
gui2::window * | owner | ||
) |
[-0, +1, -]
Definition at line 113 of file lua_widget.cpp.
References lua_absindex(), lua_createtable(), lua_isnoneornil, lua_pop, lua_pushlightuserdata(), lua_pushvalue(), lua_rawget(), lua_rawset(), lua_rawseti(), lua_remove, luaW_pushwidget(), and luaW_pushwindowtable().
Referenced by luaW_getwidgetcallback(), and luaW_setwidgetcallback().
|
static |
Definition at line 68 of file lua_widget.cpp.
References lua_createtable(), lua_isnoneornil, lua_pop, lua_pushlightuserdata(), lua_pushvalue(), lua_rawget(), lua_rawset(), LUA_REGISTRYINDEX, and widgetdataKey.
Referenced by luaW_clearwindowtable(), and luaW_pushwindowtable().
void luaW_pushwindowtable | ( | lua_State * | L, |
gui2::window * | owner | ||
) |
[-0, +1, -]
Definition at line 81 of file lua_widget.cpp.
References lua_absindex(), lua_createtable(), lua_isnoneornil, lua_pop, lua_pushlightuserdata(), lua_pushvalue(), lua_rawget(), lua_rawset(), lua_remove, and luaW_pushwidgettablecontainer().
Referenced by luaW_pushwidgettable().
bool luaW_setwidgetcallback | ( | lua_State * | L, |
gui2::widget * | wg, | ||
gui2::window * | owner, | ||
utils::string_view | name | ||
) |
returns true if a callback already existed.
[-1, +0, -]
Definition at line 140 of file lua_widget.cpp.
References lua_absindex(), lua_isnoneornil, lua_pop, lua_push(), lua_rawget(), lua_rawset(), lua_rotate(), and luaW_pushwidgettable().
Referenced by intf_set_dialog_callback(), and WIDGET_GETTER().
|
static |
Definition at line 33 of file lua_widget.cpp.
Referenced by luaW_pushwidgettablecontainer().
|
static |
Definition at line 32 of file lua_widget.cpp.
Referenced by impl_widget_collect(), luaW_checkwidget(), luaW_checkwidget_ptr(), luaW_iswidget(), luaW_pushwidget(), and lua_widget::register_metatable().