-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathContainerWindow.bindings.cs
More file actions
106 lines (82 loc) · 4.8 KB
/
ContainerWindow.bindings.cs
File metadata and controls
106 lines (82 loc) · 4.8 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using UnityEngine;
using UnityEngine.Bindings;
namespace UnityEditor
{
// How ContainerWindows are visualized. Used with ContainerWindow.Show
internal enum ShowMode
{
// Show as a normal window with max, min & close buttons.
NormalWindow = 0,
// Used for a popup menu. On mac this means light shadow and no titlebar.
PopupMenu = 1,
// Utility window - floats above the app. Disappears when app loses focus.
Utility = 2,
// Window has no shadow or decorations. Used internally for dragging stuff around.
NoShadow = 3,
// The Unity main window. On mac, this is the same as NormalWindow, except window doesn't have a close button.
MainWindow = 4,
// Aux windows. The ones that close the moment you move the mouse out of them.
AuxWindow = 5,
// Like PopupMenu, but without keyboard focus
Tooltip = 6
}
//[StaticAccessor("ContainerWindowBindings", StaticAccessorType.DoubleColon)]
[NativeHeader("Editor/Src/ContainerWindow.bindings.h")]
[MarshalUnityObjectAs(typeof(MonoBehaviour))]
internal partial class ContainerWindow
{
private const string k_ScriptingPrefix = "ContainerWindowBindings::";
// Pixel-position on screen.
public extern Rect position
{
[FreeFunction(k_ScriptingPrefix + "GetPosition", HasExplicitThis = true)] get;
[FreeFunction(k_ScriptingPrefix + "SetPosition", HasExplicitThis = true)] set;
}
public extern bool maximized {[FreeFunction(k_ScriptingPrefix + "IsWindowMaximized", HasExplicitThis = true)] get; }
[FreeFunction(k_ScriptingPrefix + "SetAlpha", HasExplicitThis = true)]
public extern void SetAlpha(float alpha);
// Used by invisible "under the mouse" window of the eye dropper.
[FreeFunction(k_ScriptingPrefix + "SetInvisible", HasExplicitThis = true)]
public extern void SetInvisible();
[FreeFunction(k_ScriptingPrefix + "IsZoomed", HasExplicitThis = true)]
public extern bool IsZoomed();
[FreeFunction(k_ScriptingPrefix + "DisplayAllViews", HasExplicitThis = true)]
public extern void DisplayAllViews();
[FreeFunction(k_ScriptingPrefix + "Minimize", HasExplicitThis = true)]
public extern void Minimize();
[FreeFunction(k_ScriptingPrefix + "ToggleMaximize", HasExplicitThis = true)]
public extern void ToggleMaximize();
[FreeFunction(k_ScriptingPrefix + "MoveInFrontOf", HasExplicitThis = true)]
public extern void MoveInFrontOf(ContainerWindow other);
[FreeFunction(k_ScriptingPrefix + "MoveBehindOf", HasExplicitThis = true)]
public extern void MoveBehindOf(ContainerWindow other);
// Fit a container window to the screen.
[FreeFunction(k_ScriptingPrefix + "FitWindowRectToScreen", HasExplicitThis = true)]
public extern Rect FitWindowRectToScreen(Rect r, bool forceCompletelyVisible, bool useMouseScreen);
// Close the editor window.
[FreeFunction(k_ScriptingPrefix + "InternalClose", HasExplicitThis = true)]
public extern void InternalClose();
[FreeFunction(k_ScriptingPrefix + "Internal_SetMinMaxSizes", HasExplicitThis = true)]
private extern void Internal_SetMinMaxSizes(Vector2 minSize, Vector2 maxSize);
[FreeFunction(k_ScriptingPrefix + "Internal_Show", HasExplicitThis = true)]
private extern void Internal_Show(Rect r, int showMode, Vector2 minSize, Vector2 maxSize);
[FreeFunction(k_ScriptingPrefix + "Internal_BringLiveAfterCreation", HasExplicitThis = true)]
private extern void Internal_BringLiveAfterCreation(bool displayImmediately, bool setFocus);
[FreeFunction(k_ScriptingPrefix + "Internal_SetTitle", HasExplicitThis = true)]
private extern void Internal_SetTitle(string title);
[FreeFunction(k_ScriptingPrefix + "SetBackgroundColor", HasExplicitThis = true)]
private extern void SetBackgroundColor(Color color);
[FreeFunction(k_ScriptingPrefix + "Internal_GetTopleftScreenPosition", HasExplicitThis = true)]
private extern Vector2 Internal_GetTopleftScreenPosition();
// Disables any repaints until freeze is set to false again.
[FreeFunction(k_ScriptingPrefix + "SetFreezeDisplay")]
public static extern void SetFreezeDisplay(bool freeze);
[FreeFunction(k_ScriptingPrefix + "GetOrderedWindowList")]
internal static extern void GetOrderedWindowList();
[FreeFunction(k_ScriptingPrefix + "FitRectToScreen")]
internal static extern Rect FitRectToScreen(Rect defaultRect, bool forceCompletelyVisible, bool useMouseScreen);
}
}