forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.bindings.cs
More file actions
72 lines (59 loc) · 3.26 KB
/
Event.bindings.cs
File metadata and controls
72 lines (59 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using UnityEngine.Bindings;
using UnityEngine.Scripting;
namespace UnityEngine
{
[NativeHeader("Modules/IMGUI/Event.bindings.h"),
StaticAccessor("GUIEvent", StaticAccessorType.DoubleColon)]
partial class Event
{
[NativeProperty("type", false, TargetType.Field)] public extern EventType rawType { get; }
[NativeProperty("mousePosition", false, TargetType.Field)] public extern Vector2 mousePosition { get; set; }
[NativeProperty("delta", false, TargetType.Field)] public extern Vector2 delta { get; set; }
[NativeProperty("button", false, TargetType.Field)] public extern int button { get; set; }
[NativeProperty("modifiers", false, TargetType.Field)] public extern EventModifiers modifiers { get; set; }
[NativeProperty("pressure", false, TargetType.Field)] public extern float pressure { get; set; }
[NativeProperty("clickCount", false, TargetType.Field)] public extern int clickCount { get; set; }
[NativeProperty("character", false, TargetType.Field)] public extern char character { get; set; }
[NativeProperty("keycode", false, TargetType.Field)] public extern KeyCode keyCode { get; set; }
[NativeProperty("displayIndex", false, TargetType.Field)] public extern int displayIndex { get; set; }
public extern EventType type
{
[FreeFunction("GUIEvent::GetType", HasExplicitThis = true)] get;
[FreeFunction("GUIEvent::SetType", HasExplicitThis = true)] set;
}
public extern string commandName
{
[FreeFunction("GUIEvent::GetCommandName", HasExplicitThis = true)] get;
[FreeFunction("GUIEvent::SetCommandName", HasExplicitThis = true)] set;
}
[NativeMethod("Use")]
private extern void Internal_Use();
[FreeFunction("GUIEvent::Internal_Create", IsThreadSafe = true)]
private static extern IntPtr Internal_Create(int displayIndex);
[FreeFunction("GUIEvent::Internal_Destroy", IsThreadSafe = true)]
private static extern void Internal_Destroy(IntPtr ptr);
[FreeFunction("GUIEvent::Internal_Copy", IsThreadSafe = true)]
private static extern IntPtr Internal_Copy(IntPtr otherPtr);
[FreeFunction("GUIEvent::GetTypeForControl", HasExplicitThis = true)]
public extern EventType GetTypeForControl(int controlID);
[VisibleToOtherModules("UnityEngine.UIElementsModule"),
FreeFunction("GUIEvent::CopyFromPtr", IsThreadSafe = true, HasExplicitThis = true)]
internal extern void CopyFromPtr(IntPtr ptr);
public static extern bool PopEvent(Event outEvent);
public static extern int GetEventCount();
private static extern void Internal_SetNativeEvent(IntPtr ptr);
[RequiredByNativeCode]
internal static void Internal_MakeMasterEventCurrent(int displayIndex)
{
if (s_MasterEvent == null)
s_MasterEvent = new Event(displayIndex);
s_MasterEvent.displayIndex = displayIndex;
s_Current = s_MasterEvent;
Internal_SetNativeEvent(s_MasterEvent.m_Ptr);
}
}
}