#include <src/ceguilua/ceguilua-0.6.2/ceguilua/CEGUILua.h>
Public Member Functions | |
void | createBindings (void) |
Method called during system initialisation, prior to running any scripts via the ScriptModule, to enable the ScriptModule to perform any operations required to complete initialisation or binding of the script language to the gui system objects. | |
void | createBindings (void) |
Method called during system initialisation, prior to running any scripts via the ScriptModule, to enable the ScriptModule to perform any operations required to complete initialisation or binding of the script language to the gui system objects. | |
void | createBindings (void) |
Method called during system initialisation, prior to running any scripts via the ScriptModule, to enable the ScriptModule to perform any operations required to complete initialisation or binding of the script language to the gui system objects. | |
void | createBindings (void) |
Method called during system initialisation, prior to running any scripts via the ScriptModule, to enable the ScriptModule to perform any operations required to complete initialisation or binding of the script language to the gui system objects. | |
void | destroyBindings (void) |
Method called during system destruction, after all scripts have been run via the ScriptModule, to enable the ScriptModule to perform any operations required to cleanup bindings of the script language to the gui system objects, as set-up in the earlier createBindings call. | |
void | destroyBindings (void) |
Method called during system destruction, after all scripts have been run via the ScriptModule, to enable the ScriptModule to perform any operations required to cleanup bindings of the script language to the gui system objects, as set-up in the earlier createBindings call. | |
void | destroyBindings (void) |
Method called during system destruction, after all scripts have been run via the ScriptModule, to enable the ScriptModule to perform any operations required to cleanup bindings of the script language to the gui system objects, as set-up in the earlier createBindings call. | |
void | destroyBindings (void) |
Method called during system destruction, after all scripts have been run via the ScriptModule, to enable the ScriptModule to perform any operations required to cleanup bindings of the script language to the gui system objects, as set-up in the earlier createBindings call. | |
bool | executeScriptedEventHandler (const String &handler_name, const EventArgs &e, const int error_handler) |
Execute a scripted global 'event handler' function by looking it up by name. | |
bool | executeScriptedEventHandler (const String &handler_name, const EventArgs &e, const String &error_handler) |
Execute a scripted global 'event handler' function by looking it up by name. | |
bool | executeScriptedEventHandler (const String &handler_name, const EventArgs &e) |
Execute a scripted global 'event handler' function by looking it up by name. | |
bool | executeScriptedEventHandler (const String &handler_name, const EventArgs &e) |
Execute a scripted global 'event handler' function by looking it up by name. | |
bool | executeScriptedEventHandler (const String &handler_name, const EventArgs &e) |
Execute a scripted global 'event handler' function by looking it up by name. | |
bool | executeScriptedEventHandler (const String &handler_name, const EventArgs &e) |
Execute a scripted global 'event handler' function by looking it up by name. | |
void | executeScriptFile (const String &filename, const String &resourceGroup, const int error_handler) |
Execute a script file. | |
void | executeScriptFile (const String &filename, const String &resourceGroup, const String &error_handler) |
Execute a script file. | |
void | executeScriptFile (const String &filename, const String &resourceGroup) |
Execute a script file. | |
void | executeScriptFile (const String &filename, const String &resourceGroup) |
Execute a script file. | |
void | executeScriptFile (const String &filename, const String &resourceGroup) |
Execute a script file. | |
void | executeScriptFile (const String &filename, const String &resourceGroup) |
Execute a script file. | |
int | executeScriptGlobal (const String &function_name, const int error_handler) |
Execute a scripted global function. The function should not take any parameters and should return an integer. | |
int | executeScriptGlobal (const String &function_name, const String &error_handler) |
Execute a scripted global function. The function should not take any parameters and should return an integer. | |
int | executeScriptGlobal (const String &function_name) |
Execute a scripted global function. The function should not take any parameters and should return an integer. | |
int | executeScriptGlobal (const String &function_name) |
Execute a scripted global function. The function should not take any parameters and should return an integer. | |
int | executeScriptGlobal (const String &function_name) |
Execute a scripted global function. The function should not take any parameters and should return an integer. | |
int | executeScriptGlobal (const String &function_name) |
Execute a scripted global function. The function should not take any parameters and should return an integer. | |
void | executeString (const String &str, const int error_handler) |
Execute script code contained in the given CEGUI::String object. | |
void | executeString (const String &str, const String &error_handler) |
Execute script code contained in the given CEGUI::String object. | |
void | executeString (const String &str) |
Execute script code contained in the given CEGUI::String object. | |
void | executeString (const String &str) |
Execute script code contained in the given CEGUI::String object. | |
void | executeString (const String &str) |
Execute script code contained in the given CEGUI::String object. | |
void | executeString (const String &str) |
Execute script code contained in the given CEGUI::String object. | |
int | getActivePCallErrorHandlerReference () const |
return the lua registry index of the active error handler function. | |
const String & | getActivePCallErrorHandlerString () const |
Return the function name string of the active error handler function. | |
lua_State * | getLuaState (void) const |
Method used to get a pointer to the lua_State that the script module is attached to. | |
lua_State * | getLuaState (void) const |
Method used to get a pointer to the lua_State that the script module is attached to. | |
lua_State * | getLuaState (void) const |
Method used to get a pointer to the lua_State that the script module is attached to. | |
lua_State * | getLuaState (void) const |
Method used to get a pointer to the lua_State that the script module is attached to. | |
LuaScriptModule (lua_State *state) | |
Constructor for LuaScriptModule class which takes a lua_State. | |
LuaScriptModule () | |
Constructor for LuaScriptModule class which create a lua_State. | |
LuaScriptModule (lua_State *state) | |
Constructor for LuaScriptModule class which takes a lua_State. | |
LuaScriptModule () | |
Constructor for LuaScriptModule class which create a lua_State. | |
LuaScriptModule (lua_State *state) | |
Constructor for LuaScriptModule class which takes a lua_State. | |
LuaScriptModule () | |
Constructor for LuaScriptModule class which create a lua_State. | |
LuaScriptModule (lua_State *state) | |
Constructor for LuaScriptModule class which takes a lua_State. | |
LuaScriptModule () | |
Constructor for LuaScriptModule class which create a lua_State. | |
void | setDefaultPCallErrorHandler (int function_reference) |
Set the function that will be passed as the error handler in calls to lua_pcall, unless an alternative is specified in some other function call. | |
void | setDefaultPCallErrorHandler (const String &error_handler_function) |
Set the name of the lua function that will be passed as the error handler in calls to lua_pcall, unless an alternative is specified in some other function call. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, Event::Group group, const String &subscriber_name, const int error_handler) |
Subscribes the specified group of the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, Event::Group group, const String &subscriber_name, const String &error_handler) |
Subscribes the specified group of the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, Event::Group group, const String &subscriber_name) |
Subscribes the specified group of the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, const String &subscriber_name, const int error_handler) |
Subscribes the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, const String &subscriber_name, const String &error_handler) |
Subscribes the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, const String &subscriber_name) |
Subscribes the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, Event::Group group, const String &subscriber_name) |
Subscribes the specified group of the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, const String &subscriber_name) |
Subscribes the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, Event::Group group, const String &subscriber_name) |
Subscribes the specified group of the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, const String &subscriber_name) |
Subscribes the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, Event::Group group, const String &subscriber_name) |
Subscribes the specified group of the named Event to a scripted funtion. | |
Event::Connection | subscribeEvent (EventSet *target, const String &name, const String &subscriber_name) |
Subscribes the named Event to a scripted funtion. | |
~LuaScriptModule () | |
Destructor for LuaScriptModule class. | |
~LuaScriptModule () | |
Destructor for LuaScriptModule class. | |
~LuaScriptModule () | |
Destructor for LuaScriptModule class. | |
~LuaScriptModule () | |
Destructor for LuaScriptModule class. | |
Private Member Functions | |
void | cleanupErrorHandlerFunc () |
bool | executeScriptedEventHandler_impl (const String &handler_name, const EventArgs &e, const int err_idx, const int top) |
Implementation function that executes a scripted event handler. | |
void | executeScriptFile_impl (const String &filename, const String &resourceGroup, const int err_idx, const int top) |
Implementation function that executes a scipt file. | |
int | executeScriptGlobal_impl (const String &function_name, const int err_idx, const int top) |
Implementation function that executes a global script function. | |
void | executeString_impl (const String &str, const int err_idx, const int top) |
Implementation function that executes script contained in a String. | |
int | initErrorHandlerFunc (int func) |
int | initErrorHandlerFunc (const String func_name) |
int | initErrorHandlerFunc () |
void | setModuleIdentifierString () |
void | setModuleIdentifierString () |
void | setModuleIdentifierString () |
void | setModuleIdentifierString () |
void | unrefErrorFunc () |
release any reference we might have made to an error handling function. | |
Private Attributes | |
int | d_activeErrFuncIndex |
String | d_activeErrFuncName |
int | d_errFuncIndex |
Default registry index of the function to pass to lua_pcall. | |
String | d_errFuncName |
Default error handler function to pass to lua_pcall. | |
bool | d_ownsState |
true when the attached lua_State was created by this script module | |
lua_State * | d_state |
The lua_State that this script module uses. |
CEGUI::LuaScriptModule::LuaScriptModule | ( | ) |
Constructor for LuaScriptModule class which create a lua_State.
References d_ownsState, d_state, and setModuleIdentifierString().
CEGUI::LuaScriptModule::LuaScriptModule | ( | lua_State * | state | ) |
Constructor for LuaScriptModule class which takes a lua_State.
state | Pointer to the lua_State that the script module should attach to. |
References d_ownsState, d_state, and setModuleIdentifierString().
CEGUI::LuaScriptModule::~LuaScriptModule | ( | ) |
CEGUI::LuaScriptModule::LuaScriptModule | ( | ) |
Constructor for LuaScriptModule class which create a lua_State.
CEGUI::LuaScriptModule::LuaScriptModule | ( | lua_State * | state | ) |
Constructor for LuaScriptModule class which takes a lua_State.
state | Pointer to the lua_State that the script module should attach to. |
CEGUI::LuaScriptModule::~LuaScriptModule | ( | ) |
Destructor for LuaScriptModule class.
CEGUI::LuaScriptModule::LuaScriptModule | ( | ) |
Constructor for LuaScriptModule class which create a lua_State.
CEGUI::LuaScriptModule::LuaScriptModule | ( | lua_State * | state | ) |
Constructor for LuaScriptModule class which takes a lua_State.
state | Pointer to the lua_State that the script module should attach to. |
CEGUI::LuaScriptModule::~LuaScriptModule | ( | ) |
Destructor for LuaScriptModule class.
CEGUI::LuaScriptModule::LuaScriptModule | ( | ) |
Constructor for LuaScriptModule class which create a lua_State.
CEGUI::LuaScriptModule::LuaScriptModule | ( | lua_State * | state | ) |
Constructor for LuaScriptModule class which takes a lua_State.
state | Pointer to the lua_State that the script module should attach to. |
CEGUI::LuaScriptModule::~LuaScriptModule | ( | ) |
Destructor for LuaScriptModule class.
void CEGUI::LuaScriptModule::cleanupErrorHandlerFunc | ( | ) | [private] |
do any needed cleanup after having called initErrorHandlerFunc and (possible) executed a script.
NB: This probably does less than you think ;)
References d_activeErrFuncIndex, and d_activeErrFuncName.
Referenced by executeScriptedEventHandler(), executeScriptFile(), executeScriptGlobal(), and executeString().
void CEGUI::LuaScriptModule::createBindings | ( | void | ) |
Method called during system initialisation, prior to running any scripts via the ScriptModule, to enable the ScriptModule to perform any operations required to complete initialisation or binding of the script language to the gui system objects.
void CEGUI::LuaScriptModule::createBindings | ( | void | ) |
Method called during system initialisation, prior to running any scripts via the ScriptModule, to enable the ScriptModule to perform any operations required to complete initialisation or binding of the script language to the gui system objects.
void CEGUI::LuaScriptModule::createBindings | ( | void | ) |
Method called during system initialisation, prior to running any scripts via the ScriptModule, to enable the ScriptModule to perform any operations required to complete initialisation or binding of the script language to the gui system objects.
void CEGUI::LuaScriptModule::createBindings | ( | void | ) |
Method called during system initialisation, prior to running any scripts via the ScriptModule, to enable the ScriptModule to perform any operations required to complete initialisation or binding of the script language to the gui system objects.
References d_state, and tolua_CEGUI_open().
void CEGUI::LuaScriptModule::destroyBindings | ( | void | ) |
Method called during system destruction, after all scripts have been run via the ScriptModule, to enable the ScriptModule to perform any operations required to cleanup bindings of the script language to the gui system objects, as set-up in the earlier createBindings call.
void CEGUI::LuaScriptModule::destroyBindings | ( | void | ) |
Method called during system destruction, after all scripts have been run via the ScriptModule, to enable the ScriptModule to perform any operations required to cleanup bindings of the script language to the gui system objects, as set-up in the earlier createBindings call.
void CEGUI::LuaScriptModule::destroyBindings | ( | void | ) |
Method called during system destruction, after all scripts have been run via the ScriptModule, to enable the ScriptModule to perform any operations required to cleanup bindings of the script language to the gui system objects, as set-up in the earlier createBindings call.
void CEGUI::LuaScriptModule::destroyBindings | ( | void | ) |
Method called during system destruction, after all scripts have been run via the ScriptModule, to enable the ScriptModule to perform any operations required to cleanup bindings of the script language to the gui system objects, as set-up in the earlier createBindings call.
References d_state.
bool CEGUI::LuaScriptModule::executeScriptedEventHandler | ( | const String & | handler_name, | |
const EventArgs & | e, | |||
const int | error_handler | |||
) |
Execute a scripted global 'event handler' function by looking it up by name.
handler_name | String object holding the name of the scripted handler function. If this string contains dots '.' it will be parsed as tables containing a function field. For example: 'mytable.subtable.func' | |
e | EventArgs based object that should be passed, by any appropriate means, to the scripted function. | |
error_handler | integer value describing a lua registry reference to the function that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References cleanupErrorHandlerFunc(), d_state, executeScriptedEventHandler_impl(), and initErrorHandlerFunc().
bool CEGUI::LuaScriptModule::executeScriptedEventHandler | ( | const String & | handler_name, | |
const EventArgs & | e, | |||
const String & | error_handler | |||
) |
Execute a scripted global 'event handler' function by looking it up by name.
handler_name | String object holding the name of the scripted handler function. If this string contains dots '.' it will be parsed as tables containing a function field. For example: 'mytable.subtable.func' | |
e | EventArgs based object that should be passed, by any appropriate means, to the scripted function. | |
error_handler | String containing the name of the script fuction that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References cleanupErrorHandlerFunc(), d_state, executeScriptedEventHandler_impl(), and initErrorHandlerFunc().
bool CEGUI::LuaScriptModule::executeScriptedEventHandler | ( | const String & | handler_name, | |
const EventArgs & | e | |||
) |
Execute a scripted global 'event handler' function by looking it up by name.
handler_name | String object holding the name of the scripted handler function. If this string contains dots '.' it will be parsed as tables containing a function field. For example: 'mytable.subtable.func' | |
e | EventArgs based object that should be passed, by any appropriate means, to the scripted function. |
bool CEGUI::LuaScriptModule::executeScriptedEventHandler | ( | const String & | handler_name, | |
const EventArgs & | e | |||
) |
Execute a scripted global 'event handler' function by looking it up by name.
handler_name | String object holding the name of the scripted handler function. If this string contains dots '.' it will be parsed as tables containing a function field. For example: 'mytable.subtable.func' | |
e | EventArgs based object that should be passed, by any appropriate means, to the scripted function. |
bool CEGUI::LuaScriptModule::executeScriptedEventHandler | ( | const String & | handler_name, | |
const EventArgs & | e | |||
) |
Execute a scripted global 'event handler' function by looking it up by name.
handler_name | String object holding the name of the scripted handler function. If this string contains dots '.' it will be parsed as tables containing a function field. For example: 'mytable.subtable.func' | |
e | EventArgs based object that should be passed, by any appropriate means, to the scripted function. |
bool CEGUI::LuaScriptModule::executeScriptedEventHandler | ( | const String & | handler_name, | |
const EventArgs & | e | |||
) |
Execute a scripted global 'event handler' function by looking it up by name.
handler_name | String object holding the name of the scripted handler function. If this string contains dots '.' it will be parsed as tables containing a function field. For example: 'mytable.subtable.func' | |
e | EventArgs based object that should be passed, by any appropriate means, to the scripted function. |
References d_state, CEGUI::LuaFunctor::pushNamedFunction(), orxonox::MT_Type::String, and tolua_pushusertype().
bool CEGUI::LuaScriptModule::executeScriptedEventHandler_impl | ( | const String & | handler_name, | |
const EventArgs & | e, | |||
const int | err_idx, | |||
const int | top | |||
) | [private] |
Implementation function that executes a scripted event handler.
References d_state, CEGUI::LuaFunctor::pushNamedFunction(), orxonox::MT_Type::String, and tolua_pushusertype().
Referenced by executeScriptedEventHandler().
void CEGUI::LuaScriptModule::executeScriptFile | ( | const String & | filename, | |
const String & | resourceGroup, | |||
const int | error_handler | |||
) |
Execute a script file.
filename | String object holding the filename of the script file that is to be executed. | |
resourceGroup | Resource group idendifier to be passed to the ResourceProvider when loading the script file. | |
error_handler | integer value describing a lua registry reference to the function that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References cleanupErrorHandlerFunc(), d_state, executeScriptFile_impl(), and initErrorHandlerFunc().
void CEGUI::LuaScriptModule::executeScriptFile | ( | const String & | filename, | |
const String & | resourceGroup, | |||
const String & | error_handler | |||
) |
Execute a script file.
filename | String object holding the filename of the script file that is to be executed. | |
resourceGroup | Resource group idendifier to be passed to the ResourceProvider when loading the script file. | |
error_handler | String containing the name of the script fuction that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References cleanupErrorHandlerFunc(), d_state, executeScriptFile_impl(), and initErrorHandlerFunc().
void CEGUI::LuaScriptModule::executeScriptFile | ( | const String & | filename, | |
const String & | resourceGroup | |||
) |
Execute a script file.
filename | String object holding the filename of the script file that is to be executed. | |
resourceGroup | Resource group idendifier to be passed to the ResourceProvider when loading the script file. |
void CEGUI::LuaScriptModule::executeScriptFile | ( | const String & | filename, | |
const String & | resourceGroup | |||
) |
Execute a script file.
filename | String object holding the filename of the script file that is to be executed | |
resourceGroup | Resource group idendifier to be passed to the ResourceProvider when loading the script file. |
void CEGUI::LuaScriptModule::executeScriptFile | ( | const String & | filename, | |
const String & | resourceGroup | |||
) |
Execute a script file.
filename | String object holding the filename of the script file that is to be executed | |
resourceGroup | Resource group idendifier to be passed to the ResourceProvider when loading the script file. |
void CEGUI::LuaScriptModule::executeScriptFile | ( | const String & | filename, | |
const String & | resourceGroup | |||
) |
Execute a script file.
filename | String object holding the filename of the script file that is to be executed | |
resourceGroup | Resource group idendifier to be passed to the ResourceProvider when loading the script file. |
References d_state, and orxonox::MT_Type::String.
Referenced by orxonox::GUIManager::loadLuaCode().
void CEGUI::LuaScriptModule::executeScriptFile_impl | ( | const String & | filename, | |
const String & | resourceGroup, | |||
const int | err_idx, | |||
const int | top | |||
) | [private] |
Implementation function that executes a scipt file.
References d_state, and orxonox::MT_Type::String.
Referenced by executeScriptFile().
int CEGUI::LuaScriptModule::executeScriptGlobal | ( | const String & | function_name, | |
const int | error_handler | |||
) |
Execute a scripted global function. The function should not take any parameters and should return an integer.
function_name | String object holding the name of the function, in the global script environment, that is to be executed. | |
error_handler | integer value describing a lua registry reference to the function that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References cleanupErrorHandlerFunc(), d_state, executeScriptGlobal_impl(), and initErrorHandlerFunc().
int CEGUI::LuaScriptModule::executeScriptGlobal | ( | const String & | function_name, | |
const String & | error_handler | |||
) |
Execute a scripted global function. The function should not take any parameters and should return an integer.
function_name | String object holding the name of the function, in the global script environment, that is to be executed. | |
error_handler | String containing the name of the script fuction that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References cleanupErrorHandlerFunc(), d_state, executeScriptGlobal_impl(), and initErrorHandlerFunc().
int CEGUI::LuaScriptModule::executeScriptGlobal | ( | const String & | function_name | ) |
Execute a scripted global function. The function should not take any parameters and should return an integer.
function_name | String object holding the name of the function, in the global script environment, that is to be executed. |
int CEGUI::LuaScriptModule::executeScriptGlobal | ( | const String & | function_name | ) |
Execute a scripted global function. The function should not take any parameters and should return an integer.
function_name | String object holding the name of the function, in the global script environment, that is to be executed. |
int CEGUI::LuaScriptModule::executeScriptGlobal | ( | const String & | function_name | ) |
Execute a scripted global function. The function should not take any parameters and should return an integer.
function_name | String object holding the name of the function, in the global script environment, that is to be executed. |
int CEGUI::LuaScriptModule::executeScriptGlobal | ( | const String & | function_name | ) |
Execute a scripted global function. The function should not take any parameters and should return an integer.
function_name | String object holding the name of the function, in the global script environment, that is to be executed. |
References d_state, and orxonox::MT_Type::String.
int CEGUI::LuaScriptModule::executeScriptGlobal_impl | ( | const String & | function_name, | |
const int | err_idx, | |||
const int | top | |||
) | [private] |
Implementation function that executes a global script function.
References d_state, and orxonox::MT_Type::String.
Referenced by executeScriptGlobal().
void CEGUI::LuaScriptModule::executeString | ( | const String & | str, | |
const int | error_handler | |||
) |
Execute script code contained in the given CEGUI::String object.
str | String object holding the valid script code that should be executed. | |
error_handler | integer value describing a lua registry reference to the function that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References cleanupErrorHandlerFunc(), d_state, executeString_impl(), and initErrorHandlerFunc().
void CEGUI::LuaScriptModule::executeString | ( | const String & | str, | |
const String & | error_handler | |||
) |
Execute script code contained in the given CEGUI::String object.
str | String object holding the valid script code that should be executed. | |
error_handler | String containing the name of the script fuction that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References cleanupErrorHandlerFunc(), d_state, executeString_impl(), and initErrorHandlerFunc().
void CEGUI::LuaScriptModule::executeString | ( | const String & | str | ) |
Execute script code contained in the given CEGUI::String object.
str | String object holding the valid script code that should be executed. |
void CEGUI::LuaScriptModule::executeString | ( | const String & | str | ) |
Execute script code contained in the given CEGUI::String object.
str | String object holding the valid script code that should be executed. |
void CEGUI::LuaScriptModule::executeString | ( | const String & | str | ) |
Execute script code contained in the given CEGUI::String object.
str | String object holding the valid script code that should be executed. |
void CEGUI::LuaScriptModule::executeString | ( | const String & | str | ) |
Execute script code contained in the given CEGUI::String object.
str | String object holding the valid script code that should be executed. |
References d_state, and orxonox::MT_Type::String.
Referenced by orxonox::GUIManager::executeCode(), and orxonox::GUIManager::showGUI().
void CEGUI::LuaScriptModule::executeString_impl | ( | const String & | str, | |
const int | err_idx, | |||
const int | top | |||
) | [private] |
Implementation function that executes script contained in a String.
References d_state, and orxonox::MT_Type::String.
Referenced by executeString().
int CEGUI::LuaScriptModule::getActivePCallErrorHandlerReference | ( | ) | const |
return the lua registry index of the active error handler function.
The 'active' error handler for the LuaScriptModule is either the default as specified by calling setDefaultPCallErrorHandler, or whatever might have been set up by a call to the internal initErrorHandlerFunc function.
References d_activeErrFuncIndex, d_activeErrFuncName, and d_errFuncIndex.
const String & CEGUI::LuaScriptModule::getActivePCallErrorHandlerString | ( | ) | const |
Return the function name string of the active error handler function.
The 'active' error handler for the LuaScriptModule is either the default as specified by calling setDefaultPCallErrorHandler, or whatever might have been set up by a call to the internal initErrorHandlerFunc function.
References d_activeErrFuncIndex, d_activeErrFuncName, and d_errFuncName.
lua_State* CEGUI::LuaScriptModule::getLuaState | ( | void | ) | const [inline] |
Method used to get a pointer to the lua_State that the script module is attached to.
lua_State* CEGUI::LuaScriptModule::getLuaState | ( | void | ) | const [inline] |
Method used to get a pointer to the lua_State that the script module is attached to.
lua_State* CEGUI::LuaScriptModule::getLuaState | ( | void | ) | const [inline] |
Method used to get a pointer to the lua_State that the script module is attached to.
lua_State* CEGUI::LuaScriptModule::getLuaState | ( | void | ) | const [inline] |
Method used to get a pointer to the lua_State that the script module is attached to.
Referenced by orxonox::GUIManager::getLevelList(), orxonox::GUIManager::initialise(), and orxonox::GUIManager::loadLuaCode().
int CEGUI::LuaScriptModule::initErrorHandlerFunc | ( | int | func | ) | [private] |
Init the error handler function. Return the lua stack index that should be passed to lua_pcall. NB: This should be called prior to pushing any function parameters onto the lua stack.
References d_activeErrFuncIndex, and d_state.
int CEGUI::LuaScriptModule::initErrorHandlerFunc | ( | const String | func_name | ) | [private] |
Init the error handler function. Return the lua stack index that should be passed to lua_pcall. NB: This should be called prior to pushing any function parameters onto the lua stack.
References d_activeErrFuncName, d_state, and CEGUI::LuaFunctor::pushNamedFunction().
int CEGUI::LuaScriptModule::initErrorHandlerFunc | ( | ) | [private] |
Init the error handler function. Return the lua stack index that should be passed to lua_pcall. NB: This should be called prior to pushing any function parameters onto the lua stack.
References d_activeErrFuncName, d_errFuncIndex, d_errFuncName, d_state, and CEGUI::LuaFunctor::pushNamedFunction().
Referenced by executeScriptedEventHandler(), executeScriptFile(), executeScriptGlobal(), and executeString().
void CEGUI::LuaScriptModule::setDefaultPCallErrorHandler | ( | int | function_reference | ) |
Set the function that will be passed as the error handler in calls to lua_pcall, unless an alternative is specified in some other function call.
function_reference | Lua function registry index of the function to be called. |
References d_errFuncIndex, d_errFuncName, and unrefErrorFunc().
void CEGUI::LuaScriptModule::setDefaultPCallErrorHandler | ( | const String & | error_handler_function | ) |
Set the name of the lua function that will be passed as the error handler in calls to lua_pcall, unless an alternative is specified in some other function call.
error_handler_function | Name of the lua function to be called. This is looked up / bound on first usage. |
References d_errFuncIndex, d_errFuncName, and unrefErrorFunc().
void CEGUI::LuaScriptModule::setModuleIdentifierString | ( | ) | [private] |
void CEGUI::LuaScriptModule::setModuleIdentifierString | ( | ) | [private] |
void CEGUI::LuaScriptModule::setModuleIdentifierString | ( | ) | [private] |
void CEGUI::LuaScriptModule::setModuleIdentifierString | ( | ) | [private] |
Referenced by LuaScriptModule().
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
Event::Group | group, | |||
const String & | subscriber_name, | |||
const int | error_handler | |||
) |
Subscribes the specified group of the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
group | Group which is to be subscribed to. Subscription groups are called in ascending order. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. | |
error_handler | integer value describing a lua registry reference to the function that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References CEGUI::LuaFunctor::d_errFuncIndex, d_state, and CEGUI::LuaFunctor::index.
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
Event::Group | group, | |||
const String & | subscriber_name, | |||
const String & | error_handler | |||
) |
Subscribes the specified group of the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
group | Group which is to be subscribed to. Subscription groups are called in ascending order. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. | |
error_handler | String containing the name of the script fuction that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References CEGUI::LuaFunctor::d_errFuncIndex, d_state, and CEGUI::LuaFunctor::index.
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
Event::Group | group, | |||
const String & | subscriber_name | |||
) |
Subscribes the specified group of the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
group | Group which is to be subscribed to. Subscription groups are called in ascending order. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. |
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
const String & | subscriber_name, | |||
const int | error_handler | |||
) |
Subscribes the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. | |
error_handler | integer value describing a lua registry reference to the function that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References CEGUI::LuaFunctor::d_errFuncIndex, d_state, and CEGUI::LuaFunctor::index.
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
const String & | subscriber_name, | |||
const String & | error_handler | |||
) |
Subscribes the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. | |
error_handler | String containing the name of the script fuction that will be called if an error occurs while executing the handler function. NB: This is the function passed as the error handler to lua_pcall. |
References CEGUI::LuaFunctor::d_errFuncIndex, d_state, and CEGUI::LuaFunctor::index.
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
const String & | subscriber_name | |||
) |
Subscribes the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. |
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
Event::Group | group, | |||
const String & | subscriber_name | |||
) |
Subscribes the specified group of the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
group | Group which is to be subscribed to. Subscription groups are called in ascending order. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. |
UnknownObjectException | Thrown if an Event named name is not in the EventSet |
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
const String & | subscriber_name | |||
) |
Subscribes the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. |
UnknownObjectException | Thrown if an Event named name is not in the EventSet |
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
Event::Group | group, | |||
const String & | subscriber_name | |||
) |
Subscribes the specified group of the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
group | Group which is to be subscribed to. Subscription groups are called in ascending order. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. |
UnknownObjectException | Thrown if an Event named name is not in the EventSet |
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
const String & | subscriber_name | |||
) |
Subscribes the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. |
UnknownObjectException | Thrown if an Event named name is not in the EventSet |
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
Event::Group | group, | |||
const String & | subscriber_name | |||
) |
Subscribes the specified group of the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
group | Group which is to be subscribed to. Subscription groups are called in ascending order. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. |
UnknownObjectException | Thrown if an Event named name is not in the EventSet |
References d_state.
Event::Connection CEGUI::LuaScriptModule::subscribeEvent | ( | EventSet * | target, | |
const String & | name, | |||
const String & | subscriber_name | |||
) |
Subscribes the named Event to a scripted funtion.
target | The target EventSet for the subscription. | |
name | String object containing the name of the Event to subscribe to. | |
subscriber_name | String object containing the name of the script funtion that is to be subscribed to the Event. |
UnknownObjectException | Thrown if an Event named name is not in the EventSet |
References d_state, and CEGUI::LuaFunctor::index.
void CEGUI::LuaScriptModule::unrefErrorFunc | ( | ) | [private] |
release any reference we might have made to an error handling function.
References d_errFuncIndex, d_errFuncName, and d_state.
Referenced by setDefaultPCallErrorHandler().
int CEGUI::LuaScriptModule::d_activeErrFuncIndex [private] |
Registry index of the function that is currently in use (as setup via a call to initErrorHandlerFunc)
Referenced by cleanupErrorHandlerFunc(), getActivePCallErrorHandlerReference(), getActivePCallErrorHandlerString(), and initErrorHandlerFunc().
String CEGUI::LuaScriptModule::d_activeErrFuncName [private] |
Error handler function that is currently in use (as setup via a call to initErrorHandlerFunc)
Referenced by cleanupErrorHandlerFunc(), getActivePCallErrorHandlerReference(), getActivePCallErrorHandlerString(), and initErrorHandlerFunc().
int CEGUI::LuaScriptModule::d_errFuncIndex [private] |
Default registry index of the function to pass to lua_pcall.
Referenced by getActivePCallErrorHandlerReference(), initErrorHandlerFunc(), setDefaultPCallErrorHandler(), and unrefErrorFunc().
String CEGUI::LuaScriptModule::d_errFuncName [private] |
Default error handler function to pass to lua_pcall.
Referenced by getActivePCallErrorHandlerString(), initErrorHandlerFunc(), setDefaultPCallErrorHandler(), and unrefErrorFunc().
bool CEGUI::LuaScriptModule::d_ownsState [private] |
true when the attached lua_State was created by this script module
Referenced by LuaScriptModule(), and ~LuaScriptModule().
lua_State * CEGUI::LuaScriptModule::d_state [private] |
The lua_State that this script module uses.
Referenced by createBindings(), destroyBindings(), executeScriptedEventHandler(), executeScriptedEventHandler_impl(), executeScriptFile(), executeScriptFile_impl(), executeScriptGlobal(), executeScriptGlobal_impl(), executeString(), executeString_impl(), initErrorHandlerFunc(), LuaScriptModule(), subscribeEvent(), unrefErrorFunc(), and ~LuaScriptModule().