License conversion from Flora to Apache 2.0
[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 Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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
18 #include "toolkit-timer.h"
19
20 #include <Ecore.h>
21
22 // INTERNAL INCLUDES
23 #include <dali/public-api/common/dali-common.h>
24 #include <dali/public-api/object/base-object.h>
25 #include <dali/public-api/signals/dali-signal-v2.h>
26
27
28 namespace
29 {
30 bool ecore_timer_running = false;
31 Ecore_Task_Cb timer_callback_func=NULL;
32 const void* timer_callback_data=NULL;
33 int timerId = 0;
34 }// anon namespace
35
36 extern "C"
37 {
38 Ecore_Timer* ecore_timer_add(double in,
39                              Ecore_Task_Cb func,
40                              const void   *data)
41 {
42   ecore_timer_running = true;
43   timer_callback_func = func;
44   timer_callback_data = data;
45   timerId += sizeof(Ecore_Timer*);
46   return (Ecore_Timer*)timerId;
47 }
48
49 void* ecore_timer_del(Ecore_Timer *timer)
50 {
51   ecore_timer_running = false;
52   timer_callback_func = NULL;
53   return NULL;
54 }
55
56 }