The Battle for Wesnoth
1.15.9+dev
scripting
lua_widget.hpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2009 - 2018 by Guillaume Melquiond <guillaume.melquiond@gmail.com>
3
Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY.
11
12
See the COPYING file for more details.
13
*/
14
15
#pragma once
16
17
#include <string>
18
19
#include "
scripting/lua_ptr.hpp
"
20
#include "
serialization/string_utils.hpp
"
21
22
namespace
gui2
{
23
class
widget;
24
class
window;
25
}
26
struct
lua_State
;
27
28
namespace
lua_widget
{
29
void
register_metatable
(
lua_State
* L);
30
}
31
32
void
luaW_pushwidget
(
lua_State
* L,
gui2::widget
&
w
);
33
bool
luaW_iswidget
(
lua_State
* L,
int
idx);
34
gui2::widget
&
luaW_checkwidget
(
lua_State
* L,
int
idx);
35
lua_ptr<gui2::widget>
&
luaW_checkwidget_ptr
(
lua_State
* L,
int
idx);
36
37
38
39
/** [-0, +1, -] */
40
void
luaW_pushwindowtable
(
lua_State
* L,
gui2::window
* owner);
41
/** [-0, +0, -] */
42
void
luaW_clearwindowtable
(
lua_State
* L,
gui2::window
* owner);
43
/** [-0, +1, -] */
44
void
luaW_pushwidgettable
(
lua_State
* L,
gui2::widget
* wg,
gui2::window
* owner);
45
/** returns true if a callback already existed. [-1, +0, -] */
46
bool
luaW_setwidgetcallback
(
lua_State
* L,
gui2::widget
* wg,
gui2::window
* owner, std::string_view
name
);
47
/** pushed ther callback function onoto the stack [-0, +1, -] */
48
void
luaW_getwidgetcallback
(
lua_State
* L,
gui2::widget
* wg,
gui2::window
* owner, std::string_view
name
);
49
/** callas a widgets callback [-0, +0, e] */
50
void
luaW_callwidgetcallback
(
lua_State
* L,
gui2::widget
* wg,
gui2::window
* owner, std::string_view
name
);
lua_ptr
Tmust inherit enable_lua_ptr<T>
Definition:
lua_ptr.hpp:18
gui2::widget
Base class for all widgets.
Definition:
widget.hpp:49
luaW_pushwindowtable
void luaW_pushwindowtable(lua_State *L, gui2::window *owner)
[-0, +1, -]
Definition:
lua_widget.cpp:81
luaW_pushwidget
void luaW_pushwidget(lua_State *L, gui2::widget &w)
Definition:
lua_widget.cpp:35
luaW_checkwidget_ptr
lua_ptr< gui2::widget > & luaW_checkwidget_ptr(lua_State *L, int idx)
Definition:
lua_widget.cpp:51
gui2
Generic file dialog.
Definition:
field-fwd.hpp:22
lua_ptr.hpp
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:
lua_widget.cpp:162
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:
lua_widget.cpp:174
lua_State
Definition:
lstate.h:178
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.
Definition:
lua_widget.cpp:140
luaW_iswidget
bool luaW_iswidget(lua_State *L, int idx)
Definition:
lua_widget.cpp:62
luaW_pushwidgettable
void luaW_pushwidgettable(lua_State *L, gui2::widget *wg, gui2::window *owner)
[-0, +1, -]
Definition:
lua_widget.cpp:113
name
std::string name
Definition:
sdl_ttf.cpp:70
lua_widget
Definition:
lua_widget.cpp:191
w
int w
Definition:
function_table.cpp:135
string_utils.hpp
luaW_checkwidget
gui2::widget & luaW_checkwidget(lua_State *L, int idx)
Definition:
lua_widget.cpp:41
lua_cpp::register_metatable
void register_metatable(lua_State *L)
Definition:
lua_cpp_function.cpp:70
gui2::window
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition:
window.hpp:64
luaW_clearwindowtable
void luaW_clearwindowtable(lua_State *L, gui2::window *owner)
[-0, +0, -]
Definition:
lua_widget.cpp:103
Generated by
1.8.13