sync ElmSharp source code latest
[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 void EcoreCallback(IntPtr data);
40         internal delegate bool EcoreTaskCallback(IntPtr data);
41         internal delegate void EcoreEventCallback(IntPtr data, int type, IntPtr evt);
42         internal delegate bool EcoreTimelineCallback(IntPtr data, double pos);
43
44         [DllImport(Libraries.Ecore)]
45         internal static extern int ecore_init();
46
47         [DllImport(Libraries.Ecore)]
48         internal static extern int ecore_shutdown();
49
50         [DllImport(Libraries.Ecore)]
51         internal static extern void ecore_main_loop_begin();
52
53         [DllImport(Libraries.Ecore)]
54         internal static extern void ecore_main_loop_quit();
55
56         [DllImport(Libraries.Ecore)]
57         internal static extern bool ecore_main_loop_glib_integrate();
58
59         [DllImport(Libraries.Ecore)]
60         internal static extern IntPtr ecore_idler_add(EcoreTaskCallback callback, IntPtr data);
61
62         [DllImport(Libraries.Ecore)]
63         internal static extern void ecore_main_loop_thread_safe_call_async(EcoreTaskCallback callback, IntPtr data);
64
65         [DllImport(Libraries.Ecore)]
66         internal static extern IntPtr ecore_main_loop_thread_safe_call_sync(EcoreTaskCallback callback, IntPtr data);
67
68         [DllImport(Libraries.Ecore)]
69         internal static extern IntPtr ecore_idler_del(IntPtr idler);
70
71         [DllImport(Libraries.Ecore)]
72         internal static extern IntPtr ecore_timer_add(double interval, EcoreTaskCallback callback, IntPtr data);
73
74         [DllImport(Libraries.Ecore)]
75         internal static extern IntPtr ecore_timer_del(IntPtr timer);
76
77         [DllImport(Libraries.Ecore)]
78         internal static extern IntPtr ecore_animator_add(EcoreTaskCallback func, IntPtr data);
79
80         [DllImport(Libraries.Ecore)]
81         internal static extern IntPtr ecore_animator_del(IntPtr animator);
82
83         [DllImport(Libraries.Ecore)]
84         internal static extern double ecore_time_get();
85
86         [DllImport(Libraries.Ecore)]
87         internal static extern IntPtr ecore_event_handler_add(int type, EcoreEventCallback func, IntPtr data);
88
89         [DllImport(Libraries.Ecore)]
90         internal static extern IntPtr ecore_event_handler_del(IntPtr handler);
91
92         [DllImport(Libraries.Ecore)]
93         internal static extern IntPtr ecore_animator_timeline_add(double runtime, EcoreTimelineCallback func, IntPtr data);
94
95         [DllImport(Libraries.Ecore)]
96         internal static extern void ecore_animator_freeze(IntPtr animator);
97
98         [DllImport(Libraries.Ecore)]
99         internal static extern void ecore_animator_thaw(IntPtr animator);
100
101         [DllImport(Libraries.Ecore)]
102         internal static extern void ecore_animator_frametime_set(double frametime);
103
104         [DllImport(Libraries.Ecore)]
105         internal static extern void ecore_animator_frametime_get();
106
107         [DllImport(Libraries.Ecore)]
108         internal static extern double ecore_animator_pos_map(double pos, PositionMap map, double v1, double v2);
109
110         [DllImport(Libraries.Ecore)]
111         internal static extern double ecore_animator_pos_map_n(double pos, PositionMap map, int v_size, double[] v);
112     }
113 }