Просмотр исходного кода

Merge branch 'next' of https://github.com/blackberry/GamePlay into next

setaylor 13 лет назад
Родитель
Сommit
1dd91ff4bb
56 измененных файлов с 855 добавлено и 933 удалено
  1. 3 3
      gameplay/src/AIAgent.cpp
  2. 5 0
      gameplay/src/AIAgent.h
  3. 2 13
      gameplay/src/AIController.cpp
  4. 5 0
      gameplay/src/AIMessage.cpp
  5. 16 5
      gameplay/src/AIMessage.h
  6. 6 6
      gameplay/src/AIState.cpp
  7. 1 0
      gameplay/src/AIState.h
  8. 8 7
      gameplay/src/AbsoluteLayout.h
  9. 1 0
      gameplay/src/Button.h
  10. 2 2
      gameplay/src/Control.cpp
  11. 7 7
      gameplay/src/FlowLayout.h
  12. 0 1
      gameplay/src/Font.h
  13. 2 2
      gameplay/src/PhysicsController.cpp
  14. 9 5
      gameplay/src/ScriptTarget.cpp
  15. 20 18
      gameplay/src/ScriptTarget.h
  16. 5 5
      gameplay/src/Transform.cpp
  17. 1 13
      gameplay/src/VerticalLayout.cpp
  18. 10 8
      gameplay/src/VerticalLayout.h
  19. 26 26
      gameplay/src/lua/lua_AIAgent.cpp
  20. 2 2
      gameplay/src/lua/lua_AIAgent.h
  21. 38 41
      gameplay/src/lua/lua_AIMessage.cpp
  22. 1 1
      gameplay/src/lua/lua_AIMessage.h
  23. 26 26
      gameplay/src/lua/lua_AIState.cpp
  24. 2 2
      gameplay/src/lua/lua_AIState.h
  25. 33 33
      gameplay/src/lua/lua_Button.cpp
  26. 2 2
      gameplay/src/lua/lua_Button.h
  27. 32 32
      gameplay/src/lua/lua_CheckBox.cpp
  28. 2 2
      gameplay/src/lua/lua_CheckBox.h
  29. 82 82
      gameplay/src/lua/lua_Container.cpp
  30. 2 2
      gameplay/src/lua/lua_Container.h
  31. 32 32
      gameplay/src/lua/lua_Control.cpp
  32. 2 2
      gameplay/src/lua/lua_Control.h
  33. 82 82
      gameplay/src/lua/lua_Form.cpp
  34. 2 2
      gameplay/src/lua/lua_Form.h
  35. 66 66
      gameplay/src/lua/lua_Joint.cpp
  36. 2 2
      gameplay/src/lua/lua_Joint.h
  37. 32 32
      gameplay/src/lua/lua_Joystick.cpp
  38. 2 2
      gameplay/src/lua/lua_Joystick.h
  39. 32 32
      gameplay/src/lua/lua_Label.cpp
  40. 2 2
      gameplay/src/lua/lua_Label.h
  41. 66 66
      gameplay/src/lua/lua_Node.cpp
  42. 2 2
      gameplay/src/lua/lua_Node.h
  43. 8 8
      gameplay/src/lua/lua_PhysicsController.cpp
  44. 2 2
      gameplay/src/lua/lua_PhysicsController.h
  45. 32 32
      gameplay/src/lua/lua_RadioButton.cpp
  46. 2 2
      gameplay/src/lua/lua_RadioButton.h
  47. 9 49
      gameplay/src/lua/lua_ScriptTarget.cpp
  48. 2 3
      gameplay/src/lua/lua_ScriptTarget.h
  49. 32 32
      gameplay/src/lua/lua_Slider.cpp
  50. 2 2
      gameplay/src/lua/lua_Slider.h
  51. 32 32
      gameplay/src/lua/lua_TextBox.cpp
  52. 2 2
      gameplay/src/lua/lua_TextBox.h
  53. 56 56
      gameplay/src/lua/lua_Transform.cpp
  54. 2 2
      gameplay/src/lua/lua_Transform.h
  55. 1 42
      gameplay/src/lua/lua_VerticalLayout.cpp
  56. 0 1
      gameplay/src/lua/lua_VerticalLayout.h

+ 3 - 3
gameplay/src/AIAgent.cpp

@@ -6,11 +6,11 @@ namespace gameplay
 {
 
 AIAgent::AIAgent()
-    : _stateMachine(NULL), _node(NULL), _enabled(true), _next(NULL)
+    : _stateMachine(NULL), _node(NULL), _enabled(true), _listener(NULL), _next(NULL)
 {
     _stateMachine = new AIStateMachine(this);
 
-    addEvent("message", "<AIMessage>");
+    addScriptEvent("message", "<AIMessage>");
 }
 
 AIAgent::~AIAgent()
@@ -84,7 +84,7 @@ bool AIAgent::processMessage(AIMessage* message)
     if (_listener && _listener->messageReceived(message))
         return true;
     
-    if (fireEvent<bool>("message", message))
+    if (fireScriptEvent<bool>("message", message))
         return true;
     
     return false;

+ 5 - 0
gameplay/src/AIAgent.h

@@ -59,12 +59,17 @@ public:
      * Creates a new AIAgent.
      *
      * @return A new AIAgent.
+     * @script{create}
      */
     static AIAgent* create();
 
     /**
      * Returns the identifier for the AIAgent.
      *
+     * This method simply returns the ID of the Node which this AIAgent
+     * is bound to. If this AIAgent is not bound to a Node, this method
+     * returns an empty string.
+     *
      * @return The identifier for the agent.
      */
     const char* getId() const;

+ 2 - 13
gameplay/src/AIController.cpp

@@ -2,17 +2,6 @@
 #include "AIController.h"
 #include "Game.h"
 
-// TODO:
-//
-// 1) Is std::string OK for message sender/receiver?
-// 2) Is AIMessage ok and is "dobule" ok for message parameters?
-// 3) Design of creating and deleting message (AIController deletes them)??
-// 4) Is setListener(Listener*) OK for AIState and AIStateMachine, or do we need addListener(Listener*)???
-
-// TODO: Add a way to snif messages on AIController??
-
-// TODO: only dispatch messages to agents that are in this list AND enabled. If not in the list, discard the message (and log) and if they are in the list and DISABLED, just hold on to the message until they are re-enabled.
-
 namespace gameplay
 {
 
@@ -47,7 +36,7 @@ void AIController::finalize()
     {
         AIMessage* temp = message;
         message = message->_next;
-        SAFE_DELETE(temp);
+        AIMessage::destroy(temp);
     }
     _firstMessage = NULL;
 }
@@ -93,7 +82,7 @@ void AIController::sendMessage(AIMessage* message, float delay)
         }
 
         // Delete the message, since it is finished being processed
-        SAFE_DELETE(message);
+        AIMessage::destroy(message);
     }
     else
     {

+ 5 - 0
gameplay/src/AIMessage.cpp

@@ -26,6 +26,11 @@ AIMessage* AIMessage::create(unsigned int id, const char* sender, const char* re
     return message;
 }
 
+void AIMessage::destroy(AIMessage* message)
+{
+    SAFE_DELETE(message);
+}
+
 unsigned int AIMessage::getId() const
 {
     return _id;

+ 16 - 5
gameplay/src/AIMessage.h

@@ -34,11 +34,6 @@ public:
         STRING
     };
 
-    /** 
-     * Destructor.
-     */
-    ~AIMessage();
-
     /**
      * Creates a new message.
      *
@@ -58,6 +53,17 @@ public:
      */
     static AIMessage* create(unsigned int id, const char* sender, const char* receiver, unsigned int parameterCount);
 
+    /**
+     * Destroys an AIMessage.
+     *
+     * Under normal circumstances this method does not need to be called since the
+     * AIController will automatically destroy an AIMessage once it has been 
+     * sent. However, in the rare case where an AIMessage is constructed and not
+     * passed to AIController::sendMessage, this method should be called to destroy
+     * the message.
+     */
+    static void destroy(AIMessage* message);
+
     /**
      * Returns the message ID.
      *
@@ -247,6 +253,11 @@ private:
      */
     AIMessage& operator=(const AIMessage&);
 
+    /**
+     * Destructor (hidden - use AIMessage::destroy instead).
+     */
+    ~AIMessage();
+
     /**
      * Returns the delivery time for the message.
      *

+ 6 - 6
gameplay/src/AIState.cpp

@@ -10,9 +10,9 @@ AIState* AIState::_empty = NULL;
 AIState::AIState(const char* id)
     : _id(id), _listener(NULL)
 {
-    addEvent("enter", "<AIAgent><AIState>");
-    addEvent("exit", "<AIAgent><AIState>");
-    addEvent("update", "<AIAgent><AIState>f");
+    addScriptEvent("enter", "<AIAgent><AIState>");
+    addScriptEvent("exit", "<AIAgent><AIState>");
+    addScriptEvent("update", "<AIAgent><AIState>f");
 }
 
 AIState::~AIState()
@@ -39,7 +39,7 @@ void AIState::enter(AIStateMachine* stateMachine)
     if (_listener)
         _listener->stateEnter(stateMachine->getAgent(), this);
 
-    fireEvent<void>("enter", stateMachine->getAgent(), this);
+    fireScriptEvent<void>("enter", stateMachine->getAgent(), this);
 }
 
 void AIState::exit(AIStateMachine* stateMachine)
@@ -47,7 +47,7 @@ void AIState::exit(AIStateMachine* stateMachine)
     if (_listener)
         _listener->stateExit(stateMachine->getAgent(), this);
 
-    fireEvent<void>("exit", stateMachine->getAgent(), this);
+    fireScriptEvent<void>("exit", stateMachine->getAgent(), this);
 }
 
 void AIState::update(AIStateMachine* stateMachine, float elapsedTime)
@@ -55,7 +55,7 @@ void AIState::update(AIStateMachine* stateMachine, float elapsedTime)
     if (_listener)
         _listener->stateUpdate(stateMachine->getAgent(), this, elapsedTime);
 
-    fireEvent<void>("update", stateMachine->getAgent(), this);
+    fireScriptEvent<void>("update", stateMachine->getAgent(), this, elapsedTime);
 }
 
 AIState::Listener::~Listener()

+ 1 - 0
gameplay/src/AIState.h

@@ -71,6 +71,7 @@ public:
      * @param id The ID of the new AIState.
      *
      * @return The new AIState.
+     * @script{create}
      */
     static AIState* create(const char* id);
 

+ 8 - 7
gameplay/src/AbsoluteLayout.h

@@ -26,13 +26,6 @@ public:
 
 protected:
 
-    /**
-     * Create an AbsoluteLayout.
-     *
-     * @return An AbsoluteLayout object.
-     */
-    static AbsoluteLayout* create();
-
     /**
      * Update the controls contained by the specified container.
      *
@@ -60,6 +53,14 @@ private:
      * Destructor.
      */
     virtual ~AbsoluteLayout();
+
+    /**
+     * Create an AbsoluteLayout.
+     *
+     * @return An AbsoluteLayout object.
+     */
+    static AbsoluteLayout* create();
+
 };
 
 }

+ 1 - 0
gameplay/src/Button.h

@@ -43,6 +43,7 @@ public:
      * @param style The control's style.
      *
      * @return The new button.
+     * @script{create}
      */
     static Button* create(const char* id, Theme::Style* style);
 

+ 2 - 2
gameplay/src/Control.cpp

@@ -10,7 +10,7 @@ Control::Control()
     _clearBounds(Rectangle::empty()), _dirty(true), _consumeInputEvents(true), _listeners(NULL),
     _contactIndex(INVALID_CONTACT_INDEX), _styleOverridden(false), _skin(NULL)
 {
-    addEvent("controlEvent", "<Control>[Control::Listener::EventType]");
+    addScriptEvent("controlEvent", "<Control>[Control::Listener::EventType]");
 }
 
 Control::~Control()
@@ -790,7 +790,7 @@ void Control::notifyListeners(Listener::EventType eventType)
         }
     }
 
-    fireEvent<void>("controlEvent", this, eventType);
+    fireScriptEvent<void>("controlEvent", this, eventType);
 }
 
 void Control::update(const Control* container, const Vector2& offset)

+ 7 - 7
gameplay/src/FlowLayout.h

@@ -25,13 +25,6 @@ public:
 
 protected:
 
-    /**
-     * Create a FlowLayout.
-     *
-     * @return A FlowLayout object.
-     */
-    static FlowLayout* create();
-
     /**
      * Update the controls contained by the specified container.
      *
@@ -57,6 +50,13 @@ private:
      */
     virtual ~FlowLayout();
 
+    /**
+     * Create a FlowLayout.
+     *
+     * @return A FlowLayout object.
+     */
+    static FlowLayout* create();
+
 };
 
 }

+ 0 - 1
gameplay/src/Font.h

@@ -288,7 +288,6 @@ private:
      * @param texture A texture map containing rendered glyphs.
      * 
      * @return The new Font.
-     * @script{create}
      */
     static Font* create(const char* family, Style style, unsigned int size, Glyph* glyphs, int glyphCount, Texture* texture);
 

+ 2 - 2
gameplay/src/PhysicsController.cpp

@@ -28,7 +28,7 @@ PhysicsController::PhysicsController()
     // Default gravity is 9.8 along the negative Y axis.
     _collisionCallback = new CollisionCallback(this);
 
-    addEvent("statusEvent", "[PhysicsController::Listener::EventType]");
+    addScriptEvent("statusEvent", "[PhysicsController::Listener::EventType]");
 }
 
 PhysicsController::~PhysicsController()
@@ -521,7 +521,7 @@ void PhysicsController::update(float elapsedTime)
                 }
             }
 
-            fireEvent<void>("statusEvent", _status);
+            fireScriptEvent<void>("statusEvent", _status);
         }
     }
 

+ 9 - 5
gameplay/src/ScriptTarget.cpp

@@ -7,6 +7,10 @@ namespace gameplay
 
 extern void splitURL(const std::string& url, std::string* file, std::string* id);
 
+ScriptTarget::ScriptTarget()
+{
+}
+
 ScriptTarget::~ScriptTarget()
 {
     std::map<std::string, std::vector<Callback>* >::iterator iter = _callbacks.begin();
@@ -16,7 +20,7 @@ ScriptTarget::~ScriptTarget()
     }
 }
 
-template<> void ScriptTarget::fireEvent<void>(const char* eventName, ...)
+template<> void ScriptTarget::fireScriptEvent<void>(const char* eventName, ...)
 {
     va_list list;
     va_start(list, eventName);
@@ -45,7 +49,7 @@ template<> void ScriptTarget::fireEvent<void>(const char* eventName, ...)
     va_end(list);
 }
 
-template<> bool ScriptTarget::fireEvent<bool>(const char* eventName, ...)
+template<> bool ScriptTarget::fireScriptEvent<bool>(const char* eventName, ...)
 {
     va_list list;
     va_start(list, eventName);
@@ -83,7 +87,7 @@ template<> bool ScriptTarget::fireEvent<bool>(const char* eventName, ...)
     return false;
 }
 
-void ScriptTarget::addCallback(const std::string& eventName, const std::string& function)
+void ScriptTarget::addScriptCallback(const std::string& eventName, const std::string& function)
 {
     std::map<std::string, std::vector<Callback>* >::iterator iter = _callbacks.find(eventName);
     if (iter != _callbacks.end())
@@ -101,7 +105,7 @@ void ScriptTarget::addCallback(const std::string& eventName, const std::string&
     }
 }
 
-void ScriptTarget::removeCallback(const std::string& eventName, const std::string& function)
+void ScriptTarget::removeScriptCallback(const std::string& eventName, const std::string& function)
 {
     std::map<std::string, std::vector<Callback>* >::iterator iter = _callbacks.find(eventName);
     if (iter != _callbacks.end())
@@ -133,7 +137,7 @@ void ScriptTarget::removeCallback(const std::string& eventName, const std::strin
     }
 }
 
-void ScriptTarget::addEvent(const std::string& eventName, const char* argsString)
+void ScriptTarget::addScriptEvent(const std::string& eventName, const char* argsString)
 {
     _events[eventName] = (argsString ? argsString : "");
     _callbacks[eventName] = NULL;

+ 20 - 18
gameplay/src/ScriptTarget.h

@@ -12,17 +12,6 @@ namespace gameplay
 class ScriptTarget
 {
 public:
-    /**
-     * Destructor.
-     */
-    virtual ~ScriptTarget();
-
-    /**
-     * Fires the event with the given event name and the given arguments.
-     * 
-     * @param eventName The name of the event.
-     */
-    template<typename T> T fireEvent(const char* eventName, ...);
 
     /**
      * Adds the given Lua script function as a callback for the given event.
@@ -32,7 +21,7 @@ public:
      *      just the name of a function (if the function's script file has already been loaded), or can be
      *      a URL of the form scriptFile.lua#functionName.
      */
-    virtual void addCallback(const std::string& eventName, const std::string& function);
+    virtual void addScriptCallback(const std::string& eventName, const std::string& function);
 
     /**
      * Removes the given Lua script function as a callback for the given event.
@@ -40,13 +29,19 @@ public:
      * @param eventName The name of the event.
      * @param function The name of the Lua script function.
      */
-    virtual void removeCallback(const std::string& eventName, const std::string& function);
+    virtual void removeScriptCallback(const std::string& eventName, const std::string& function);
 
 protected:
+
     /**
      * Hidden constructor.
      */
-    ScriptTarget() {}
+    ScriptTarget();
+
+    /**
+     * Destructor.
+     */
+    virtual ~ScriptTarget();
 
     /**
      * Adds the given event with the given Lua script parameter string ({@link ScriptController::executeFunction})
@@ -55,7 +50,14 @@ protected:
      * @param eventName The name of the event.
      * @param argsString The argument string for the event.
      */
-    void addEvent(const std::string& eventName, const char* argsString = NULL);
+    void addScriptEvent(const std::string& eventName, const char* argsString = NULL);
+
+    /**
+     * Fires the event with the given event name and the given arguments.
+     * 
+     * @param eventName The name of the event.
+     */
+    template<typename T> T fireScriptEvent(const char* eventName, ...);
 
     /** Used to store a script callbacks for given event. */
     struct Callback
@@ -73,15 +75,15 @@ protected:
     std::map<std::string, std::vector<Callback>*> _callbacks;
 };
 
-template<typename T> T ScriptTarget::fireEvent(const char* eventName, ...)
+template<typename T> T ScriptTarget::fireScriptEvent(const char* eventName, ...)
 {
     GP_ERROR("Unsupported return type!");
 }
 
 /** Template specialization. */
-template<> void ScriptTarget::fireEvent<void>(const char* eventName, ...);
+template<> void ScriptTarget::fireScriptEvent<void>(const char* eventName, ...);
 /** Template specialization. */
-template<> bool ScriptTarget::fireEvent<bool>(const char* eventName, ...);
+template<> bool ScriptTarget::fireScriptEvent<bool>(const char* eventName, ...);
 
 }
 

+ 5 - 5
gameplay/src/Transform.cpp

@@ -14,7 +14,7 @@ Transform::Transform()
 {
     _targetType = AnimationTarget::TRANSFORM;
     _scale.set(Vector3::one());
-    addEvent("transformChanged", "<Transform>");
+    addScriptEvent("transformChanged", "<Transform>");
 }
 
 Transform::Transform(const Vector3& scale, const Quaternion& rotation, const Vector3& translation)
@@ -22,7 +22,7 @@ Transform::Transform(const Vector3& scale, const Quaternion& rotation, const Vec
 {
     _targetType = AnimationTarget::TRANSFORM;
     set(scale, rotation, translation);
-    addEvent("transformChanged", "<Transform>");
+    addScriptEvent("transformChanged", "<Transform>");
 }
 
 Transform::Transform(const Vector3& scale, const Matrix& rotation, const Vector3& translation)
@@ -30,7 +30,7 @@ Transform::Transform(const Vector3& scale, const Matrix& rotation, const Vector3
 {
     _targetType = AnimationTarget::TRANSFORM;
     set(scale, rotation, translation);
-    addEvent("transformChanged", "<Transform>");
+    addScriptEvent("transformChanged", "<Transform>");
 }
 
 Transform::Transform(const Transform& copy)
@@ -38,7 +38,7 @@ Transform::Transform(const Transform& copy)
 {
     _targetType = AnimationTarget::TRANSFORM;
     set(copy);
-    addEvent("transformChanged", "<Transform>");
+    addScriptEvent("transformChanged", "<Transform>");
 }
 
 Transform::~Transform()
@@ -847,7 +847,7 @@ void Transform::transformChanged()
             l.listener->transformChanged(this, l.cookie);
         }
     }
-    fireEvent<void>("transformChanged", this);
+    fireScriptEvent<void>("transformChanged", this);
 }
 
 void Transform::cloneInto(Transform* transform, NodeCloneContext &context) const

+ 1 - 13
gameplay/src/VerticalLayout.cpp

@@ -4,29 +4,17 @@
 namespace gameplay
 {
 
-static VerticalLayout* __instance;
-
 VerticalLayout::VerticalLayout() : _bottomToTop(false)
 {
 }
 
 VerticalLayout::~VerticalLayout()
 {
-    __instance = NULL;
 }
 
 VerticalLayout* VerticalLayout::create()
 {
-    if (!__instance)
-    {
-        __instance = new VerticalLayout();
-    }
-    else
-    {
-        __instance->addRef();
-    }
-
-    return __instance;
+    return new VerticalLayout();
 }
 
 void VerticalLayout::setBottomToTop(bool bottomToTop)

+ 10 - 8
gameplay/src/VerticalLayout.h

@@ -13,17 +13,11 @@ namespace gameplay
  */
 class VerticalLayout : public Layout
 {
+    friend class Form;
+    friend class Container;
 
 public:
 
-    /**
-     * Create a VerticalLayout.
-     *
-     * @return a VerticalLayout object.
-     * @script{create}
-     */
-    static VerticalLayout* create();
-
     /**
      * Set whether this layout will start laying out controls from the bottom of the container.
      * This setting defaults to 'false', meaning controls will start at the top.
@@ -81,6 +75,14 @@ private:
      * Constructor.
      */
     VerticalLayout(const VerticalLayout& copy);
+
+    /**
+     * Create a VerticalLayout.
+     *
+     * @return a VerticalLayout object.
+     */
+    static VerticalLayout* create();
+
 };
 
 }

+ 26 - 26
gameplay/src/lua/lua_AIAgent.cpp

@@ -16,15 +16,15 @@ void luaRegister_AIAgent()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_AIAgent_addCallback},
         {"addRef", lua_AIAgent_addRef},
+        {"addScriptCallback", lua_AIAgent_addScriptCallback},
         {"getId", lua_AIAgent_getId},
         {"getNode", lua_AIAgent_getNode},
         {"getRefCount", lua_AIAgent_getRefCount},
         {"getStateMachine", lua_AIAgent_getStateMachine},
         {"isEnabled", lua_AIAgent_isEnabled},
         {"release", lua_AIAgent_release},
-        {"removeCallback", lua_AIAgent_removeCallback},
+        {"removeScriptCallback", lua_AIAgent_removeScriptCallback},
         {"setEnabled", lua_AIAgent_setEnabled},
         {"setListener", lua_AIAgent_setListener},
         {NULL, NULL}
@@ -86,7 +86,7 @@ int lua_AIAgent__gc(lua_State* state)
     return 0;
 }
 
-int lua_AIAgent_addCallback(lua_State* state)
+int lua_AIAgent_addRef(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -94,33 +94,25 @@ int lua_AIAgent_addCallback(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 1:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
-                // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
-
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
-
                 AIAgent* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addRef();
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_AIAgent_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_AIAgent_addRef - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
             lua_error(state);
             break;
         }
@@ -128,7 +120,7 @@ int lua_AIAgent_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_AIAgent_addRef(lua_State* state)
+int lua_AIAgent_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -136,25 +128,33 @@ int lua_AIAgent_addRef(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 1:
+        case 3:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
                 AIAgent* instance = getInstance(state);
-                instance->addRef();
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_AIAgent_addRef - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_AIAgent_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -399,7 +399,7 @@ int lua_AIAgent_release(lua_State* state)
     return 0;
 }
 
-int lua_AIAgent_removeCallback(lua_State* state)
+int lua_AIAgent_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -420,13 +420,13 @@ int lua_AIAgent_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 AIAgent* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_AIAgent_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_AIAgent_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -532,7 +532,7 @@ int lua_AIAgent_static_create(lua_State* state)
             {
                 ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                 object->instance = returnPtr;
-                object->owns = false;
+                object->owns = true;
                 luaL_getmetatable(state, "AIAgent");
                 lua_setmetatable(state, -2);
             }

+ 2 - 2
gameplay/src/lua/lua_AIAgent.h

@@ -6,15 +6,15 @@ namespace gameplay
 
 // Lua bindings for AIAgent.
 int lua_AIAgent__gc(lua_State* state);
-int lua_AIAgent_addCallback(lua_State* state);
 int lua_AIAgent_addRef(lua_State* state);
+int lua_AIAgent_addScriptCallback(lua_State* state);
 int lua_AIAgent_getId(lua_State* state);
 int lua_AIAgent_getNode(lua_State* state);
 int lua_AIAgent_getRefCount(lua_State* state);
 int lua_AIAgent_getStateMachine(lua_State* state);
 int lua_AIAgent_isEnabled(lua_State* state);
 int lua_AIAgent_release(lua_State* state);
-int lua_AIAgent_removeCallback(lua_State* state);
+int lua_AIAgent_removeScriptCallback(lua_State* state);
 int lua_AIAgent_setEnabled(lua_State* state);
 int lua_AIAgent_setListener(lua_State* state);
 int lua_AIAgent_static_create(lua_State* state);

+ 38 - 41
gameplay/src/lua/lua_AIMessage.cpp

@@ -34,11 +34,12 @@ void luaRegister_AIMessage()
     const luaL_Reg lua_statics[] = 
     {
         {"create", lua_AIMessage_static_create},
+        {"destroy", lua_AIMessage_static_destroy},
         {NULL, NULL}
     };
     std::vector<std::string> scopePath;
 
-    ScriptUtil::registerClass("AIMessage", lua_members, NULL, lua_AIMessage__gc, lua_statics, scopePath);
+    ScriptUtil::registerClass("AIMessage", lua_members, NULL, NULL, lua_statics, scopePath);
 }
 
 static AIMessage* getInstance(lua_State* state)
@@ -48,46 +49,6 @@ static AIMessage* getInstance(lua_State* state)
     return (AIMessage*)((ScriptUtil::LuaObject*)userdata)->instance;
 }
 
-int lua_AIMessage__gc(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                void* userdata = luaL_checkudata(state, 1, "AIMessage");
-                luaL_argcheck(state, userdata != NULL, 1, "'AIMessage' expected.");
-                ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)userdata;
-                if (object->owns)
-                {
-                    AIMessage* instance = (AIMessage*)object->instance;
-                    SAFE_DELETE(instance);
-                }
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_AIMessage__gc - Failed to match the given parameters to a valid function signature.");
-                lua_error(state);
-            }
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_AIMessage_getBoolean(lua_State* state)
 {
     // Get the number of parameters.
@@ -835,4 +796,40 @@ int lua_AIMessage_static_create(lua_State* state)
     return 0;
 }
 
+int lua_AIMessage_static_destroy(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 1:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA || lua_type(state, 1) == LUA_TTABLE || lua_type(state, 1) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                AIMessage* param1 = ScriptUtil::getObjectPointer<AIMessage>(1, "AIMessage", false);
+
+                AIMessage::destroy(param1);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_AIMessage_static_destroy - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 }

+ 1 - 1
gameplay/src/lua/lua_AIMessage.h

@@ -5,7 +5,6 @@ namespace gameplay
 {
 
 // Lua bindings for AIMessage.
-int lua_AIMessage__gc(lua_State* state);
 int lua_AIMessage_getBoolean(lua_State* state);
 int lua_AIMessage_getDouble(lua_State* state);
 int lua_AIMessage_getFloat(lua_State* state);
@@ -24,6 +23,7 @@ int lua_AIMessage_setInt(lua_State* state);
 int lua_AIMessage_setLong(lua_State* state);
 int lua_AIMessage_setString(lua_State* state);
 int lua_AIMessage_static_create(lua_State* state);
+int lua_AIMessage_static_destroy(lua_State* state);
 
 void luaRegister_AIMessage();
 

+ 26 - 26
gameplay/src/lua/lua_AIState.cpp

@@ -16,12 +16,12 @@ void luaRegister_AIState()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_AIState_addCallback},
         {"addRef", lua_AIState_addRef},
+        {"addScriptCallback", lua_AIState_addScriptCallback},
         {"getId", lua_AIState_getId},
         {"getRefCount", lua_AIState_getRefCount},
         {"release", lua_AIState_release},
-        {"removeCallback", lua_AIState_removeCallback},
+        {"removeScriptCallback", lua_AIState_removeScriptCallback},
         {"setListener", lua_AIState_setListener},
         {NULL, NULL}
     };
@@ -82,7 +82,7 @@ int lua_AIState__gc(lua_State* state)
     return 0;
 }
 
-int lua_AIState_addCallback(lua_State* state)
+int lua_AIState_addRef(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -90,33 +90,25 @@ int lua_AIState_addCallback(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 1:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
-                // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
-
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
-
                 AIState* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addRef();
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_AIState_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_AIState_addRef - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
             lua_error(state);
             break;
         }
@@ -124,7 +116,7 @@ int lua_AIState_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_AIState_addRef(lua_State* state)
+int lua_AIState_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -132,25 +124,33 @@ int lua_AIState_addRef(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 1:
+        case 3:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
                 AIState* instance = getInstance(state);
-                instance->addRef();
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_AIState_addRef - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_AIState_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -266,7 +266,7 @@ int lua_AIState_release(lua_State* state)
     return 0;
 }
 
-int lua_AIState_removeCallback(lua_State* state)
+int lua_AIState_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -287,13 +287,13 @@ int lua_AIState_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 AIState* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_AIState_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_AIState_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -366,7 +366,7 @@ int lua_AIState_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "AIState");
                     lua_setmetatable(state, -2);
                 }

+ 2 - 2
gameplay/src/lua/lua_AIState.h

@@ -6,12 +6,12 @@ namespace gameplay
 
 // Lua bindings for AIState.
 int lua_AIState__gc(lua_State* state);
-int lua_AIState_addCallback(lua_State* state);
 int lua_AIState_addRef(lua_State* state);
+int lua_AIState_addScriptCallback(lua_State* state);
 int lua_AIState_getId(lua_State* state);
 int lua_AIState_getRefCount(lua_State* state);
 int lua_AIState_release(lua_State* state);
-int lua_AIState_removeCallback(lua_State* state);
+int lua_AIState_removeScriptCallback(lua_State* state);
 int lua_AIState_setListener(lua_State* state);
 int lua_AIState_static_create(lua_State* state);
 

+ 33 - 33
gameplay/src/lua/lua_Button.cpp

@@ -25,9 +25,9 @@ void luaRegister_Button()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_Button_addCallback},
         {"addListener", lua_Button_addListener},
         {"addRef", lua_Button_addRef},
+        {"addScriptCallback", lua_Button_addScriptCallback},
         {"createAnimation", lua_Button_createAnimation},
         {"createAnimationFromBy", lua_Button_createAnimationFromBy},
         {"createAnimationFromTo", lua_Button_createAnimationFromTo},
@@ -75,7 +75,7 @@ void luaRegister_Button()
         {"isContainer", lua_Button_isContainer},
         {"isEnabled", lua_Button_isEnabled},
         {"release", lua_Button_release},
-        {"removeCallback", lua_Button_removeCallback},
+        {"removeScriptCallback", lua_Button_removeScriptCallback},
         {"setAlignment", lua_Button_setAlignment},
         {"setAnimationPropertyValue", lua_Button_setAnimationPropertyValue},
         {"setAutoHeight", lua_Button_setAutoHeight},
@@ -170,7 +170,7 @@ int lua_Button__gc(lua_State* state)
     return 0;
 }
 
-int lua_Button_addCallback(lua_State* state)
+int lua_Button_addListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -181,23 +181,23 @@ int lua_Button_addCallback(lua_State* state)
         case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
 
                 // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                int param2 = (int)luaL_checkint(state, 3);
 
                 Button* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addListener(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Button_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Button_addListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -212,7 +212,7 @@ int lua_Button_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_Button_addListener(lua_State* state)
+int lua_Button_addRef(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -220,33 +220,25 @@ int lua_Button_addListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 1:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TNUMBER)
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
-                // Get parameter 1 off the stack.
-                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
-
-                // Get parameter 2 off the stack.
-                int param2 = (int)luaL_checkint(state, 3);
-
                 Button* instance = getInstance(state);
-                instance->addListener(param1, param2);
+                instance->addRef();
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Button_addListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Button_addRef - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
             lua_error(state);
             break;
         }
@@ -254,7 +246,7 @@ int lua_Button_addListener(lua_State* state)
     return 0;
 }
 
-int lua_Button_addRef(lua_State* state)
+int lua_Button_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -262,25 +254,33 @@ int lua_Button_addRef(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 1:
+        case 3:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
                 Button* instance = getInstance(state);
-                instance->addRef();
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Button_addRef - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Button_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -2748,7 +2748,7 @@ int lua_Button_release(lua_State* state)
     return 0;
 }
 
-int lua_Button_removeCallback(lua_State* state)
+int lua_Button_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -2769,13 +2769,13 @@ int lua_Button_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 Button* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Button_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Button_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -4373,7 +4373,7 @@ int lua_Button_static_create(lua_State* state)
                 {
                     ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
                     object->instance = returnPtr;
-                    object->owns = false;
+                    object->owns = true;
                     luaL_getmetatable(state, "Button");
                     lua_setmetatable(state, -2);
                 }

+ 2 - 2
gameplay/src/lua/lua_Button.h

@@ -6,9 +6,9 @@ namespace gameplay
 
 // Lua bindings for Button.
 int lua_Button__gc(lua_State* state);
-int lua_Button_addCallback(lua_State* state);
 int lua_Button_addListener(lua_State* state);
 int lua_Button_addRef(lua_State* state);
+int lua_Button_addScriptCallback(lua_State* state);
 int lua_Button_createAnimation(lua_State* state);
 int lua_Button_createAnimationFromBy(lua_State* state);
 int lua_Button_createAnimationFromTo(lua_State* state);
@@ -56,7 +56,7 @@ int lua_Button_getZIndex(lua_State* state);
 int lua_Button_isContainer(lua_State* state);
 int lua_Button_isEnabled(lua_State* state);
 int lua_Button_release(lua_State* state);
-int lua_Button_removeCallback(lua_State* state);
+int lua_Button_removeScriptCallback(lua_State* state);
 int lua_Button_setAlignment(lua_State* state);
 int lua_Button_setAnimationPropertyValue(lua_State* state);
 int lua_Button_setAutoHeight(lua_State* state);

+ 32 - 32
gameplay/src/lua/lua_CheckBox.cpp

@@ -26,9 +26,9 @@ void luaRegister_CheckBox()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_CheckBox_addCallback},
         {"addListener", lua_CheckBox_addListener},
         {"addRef", lua_CheckBox_addRef},
+        {"addScriptCallback", lua_CheckBox_addScriptCallback},
         {"createAnimation", lua_CheckBox_createAnimation},
         {"createAnimationFromBy", lua_CheckBox_createAnimationFromBy},
         {"createAnimationFromTo", lua_CheckBox_createAnimationFromTo},
@@ -79,7 +79,7 @@ void luaRegister_CheckBox()
         {"isContainer", lua_CheckBox_isContainer},
         {"isEnabled", lua_CheckBox_isEnabled},
         {"release", lua_CheckBox_release},
-        {"removeCallback", lua_CheckBox_removeCallback},
+        {"removeScriptCallback", lua_CheckBox_removeScriptCallback},
         {"setAlignment", lua_CheckBox_setAlignment},
         {"setAnimationPropertyValue", lua_CheckBox_setAnimationPropertyValue},
         {"setAutoHeight", lua_CheckBox_setAutoHeight},
@@ -176,7 +176,7 @@ int lua_CheckBox__gc(lua_State* state)
     return 0;
 }
 
-int lua_CheckBox_addCallback(lua_State* state)
+int lua_CheckBox_addListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -187,23 +187,23 @@ int lua_CheckBox_addCallback(lua_State* state)
         case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
 
                 // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                int param2 = (int)luaL_checkint(state, 3);
 
                 CheckBox* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addListener(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_CheckBox_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_CheckBox_addListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -218,7 +218,7 @@ int lua_CheckBox_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_CheckBox_addListener(lua_State* state)
+int lua_CheckBox_addRef(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -226,33 +226,25 @@ int lua_CheckBox_addListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 1:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TNUMBER)
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
-                // Get parameter 1 off the stack.
-                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
-
-                // Get parameter 2 off the stack.
-                int param2 = (int)luaL_checkint(state, 3);
-
                 CheckBox* instance = getInstance(state);
-                instance->addListener(param1, param2);
+                instance->addRef();
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_CheckBox_addListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_CheckBox_addRef - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
             lua_error(state);
             break;
         }
@@ -260,7 +252,7 @@ int lua_CheckBox_addListener(lua_State* state)
     return 0;
 }
 
-int lua_CheckBox_addRef(lua_State* state)
+int lua_CheckBox_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -268,25 +260,33 @@ int lua_CheckBox_addRef(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 1:
+        case 3:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
                 CheckBox* instance = getInstance(state);
-                instance->addRef();
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_CheckBox_addRef - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_CheckBox_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -2874,7 +2874,7 @@ int lua_CheckBox_release(lua_State* state)
     return 0;
 }
 
-int lua_CheckBox_removeCallback(lua_State* state)
+int lua_CheckBox_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -2895,13 +2895,13 @@ int lua_CheckBox_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 CheckBox* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_CheckBox_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_CheckBox_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;

+ 2 - 2
gameplay/src/lua/lua_CheckBox.h

@@ -6,9 +6,9 @@ namespace gameplay
 
 // Lua bindings for CheckBox.
 int lua_CheckBox__gc(lua_State* state);
-int lua_CheckBox_addCallback(lua_State* state);
 int lua_CheckBox_addListener(lua_State* state);
 int lua_CheckBox_addRef(lua_State* state);
+int lua_CheckBox_addScriptCallback(lua_State* state);
 int lua_CheckBox_createAnimation(lua_State* state);
 int lua_CheckBox_createAnimationFromBy(lua_State* state);
 int lua_CheckBox_createAnimationFromTo(lua_State* state);
@@ -59,7 +59,7 @@ int lua_CheckBox_isChecked(lua_State* state);
 int lua_CheckBox_isContainer(lua_State* state);
 int lua_CheckBox_isEnabled(lua_State* state);
 int lua_CheckBox_release(lua_State* state);
-int lua_CheckBox_removeCallback(lua_State* state);
+int lua_CheckBox_removeScriptCallback(lua_State* state);
 int lua_CheckBox_setAlignment(lua_State* state);
 int lua_CheckBox_setAnimationPropertyValue(lua_State* state);
 int lua_CheckBox_setAutoHeight(lua_State* state);

+ 82 - 82
gameplay/src/lua/lua_Container.cpp

@@ -37,10 +37,10 @@ void luaRegister_Container()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_Container_addCallback},
         {"addControl", lua_Container_addControl},
         {"addListener", lua_Container_addListener},
         {"addRef", lua_Container_addRef},
+        {"addScriptCallback", lua_Container_addScriptCallback},
         {"createAnimation", lua_Container_createAnimation},
         {"createAnimationFromBy", lua_Container_createAnimationFromBy},
         {"createAnimationFromTo", lua_Container_createAnimationFromTo},
@@ -93,8 +93,8 @@ void luaRegister_Container()
         {"isEnabled", lua_Container_isEnabled},
         {"isScrollBarsAutoHide", lua_Container_isScrollBarsAutoHide},
         {"release", lua_Container_release},
-        {"removeCallback", lua_Container_removeCallback},
         {"removeControl", lua_Container_removeControl},
+        {"removeScriptCallback", lua_Container_removeScriptCallback},
         {"setAlignment", lua_Container_setAlignment},
         {"setAnimationPropertyValue", lua_Container_setAnimationPropertyValue},
         {"setAutoHeight", lua_Container_setAutoHeight},
@@ -191,48 +191,6 @@ int lua_Container__gc(lua_State* state)
     return 0;
 }
 
-int lua_Container_addCallback(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 3:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
-
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
-
-                Container* instance = getInstance(state);
-                instance->addCallback(param1, param2);
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Container_addCallback - Failed to match the given parameters to a valid function signature.");
-                lua_error(state);
-            }
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Container_addControl(lua_State* state)
 {
     // Get the number of parameters.
@@ -350,6 +308,48 @@ int lua_Container_addRef(lua_State* state)
     return 0;
 }
 
+int lua_Container_addScriptCallback(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
+                Container* instance = getInstance(state);
+                instance->addScriptCallback(param1, param2);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Container_addScriptCallback - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Container_createAnimation(lua_State* state)
 {
     // Get the number of parameters.
@@ -3045,7 +3045,7 @@ int lua_Container_release(lua_State* state)
     return 0;
 }
 
-int lua_Container_removeCallback(lua_State* state)
+int lua_Container_removeControl(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -3053,33 +3053,51 @@ int lua_Container_removeCallback(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 2:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                lua_type(state, 2) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
 
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                Container* instance = getInstance(state);
+                instance->removeControl(param1);
+                
+                return 0;
+            }
+            else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                const char* param1 = ScriptUtil::getString(2, false);
+
+                Container* instance = getInstance(state);
+                instance->removeControl(param1);
+                
+                return 0;
+            }
+            else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                Control* param1 = ScriptUtil::getObjectPointer<Control>(2, "Control", false);
 
                 Container* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeControl(param1);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Container_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Container_removeControl - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
             lua_error(state);
             break;
         }
@@ -3087,7 +3105,7 @@ int lua_Container_removeCallback(lua_State* state)
     return 0;
 }
 
-int lua_Container_removeControl(lua_State* state)
+int lua_Container_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -3095,51 +3113,33 @@ int lua_Container_removeControl(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 2:
+        case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TNUMBER)
-            {
-                // Get parameter 1 off the stack.
-                unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
-
-                Container* instance = getInstance(state);
-                instance->removeControl(param1);
-                
-                return 0;
-            }
-            else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                const char* param1 = ScriptUtil::getString(2, false);
+                std::string param1 = ScriptUtil::getString(2, true);
 
-                Container* instance = getInstance(state);
-                instance->removeControl(param1);
-                
-                return 0;
-            }
-            else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                Control* param1 = ScriptUtil::getObjectPointer<Control>(2, "Control", false);
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
 
                 Container* instance = getInstance(state);
-                instance->removeControl(param1);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Container_removeControl - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Container_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }

+ 2 - 2
gameplay/src/lua/lua_Container.h

@@ -6,10 +6,10 @@ namespace gameplay
 
 // Lua bindings for Container.
 int lua_Container__gc(lua_State* state);
-int lua_Container_addCallback(lua_State* state);
 int lua_Container_addControl(lua_State* state);
 int lua_Container_addListener(lua_State* state);
 int lua_Container_addRef(lua_State* state);
+int lua_Container_addScriptCallback(lua_State* state);
 int lua_Container_createAnimation(lua_State* state);
 int lua_Container_createAnimationFromBy(lua_State* state);
 int lua_Container_createAnimationFromTo(lua_State* state);
@@ -62,8 +62,8 @@ int lua_Container_isContainer(lua_State* state);
 int lua_Container_isEnabled(lua_State* state);
 int lua_Container_isScrollBarsAutoHide(lua_State* state);
 int lua_Container_release(lua_State* state);
-int lua_Container_removeCallback(lua_State* state);
 int lua_Container_removeControl(lua_State* state);
+int lua_Container_removeScriptCallback(lua_State* state);
 int lua_Container_setAlignment(lua_State* state);
 int lua_Container_setAnimationPropertyValue(lua_State* state);
 int lua_Container_setAutoHeight(lua_State* state);

+ 32 - 32
gameplay/src/lua/lua_Control.cpp

@@ -23,9 +23,9 @@ void luaRegister_Control()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_Control_addCallback},
         {"addListener", lua_Control_addListener},
         {"addRef", lua_Control_addRef},
+        {"addScriptCallback", lua_Control_addScriptCallback},
         {"createAnimation", lua_Control_createAnimation},
         {"createAnimationFromBy", lua_Control_createAnimationFromBy},
         {"createAnimationFromTo", lua_Control_createAnimationFromTo},
@@ -73,7 +73,7 @@ void luaRegister_Control()
         {"isContainer", lua_Control_isContainer},
         {"isEnabled", lua_Control_isEnabled},
         {"release", lua_Control_release},
-        {"removeCallback", lua_Control_removeCallback},
+        {"removeScriptCallback", lua_Control_removeScriptCallback},
         {"setAlignment", lua_Control_setAlignment},
         {"setAnimationPropertyValue", lua_Control_setAnimationPropertyValue},
         {"setAutoHeight", lua_Control_setAutoHeight},
@@ -166,7 +166,7 @@ int lua_Control__gc(lua_State* state)
     return 0;
 }
 
-int lua_Control_addCallback(lua_State* state)
+int lua_Control_addListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -177,23 +177,23 @@ int lua_Control_addCallback(lua_State* state)
         case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
 
                 // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                int param2 = (int)luaL_checkint(state, 3);
 
                 Control* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addListener(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Control_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Control_addListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -208,7 +208,7 @@ int lua_Control_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_Control_addListener(lua_State* state)
+int lua_Control_addRef(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -216,33 +216,25 @@ int lua_Control_addListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 1:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TNUMBER)
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
-                // Get parameter 1 off the stack.
-                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
-
-                // Get parameter 2 off the stack.
-                int param2 = (int)luaL_checkint(state, 3);
-
                 Control* instance = getInstance(state);
-                instance->addListener(param1, param2);
+                instance->addRef();
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Control_addListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Control_addRef - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
             lua_error(state);
             break;
         }
@@ -250,7 +242,7 @@ int lua_Control_addListener(lua_State* state)
     return 0;
 }
 
-int lua_Control_addRef(lua_State* state)
+int lua_Control_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -258,25 +250,33 @@ int lua_Control_addRef(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 1:
+        case 3:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
                 Control* instance = getInstance(state);
-                instance->addRef();
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Control_addRef - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Control_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -2744,7 +2744,7 @@ int lua_Control_release(lua_State* state)
     return 0;
 }
 
-int lua_Control_removeCallback(lua_State* state)
+int lua_Control_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -2765,13 +2765,13 @@ int lua_Control_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 Control* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Control_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Control_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;

+ 2 - 2
gameplay/src/lua/lua_Control.h

@@ -6,9 +6,9 @@ namespace gameplay
 
 // Lua bindings for Control.
 int lua_Control__gc(lua_State* state);
-int lua_Control_addCallback(lua_State* state);
 int lua_Control_addListener(lua_State* state);
 int lua_Control_addRef(lua_State* state);
+int lua_Control_addScriptCallback(lua_State* state);
 int lua_Control_createAnimation(lua_State* state);
 int lua_Control_createAnimationFromBy(lua_State* state);
 int lua_Control_createAnimationFromTo(lua_State* state);
@@ -56,7 +56,7 @@ int lua_Control_getZIndex(lua_State* state);
 int lua_Control_isContainer(lua_State* state);
 int lua_Control_isEnabled(lua_State* state);
 int lua_Control_release(lua_State* state);
-int lua_Control_removeCallback(lua_State* state);
+int lua_Control_removeScriptCallback(lua_State* state);
 int lua_Control_setAlignment(lua_State* state);
 int lua_Control_setAnimationPropertyValue(lua_State* state);
 int lua_Control_setAutoHeight(lua_State* state);

+ 82 - 82
gameplay/src/lua/lua_Form.cpp

@@ -40,10 +40,10 @@ void luaRegister_Form()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_Form_addCallback},
         {"addControl", lua_Form_addControl},
         {"addListener", lua_Form_addListener},
         {"addRef", lua_Form_addRef},
+        {"addScriptCallback", lua_Form_addScriptCallback},
         {"createAnimation", lua_Form_createAnimation},
         {"createAnimationFromBy", lua_Form_createAnimationFromBy},
         {"createAnimationFromTo", lua_Form_createAnimationFromTo},
@@ -98,8 +98,8 @@ void luaRegister_Form()
         {"isEnabled", lua_Form_isEnabled},
         {"isScrollBarsAutoHide", lua_Form_isScrollBarsAutoHide},
         {"release", lua_Form_release},
-        {"removeCallback", lua_Form_removeCallback},
         {"removeControl", lua_Form_removeControl},
+        {"removeScriptCallback", lua_Form_removeScriptCallback},
         {"setAlignment", lua_Form_setAlignment},
         {"setAnimationPropertyValue", lua_Form_setAnimationPropertyValue},
         {"setAutoHeight", lua_Form_setAutoHeight},
@@ -199,48 +199,6 @@ int lua_Form__gc(lua_State* state)
     return 0;
 }
 
-int lua_Form_addCallback(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 3:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
-
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
-
-                Form* instance = getInstance(state);
-                instance->addCallback(param1, param2);
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Form_addCallback - Failed to match the given parameters to a valid function signature.");
-                lua_error(state);
-            }
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Form_addControl(lua_State* state)
 {
     // Get the number of parameters.
@@ -358,6 +316,48 @@ int lua_Form_addRef(lua_State* state)
     return 0;
 }
 
+int lua_Form_addScriptCallback(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
+                Form* instance = getInstance(state);
+                instance->addScriptCallback(param1, param2);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Form_addScriptCallback - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Form_createAnimation(lua_State* state)
 {
     // Get the number of parameters.
@@ -3133,7 +3133,7 @@ int lua_Form_release(lua_State* state)
     return 0;
 }
 
-int lua_Form_removeCallback(lua_State* state)
+int lua_Form_removeControl(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -3141,33 +3141,51 @@ int lua_Form_removeCallback(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 2:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                lua_type(state, 2) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
 
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                Form* instance = getInstance(state);
+                instance->removeControl(param1);
+                
+                return 0;
+            }
+            else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                const char* param1 = ScriptUtil::getString(2, false);
+
+                Form* instance = getInstance(state);
+                instance->removeControl(param1);
+                
+                return 0;
+            }
+            else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                Control* param1 = ScriptUtil::getObjectPointer<Control>(2, "Control", false);
 
                 Form* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeControl(param1);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Form_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Form_removeControl - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
             lua_error(state);
             break;
         }
@@ -3175,7 +3193,7 @@ int lua_Form_removeCallback(lua_State* state)
     return 0;
 }
 
-int lua_Form_removeControl(lua_State* state)
+int lua_Form_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -3183,51 +3201,33 @@ int lua_Form_removeControl(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 2:
+        case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                lua_type(state, 2) == LUA_TNUMBER)
-            {
-                // Get parameter 1 off the stack.
-                unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
-
-                Form* instance = getInstance(state);
-                instance->removeControl(param1);
-                
-                return 0;
-            }
-            else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                const char* param1 = ScriptUtil::getString(2, false);
+                std::string param1 = ScriptUtil::getString(2, true);
 
-                Form* instance = getInstance(state);
-                instance->removeControl(param1);
-                
-                return 0;
-            }
-            else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                Control* param1 = ScriptUtil::getObjectPointer<Control>(2, "Control", false);
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
 
                 Form* instance = getInstance(state);
-                instance->removeControl(param1);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Form_removeControl - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Form_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }

+ 2 - 2
gameplay/src/lua/lua_Form.h

@@ -6,10 +6,10 @@ namespace gameplay
 
 // Lua bindings for Form.
 int lua_Form__gc(lua_State* state);
-int lua_Form_addCallback(lua_State* state);
 int lua_Form_addControl(lua_State* state);
 int lua_Form_addListener(lua_State* state);
 int lua_Form_addRef(lua_State* state);
+int lua_Form_addScriptCallback(lua_State* state);
 int lua_Form_createAnimation(lua_State* state);
 int lua_Form_createAnimationFromBy(lua_State* state);
 int lua_Form_createAnimationFromTo(lua_State* state);
@@ -64,8 +64,8 @@ int lua_Form_isContainer(lua_State* state);
 int lua_Form_isEnabled(lua_State* state);
 int lua_Form_isScrollBarsAutoHide(lua_State* state);
 int lua_Form_release(lua_State* state);
-int lua_Form_removeCallback(lua_State* state);
 int lua_Form_removeControl(lua_State* state);
+int lua_Form_removeScriptCallback(lua_State* state);
 int lua_Form_setAlignment(lua_State* state);
 int lua_Form_setAnimationPropertyValue(lua_State* state);
 int lua_Form_setAutoHeight(lua_State* state);

+ 66 - 66
gameplay/src/lua/lua_Joint.cpp

@@ -28,10 +28,10 @@ void luaRegister_Joint()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_Joint_addCallback},
         {"addChild", lua_Joint_addChild},
         {"addListener", lua_Joint_addListener},
         {"addRef", lua_Joint_addRef},
+        {"addScriptCallback", lua_Joint_addScriptCallback},
         {"clone", lua_Joint_clone},
         {"createAnimation", lua_Joint_createAnimation},
         {"createAnimationFromBy", lua_Joint_createAnimationFromBy},
@@ -100,9 +100,9 @@ void luaRegister_Joint()
         {"isVisible", lua_Joint_isVisible},
         {"release", lua_Joint_release},
         {"removeAllChildren", lua_Joint_removeAllChildren},
-        {"removeCallback", lua_Joint_removeCallback},
         {"removeChild", lua_Joint_removeChild},
         {"removeListener", lua_Joint_removeListener},
+        {"removeScriptCallback", lua_Joint_removeScriptCallback},
         {"rotate", lua_Joint_rotate},
         {"rotateX", lua_Joint_rotateX},
         {"rotateY", lua_Joint_rotateY},
@@ -217,48 +217,6 @@ int lua_Joint__gc(lua_State* state)
     return 0;
 }
 
-int lua_Joint_addCallback(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 3:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
-
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
-
-                Joint* instance = getInstance(state);
-                instance->addCallback(param1, param2);
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Joint_addCallback - Failed to match the given parameters to a valid function signature.");
-                lua_error(state);
-            }
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Joint_addChild(lua_State* state)
 {
     // Get the number of parameters.
@@ -393,6 +351,48 @@ int lua_Joint_addRef(lua_State* state)
     return 0;
 }
 
+int lua_Joint_addScriptCallback(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
+                Joint* instance = getInstance(state);
+                instance->addScriptCallback(param1, param2);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Joint_addScriptCallback - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Joint_clone(lua_State* state)
 {
     // Get the number of parameters.
@@ -3891,7 +3891,7 @@ int lua_Joint_removeAllChildren(lua_State* state)
     return 0;
 }
 
-int lua_Joint_removeCallback(lua_State* state)
+int lua_Joint_removeChild(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -3899,33 +3899,29 @@ int lua_Joint_removeCallback(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 2:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
-
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                Node* param1 = ScriptUtil::getObjectPointer<Node>(2, "Node", false);
 
                 Joint* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeChild(param1);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Joint_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Joint_removeChild - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
             lua_error(state);
             break;
         }
@@ -3933,7 +3929,7 @@ int lua_Joint_removeCallback(lua_State* state)
     return 0;
 }
 
-int lua_Joint_removeChild(lua_State* state)
+int lua_Joint_removeListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -3947,16 +3943,16 @@ int lua_Joint_removeChild(lua_State* state)
                 (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                Node* param1 = ScriptUtil::getObjectPointer<Node>(2, "Node", false);
+                Transform::Listener* param1 = ScriptUtil::getObjectPointer<Transform::Listener>(2, "TransformListener", false);
 
                 Joint* instance = getInstance(state);
-                instance->removeChild(param1);
+                instance->removeListener(param1);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Joint_removeChild - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Joint_removeListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -3971,7 +3967,7 @@ int lua_Joint_removeChild(lua_State* state)
     return 0;
 }
 
-int lua_Joint_removeListener(lua_State* state)
+int lua_Joint_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -3979,29 +3975,33 @@ int lua_Joint_removeListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 2:
+        case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                Transform::Listener* param1 = ScriptUtil::getObjectPointer<Transform::Listener>(2, "TransformListener", false);
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
 
                 Joint* instance = getInstance(state);
-                instance->removeListener(param1);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Joint_removeListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Joint_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }

+ 2 - 2
gameplay/src/lua/lua_Joint.h

@@ -6,10 +6,10 @@ namespace gameplay
 
 // Lua bindings for Joint.
 int lua_Joint__gc(lua_State* state);
-int lua_Joint_addCallback(lua_State* state);
 int lua_Joint_addChild(lua_State* state);
 int lua_Joint_addListener(lua_State* state);
 int lua_Joint_addRef(lua_State* state);
+int lua_Joint_addScriptCallback(lua_State* state);
 int lua_Joint_clone(lua_State* state);
 int lua_Joint_createAnimation(lua_State* state);
 int lua_Joint_createAnimationFromBy(lua_State* state);
@@ -78,9 +78,9 @@ int lua_Joint_isTransparent(lua_State* state);
 int lua_Joint_isVisible(lua_State* state);
 int lua_Joint_release(lua_State* state);
 int lua_Joint_removeAllChildren(lua_State* state);
-int lua_Joint_removeCallback(lua_State* state);
 int lua_Joint_removeChild(lua_State* state);
 int lua_Joint_removeListener(lua_State* state);
+int lua_Joint_removeScriptCallback(lua_State* state);
 int lua_Joint_rotate(lua_State* state);
 int lua_Joint_rotateX(lua_State* state);
 int lua_Joint_rotateY(lua_State* state);

+ 32 - 32
gameplay/src/lua/lua_Joystick.cpp

@@ -24,9 +24,9 @@ void luaRegister_Joystick()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_Joystick_addCallback},
         {"addListener", lua_Joystick_addListener},
         {"addRef", lua_Joystick_addRef},
+        {"addScriptCallback", lua_Joystick_addScriptCallback},
         {"createAnimation", lua_Joystick_createAnimation},
         {"createAnimationFromBy", lua_Joystick_createAnimationFromBy},
         {"createAnimationFromTo", lua_Joystick_createAnimationFromTo},
@@ -78,7 +78,7 @@ void luaRegister_Joystick()
         {"isEnabled", lua_Joystick_isEnabled},
         {"isRelative", lua_Joystick_isRelative},
         {"release", lua_Joystick_release},
-        {"removeCallback", lua_Joystick_removeCallback},
+        {"removeScriptCallback", lua_Joystick_removeScriptCallback},
         {"setAlignment", lua_Joystick_setAlignment},
         {"setAnimationPropertyValue", lua_Joystick_setAnimationPropertyValue},
         {"setAutoHeight", lua_Joystick_setAutoHeight},
@@ -175,7 +175,7 @@ int lua_Joystick__gc(lua_State* state)
     return 0;
 }
 
-int lua_Joystick_addCallback(lua_State* state)
+int lua_Joystick_addListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -186,23 +186,23 @@ int lua_Joystick_addCallback(lua_State* state)
         case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
 
                 // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                int param2 = (int)luaL_checkint(state, 3);
 
                 Joystick* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addListener(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Joystick_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Joystick_addListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -217,7 +217,7 @@ int lua_Joystick_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_Joystick_addListener(lua_State* state)
+int lua_Joystick_addRef(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -225,33 +225,25 @@ int lua_Joystick_addListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 1:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TNUMBER)
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
-                // Get parameter 1 off the stack.
-                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
-
-                // Get parameter 2 off the stack.
-                int param2 = (int)luaL_checkint(state, 3);
-
                 Joystick* instance = getInstance(state);
-                instance->addListener(param1, param2);
+                instance->addRef();
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Joystick_addListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Joystick_addRef - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
             lua_error(state);
             break;
         }
@@ -259,7 +251,7 @@ int lua_Joystick_addListener(lua_State* state)
     return 0;
 }
 
-int lua_Joystick_addRef(lua_State* state)
+int lua_Joystick_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -267,25 +259,33 @@ int lua_Joystick_addRef(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 1:
+        case 3:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
                 Joystick* instance = getInstance(state);
-                instance->addRef();
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Joystick_addRef - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Joystick_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -2928,7 +2928,7 @@ int lua_Joystick_release(lua_State* state)
     return 0;
 }
 
-int lua_Joystick_removeCallback(lua_State* state)
+int lua_Joystick_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -2949,13 +2949,13 @@ int lua_Joystick_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 Joystick* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Joystick_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Joystick_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;

+ 2 - 2
gameplay/src/lua/lua_Joystick.h

@@ -6,9 +6,9 @@ namespace gameplay
 
 // Lua bindings for Joystick.
 int lua_Joystick__gc(lua_State* state);
-int lua_Joystick_addCallback(lua_State* state);
 int lua_Joystick_addListener(lua_State* state);
 int lua_Joystick_addRef(lua_State* state);
+int lua_Joystick_addScriptCallback(lua_State* state);
 int lua_Joystick_createAnimation(lua_State* state);
 int lua_Joystick_createAnimationFromBy(lua_State* state);
 int lua_Joystick_createAnimationFromTo(lua_State* state);
@@ -60,7 +60,7 @@ int lua_Joystick_isContainer(lua_State* state);
 int lua_Joystick_isEnabled(lua_State* state);
 int lua_Joystick_isRelative(lua_State* state);
 int lua_Joystick_release(lua_State* state);
-int lua_Joystick_removeCallback(lua_State* state);
+int lua_Joystick_removeScriptCallback(lua_State* state);
 int lua_Joystick_setAlignment(lua_State* state);
 int lua_Joystick_setAnimationPropertyValue(lua_State* state);
 int lua_Joystick_setAutoHeight(lua_State* state);

+ 32 - 32
gameplay/src/lua/lua_Label.cpp

@@ -24,9 +24,9 @@ void luaRegister_Label()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_Label_addCallback},
         {"addListener", lua_Label_addListener},
         {"addRef", lua_Label_addRef},
+        {"addScriptCallback", lua_Label_addScriptCallback},
         {"createAnimation", lua_Label_createAnimation},
         {"createAnimationFromBy", lua_Label_createAnimationFromBy},
         {"createAnimationFromTo", lua_Label_createAnimationFromTo},
@@ -75,7 +75,7 @@ void luaRegister_Label()
         {"isContainer", lua_Label_isContainer},
         {"isEnabled", lua_Label_isEnabled},
         {"release", lua_Label_release},
-        {"removeCallback", lua_Label_removeCallback},
+        {"removeScriptCallback", lua_Label_removeScriptCallback},
         {"setAlignment", lua_Label_setAlignment},
         {"setAnimationPropertyValue", lua_Label_setAnimationPropertyValue},
         {"setAutoHeight", lua_Label_setAutoHeight},
@@ -170,7 +170,7 @@ int lua_Label__gc(lua_State* state)
     return 0;
 }
 
-int lua_Label_addCallback(lua_State* state)
+int lua_Label_addListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -181,23 +181,23 @@ int lua_Label_addCallback(lua_State* state)
         case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
 
                 // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                int param2 = (int)luaL_checkint(state, 3);
 
                 Label* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addListener(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Label_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Label_addListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -212,7 +212,7 @@ int lua_Label_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_Label_addListener(lua_State* state)
+int lua_Label_addRef(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -220,33 +220,25 @@ int lua_Label_addListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 1:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TNUMBER)
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
-                // Get parameter 1 off the stack.
-                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
-
-                // Get parameter 2 off the stack.
-                int param2 = (int)luaL_checkint(state, 3);
-
                 Label* instance = getInstance(state);
-                instance->addListener(param1, param2);
+                instance->addRef();
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Label_addListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Label_addRef - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
             lua_error(state);
             break;
         }
@@ -254,7 +246,7 @@ int lua_Label_addListener(lua_State* state)
     return 0;
 }
 
-int lua_Label_addRef(lua_State* state)
+int lua_Label_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -262,25 +254,33 @@ int lua_Label_addRef(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 1:
+        case 3:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
                 Label* instance = getInstance(state);
-                instance->addRef();
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Label_addRef - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Label_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -2785,7 +2785,7 @@ int lua_Label_release(lua_State* state)
     return 0;
 }
 
-int lua_Label_removeCallback(lua_State* state)
+int lua_Label_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -2806,13 +2806,13 @@ int lua_Label_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 Label* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Label_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Label_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;

+ 2 - 2
gameplay/src/lua/lua_Label.h

@@ -6,9 +6,9 @@ namespace gameplay
 
 // Lua bindings for Label.
 int lua_Label__gc(lua_State* state);
-int lua_Label_addCallback(lua_State* state);
 int lua_Label_addListener(lua_State* state);
 int lua_Label_addRef(lua_State* state);
+int lua_Label_addScriptCallback(lua_State* state);
 int lua_Label_createAnimation(lua_State* state);
 int lua_Label_createAnimationFromBy(lua_State* state);
 int lua_Label_createAnimationFromTo(lua_State* state);
@@ -57,7 +57,7 @@ int lua_Label_getZIndex(lua_State* state);
 int lua_Label_isContainer(lua_State* state);
 int lua_Label_isEnabled(lua_State* state);
 int lua_Label_release(lua_State* state);
-int lua_Label_removeCallback(lua_State* state);
+int lua_Label_removeScriptCallback(lua_State* state);
 int lua_Label_setAlignment(lua_State* state);
 int lua_Label_setAnimationPropertyValue(lua_State* state);
 int lua_Label_setAutoHeight(lua_State* state);

+ 66 - 66
gameplay/src/lua/lua_Node.cpp

@@ -27,10 +27,10 @@ void luaRegister_Node()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_Node_addCallback},
         {"addChild", lua_Node_addChild},
         {"addListener", lua_Node_addListener},
         {"addRef", lua_Node_addRef},
+        {"addScriptCallback", lua_Node_addScriptCallback},
         {"clone", lua_Node_clone},
         {"createAnimation", lua_Node_createAnimation},
         {"createAnimationFromBy", lua_Node_createAnimationFromBy},
@@ -98,9 +98,9 @@ void luaRegister_Node()
         {"isVisible", lua_Node_isVisible},
         {"release", lua_Node_release},
         {"removeAllChildren", lua_Node_removeAllChildren},
-        {"removeCallback", lua_Node_removeCallback},
         {"removeChild", lua_Node_removeChild},
         {"removeListener", lua_Node_removeListener},
+        {"removeScriptCallback", lua_Node_removeScriptCallback},
         {"rotate", lua_Node_rotate},
         {"rotateX", lua_Node_rotateX},
         {"rotateY", lua_Node_rotateY},
@@ -216,48 +216,6 @@ int lua_Node__gc(lua_State* state)
     return 0;
 }
 
-int lua_Node_addCallback(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 3:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
-
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
-
-                Node* instance = getInstance(state);
-                instance->addCallback(param1, param2);
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Node_addCallback - Failed to match the given parameters to a valid function signature.");
-                lua_error(state);
-            }
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 int lua_Node_addChild(lua_State* state)
 {
     // Get the number of parameters.
@@ -392,6 +350,48 @@ int lua_Node_addRef(lua_State* state)
     return 0;
 }
 
+int lua_Node_addScriptCallback(lua_State* state)
+{
+    // Get the number of parameters.
+    int paramCount = lua_gettop(state);
+
+    // Attempt to match the parameters to a valid binding.
+    switch (paramCount)
+    {
+        case 3:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
+                Node* instance = getInstance(state);
+                instance->addScriptCallback(param1, param2);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Node_addScriptCallback - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
+        default:
+        {
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_error(state);
+            break;
+        }
+    }
+    return 0;
+}
+
 int lua_Node_clone(lua_State* state)
 {
     // Get the number of parameters.
@@ -3844,7 +3844,7 @@ int lua_Node_removeAllChildren(lua_State* state)
     return 0;
 }
 
-int lua_Node_removeCallback(lua_State* state)
+int lua_Node_removeChild(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -3852,33 +3852,29 @@ int lua_Node_removeCallback(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 2:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
-
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                Node* param1 = ScriptUtil::getObjectPointer<Node>(2, "Node", false);
 
                 Node* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeChild(param1);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Node_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Node_removeChild - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
             lua_error(state);
             break;
         }
@@ -3886,7 +3882,7 @@ int lua_Node_removeCallback(lua_State* state)
     return 0;
 }
 
-int lua_Node_removeChild(lua_State* state)
+int lua_Node_removeListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -3900,16 +3896,16 @@ int lua_Node_removeChild(lua_State* state)
                 (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                Node* param1 = ScriptUtil::getObjectPointer<Node>(2, "Node", false);
+                Transform::Listener* param1 = ScriptUtil::getObjectPointer<Transform::Listener>(2, "TransformListener", false);
 
                 Node* instance = getInstance(state);
-                instance->removeChild(param1);
+                instance->removeListener(param1);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Node_removeChild - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Node_removeListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -3924,7 +3920,7 @@ int lua_Node_removeChild(lua_State* state)
     return 0;
 }
 
-int lua_Node_removeListener(lua_State* state)
+int lua_Node_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -3932,29 +3928,33 @@ int lua_Node_removeListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 2:
+        case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                Transform::Listener* param1 = ScriptUtil::getObjectPointer<Transform::Listener>(2, "TransformListener", false);
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
 
                 Node* instance = getInstance(state);
-                instance->removeListener(param1);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Node_removeListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Node_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }

+ 2 - 2
gameplay/src/lua/lua_Node.h

@@ -6,10 +6,10 @@ namespace gameplay
 
 // Lua bindings for Node.
 int lua_Node__gc(lua_State* state);
-int lua_Node_addCallback(lua_State* state);
 int lua_Node_addChild(lua_State* state);
 int lua_Node_addListener(lua_State* state);
 int lua_Node_addRef(lua_State* state);
+int lua_Node_addScriptCallback(lua_State* state);
 int lua_Node_clone(lua_State* state);
 int lua_Node_createAnimation(lua_State* state);
 int lua_Node_createAnimationFromBy(lua_State* state);
@@ -77,9 +77,9 @@ int lua_Node_isTransparent(lua_State* state);
 int lua_Node_isVisible(lua_State* state);
 int lua_Node_release(lua_State* state);
 int lua_Node_removeAllChildren(lua_State* state);
-int lua_Node_removeCallback(lua_State* state);
 int lua_Node_removeChild(lua_State* state);
 int lua_Node_removeListener(lua_State* state);
+int lua_Node_removeScriptCallback(lua_State* state);
 int lua_Node_rotate(lua_State* state);
 int lua_Node_rotateX(lua_State* state);
 int lua_Node_rotateY(lua_State* state);

+ 8 - 8
gameplay/src/lua/lua_PhysicsController.cpp

@@ -19,7 +19,7 @@ void luaRegister_PhysicsController()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_PhysicsController_addCallback},
+        {"addScriptCallback", lua_PhysicsController_addScriptCallback},
         {"addStatusListener", lua_PhysicsController_addStatusListener},
         {"createFixedConstraint", lua_PhysicsController_createFixedConstraint},
         {"createGenericConstraint", lua_PhysicsController_createGenericConstraint},
@@ -29,7 +29,7 @@ void luaRegister_PhysicsController()
         {"drawDebug", lua_PhysicsController_drawDebug},
         {"getGravity", lua_PhysicsController_getGravity},
         {"rayTest", lua_PhysicsController_rayTest},
-        {"removeCallback", lua_PhysicsController_removeCallback},
+        {"removeScriptCallback", lua_PhysicsController_removeScriptCallback},
         {"removeStatusListener", lua_PhysicsController_removeStatusListener},
         {"setGravity", lua_PhysicsController_setGravity},
         {"sweepTest", lua_PhysicsController_sweepTest},
@@ -48,7 +48,7 @@ static PhysicsController* getInstance(lua_State* state)
     return (PhysicsController*)((ScriptUtil::LuaObject*)userdata)->instance;
 }
 
-int lua_PhysicsController_addCallback(lua_State* state)
+int lua_PhysicsController_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -69,13 +69,13 @@ int lua_PhysicsController_addCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 PhysicsController* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_PhysicsController_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_PhysicsController_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -1184,7 +1184,7 @@ int lua_PhysicsController_rayTest(lua_State* state)
     return 0;
 }
 
-int lua_PhysicsController_removeCallback(lua_State* state)
+int lua_PhysicsController_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -1205,13 +1205,13 @@ int lua_PhysicsController_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 PhysicsController* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_PhysicsController_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_PhysicsController_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;

+ 2 - 2
gameplay/src/lua/lua_PhysicsController.h

@@ -5,7 +5,7 @@ namespace gameplay
 {
 
 // Lua bindings for PhysicsController.
-int lua_PhysicsController_addCallback(lua_State* state);
+int lua_PhysicsController_addScriptCallback(lua_State* state);
 int lua_PhysicsController_addStatusListener(lua_State* state);
 int lua_PhysicsController_createFixedConstraint(lua_State* state);
 int lua_PhysicsController_createGenericConstraint(lua_State* state);
@@ -15,7 +15,7 @@ int lua_PhysicsController_createSpringConstraint(lua_State* state);
 int lua_PhysicsController_drawDebug(lua_State* state);
 int lua_PhysicsController_getGravity(lua_State* state);
 int lua_PhysicsController_rayTest(lua_State* state);
-int lua_PhysicsController_removeCallback(lua_State* state);
+int lua_PhysicsController_removeScriptCallback(lua_State* state);
 int lua_PhysicsController_removeStatusListener(lua_State* state);
 int lua_PhysicsController_setGravity(lua_State* state);
 int lua_PhysicsController_sweepTest(lua_State* state);

+ 32 - 32
gameplay/src/lua/lua_RadioButton.cpp

@@ -26,9 +26,9 @@ void luaRegister_RadioButton()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_RadioButton_addCallback},
         {"addListener", lua_RadioButton_addListener},
         {"addRef", lua_RadioButton_addRef},
+        {"addScriptCallback", lua_RadioButton_addScriptCallback},
         {"createAnimation", lua_RadioButton_createAnimation},
         {"createAnimationFromBy", lua_RadioButton_createAnimationFromBy},
         {"createAnimationFromTo", lua_RadioButton_createAnimationFromTo},
@@ -79,7 +79,7 @@ void luaRegister_RadioButton()
         {"isEnabled", lua_RadioButton_isEnabled},
         {"isSelected", lua_RadioButton_isSelected},
         {"release", lua_RadioButton_release},
-        {"removeCallback", lua_RadioButton_removeCallback},
+        {"removeScriptCallback", lua_RadioButton_removeScriptCallback},
         {"setAlignment", lua_RadioButton_setAlignment},
         {"setAnimationPropertyValue", lua_RadioButton_setAnimationPropertyValue},
         {"setAutoHeight", lua_RadioButton_setAutoHeight},
@@ -175,7 +175,7 @@ int lua_RadioButton__gc(lua_State* state)
     return 0;
 }
 
-int lua_RadioButton_addCallback(lua_State* state)
+int lua_RadioButton_addListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -186,23 +186,23 @@ int lua_RadioButton_addCallback(lua_State* state)
         case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
 
                 // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                int param2 = (int)luaL_checkint(state, 3);
 
                 RadioButton* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addListener(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_RadioButton_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_RadioButton_addListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -217,7 +217,7 @@ int lua_RadioButton_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_RadioButton_addListener(lua_State* state)
+int lua_RadioButton_addRef(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -225,33 +225,25 @@ int lua_RadioButton_addListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 1:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TNUMBER)
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
-                // Get parameter 1 off the stack.
-                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
-
-                // Get parameter 2 off the stack.
-                int param2 = (int)luaL_checkint(state, 3);
-
                 RadioButton* instance = getInstance(state);
-                instance->addListener(param1, param2);
+                instance->addRef();
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_RadioButton_addListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_RadioButton_addRef - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
             lua_error(state);
             break;
         }
@@ -259,7 +251,7 @@ int lua_RadioButton_addListener(lua_State* state)
     return 0;
 }
 
-int lua_RadioButton_addRef(lua_State* state)
+int lua_RadioButton_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -267,25 +259,33 @@ int lua_RadioButton_addRef(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 1:
+        case 3:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
                 RadioButton* instance = getInstance(state);
-                instance->addRef();
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_RadioButton_addRef - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_RadioButton_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -2873,7 +2873,7 @@ int lua_RadioButton_release(lua_State* state)
     return 0;
 }
 
-int lua_RadioButton_removeCallback(lua_State* state)
+int lua_RadioButton_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -2894,13 +2894,13 @@ int lua_RadioButton_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 RadioButton* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_RadioButton_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_RadioButton_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;

+ 2 - 2
gameplay/src/lua/lua_RadioButton.h

@@ -6,9 +6,9 @@ namespace gameplay
 
 // Lua bindings for RadioButton.
 int lua_RadioButton__gc(lua_State* state);
-int lua_RadioButton_addCallback(lua_State* state);
 int lua_RadioButton_addListener(lua_State* state);
 int lua_RadioButton_addRef(lua_State* state);
+int lua_RadioButton_addScriptCallback(lua_State* state);
 int lua_RadioButton_createAnimation(lua_State* state);
 int lua_RadioButton_createAnimationFromBy(lua_State* state);
 int lua_RadioButton_createAnimationFromTo(lua_State* state);
@@ -59,7 +59,7 @@ int lua_RadioButton_isContainer(lua_State* state);
 int lua_RadioButton_isEnabled(lua_State* state);
 int lua_RadioButton_isSelected(lua_State* state);
 int lua_RadioButton_release(lua_State* state);
-int lua_RadioButton_removeCallback(lua_State* state);
+int lua_RadioButton_removeScriptCallback(lua_State* state);
 int lua_RadioButton_setAlignment(lua_State* state);
 int lua_RadioButton_setAnimationPropertyValue(lua_State* state);
 int lua_RadioButton_setAutoHeight(lua_State* state);

+ 9 - 49
gameplay/src/lua/lua_ScriptTarget.cpp

@@ -12,14 +12,14 @@ void luaRegister_ScriptTarget()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_ScriptTarget_addCallback},
-        {"removeCallback", lua_ScriptTarget_removeCallback},
+        {"addScriptCallback", lua_ScriptTarget_addScriptCallback},
+        {"removeScriptCallback", lua_ScriptTarget_removeScriptCallback},
         {NULL, NULL}
     };
     const luaL_Reg* lua_statics = NULL;
     std::vector<std::string> scopePath;
 
-    ScriptUtil::registerClass("ScriptTarget", lua_members, NULL, lua_ScriptTarget__gc, lua_statics, scopePath);
+    ScriptUtil::registerClass("ScriptTarget", lua_members, NULL, NULL, lua_statics, scopePath);
 }
 
 static ScriptTarget* getInstance(lua_State* state)
@@ -29,47 +29,7 @@ static ScriptTarget* getInstance(lua_State* state)
     return (ScriptTarget*)((ScriptUtil::LuaObject*)userdata)->instance;
 }
 
-int lua_ScriptTarget__gc(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 1:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
-            {
-                void* userdata = luaL_checkudata(state, 1, "ScriptTarget");
-                luaL_argcheck(state, userdata != NULL, 1, "'ScriptTarget' expected.");
-                ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)userdata;
-                if (object->owns)
-                {
-                    ScriptTarget* instance = (ScriptTarget*)object->instance;
-                    SAFE_DELETE(instance);
-                }
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_ScriptTarget__gc - Failed to match the given parameters to a valid function signature.");
-                lua_error(state);
-            }
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
-int lua_ScriptTarget_addCallback(lua_State* state)
+int lua_ScriptTarget_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -90,13 +50,13 @@ int lua_ScriptTarget_addCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 ScriptTarget* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_ScriptTarget_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_ScriptTarget_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -111,7 +71,7 @@ int lua_ScriptTarget_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_ScriptTarget_removeCallback(lua_State* state)
+int lua_ScriptTarget_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -132,13 +92,13 @@ int lua_ScriptTarget_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 ScriptTarget* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_ScriptTarget_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_ScriptTarget_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;

+ 2 - 3
gameplay/src/lua/lua_ScriptTarget.h

@@ -5,9 +5,8 @@ namespace gameplay
 {
 
 // Lua bindings for ScriptTarget.
-int lua_ScriptTarget__gc(lua_State* state);
-int lua_ScriptTarget_addCallback(lua_State* state);
-int lua_ScriptTarget_removeCallback(lua_State* state);
+int lua_ScriptTarget_addScriptCallback(lua_State* state);
+int lua_ScriptTarget_removeScriptCallback(lua_State* state);
 
 void luaRegister_ScriptTarget();
 

+ 32 - 32
gameplay/src/lua/lua_Slider.cpp

@@ -25,9 +25,9 @@ void luaRegister_Slider()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_Slider_addCallback},
         {"addListener", lua_Slider_addListener},
         {"addRef", lua_Slider_addRef},
+        {"addScriptCallback", lua_Slider_addScriptCallback},
         {"createAnimation", lua_Slider_createAnimation},
         {"createAnimationFromBy", lua_Slider_createAnimationFromBy},
         {"createAnimationFromTo", lua_Slider_createAnimationFromTo},
@@ -80,7 +80,7 @@ void luaRegister_Slider()
         {"isContainer", lua_Slider_isContainer},
         {"isEnabled", lua_Slider_isEnabled},
         {"release", lua_Slider_release},
-        {"removeCallback", lua_Slider_removeCallback},
+        {"removeScriptCallback", lua_Slider_removeScriptCallback},
         {"setAlignment", lua_Slider_setAlignment},
         {"setAnimationPropertyValue", lua_Slider_setAnimationPropertyValue},
         {"setAutoHeight", lua_Slider_setAutoHeight},
@@ -179,7 +179,7 @@ int lua_Slider__gc(lua_State* state)
     return 0;
 }
 
-int lua_Slider_addCallback(lua_State* state)
+int lua_Slider_addListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -190,23 +190,23 @@ int lua_Slider_addCallback(lua_State* state)
         case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
 
                 // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                int param2 = (int)luaL_checkint(state, 3);
 
                 Slider* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addListener(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Slider_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Slider_addListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -221,7 +221,7 @@ int lua_Slider_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_Slider_addListener(lua_State* state)
+int lua_Slider_addRef(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -229,33 +229,25 @@ int lua_Slider_addListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 1:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TNUMBER)
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
-                // Get parameter 1 off the stack.
-                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
-
-                // Get parameter 2 off the stack.
-                int param2 = (int)luaL_checkint(state, 3);
-
                 Slider* instance = getInstance(state);
-                instance->addListener(param1, param2);
+                instance->addRef();
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Slider_addListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Slider_addRef - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
             lua_error(state);
             break;
         }
@@ -263,7 +255,7 @@ int lua_Slider_addListener(lua_State* state)
     return 0;
 }
 
-int lua_Slider_addRef(lua_State* state)
+int lua_Slider_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -271,25 +263,33 @@ int lua_Slider_addRef(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 1:
+        case 3:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
                 Slider* instance = getInstance(state);
-                instance->addRef();
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Slider_addRef - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Slider_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -2942,7 +2942,7 @@ int lua_Slider_release(lua_State* state)
     return 0;
 }
 
-int lua_Slider_removeCallback(lua_State* state)
+int lua_Slider_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -2963,13 +2963,13 @@ int lua_Slider_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 Slider* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Slider_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Slider_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;

+ 2 - 2
gameplay/src/lua/lua_Slider.h

@@ -6,9 +6,9 @@ namespace gameplay
 
 // Lua bindings for Slider.
 int lua_Slider__gc(lua_State* state);
-int lua_Slider_addCallback(lua_State* state);
 int lua_Slider_addListener(lua_State* state);
 int lua_Slider_addRef(lua_State* state);
+int lua_Slider_addScriptCallback(lua_State* state);
 int lua_Slider_createAnimation(lua_State* state);
 int lua_Slider_createAnimationFromBy(lua_State* state);
 int lua_Slider_createAnimationFromTo(lua_State* state);
@@ -61,7 +61,7 @@ int lua_Slider_getZIndex(lua_State* state);
 int lua_Slider_isContainer(lua_State* state);
 int lua_Slider_isEnabled(lua_State* state);
 int lua_Slider_release(lua_State* state);
-int lua_Slider_removeCallback(lua_State* state);
+int lua_Slider_removeScriptCallback(lua_State* state);
 int lua_Slider_setAlignment(lua_State* state);
 int lua_Slider_setAnimationPropertyValue(lua_State* state);
 int lua_Slider_setAutoHeight(lua_State* state);

+ 32 - 32
gameplay/src/lua/lua_TextBox.cpp

@@ -25,9 +25,9 @@ void luaRegister_TextBox()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_TextBox_addCallback},
         {"addListener", lua_TextBox_addListener},
         {"addRef", lua_TextBox_addRef},
+        {"addScriptCallback", lua_TextBox_addScriptCallback},
         {"createAnimation", lua_TextBox_createAnimation},
         {"createAnimationFromBy", lua_TextBox_createAnimationFromBy},
         {"createAnimationFromTo", lua_TextBox_createAnimationFromTo},
@@ -77,7 +77,7 @@ void luaRegister_TextBox()
         {"isContainer", lua_TextBox_isContainer},
         {"isEnabled", lua_TextBox_isEnabled},
         {"release", lua_TextBox_release},
-        {"removeCallback", lua_TextBox_removeCallback},
+        {"removeScriptCallback", lua_TextBox_removeScriptCallback},
         {"setAlignment", lua_TextBox_setAlignment},
         {"setAnimationPropertyValue", lua_TextBox_setAnimationPropertyValue},
         {"setAutoHeight", lua_TextBox_setAutoHeight},
@@ -172,7 +172,7 @@ int lua_TextBox__gc(lua_State* state)
     return 0;
 }
 
-int lua_TextBox_addCallback(lua_State* state)
+int lua_TextBox_addListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -183,23 +183,23 @@ int lua_TextBox_addCallback(lua_State* state)
         case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
 
                 // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                int param2 = (int)luaL_checkint(state, 3);
 
                 TextBox* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addListener(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_TextBox_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_TextBox_addListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
@@ -214,7 +214,7 @@ int lua_TextBox_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_TextBox_addListener(lua_State* state)
+int lua_TextBox_addRef(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -222,33 +222,25 @@ int lua_TextBox_addListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 1:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TNUMBER)
+            if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
-                // Get parameter 1 off the stack.
-                Control::Listener* param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
-
-                // Get parameter 2 off the stack.
-                int param2 = (int)luaL_checkint(state, 3);
-
                 TextBox* instance = getInstance(state);
-                instance->addListener(param1, param2);
+                instance->addRef();
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_TextBox_addListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_TextBox_addRef - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 1).");
             lua_error(state);
             break;
         }
@@ -256,7 +248,7 @@ int lua_TextBox_addListener(lua_State* state)
     return 0;
 }
 
-int lua_TextBox_addRef(lua_State* state)
+int lua_TextBox_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -264,25 +256,33 @@ int lua_TextBox_addRef(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 1:
+        case 3:
         {
-            if ((lua_type(state, 1) == LUA_TUSERDATA))
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
+                // Get parameter 1 off the stack.
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
+
                 TextBox* instance = getInstance(state);
-                instance->addRef();
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_TextBox_addRef - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_TextBox_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 1).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -2824,7 +2824,7 @@ int lua_TextBox_release(lua_State* state)
     return 0;
 }
 
-int lua_TextBox_removeCallback(lua_State* state)
+int lua_TextBox_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -2845,13 +2845,13 @@ int lua_TextBox_removeCallback(lua_State* state)
                 std::string param2 = ScriptUtil::getString(3, true);
 
                 TextBox* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_TextBox_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_TextBox_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;

+ 2 - 2
gameplay/src/lua/lua_TextBox.h

@@ -6,9 +6,9 @@ namespace gameplay
 
 // Lua bindings for TextBox.
 int lua_TextBox__gc(lua_State* state);
-int lua_TextBox_addCallback(lua_State* state);
 int lua_TextBox_addListener(lua_State* state);
 int lua_TextBox_addRef(lua_State* state);
+int lua_TextBox_addScriptCallback(lua_State* state);
 int lua_TextBox_createAnimation(lua_State* state);
 int lua_TextBox_createAnimationFromBy(lua_State* state);
 int lua_TextBox_createAnimationFromTo(lua_State* state);
@@ -58,7 +58,7 @@ int lua_TextBox_getZIndex(lua_State* state);
 int lua_TextBox_isContainer(lua_State* state);
 int lua_TextBox_isEnabled(lua_State* state);
 int lua_TextBox_release(lua_State* state);
-int lua_TextBox_removeCallback(lua_State* state);
+int lua_TextBox_removeScriptCallback(lua_State* state);
 int lua_TextBox_setAlignment(lua_State* state);
 int lua_TextBox_setAnimationPropertyValue(lua_State* state);
 int lua_TextBox_setAutoHeight(lua_State* state);

+ 56 - 56
gameplay/src/lua/lua_Transform.cpp

@@ -18,8 +18,8 @@ void luaRegister_Transform()
 {
     const luaL_Reg lua_members[] = 
     {
-        {"addCallback", lua_Transform_addCallback},
         {"addListener", lua_Transform_addListener},
+        {"addScriptCallback", lua_Transform_addScriptCallback},
         {"createAnimation", lua_Transform_createAnimation},
         {"createAnimationFromBy", lua_Transform_createAnimationFromBy},
         {"createAnimationFromTo", lua_Transform_createAnimationFromTo},
@@ -43,8 +43,8 @@ void luaRegister_Transform()
         {"getTranslationY", lua_Transform_getTranslationY},
         {"getTranslationZ", lua_Transform_getTranslationZ},
         {"getUpVector", lua_Transform_getUpVector},
-        {"removeCallback", lua_Transform_removeCallback},
         {"removeListener", lua_Transform_removeListener},
+        {"removeScriptCallback", lua_Transform_removeScriptCallback},
         {"rotate", lua_Transform_rotate},
         {"rotateX", lua_Transform_rotateX},
         {"rotateY", lua_Transform_rotateY},
@@ -281,7 +281,7 @@ int lua_Transform__init(lua_State* state)
     return 0;
 }
 
-int lua_Transform_addCallback(lua_State* state)
+int lua_Transform_addListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -289,33 +289,53 @@ int lua_Transform_addCallback(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
+        case 2:
+        {
+            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+            {
+                // Get parameter 1 off the stack.
+                Transform::Listener* param1 = ScriptUtil::getObjectPointer<Transform::Listener>(2, "TransformListener", false);
+
+                Transform* instance = getInstance(state);
+                instance->addListener(param1);
+                
+                return 0;
+            }
+            else
+            {
+                lua_pushstring(state, "lua_Transform_addListener - Failed to match the given parameters to a valid function signature.");
+                lua_error(state);
+            }
+            break;
+        }
         case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
+                lua_type(state, 3) == LUA_TNUMBER)
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
+                Transform::Listener* param1 = ScriptUtil::getObjectPointer<Transform::Listener>(2, "TransformListener", false);
 
                 // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                long param2 = (long)luaL_checklong(state, 3);
 
                 Transform* instance = getInstance(state);
-                instance->addCallback(param1, param2);
+                instance->addListener(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Transform_addCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Transform_addListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
             lua_error(state);
             break;
         }
@@ -323,7 +343,7 @@ int lua_Transform_addCallback(lua_State* state)
     return 0;
 }
 
-int lua_Transform_addListener(lua_State* state)
+int lua_Transform_addScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -331,53 +351,33 @@ int lua_Transform_addListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 2:
-        {
-            if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
-            {
-                // Get parameter 1 off the stack.
-                Transform::Listener* param1 = ScriptUtil::getObjectPointer<Transform::Listener>(2, "TransformListener", false);
-
-                Transform* instance = getInstance(state);
-                instance->addListener(param1);
-                
-                return 0;
-            }
-            else
-            {
-                lua_pushstring(state, "lua_Transform_addListener - Failed to match the given parameters to a valid function signature.");
-                lua_error(state);
-            }
-            break;
-        }
         case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
-                lua_type(state, 3) == LUA_TNUMBER)
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                Transform::Listener* param1 = ScriptUtil::getObjectPointer<Transform::Listener>(2, "TransformListener", false);
+                std::string param1 = ScriptUtil::getString(2, true);
 
                 // Get parameter 2 off the stack.
-                long param2 = (long)luaL_checklong(state, 3);
+                std::string param2 = ScriptUtil::getString(3, true);
 
                 Transform* instance = getInstance(state);
-                instance->addListener(param1, param2);
+                instance->addScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Transform_addListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Transform_addScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }
@@ -1820,7 +1820,7 @@ int lua_Transform_getUpVector(lua_State* state)
     return 0;
 }
 
-int lua_Transform_removeCallback(lua_State* state)
+int lua_Transform_removeListener(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -1828,33 +1828,29 @@ int lua_Transform_removeCallback(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 3:
+        case 2:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
-                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                std::string param1 = ScriptUtil::getString(2, true);
-
-                // Get parameter 2 off the stack.
-                std::string param2 = ScriptUtil::getString(3, true);
+                Transform::Listener* param1 = ScriptUtil::getObjectPointer<Transform::Listener>(2, "TransformListener", false);
 
                 Transform* instance = getInstance(state);
-                instance->removeCallback(param1, param2);
+                instance->removeListener(param1);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Transform_removeCallback - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Transform_removeListener - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 3).");
+            lua_pushstring(state, "Invalid number of parameters (expected 2).");
             lua_error(state);
             break;
         }
@@ -1862,7 +1858,7 @@ int lua_Transform_removeCallback(lua_State* state)
     return 0;
 }
 
-int lua_Transform_removeListener(lua_State* state)
+int lua_Transform_removeScriptCallback(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -1870,29 +1866,33 @@ int lua_Transform_removeListener(lua_State* state)
     // Attempt to match the parameters to a valid binding.
     switch (paramCount)
     {
-        case 2:
+        case 3:
         {
             if ((lua_type(state, 1) == LUA_TUSERDATA) &&
-                (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
+                (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
+                (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
             {
                 // Get parameter 1 off the stack.
-                Transform::Listener* param1 = ScriptUtil::getObjectPointer<Transform::Listener>(2, "TransformListener", false);
+                std::string param1 = ScriptUtil::getString(2, true);
+
+                // Get parameter 2 off the stack.
+                std::string param2 = ScriptUtil::getString(3, true);
 
                 Transform* instance = getInstance(state);
-                instance->removeListener(param1);
+                instance->removeScriptCallback(param1, param2);
                 
                 return 0;
             }
             else
             {
-                lua_pushstring(state, "lua_Transform_removeListener - Failed to match the given parameters to a valid function signature.");
+                lua_pushstring(state, "lua_Transform_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
                 lua_error(state);
             }
             break;
         }
         default:
         {
-            lua_pushstring(state, "Invalid number of parameters (expected 2).");
+            lua_pushstring(state, "Invalid number of parameters (expected 3).");
             lua_error(state);
             break;
         }

+ 2 - 2
gameplay/src/lua/lua_Transform.h

@@ -7,8 +7,8 @@ namespace gameplay
 // Lua bindings for Transform.
 int lua_Transform__gc(lua_State* state);
 int lua_Transform__init(lua_State* state);
-int lua_Transform_addCallback(lua_State* state);
 int lua_Transform_addListener(lua_State* state);
+int lua_Transform_addScriptCallback(lua_State* state);
 int lua_Transform_createAnimation(lua_State* state);
 int lua_Transform_createAnimationFromBy(lua_State* state);
 int lua_Transform_createAnimationFromTo(lua_State* state);
@@ -32,8 +32,8 @@ int lua_Transform_getTranslationX(lua_State* state);
 int lua_Transform_getTranslationY(lua_State* state);
 int lua_Transform_getTranslationZ(lua_State* state);
 int lua_Transform_getUpVector(lua_State* state);
-int lua_Transform_removeCallback(lua_State* state);
 int lua_Transform_removeListener(lua_State* state);
+int lua_Transform_removeScriptCallback(lua_State* state);
 int lua_Transform_rotate(lua_State* state);
 int lua_Transform_rotateX(lua_State* state);
 int lua_Transform_rotateY(lua_State* state);

+ 1 - 42
gameplay/src/lua/lua_VerticalLayout.cpp

@@ -25,11 +25,7 @@ void luaRegister_VerticalLayout()
         {"setBottomToTop", lua_VerticalLayout_setBottomToTop},
         {NULL, NULL}
     };
-    const luaL_Reg lua_statics[] = 
-    {
-        {"create", lua_VerticalLayout_static_create},
-        {NULL, NULL}
-    };
+    const luaL_Reg* lua_statics = NULL;
     std::vector<std::string> scopePath;
 
     ScriptUtil::registerClass("VerticalLayout", lua_members, NULL, lua_VerticalLayout__gc, lua_statics, scopePath);
@@ -299,41 +295,4 @@ int lua_VerticalLayout_setBottomToTop(lua_State* state)
     return 0;
 }
 
-int lua_VerticalLayout_static_create(lua_State* state)
-{
-    // Get the number of parameters.
-    int paramCount = lua_gettop(state);
-
-    // Attempt to match the parameters to a valid binding.
-    switch (paramCount)
-    {
-        case 0:
-        {
-            void* returnPtr = (void*)VerticalLayout::create();
-            if (returnPtr)
-            {
-                ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
-                object->instance = returnPtr;
-                object->owns = true;
-                luaL_getmetatable(state, "VerticalLayout");
-                lua_setmetatable(state, -2);
-            }
-            else
-            {
-                lua_pushnil(state);
-            }
-
-            return 1;
-            break;
-        }
-        default:
-        {
-            lua_pushstring(state, "Invalid number of parameters (expected 0).");
-            lua_error(state);
-            break;
-        }
-    }
-    return 0;
-}
-
 }

+ 0 - 1
gameplay/src/lua/lua_VerticalLayout.h

@@ -12,7 +12,6 @@ int lua_VerticalLayout_getRefCount(lua_State* state);
 int lua_VerticalLayout_getType(lua_State* state);
 int lua_VerticalLayout_release(lua_State* state);
 int lua_VerticalLayout_setBottomToTop(lua_State* state);
-int lua_VerticalLayout_static_create(lua_State* state);
 
 void luaRegister_VerticalLayout();