2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.Runtime.InteropServices;
20 internal static partial class Interop
22 internal static partial class Elementary
24 [DllImport(Libraries.Elementary)]
25 internal static extern double elm_config_scroll_bring_in_scroll_friction_set(double time);
27 [DllImport(Libraries.Elementary)]
28 internal static extern double elm_config_scroll_bring_in_scroll_friction_get();
30 [DllImport(Libraries.Elementary)]
31 internal static extern IntPtr elm_config_accel_preference_set(string preference);
33 [DllImport(Libraries.Elementary)]
34 internal static extern void elm_config_scale_set(double scale);
36 [DllImport(Libraries.Elementary)]
37 internal static extern double elm_config_scale_get();
39 [DllImport(Libraries.Elementary)]
40 internal static extern string elm_config_profile_get();
42 [DllImport(Libraries.Elementary)]
43 internal static extern void elm_object_tree_dump(IntPtr top);
45 [DllImport(Libraries.Elementary)]
46 internal static extern bool elm_object_disabled_get(IntPtr obj);
48 [DllImport(Libraries.Elementary)]
49 internal static extern void elm_object_disabled_set(IntPtr obj, bool disabled);
51 [DllImport(Libraries.Elementary)]
52 internal static extern void elm_init(int argc, string[] argv);
54 [DllImport(Libraries.Elementary)]
55 internal static extern bool ecore_main_loop_glib_integrate();
57 [DllImport(Libraries.Elementary)]
58 internal static extern void elm_run();
60 [DllImport(Libraries.Elementary)]
61 internal static extern void elm_exit();
63 [DllImport(Libraries.Elementary)]
64 internal static extern void elm_shutdown();
66 [DllImport(Libraries.Elementary)]
67 internal static extern void elm_app_base_scale_set(double base_scale);
69 [DllImport(Libraries.Elementary)]
70 internal static extern IntPtr elm_conformant_add(IntPtr obj);
72 [DllImport(Libraries.Elementary, EntryPoint = "elm_object_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
73 internal static extern IntPtr _elm_object_part_text_get(IntPtr obj, IntPtr part);
75 [DllImport(Libraries.Elementary, EntryPoint = "elm_object_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
76 internal static extern IntPtr _elm_object_part_text_get(IntPtr obj, string part);
78 internal static string elm_object_part_text_get(IntPtr obj, string part)
80 var text = _elm_object_part_text_get(obj, part);
81 return Marshal.PtrToStringAnsi(text);
84 internal static string elm_object_part_text_get(IntPtr obj)
86 var text = _elm_object_part_text_get(obj, IntPtr.Zero);
87 return Marshal.PtrToStringAnsi(text);
90 [DllImport(Libraries.Elementary)]
91 internal static extern void elm_object_item_part_content_set(IntPtr obj, string part, IntPtr content);
93 [DllImport(Libraries.Elementary)]
94 internal static extern IntPtr elm_object_item_part_content_unset(IntPtr obj, string part);
96 [DllImport(Libraries.Elementary)]
97 internal static extern void elm_object_item_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
99 [DllImport(Libraries.Elementary)]
100 internal static extern IntPtr elm_object_part_content_get(IntPtr obj, string part);
102 [DllImport(Libraries.Elementary)]
103 internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content);
105 [DllImport(Libraries.Elementary)]
106 internal static extern void elm_object_part_content_set(IntPtr obj, IntPtr part, IntPtr content);
108 internal static void elm_object_content_set(IntPtr obj, IntPtr content)
110 elm_object_part_content_set(obj, IntPtr.Zero, content);
113 [DllImport(Libraries.Elementary)]
114 internal static extern void elm_object_part_content_unset(IntPtr obj, string part);
116 internal static void elm_object_content_unset(IntPtr obj)
118 elm_object_part_content_unset(obj, null);
121 [DllImport(Libraries.Elementary)]
122 internal static extern IntPtr elm_layout_add(IntPtr obj);
124 [DllImport(Libraries.Elementary)]
125 internal static extern IntPtr elm_layout_content_get(IntPtr obj, string swallow);
127 [DllImport(Libraries.Elementary)]
128 internal static extern bool elm_layout_content_set(IntPtr obj, string swallow, IntPtr content);
130 [DllImport(Libraries.Elementary)]
131 internal static extern IntPtr elm_layout_content_unset(IntPtr obj, string swallow);
133 [DllImport(Libraries.Elementary)]
134 internal static extern bool elm_layout_text_set(IntPtr obj, string part, string text);
136 [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
137 internal static extern IntPtr _elm_layout_text_get(IntPtr obj, string part);
139 internal static string elm_layout_text_get(IntPtr obj, string part)
141 var text = _elm_layout_text_get(obj, part);
142 return Marshal.PtrToStringAnsi(text);
145 [DllImport(Libraries.Elementary)]
146 internal static extern bool elm_layout_theme_set(IntPtr obj, string klass, string group, string style);
148 [DllImport(Libraries.Elementary)]
149 internal static extern bool elm_layout_file_set(IntPtr obj, string file, string group);
151 [DllImport(Libraries.Elementary)]
152 internal static extern bool elm_object_style_set(IntPtr obj, string style);
154 [DllImport(Libraries.Elementary, EntryPoint = "elm_object_style_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
155 internal static extern IntPtr _elm_object_style_get(IntPtr obj);
157 internal static string elm_object_style_get(IntPtr obj)
159 var text = _elm_object_style_get(obj);
160 return Marshal.PtrToStringAnsi(text);
163 [DllImport(Libraries.Elementary)]
164 internal static extern void elm_object_color_class_color_get(IntPtr obj, string colorClass, out int r, out int g, out int b, out int a);
166 [DllImport(Libraries.Elementary)]
167 internal static extern void elm_object_color_class_color_set(IntPtr obj, string colorClass, int r, int g, int b, int a);
169 [DllImport(Libraries.Elementary)]
170 internal static extern void elm_object_part_text_set(IntPtr obj, string part, string text);
172 [DllImport(Libraries.Elementary)]
173 internal static extern void elm_object_part_text_set(IntPtr obj, IntPtr part, string text);
175 [DllImport(Libraries.Elementary, EntryPoint = "elm_object_item_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
176 internal static extern IntPtr _elm_object_item_part_text_get(IntPtr obj, string part);
178 internal static string elm_object_item_part_text_get(IntPtr obj, string part)
180 var text = _elm_object_item_part_text_get(obj, part);
181 return Marshal.PtrToStringAnsi(text);
184 [DllImport(Libraries.Elementary)]
185 internal static extern void elm_object_item_color_class_color_set(IntPtr it, string part, int r, int g, int b, int a);
187 [DllImport(Libraries.Elementary)]
188 internal static extern void elm_object_item_color_class_color_get(IntPtr obj, string part, out int r, out int g, out int b, out int a);
190 [DllImport(Libraries.Elementary)]
191 internal static extern void elm_object_item_color_class_del(IntPtr obj, string part);
193 [DllImport(Libraries.Elementary)]
194 internal static extern void elm_object_item_part_text_set(IntPtr obj, string part, string label);
196 [DllImport(Libraries.Elementary)]
197 internal static extern void elm_object_item_part_text_set(IntPtr obj, IntPtr part, string label);
199 [DllImport(Libraries.Elementary)]
200 internal static extern IntPtr elm_object_item_data_get(IntPtr it);
202 [DllImport(Libraries.Elementary)]
203 internal static extern void elm_object_item_data_set(IntPtr it, IntPtr data);
205 [DllImport(Libraries.Elementary)]
206 internal static extern void elm_object_item_del(IntPtr obj);
208 [DllImport(Libraries.Elementary)]
209 internal static extern void elm_object_item_del_cb_set(IntPtr obj, Interop.Evas.SmartCallback callback);
211 [DllImport(Libraries.Elementary)]
212 internal static extern void elm_object_item_disabled_set(IntPtr obj, bool disable);
214 [DllImport(Libraries.Elementary)]
215 internal static extern bool elm_object_item_disabled_get(IntPtr obj);
217 [DllImport(Libraries.Elementary)]
218 internal static extern bool elm_object_focus_get(IntPtr obj);
220 [DllImport(Libraries.Elementary)]
221 internal static extern void elm_object_focus_set(IntPtr obj, bool focus);
223 [DllImport(Libraries.Elementary)]
224 internal static extern void elm_theme_extension_add(IntPtr theme, string path);
226 [DllImport(Libraries.Elementary)]
227 internal static extern void elm_theme_overlay_add(IntPtr theme, string path);
229 [DllImport(Libraries.Elementary)]
230 internal static extern IntPtr elm_theme_new();
232 [DllImport(Libraries.Elementary)]
233 internal static extern void elm_object_theme_set(IntPtr obj, IntPtr theme);
235 [DllImport(Libraries.Elementary)]
236 internal static extern IntPtr elm_layout_edje_get(IntPtr obj);
238 [DllImport(Libraries.Elementary)]
239 internal static extern void edje_object_color_class_del(IntPtr obj, string colorClass);
241 [DllImport(Libraries.Elementary)]
242 internal static extern bool edje_object_part_exists(IntPtr obj, string part);
244 [DllImport(Libraries.Elementary)]
245 internal static extern IntPtr edje_object_part_object_get(IntPtr obj, string part);
247 [DllImport(Libraries.Elementary)]
248 internal static extern bool edje_object_part_geometry_get(IntPtr obj, string part, out int x, out int y, out int w, out int h);
250 [DllImport(Libraries.Elementary)]
251 internal static extern bool edje_object_part_text_set(IntPtr obj, string part, string text);
253 [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_get", CharSet = CharSet.Ansi)]
254 internal static extern IntPtr _edje_object_part_text_get(IntPtr obj, string part);
256 internal static string edje_object_part_text_get(IntPtr obj, string part)
258 var text = _edje_object_part_text_get(obj, part);
259 return Marshal.PtrToStringAnsi(text);
262 [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
263 internal static extern IntPtr _edje_object_part_text_style_user_peek(IntPtr obj, string part);
265 internal static string edje_object_part_text_style_user_peek(IntPtr obj, string part)
267 var text = _edje_object_part_text_style_user_peek(obj, part);
268 return Marshal.PtrToStringAnsi(text);
271 [DllImport(Libraries.Elementary)]
272 internal static extern void edje_object_part_text_style_user_push(IntPtr obj, string part, string style);
274 [DllImport(Libraries.Elementary)]
275 internal static extern void edje_object_part_text_style_user_pop(IntPtr obj, string part);
277 [DllImport(Libraries.Elementary)]
278 internal static extern void edje_object_signal_emit(IntPtr obj, string emission, string source);
280 internal static void SetObjectText(IntPtr obj, string text)
282 elm_object_part_text_set(obj, IntPtr.Zero, text);