From 6590d34bda4cc42453841f6466c802e31c56d18a Mon Sep 17 00:00:00 2001 From: VisualSJ Date: Tue, 24 Mar 2015 16:37:09 +0800 Subject: [PATCH] [ci skip] Add javascript notes... cocos/base/CCEventListener.h cocos/base/CCEventListenerAcceleration.h cocos/base/CCEventListenerController.h cocos/base/CCEventListenerCustom.h cocos/base/CCEventListenerFocus.h cocos/base/CCEventListenerKeyboard.h cocos/base/CCEventListenerMouse.h cocos/base/CCEventListenerTouch.h cocos/base/CCEventMouse.h cocos/base/CCEventTouch.h --- cocos/base/CCEventCustom.h | 1 + cocos/base/CCEventDispatcher.h | 1 + cocos/base/CCEventFocus.h | 1 + cocos/base/CCEventKeyboard.h | 2 ++ cocos/base/CCEventListener.h | 11 +++++++++-- cocos/base/CCEventListenerAcceleration.h | 1 + cocos/base/CCEventListenerController.h | 1 + cocos/base/CCEventListenerCustom.h | 1 + cocos/base/CCEventListenerFocus.h | 1 + cocos/base/CCEventListenerKeyboard.h | 1 + cocos/base/CCEventListenerMouse.h | 1 + cocos/base/CCEventListenerTouch.h | 7 ++++++- cocos/base/CCEventMouse.h | 11 +++++++++++ cocos/base/CCEventTouch.h | 5 ++++- 14 files changed, 41 insertions(+), 4 deletions(-) diff --git a/cocos/base/CCEventCustom.h b/cocos/base/CCEventCustom.h index 94602b7c43..a2fa30fde7 100644 --- a/cocos/base/CCEventCustom.h +++ b/cocos/base/CCEventCustom.h @@ -39,6 +39,7 @@ public: /** Constructor. * * @param eventName A given name of the custom event. + * @js ctor */ EventCustom(const std::string& eventName); diff --git a/cocos/base/CCEventDispatcher.h b/cocos/base/CCEventDispatcher.h index 0016c6f910..d84ef68550 100644 --- a/cocos/base/CCEventDispatcher.h +++ b/cocos/base/CCEventDispatcher.h @@ -52,6 +52,7 @@ The EventListener list is managed in such a way that event listeners can be added and removed even from within an EventListener, while events are being dispatched. +@js NA */ class CC_DLL EventDispatcher : public Ref { diff --git a/cocos/base/CCEventFocus.h b/cocos/base/CCEventFocus.h index e63ee3669c..6cba136ac8 100644 --- a/cocos/base/CCEventFocus.h +++ b/cocos/base/CCEventFocus.h @@ -45,6 +45,7 @@ public: * * @param widgetLoseFocus The widget which lose focus. * @param widgetGetFocus The widget which get focus. + * @js ctor */ EventFocus(ui::Widget* widgetLoseFocus, ui::Widget* widgetGetFocus); diff --git a/cocos/base/CCEventKeyboard.h b/cocos/base/CCEventKeyboard.h index 78999f0fe5..b552fd3e71 100644 --- a/cocos/base/CCEventKeyboard.h +++ b/cocos/base/CCEventKeyboard.h @@ -38,6 +38,7 @@ class CC_DLL EventKeyboard : public Event public: /** * KeyCode The key (code). + * @js NA */ enum class KeyCode { @@ -217,6 +218,7 @@ public: * * @param keyCode A given keycode. * @param isPressed True if the key is pressed. + * @js ctor */ EventKeyboard(KeyCode keyCode, bool isPressed); diff --git a/cocos/base/CCEventListener.h b/cocos/base/CCEventListener.h index aa0f276f48..a2c9d923ba 100644 --- a/cocos/base/CCEventListener.h +++ b/cocos/base/CCEventListener.h @@ -62,13 +62,20 @@ public: typedef std::string ListenerID; CC_CONSTRUCTOR_ACCESS: - /** Constructor */ + /** + * Constructor + * @js ctor + */ EventListener(); - /** Initializes event with type and callback function */ + /** + * Initializes event with type and callback function + * @js NA + */ bool init(Type t, const ListenerID& listenerID, const std::function& callback); public: /** Destructor. + * @js NA */ virtual ~EventListener(); diff --git a/cocos/base/CCEventListenerAcceleration.h b/cocos/base/CCEventListenerAcceleration.h index c9f226d8cb..ab22d177d4 100644 --- a/cocos/base/CCEventListenerAcceleration.h +++ b/cocos/base/CCEventListenerAcceleration.h @@ -32,6 +32,7 @@ NS_CC_BEGIN /** @class EventListenerAcceleration * @brief Acceleration event listener. + * @js NA */ class CC_DLL EventListenerAcceleration : public EventListener { diff --git a/cocos/base/CCEventListenerController.h b/cocos/base/CCEventListenerController.h index c6e1032489..e5c42737af 100644 --- a/cocos/base/CCEventListenerController.h +++ b/cocos/base/CCEventListenerController.h @@ -36,6 +36,7 @@ class Controller; /** @class EventListenerController * @param Controller event listener. + * @js NA */ class EventListenerController : public EventListener { diff --git a/cocos/base/CCEventListenerCustom.h b/cocos/base/CCEventListenerCustom.h index 6cdb17df4c..12681131f8 100644 --- a/cocos/base/CCEventListenerCustom.h +++ b/cocos/base/CCEventListenerCustom.h @@ -49,6 +49,7 @@ class EventCustom; * Removes a listener * * dispatcher->removeEventListener(listener); + * @js cc._EventListenerCustom */ class CC_DLL EventListenerCustom : public EventListener { diff --git a/cocos/base/CCEventListenerFocus.h b/cocos/base/CCEventListenerFocus.h index e2486c1db9..05c78b3167 100644 --- a/cocos/base/CCEventListenerFocus.h +++ b/cocos/base/CCEventListenerFocus.h @@ -50,6 +50,7 @@ public: static EventListenerFocus* create(); /** Destructor. + * @js NA */ virtual ~EventListenerFocus(); diff --git a/cocos/base/CCEventListenerKeyboard.h b/cocos/base/CCEventListenerKeyboard.h index 7a63529f88..293f60f540 100644 --- a/cocos/base/CCEventListenerKeyboard.h +++ b/cocos/base/CCEventListenerKeyboard.h @@ -35,6 +35,7 @@ class Event; /** @class EventListenerKeyboard * @brief Keyboard event listener. + * @js cc._EventListenerKeyboard */ class CC_DLL EventListenerKeyboard : public EventListener { diff --git a/cocos/base/CCEventListenerMouse.h b/cocos/base/CCEventListenerMouse.h index b1e0a83c67..64f042765d 100644 --- a/cocos/base/CCEventListenerMouse.h +++ b/cocos/base/CCEventListenerMouse.h @@ -35,6 +35,7 @@ class Event; /** @class EventListenerMouse * @brief Mouse event listener. + * @js cc._EventListenerMouse */ class CC_DLL EventListenerMouse : public EventListener { diff --git a/cocos/base/CCEventListenerTouch.h b/cocos/base/CCEventListenerTouch.h index 33b662609d..7ca9421bf8 100644 --- a/cocos/base/CCEventListenerTouch.h +++ b/cocos/base/CCEventListenerTouch.h @@ -36,6 +36,7 @@ class Touch; /** @class EventListenerTouchOneByOne * @brief Single touch event listener. + * @js cc._EventListenerTouchOneByOne */ class CC_DLL EventListenerTouchOneByOne : public EventListener { @@ -46,7 +47,10 @@ public: */ static EventListenerTouchOneByOne* create(); - /** Destructor. */ + /** + * Destructor. + * @js NA + */ virtual ~EventListenerTouchOneByOne(); /** Whether or not to swall touches. @@ -100,6 +104,7 @@ public: */ static EventListenerTouchAllAtOnce* create(); /** Destructor. + * @js NA */ virtual ~EventListenerTouchAllAtOnce(); diff --git a/cocos/base/CCEventMouse.h b/cocos/base/CCEventMouse.h index a1f4fc39a3..d97e09912e 100644 --- a/cocos/base/CCEventMouse.h +++ b/cocos/base/CCEventMouse.h @@ -48,6 +48,7 @@ class CC_DLL EventMouse : public Event public: /** * MouseEventType Different types of MouseEvent. + * @js NA */ enum class MouseEventType { @@ -61,6 +62,7 @@ public: /** Constructor. * * @param mouseEventCode A given mouse event type. + * @js ctor */ EventMouse(MouseEventType mouseEventCode); @@ -85,6 +87,7 @@ public: * * @param x The x coordinate of cursor position. * @param y The y coordinate of cursor position. + * @js setLocation */ inline void setCursorPosition(float x, float y) { _x = x; @@ -102,21 +105,25 @@ public: /** Set mouse button. * * @param button a given mouse button. + * @js setButton */ inline void setMouseButton(int button) { _mouseButton = button; }; /** Get mouse button. * * @return The mouse button. + * @js getButton */ inline int getMouseButton() { return _mouseButton; }; /** Get the cursor position of x axis. * * @return The x coordinate of cursor position. + * @js getLocationX */ inline float getCursorX() { return _x; }; /** Get the cursor position of y axis. * * @return The y coordinate of cursor position. + * @js getLocationY */ inline float getCursorY() { return _y; }; @@ -128,11 +135,13 @@ public: /** Returns the previous touch location in OpenGL coordinates. * * @return The previous touch location in OpenGL coordinates. + * @js NA */ Vec2 getPreviousLocation() const; /** Returns the start touch location in OpenGL coordinates. * * @return The start touch location in OpenGL coordinates. + * @js NA */ Vec2 getStartLocation() const; /** Returns the delta of 2 current touches locations in screen coordinates. @@ -148,11 +157,13 @@ public: /** Returns the previous touch location in screen coordinates. * * @return The previous touch location in screen coordinates. + * @js NA */ Vec2 getPreviousLocationInView() const; /** Returns the start touch location in screen coordinates. * * @return The start touch location in screen coordinates. + * @js NA */ Vec2 getStartLocationInView() const; diff --git a/cocos/base/CCEventTouch.h b/cocos/base/CCEventTouch.h index 50292fe547..bc526307eb 100644 --- a/cocos/base/CCEventTouch.h +++ b/cocos/base/CCEventTouch.h @@ -51,7 +51,10 @@ public: CANCELLED }; - /** Constructor.*/ + /** + * Constructor. + * @js NA + */ EventTouch(); /** Get event code.