using System;
using System.Numerics;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using SDL3;
namespace Robust.Client.Graphics
{
///
/// Represents a single operating system window.
///
[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; }
Vector2 ContentScale { get; }
///
/// If set to true, the user closing the window will also it.
///
bool DisposeOnClose { get; set; }
///
/// Fired when the user tries to close the window. Note that if is not true,
/// this is merely a request and the user pressing the close button does nothing.
///
event Action RequestClosed;
///
/// Raised when the window has been definitively closed.
/// This means the window must not be used anymore (it is disposed).
///
event Action Destroyed;
///
/// Raised when the window has been resized.
///
event Action Resized;
internal void SetWindowProgress(WindowProgressState state, float value);
///
/// Set the active text input area in window pixel coordinates.
///
///
/// This information is used by the OS to position overlays like IMEs or emoji pickers etc.
///
void TextInputSetRect(UIBox2i rect, int cursor);
///
/// Indicate that the game should start accepting text input on the currently focused window.
///
///
/// 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.
///
///
void TextInputStart();
///
/// Stop text input, opposite of .
///
///
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; }
}
}