Merge remote-tracking branch 'origin/API10' into tizen_7.0
[platform/core/csapi/tizenfx.git] / src / ElmSharp / Interop / Interop.Ecore.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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 using System;
18 using System.Runtime.InteropServices;
19
20 internal static partial class Interop
21 {
22     internal static partial class Ecore
23     {
24         internal enum PositionMap
25         {
26             Linear,
27             Accelerate,
28             Decelerate,
29             Sinusoidal,
30             AccelerateFactor,
31             DecelerateFactor,
32             SinusoidalFactor,
33             DivisorInterp,
34             Bounce,
35             Spring,
36             CubicBezier
37         }
38
39         internal delegate bool EcoreTaskCallback(IntPtr data);
40         internal delegate bool EcoreEventCallback(IntPtr data, int type, IntPtr evt);
41         internal delegate bool EcoreTimelineCallback(IntPtr data, double pos);
42
43         [DllImport(Libraries.Ecore)]
44         internal static extern int ecore_init();
45
46         [DllImport(Libraries.Ecore)]
47         internal static extern int ecore_shutdown();
48
49         [DllImport(Libraries.Ecore)]
50         internal static extern void ecore_main_loop_begin();
51
52         [DllImport(Libraries.Ecore)]
53         internal static extern void ecore_main_loop_quit();
54
55         [DllImport(Libraries.Ecore)]
56         internal static extern bool ecore_main_loop_glib_integrate();
57
58         [DllImport(Libraries.Ecore)]
59         internal static extern IntPtr ecore_idler_add(EcoreTaskCallback callback, IntPtr data);
60
61         [DllImport(Libraries.Ecore)]
62         internal static extern void ecore_main_loop_thread_safe_call_async(EcoreTaskCallback callback, IntPtr data);
63
64         [DllImport(Libraries.Ecore)]
65         internal static extern IntPtr ecore_main_loop_thread_safe_call_sync(EcoreTaskCallback callback, IntPtr data);
66
67         [DllImport(Libraries.Ecore)]
68         internal static extern IntPtr ecore_idler_del(IntPtr idler);
69
70         [DllImport(Libraries.Ecore)]
71         internal static extern IntPtr ecore_timer_add(double interval, EcoreTaskCallback callback, IntPtr data);
72
73         [DllImport(Libraries.Ecore)]
74         internal static extern IntPtr ecore_timer_del(IntPtr timer);
75
76         [DllImport(Libraries.Ecore)]
77         internal static extern IntPtr ecore_animator_add(EcoreTaskCallback func, IntPtr data);
78
79         [DllImport(Libraries.Ecore)]
80         internal static extern IntPtr ecore_animator_del(IntPtr animator);
81
82         [DllImport(Libraries.Ecore)]
83         internal static extern double ecore_time_get();
84
85         [DllImport(Libraries.Ecore)]
86         internal static extern IntPtr ecore_event_handler_add(int type, EcoreEventCallback func, IntPtr data);
87
88         [DllImport(Libraries.Ecore)]
89         internal static extern IntPtr ecore_event_handler_del(IntPtr handler);
90
91         [DllImport(Libraries.Ecore)]
92         internal static extern IntPtr ecore_animator_timeline_add(double runtime, EcoreTimelineCallback func, IntPtr data);
93
94         [DllImport(Libraries.Ecore)]
95         internal static extern void ecore_animator_freeze(IntPtr animator);
96
97         [DllImport(Libraries.Ecore)]
98         internal static extern void ecore_animator_thaw(IntPtr animator);
99
100         [DllImport(Libraries.Ecore)]
101         internal static extern void ecore_animator_frametime_set(double frametime);
102
103         [DllImport(Libraries.Ecore)]
104         internal static extern void ecore_animator_frametime_get();
105
106         [DllImport(Libraries.Ecore)]
107         internal static extern double ecore_animator_pos_map(double pos, PositionMap map, double v1, double v2);
108
109         [DllImport(Libraries.Ecore)]
110         internal static extern double ecore_animator_pos_map_n(double pos, PositionMap map, int v_size, double[] v);
111     }
112 }