#include "config.hpp"
#include "gui/core/canvas.hpp"
#include "gui/core/gui_definition.hpp"
#include "gui/core/event/handler.hpp"
#include "gui/core/window_builder.hpp"
#include "gui/widgets/clickable_item.hpp"
#include "gui/widgets/styled_widget.hpp"
#include "gui/widgets/listbox.hpp"
#include "gui/widgets/multi_page.hpp"
#include "gui/widgets/multimenu_button.hpp"
#include "gui/widgets/progress_bar.hpp"
#include "gui/widgets/selectable_item.hpp"
#include "gui/widgets/slider.hpp"
#include "gui/widgets/stacked_widget.hpp"
#include "gui/widgets/text_box.hpp"
#include "gui/widgets/tree_view.hpp"
#include "gui/widgets/tree_view_node.hpp"
#include "gui/widgets/unit_preview_pane.hpp"
#include "gui/widgets/widget.hpp"
#include "gui/widgets/window.hpp"
#include "log.hpp"
#include "scripting/lua_common.hpp"
#include "scripting/lua_cpp_function.hpp"
#include "scripting/lua_kernel_base.hpp"
#include "scripting/lua_ptr.hpp"
#include "scripting/lua_widget.hpp"
#include "scripting/lua_widget_methods.hpp"
#include "scripting/push_check.hpp"
#include "serialization/string_utils.hpp"
#include "tstring.hpp"
#include <functional>
#include <type_traits>
#include <map>
#include <utility>
#include <vector>
#include "lua/lauxlib.h"
#include "lua/lua.h"
Go to the source code of this file.
Namespaces | |
lua_widget | |
Macros | |
#define | ERR_LUA LOG_STREAM(err, log_scripting_lua) |
Functions | |
int | intf_show_dialog (lua_State *L) |
Displays a window. More... | |
static gui2::widget * | find_widget_impl (lua_State *L, gui2::widget *w, int i, bool readonly) |
static int | intf_find_widget (lua_State *L) |
static int | intf_remove_dialog_item (lua_State *L) |
Removes an entry from a list. More... | |
static int | intf_set_dialog_callback (lua_State *L) |
Sets a callback on a widget of the current dialog. More... | |
static int | intf_set_dialog_canvas (lua_State *L) |
Sets a canvas on a widget of the current dialog. More... | |
static int | intf_set_dialog_focus (lua_State *L) |
Sets a widget to have the focus. More... | |
static int | intf_add_item_of_type (lua_State *L) |
Sets a widget's state to active or inactive. More... | |
static int | intf_add_dialog_item (lua_State *L) |
Sets a widget's state to active or inactive. More... | |
static int | intf_dialog_close (lua_State *L) |
Closes a window. More... | |
int | lua_widget::luaW_open (lua_State *L) |
Variables | |
static lg::log_domain | log_scripting_lua ("scripting/lua") |
#define ERR_LUA LOG_STREAM(err, log_scripting_lua) |
Definition at line 56 of file lua_widget_methods.cpp.
Referenced by intf_remove_dialog_item().
|
static |
Definition at line 92 of file lua_widget_methods.cpp.
References gui2::tree_view_node::count_children(), dummy, gui2::tree_view_node::find(), gui2::widget::find(), gui2::tree_view_node::get_child_at(), i, lua_isnoneornil, lua_isnumber(), lua_tointeger, lua_tostring, luaL_checkstring, n, and w.
Referenced by intf_find_widget().
|
static |
Sets a widget's state to active or inactive.
Definition at line 388 of file lua_widget_methods.cpp.
References lua_gettop(), luaL_argerror(), luaW_checkwidget(), luaW_pushwidget(), and w.
Referenced by lua_widget::luaW_open().
|
static |
Sets a widget's state to active or inactive.
Definition at line 357 of file lua_widget_methods.cpp.
References lua_gettop(), lua_isnumber(), lua_push(), luaL_argerror(), luaL_checkinteger(), luaL_checkstring, luaW_checkwidget(), luaW_pushwidget(), and w.
Referenced by lua_widget::luaW_open().
|
static |
Closes a window.
Definition at line 408 of file lua_widget_methods.cpp.
References lua_gettop(), luaL_argerror(), luaW_checkwidget(), and w.
Referenced by lua_widget::luaW_open().
|
static |
Definition at line 194 of file lua_widget_methods.cpp.
References gui2::tree_view_node::count_children(), find_widget_impl(), gui2::tree_view_node::get_child_at(), gui2::tree_view_node::get_tree_view(), i, luaW_checkwidget(), luaW_pushwidget(), gui2::tree_view::remove_node(), and w.
Referenced by lua_widget::luaW_open().
|
static |
Removes an entry from a list.
Definition at line 230 of file lua_widget_methods.cpp.
References ERR_LUA, lua_ptr< T >::get_ptr(), gui2::widget::get_window(), lua_gettop(), luaL_argerror(), luaL_checkinteger(), luaW_callwidgetcallback(), luaW_checkwidget(), and w.
Referenced by lua_widget::luaW_open().
|
static |
Sets a callback on a widget of the current dialog.
Definition at line 274 of file lua_widget_methods.cpp.
References c, gui2::event::connect_signal_notify_modified(), lua_ptr< T >::get_ptr(), gui2::widget::get_window(), lua_gettop(), lua_pushvalue(), luaL_argerror(), luaW_checkwidget_ptr(), luaW_setwidgetcallback(), and w.
Referenced by lua_widget::luaW_open().
|
static |
Sets a canvas on a widget of the current dialog.
Definition at line 317 of file lua_widget_methods.cpp.
References c, gui2::styled_widget::get_canvases(), i, lua_gettop(), luaL_argerror(), luaL_checkinteger(), luaW_checkconfig(), luaW_checkwidget(), gui2::widget::set_is_dirty(), and w.
Referenced by lua_widget::luaW_open().
|
static |
Sets a widget to have the focus.
Definition at line 341 of file lua_widget_methods.cpp.
References gui2::widget::get_window(), luaW_checkwidget(), and w.
Referenced by lua_widget::luaW_open().
int intf_show_dialog | ( | lua_State * | L | ) |
Displays a window.
Definition at line 65 of file lua_widget_methods.cpp.
References gui2::build(), lua_call, lua_isnoneornil, lua_pushinteger(), lua_pushvalue(), luaW_checkconfig(), luaW_clearwindowtable(), luaW_pushwidget(), gui2::open_window_stack, gui2::remove_from_window_stack(), and gui2::window::show().
Referenced by lua_gui2::luaW_open().
|
static |