issue #2378: Setter/Getter for Director, removing CC_PROPERTY_XXX macros.

This commit is contained in:
James Chen 2013-07-23 15:19:26 +08:00
parent d6f15bc79f
commit 50ba072bac
2 changed files with 86 additions and 21 deletions

View File

@ -963,7 +963,7 @@ void Director::setScheduler(Scheduler* pScheduler)
}
}
Scheduler* Director::getScheduler()
Scheduler* Director::getScheduler() const
{
return _scheduler;
}
@ -978,7 +978,7 @@ void Director::setActionManager(ActionManager* pActionManager)
}
}
ActionManager* Director::getActionManager()
ActionManager* Director::getActionManager() const
{
return _actionManager;
}
@ -993,7 +993,7 @@ void Director::setTouchDispatcher(TouchDispatcher* pTouchDispatcher)
}
}
TouchDispatcher* Director::getTouchDispatcher()
TouchDispatcher* Director::getTouchDispatcher() const
{
return _touchDispatcher;
}
@ -1005,7 +1005,7 @@ void Director::setKeyboardDispatcher(KeyboardDispatcher* pKeyboardDispatcher)
_keyboardDispatcher = pKeyboardDispatcher;
}
KeyboardDispatcher* Director::getKeyboardDispatcher()
KeyboardDispatcher* Director::getKeyboardDispatcher() const
{
return _keyboardDispatcher;
}
@ -1017,7 +1017,7 @@ void Director::setKeypadDispatcher(KeypadDispatcher* pKeypadDispatcher)
_keypadDispatcher = pKeypadDispatcher;
}
KeypadDispatcher* Director::getKeypadDispatcher()
KeypadDispatcher* Director::getKeypadDispatcher() const
{
return _keypadDispatcher;
}
@ -1031,7 +1031,7 @@ void Director::setAccelerometer(Accelerometer* pAccelerometer)
}
}
Accelerometer* Director::getAccelerometer()
Accelerometer* Director::getAccelerometer() const
{
return _accelerometer;
}

View File

@ -318,39 +318,70 @@ public:
float getContentScaleFactor(void) const;
public:
/** Scheduler associated with this director
/** Gets the Scheduler associated with this director
@since v2.0
*/
CC_PROPERTY(Scheduler*, _scheduler, Scheduler);
/** ActionManager associated with this director
Scheduler* getScheduler() const;
/** Sets the Scheduler associated with this director
@since v2.0
*/
CC_PROPERTY(ActionManager*, _actionManager, ActionManager);
void setScheduler(Scheduler* scheduler);
/** TouchDispatcher associated with this director
/** Gets the ActionManager associated with this director
@since v2.0
*/
CC_PROPERTY(TouchDispatcher*, _touchDispatcher, TouchDispatcher);
ActionManager* getActionManager() const;
/** Sets the ActionManager associated with this director
@since v2.0
*/
void setActionManager(ActionManager* actionManager);
/** Gets the TouchDispatcher associated with this director
@since v2.0
*/
TouchDispatcher* getTouchDispatcher() const;
/** Sets the TouchDispatcher associated with this director
@since v2.0
*/
void setTouchDispatcher(TouchDispatcher* touchDispatcher);
/** KeyboardDispatcher associated with this director
/** Gets the KeyboardDispatcher associated with this director
@note Supported on Mac and Linux only now.
@since v3.0
*/
CC_PROPERTY(KeyboardDispatcher*, _keyboardDispatcher, KeyboardDispatcher);
KeyboardDispatcher* getKeyboardDispatcher() const;
/** KeypadDispatcher associated with this director
/** Sets the KeyboardDispatcher associated with this director
@note Supported on Mac and Linux only now.
@since v3.0
*/
void setKeyboardDispatcher(KeyboardDispatcher* keyboardDispatcher);
/** Gets the KeypadDispatcher associated with this director
@since v2.0
*/
CC_PROPERTY(KeypadDispatcher*, _keypadDispatcher, KeypadDispatcher);
KeypadDispatcher* getKeypadDispatcher() const;
/** Accelerometer associated with this director
/** Sets the KeypadDispatcher associated with this director
@since v2.0
*/
CC_PROPERTY(Accelerometer*, _accelerometer, Accelerometer);
void setKeypadDispatcher(KeypadDispatcher* keypadDispatcher);
/** Gets Accelerometer associated with this director
@since v2.0
*/
Accelerometer* getAccelerometer() const;
/** Sets Accelerometer associated with this director
@since v2.0
*/
void setAccelerometer(Accelerometer* acc);
/* delta time since last tick to main loop */
CC_PROPERTY_READONLY(float, _deltaTime, DeltaTime);
/* Gets delta time since last tick to main loop */
float getDeltaTime() const;
protected:
void purgeDirector();
@ -367,6 +398,40 @@ protected:
void calculateDeltaTime();
protected:
/** Scheduler associated with this director
@since v2.0
*/
Scheduler* _scheduler;
/** ActionManager associated with this director
@since v2.0
*/
ActionManager* _actionManager;
/** TouchDispatcher associated with this director
@since v2.0
*/
TouchDispatcher* _touchDispatcher;
/** KeyboardDispatcher associated with this director
@note Supported on Mac and Linux only now.
@since v3.0
*/
KeyboardDispatcher* _keyboardDispatcher;
/** KeypadDispatcher associated with this director
@since v2.0
*/
KeypadDispatcher* _keypadDispatcher;
/** Accelerometer associated with this director
@since v2.0
*/
Accelerometer* _accelerometer;
/* delta time since last tick to main loop */
float _deltaTime;
/* The EGLView, where everything is rendered */
EGLView *_openGLView;