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 IntPtr elm_win_add(IntPtr parent, string name, int type);
27 [DllImport(Libraries.Elementary)]
28 internal static extern IntPtr elm_win_util_standard_add(string name, string title);
30 [DllImport(Libraries.Elementary)]
31 internal static extern void elm_win_activate(IntPtr obj);
33 [DllImport(Libraries.Elementary)]
34 internal static extern void elm_win_title_set(IntPtr obj, string title);
36 [DllImport(Libraries.Elementary, EntryPoint = "elm_win_title_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)]
37 internal static extern IntPtr _elm_win_title_get(IntPtr obj);
39 internal static string elm_win_title_get(IntPtr obj)
41 var text = _elm_win_title_get(obj);
42 return Marshal.PtrToStringAnsi(text);
45 [DllImport(Libraries.Elementary)]
46 internal static extern void elm_win_screen_size_get(IntPtr obj, out int x, out int y, out int w, out int h);
48 [DllImport(Libraries.Elementary)]
49 internal static extern void elm_win_resize_object_del(IntPtr obj, IntPtr subobj);
51 [DllImport(Libraries.Elementary)]
52 internal static extern void elm_win_resize_object_add(IntPtr obj, IntPtr subobj);
54 [DllImport(Libraries.Elementary)]
55 internal static extern void elm_win_autodel_set(IntPtr obj, bool autodel);
57 [DllImport(Libraries.Elementary)]
58 internal static extern bool elm_win_autodel_get(IntPtr obj);
60 [DllImport(Libraries.Elementary)]
61 internal static extern void elm_win_indicator_opacity_set(IntPtr obj, int opacity);
63 [DllImport(Libraries.Elementary)]
64 internal static extern int elm_win_indicator_opacity_get(IntPtr obj);
66 [DllImport(Libraries.Elementary)]
67 internal static extern void elm_win_indicator_mode_set(IntPtr obj, int mode);
69 [DllImport(Libraries.Elementary)]
70 internal static extern int elm_win_indicator_mode_get(IntPtr obj);
72 [DllImport(Libraries.Elementary)]
73 internal static extern void elm_win_conformant_set(IntPtr obj, bool conformant);
75 [DllImport(Libraries.Elementary)]
76 internal static extern bool elm_win_fullscreen_get(IntPtr obj);
78 [DllImport(Libraries.Elementary)]
79 internal static extern void elm_win_fullscreen_set(IntPtr obj, bool fullscreen);
81 [DllImport(Libraries.Elementary)]
82 internal static extern void elm_win_rotation_set(IntPtr obj, int rotation);
84 [DllImport(Libraries.Elementary)]
85 internal static extern int elm_win_rotation_get(IntPtr obj);
87 [DllImport(Libraries.Elementary)]
88 internal static extern bool elm_win_wm_rotation_supported_get(IntPtr obj);
90 [DllImport(Libraries.Elementary, EntryPoint = "elm_win_wm_rotation_available_rotations_set")]
91 internal static extern void _elm_win_wm_rotation_available_rotations_set(IntPtr obj, IntPtr rotations, uint count);
93 internal static void elm_win_wm_rotation_available_rotations_set(IntPtr obj, int[] rotations)
95 IntPtr pRotations = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)) * rotations.Length);
96 Marshal.Copy(rotations, 0, pRotations, rotations.Length);
97 _elm_win_wm_rotation_available_rotations_set(obj, pRotations, (uint)rotations.Length);
98 Marshal.FreeHGlobal(pRotations);
101 [DllImport(Libraries.Elementary, EntryPoint = "elm_win_wm_rotation_available_rotations_get")]
102 internal static extern bool _elm_win_wm_rotation_available_rotations_get(IntPtr obj, out IntPtr rotations, out int count);
104 internal static bool elm_win_wm_rotation_available_rotations_get(IntPtr obj, out int[] rotations)
106 IntPtr rotationArrPtr;
108 if (_elm_win_wm_rotation_available_rotations_get(obj, out rotationArrPtr, out count))
110 rotations = new int[count];
111 Marshal.Copy(rotationArrPtr, rotations, 0, count);
112 Libc.Free(rotationArrPtr);
119 [DllImport(Libraries.Elementary)]
120 internal static extern void elm_win_screen_dpi_get(IntPtr obj, out int xdpi, out int ydpi);