-
Notifications
You must be signed in to change notification settings - Fork 701
Expand file tree
/
Copy pathIClydeWindow.cs
More file actions
92 lines (81 loc) · 3.22 KB
/
Copy pathIClydeWindow.cs
File metadata and controls
92 lines (81 loc) · 3.22 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
using Robust.Shared.Map;
using Robust.Shared.Maths;
using SDL3;
using System;
using System.Numerics;
namespace Robust.Client.Graphics
{
/// <summary>
/// Represents a single operating system window.
/// </summary>
[NotContentImplementable]
public interface IClydeWindow : IDisposable
{
bool IsDisposed { get; }
WindowId Id { get; }
IRenderTarget RenderTarget { get; }
string Title { get; set; }
Vector2i Size { get; set; }
bool IsFocused { get; }
bool IsMinimized { get; }
bool IsVisible { get; set; }
/// <summary>
/// If set to false, then the titlebar and border of the window will be hidden.
/// </summary>
bool IsBordered { get; set; }
Vector2 ContentScale { get; }
/// <summary>
/// If set to true, the user closing the window will also <see cref="IDisposable.Dispose"/> it.
/// </summary>
bool DisposeOnClose { get; set; }
/// <summary>
/// Fired when the user tries to close the window. Note that if <see cref="DisposeOnClose"/> is not true,
/// this is merely a request and the user pressing the close button does nothing.
/// </summary>
event Action<WindowRequestClosedEventArgs> RequestClosed;
/// <summary>
/// Raised when the window has been definitively closed.
/// This means the window must not be used anymore (it is disposed).
/// </summary>
event Action<WindowDestroyedEventArgs> Destroyed;
/// <summary>
/// Raised when the window has been resized.
/// </summary>
event Action<WindowResizedEventArgs> Resized;
internal void SetWindowProgress(WindowProgressState state, float value);
/// <summary>
/// Set the active text input area in window pixel coordinates.
/// </summary>
/// <param name="rect">
/// This information is used by the OS to position overlays like IMEs or emoji pickers etc.
/// </param>
void TextInputSetRect(UIBox2i rect, int cursor);
/// <summary>
/// Indicate that the game should start accepting text input on the currently focused window.
/// </summary>
/// <remarks>
/// On some platforms, this will cause an on-screen keyboard to appear.
/// The game will also start accepting IME input if configured by the user.
/// </remarks>
/// <seealso cref="TextInputStop"/>
void TextInputStart();
/// <summary>
/// Stop text input, opposite of <see cref="TextInputStart"/>.
/// </summary>
/// <seealso cref="TextInputStart"/>
void TextInputStop();
}
internal enum WindowProgressState : byte
{
None = SDL.SDL_ProgressState.SDL_PROGRESS_STATE_NONE,
Indeterminate = SDL.SDL_ProgressState.SDL_PROGRESS_STATE_INDETERMINATE,
Normal = SDL.SDL_ProgressState.SDL_PROGRESS_STATE_NORMAL,
Paused = SDL.SDL_ProgressState.SDL_PROGRESS_STATE_PAUSED,
Error = SDL.SDL_ProgressState.SDL_PROGRESS_STATE_ERROR
}
[NotContentImplementable]
internal interface IClydeWindowInternal : IClydeWindow
{
nint? WindowsHWnd { get; }
}
}