#include <application_lua_kernel.hpp>
Classes | |
class | thread |
Public Types | |
typedef std::vector < std::function< bool(void)> > | request_list |
Public Types inherited from lua_kernel_base | |
typedef std::function< void(char const *, char const *)> | error_handler |
Public Member Functions | |
application_lua_kernel (CVideo *) | |
virtual std::string | my_name () |
thread * | load_script_from_string (const std::string &) |
thread * | load_script_from_file (const std::string &) |
Public Member Functions inherited from lua_kernel_base | |
lua_kernel_base (CVideo *ptr) | |
virtual | ~lua_kernel_base () |
void | run_lua_tag (const config &cfg) |
Runs a [lua] tag. More... | |
void | run (char const *prog, int nArgs=0) |
Runs a plain script. More... | |
void | throwing_run (char const *prog, int nArgs) |
Runs a plain script, but reports errors by throwing lua_error. More... | |
void | interactive_run (char const *prog) |
Tests if a program resolves to an expression, and pretty prints it if it is, otherwise it runs it normally. More... | |
void | load_package () |
Loads the "package" package into the Lua environment. More... | |
std::vector< std::string > | get_global_var_names () |
Gets all the global variable names in the Lua environment. More... | |
std::vector< std::string > | get_attribute_names (const std::string &var_path) |
Gets all attribute names of an extended variable name. More... | |
const std::stringstream & | get_log () |
void | clear_log () |
void | set_external_log (std::ostream *lg) |
virtual void | log_error (char const *msg, char const *context="Lua error") |
virtual void | throw_exception (char const *msg, char const *context="Lua error") |
void | set_video (CVideo *ptr) |
virtual boost::uint32_t | get_random_seed () |
lua_State * | get_state () |
Additional Inherited Members | |
Static Public Member Functions inherited from lua_kernel_base | |
template<typename T > | |
static T & | get_lua_kernel (lua_State *L) |
Protected Member Functions inherited from lua_kernel_base | |
int | intf_print (lua_State *L) |
Replacement print function – instead of printing to std::cout, print to the command log. More... | |
int | intf_show_dialog (lua_State *L) |
int | intf_show_message_dialog (lua_State *L) |
int | intf_show_popup_dialog (lua_State *L) |
int | intf_show_lua_console (lua_State *L) |
bool | protected_call (int nArgs, int nRets, error_handler) |
bool | load_string (char const *prog, error_handler) |
virtual bool | protected_call (int nArgs, int nRets) |
virtual bool | load_string (char const *prog) |
int | intf_dofile (lua_State *L) |
Loads and executes a Lua file. More... | |
int | intf_require (lua_State *L) |
Loads and executes a Lua file, if there is no corresponding entry in wesnoth.package. More... | |
Static Protected Member Functions inherited from lua_kernel_base | |
static bool | protected_call (lua_State *L, int nArgs, int nRets, error_handler) |
Protected Attributes inherited from lua_kernel_base | |
lua_State * | mState |
CVideo * | video_ |
command_log | cmd_log_ |
Definition at line 30 of file application_lua_kernel.hpp.
typedef std::vector<std::function<bool(void)> > application_lua_kernel::request_list |
Definition at line 36 of file application_lua_kernel.hpp.
application_lua_kernel::application_lua_kernel | ( | CVideo * | ptr | ) |
Definition at line 97 of file application_lua_kernel.cpp.
References intf_describe_plugins(), lua_pushcfunction, lua_setglobal(), lua_settop(), and lua_kernel_base::mState.
application_lua_kernel::thread * application_lua_kernel::load_script_from_file | ( | const std::string & | file | ) |
Definition at line 193 of file application_lua_kernel.cpp.
References get_new_thread(), lua_fileops::load_file(), lua_kernel_base::log_error(), lua_error(), lua_isfunction, lua_pushstring(), lua_type(), lua_typename(), lua_kernel_base::mState, and lua_kernel_base::protected_call().
application_lua_kernel::thread * application_lua_kernel::load_script_from_string | ( | const std::string & | prog | ) |
Definition at line 156 of file application_lua_kernel.cpp.
References DBG_LUA, get_new_thread(), lua_kernel_base::log_error(), LUA_ERRGCMM, LUA_ERRMEM, lua_error(), LUA_ERRSYNTAX, lua_isfunction, LUA_OK, lua_status(), lua_tostring, lua_type(), lua_typename(), luaL_loadstring(), game_logic::msg(), lua_kernel_base::mState, and lua_kernel_base::protected_call().
|
inlinevirtual |
Reimplemented from lua_kernel_base.
Definition at line 34 of file application_lua_kernel.hpp.