The Battle for Wesnoth  1.19.0-dev
Namespaces | Functions | Variables
lua_widget.cpp File Reference
#include "scripting/lua_widget.hpp"
#include "scripting/lua_widget_attributes.hpp"
#include "gui/widgets/widget.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/lua_ptr.hpp"
#include "scripting/push_check.hpp"
Include dependency graph for lua_widget.cpp:

Go to the source code of this file.

Namespaces

 lua_widget
 

Functions

void luaW_pushwidget (lua_State *L, gui2::widget &w)
 
gui2::widgetluaW_checkwidget (lua_State *L, int n)
 
lua_ptr< gui2::widget > & luaW_checkwidget_ptr (lua_State *L, int n)
 
bool luaW_iswidget (lua_State *L, int index)
 
static void luaW_pushwidgettablecontainer (lua_State *L)
 
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, std::string_view name)
 returns true if a callback already existed. More...
 
void luaW_getwidgetcallback (lua_State *L, gui2::widget *wg, gui2::window *owner, std::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, std::string_view name)
 callas a widgets callback [-0, +0, e] More...
 
static int impl_widget_collect (lua_State *L)
 
void lua_widget::register_metatable (lua_State *L)
 

Variables

static const char widgetKey [] = "widget"
 
static char widgetdataKey [] = "widgetdata"
 

Function Documentation

◆ impl_widget_collect()

static int impl_widget_collect ( lua_State *  L)
static

Definition at line 178 of file lua_widget.cpp.

References w, and widgetKey.

Referenced by lua_widget::register_metatable().

◆ luaW_callwidgetcallback()

void luaW_callwidgetcallback ( lua_State *  L,
gui2::widget wg,
gui2::window owner,
std::string_view  name 
)

callas a widgets callback [-0, +0, e]

Definition at line 169 of file lua_widget.cpp.

References luaW_getwidgetcallback(), and luaW_pushwidget().

◆ luaW_checkwidget()

gui2::widget& luaW_checkwidget ( lua_State *  L,
int  n 
)

◆ luaW_checkwidget_ptr()

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

Definition at line 46 of file lua_widget.cpp.

References lua_ptr< T >::get_ptr(), n, and widgetKey.

Referenced by intf_set_dialog_callback().

◆ luaW_clearwindowtable()

void luaW_clearwindowtable ( lua_State *  L,
gui2::window owner 
)

[-0, +0, -]

Definition at line 98 of file lua_widget.cpp.

References luaW_pushwidgettablecontainer().

Referenced by intf_show_dialog().

◆ luaW_getwidgetcallback()

void luaW_getwidgetcallback ( lua_State *  L,
gui2::widget wg,
gui2::window owner,
std::string_view  name 
)

pushed ther callback function onoto the stack [-0, +1, -]

Definition at line 157 of file lua_widget.cpp.

References lua_push(), and luaW_pushwidgettable().

Referenced by luaW_callwidgetcallback().

◆ luaW_iswidget()

bool luaW_iswidget ( lua_State *  L,
int  index 
)

Definition at line 57 of file lua_widget.cpp.

References utf8::index(), 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 
)

[-0, +1, -]

Definition at line 108 of file lua_widget.cpp.

References luaW_pushwidget(), and luaW_pushwindowtable().

Referenced by luaW_getwidgetcallback(), and luaW_setwidgetcallback().

◆ luaW_pushwidgettablecontainer()

static void luaW_pushwidgettablecontainer ( lua_State *  L)
static

Definition at line 63 of file lua_widget.cpp.

References widgetdataKey.

Referenced by luaW_clearwindowtable(), and luaW_pushwindowtable().

◆ luaW_pushwindowtable()

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

[-0, +1, -]

Definition at line 76 of file lua_widget.cpp.

References luaW_pushwidgettablecontainer().

Referenced by luaW_pushwidgettable().

◆ luaW_setwidgetcallback()

bool luaW_setwidgetcallback ( lua_State *  L,
gui2::widget wg,
gui2::window owner,
std::string_view  name 
)

returns true if a callback already existed.

[-1, +0, -]

Definition at line 135 of file lua_widget.cpp.

References lua_push(), and luaW_pushwidgettable().

Referenced by intf_set_dialog_callback().

Variable Documentation

◆ widgetdataKey

char widgetdataKey[] = "widgetdata"
static

Definition at line 28 of file lua_widget.cpp.

Referenced by luaW_pushwidgettablecontainer().

◆ widgetKey

const char widgetKey[] = "widget"
static