The Battle for Wesnoth  1.15.5+dev
Namespaces | Functions
lua_widget.hpp File Reference
#include <string>
#include "scripting/lua_ptr.hpp"
#include "serialization/string_utils.hpp"
Include dependency graph for lua_widget.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 gui2
 Generic file dialog.
 
 lua_widget
 

Functions

void lua_widget::register_metatable (lua_State *L)
 
void luaW_pushwidget (lua_State *L, gui2::widget &w)
 
bool luaW_iswidget (lua_State *L, int idx)
 
gui2::widgetluaW_checkwidget (lua_State *L, int idx)
 
lua_ptr< gui2::widget > & luaW_checkwidget_ptr (lua_State *L, int idx)
 
void luaW_pushwindowtable (lua_State *L, gui2::window *owner)
 [-0, +1, -] More...
 
void luaW_clearwindowtable (lua_State *L, gui2::window *owner)
 [-0, +0, -] More...
 
void luaW_pushwidgettable (lua_State *L, gui2::widget *wg, gui2::window *owner)
 [-0, +1, -] More...
 
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, -] More...
 
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, -] More...
 
void luaW_callwidgetcallback (lua_State *L, gui2::widget *wg, gui2::window *owner, utils::string_view name)
 callas a widgets callback [-0, +0, e] More...
 

Function Documentation

◆ luaW_callwidgetcallback()

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().

◆ luaW_checkwidget()

gui2::widget& luaW_checkwidget ( lua_State L,
int  idx 
)

◆ luaW_checkwidget_ptr()

lua_ptr<gui2::widget>& luaW_checkwidget_ptr ( lua_State L,
int  idx 
)

◆ luaW_clearwindowtable()

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().

◆ luaW_getwidgetcallback()

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().

◆ luaW_iswidget()

bool luaW_iswidget ( lua_State L,
int  idx 
)

Definition at line 62 of file lua_widget.cpp.

References luaL_testudata(), and widgetKey.

◆ luaW_pushwidget()

void luaW_pushwidget ( lua_State L,
gui2::widget w 
)

◆ luaW_pushwidgettable()

void luaW_pushwidgettable ( lua_State L,
gui2::widget wg,
gui2::window owner 
)

◆ luaW_pushwindowtable()

void luaW_pushwindowtable ( lua_State L,
gui2::window owner 
)

◆ luaW_setwidgetcallback()

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().