Release 4.0.0-preview1-00194
[platform/core/csapi/tizenfx.git] / src / ElmSharp.Wearable / Interop / Interop.Eext.Rotary.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 Eext
23     {
24         const short EEXT_CALLBACK_PRIORITY_AFTER = 100;
25         const short EEXT_CALLBACK_PRIORITY_BEFORE = -100;
26         const short EEXT_CALLBACK_PRIORITY_DEFAULT = 0;
27
28         internal delegate bool Eext_Rotary_Event_Cb(IntPtr data, IntPtr obj, IntPtr info);
29         internal delegate bool Eext_Rotary_Handler_Cb(IntPtr data, IntPtr info);
30
31         internal enum Eext_Rotary_Event_Direction
32         {
33             Clockwise,
34             CounterClockwise
35         }
36
37         internal struct Eext_Rotary_Event_Info
38         {
39             public Eext_Rotary_Event_Direction Direction;
40             public uint TimeStamp;
41         }
42
43         internal static Eext_Rotary_Event_Info FromIntPtr(IntPtr infoPtr)
44         {
45             var info = Marshal.PtrToStructure<Eext_Rotary_Event_Info>(infoPtr);
46             return info;
47         }
48
49         [DllImport(Libraries.Eext)]
50         internal static extern IntPtr eext_rotary_object_event_activated_set(IntPtr circleObject, bool activated);
51
52         [DllImport(Libraries.Eext)]
53         internal static extern bool eext_rotary_object_event_callback_add(IntPtr obj, Eext_Rotary_Event_Cb func, IntPtr data);
54
55         [DllImport(Libraries.Eext)]
56         internal static extern bool eext_rotary_object_event_callback_priority_add(IntPtr obj, short priority, Eext_Rotary_Event_Cb func, IntPtr data);
57
58         [DllImport(Libraries.Eext)]
59         internal static extern IntPtr eext_rotary_object_event_callback_del(IntPtr obj, Eext_Rotary_Event_Cb func);
60
61         [DllImport(Libraries.Eext)]
62         internal static extern bool eext_rotary_event_handler_add(Eext_Rotary_Handler_Cb func, IntPtr data);
63
64         [DllImport(Libraries.Eext)]
65         internal static extern IntPtr eext_rotary_event_handler_del(Eext_Rotary_Handler_Cb func);
66     }
67 }