2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #include "toolkit-timer.h"
20 #include <dali/public-api/common/dali-common.h>
21 #include <dali/public-api/object/base-object.h>
22 #include <dali/public-api/signals/dali-signal-v2.h>
33 * This is a global signal that all users of this stub will connect to.
34 * If we were to use a timer stub with real ticks we may wish to have this as a member variable created with each New Timer.
35 * Currently unable to get the boost singal connect to work with the stub timer when using a member hence this global.
37 Dali::Timer::TimerSignalV2 gTimerTick;
44 Timer Timer::New( unsigned int milliSec )
46 DALI_ASSERT_ALWAYS( gTimer );
51 Timer::TimerSignalV2& Timer::TickSignal()
56 bool Timer::IsRunning() const
61 Timer::Timer( const Timer& timer )
86 * Stub for the Internal Timer
88 class Timer : public BaseObject
90 public: // Creation & Destruction
93 Timer(ToolkitTimer *timer);
100 bool IsRunning() const;
106 ToolkitTimer* mToolkitTimer;
111 : mToolkitTimer(NULL),
116 Timer::Timer(ToolkitTimer *timer)
117 : mToolkitTimer(timer),
128 DALI_ASSERT_ALWAYS( gTimer );
133 DALI_ASSERT_ALWAYS( gTimer );
136 bool Timer::IsRunning() const
138 DALI_ASSERT_ALWAYS( gTimer );
142 } // namespace Adaptor
144 } // namespace Internal
146 ////////////////////////////////////////////////////////////////////////////////////////////////////
148 ToolkitTimer::ToolkitTimer()
149 : mTimerStub(new Internal::Adaptor::Timer(this)),
158 ToolkitTimer::~ToolkitTimer()
163 Timer ToolkitTimer::GetTimer()