/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "toolkit-timer.h"
// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
+#include <dali-toolkit/public-api/dali-toolkit-common.h>
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/signals/dali-signal.h>
Dali::Timer::TimerSignalType gTickSignal;
int gTimerCount = 0;
+bool gKeepTimersRunning = false;
/**
* Implementation of the timer
private: // Data
unsigned int mInterval;
+ bool mRunning;
};
inline Timer& GetImplementation(Dali::Timer& timer)
}
Timer::Timer( unsigned int milliSec )
-: mInterval( milliSec )
+: mInterval( milliSec ),
+ mRunning( false )
{
++gTimerCount;
}
void Timer::Start()
{
+ mRunning = true;
}
void Timer::Stop()
{
+ mRunning = false;
}
void Timer::SetInterval( unsigned int interval )
bool Timer::IsRunning() const
{
- return true;
+ return mRunning;
}
bool Timer::Tick()
}
}
-
} // namespace Adaptor
} // namespace Internal
void Timer::Start()
{
Internal::Adaptor::GetImplementation( *this ).Start();
+ Dali::Internal::Adaptor::gKeepTimersRunning = true;
}
void Timer::Stop()
} // namespace Dali
+
+namespace Test
+{
+
+int GetTimerCount()
+{
+ return Dali::Internal::Adaptor::gTimerCount;
+}
+
+void EmitGlobalTimerSignal()
+{
+ // @todo Multiplex timers properly.
+ Dali::Internal::Adaptor::gKeepTimersRunning = Dali::Internal::Adaptor::gTickSignal.Emit();
+}
+
+bool AreTimersRunning()
+{
+ return Dali::Internal::Adaptor::gKeepTimersRunning;
+}
+
+}