Adding new test harness
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-timer.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 #include "toolkit-timer.h"
18
19 #include <Ecore.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/public-api/object/base-object.h>
24 #include <dali/public-api/signals/dali-signal-v2.h>
25
26
27 namespace
28 {
29 bool ecore_timer_running = false;
30 Ecore_Task_Cb timer_callback_func=NULL;
31 const void* timer_callback_data=NULL;
32 int timerId = 0;
33 }// anon namespace
34
35 extern "C"
36 {
37 Ecore_Timer* ecore_timer_add(double in,
38                              Ecore_Task_Cb func,
39                              const void   *data)
40 {
41   ecore_timer_running = true;
42   timer_callback_func = func;
43   timer_callback_data = data;
44   timerId += sizeof(Ecore_Timer*);
45   return (Ecore_Timer*)timerId;
46 }
47
48 void* ecore_timer_del(Ecore_Timer *timer)
49 {
50   ecore_timer_running = false;
51   timer_callback_func = NULL;
52   return NULL;
53 }
54
55 }