IAppWindow#
Fully qualified name: omni::kit::IAppWindow
-
class IAppWindow : public carb::IObject#
Application window.
Public Functions
-
virtual bool startup(const char *name) = 0#
Initializes the window taking parameters from carb::settings.
- Parameters:
name – Name that identifies the window, can be nullptr.
- Returns:
Whether the startup operation was completed successfully.
- virtual bool startupWithDesc(
- const char *name,
- const WindowDesc &desc,
Initializes the window with custom description.
- Returns:
Whether the startup operation was completed successfully.
-
virtual bool shutdown() = 0#
Deinitializes the window.
- Returns:
Whether the shutdown operation was completed successfully.
-
virtual void update(float dt = -1.0f) = 0#
Call one update loop iteration on application.
Normally, explicitly calling update is not required, as in presence of IApp interface, a subscription will be created that will be this function automatically.
- Parameters:
dt – Time elapsed since previous call. If <0 application ignores passed value and measures elapsed time automatically.
-
virtual carb::windowing::Window *getWindow() = 0#
Returns the Carbonite window the editor is working with, or nullptr if headless.
- Returns:
Carbonite window the editor is working with, or nullptr if headless.
-
virtual carb::events::IEventStream *getWindowResizeEventStream() = 0#
- Returns:
The event stream that fires events on window resize.
-
virtual carb::events::IEventStream *getWindowCloseEventStream() = 0#
- Returns:
The event stream that fires events on window close.
-
virtual carb::events::IEventStream *getWindowMoveEventStream() = 0#
- Returns:
The event stream that fires events on window move.
- virtual carb::events::IEventStream *getWindowContentScaleEventStream(
- Returns:
The event stream that fires events on window DPI scale change. Content scale event stream provides DPI and “real DPI”. The first one is affected by the DPI override, while the second one is raw hardware DPI induced this event.
-
virtual carb::events::IEventStream *getWindowDropEventStream() = 0#
- Returns:
The event stream that fires events on window drag-n-drop events.
-
virtual carb::events::IEventStream *getWindowFocusEventStream() = 0#
- Returns:
The event stream that fires events on window focus change.
-
virtual carb::events::IEventStream *getWindowMinimizeEventStream() = 0#
- Returns:
The event stream that fires events on window minimize events.
-
virtual void setFullscreen(bool fullscreen) = 0#
Sets fullscreen state of editor Window.
- Parameters:
fullscreen – true to set Editor Window to fullscreen.
-
virtual bool isFullscreen() = 0#
Gets the fullscreen state of editor Window.
- Returns:
true if Editor is fullscreen.
-
virtual void resize(uint32_t width, uint32_t height) = 0#
Resizes the window.
- Parameters:
width – The width of the window.
height – The height of the window.
-
virtual uint32_t getWidth() = 0#
- Returns:
window width.
-
virtual uint32_t getHeight() = 0#
- Returns:
window height.
-
virtual void move(int x, int y) = 0#
Moves the window.
- Parameters:
x – The x coordinate of the window.
y – The y coordinate of the window.
-
virtual float getUiScaleMultiplier() const = 0#
- Returns:
UI scale multiplier that is applied on top of the OS DPI scale.
-
virtual void setUiScaleMultiplier(float uiScaleMultiplier) = 0#
Sets the UI scale multiplier that is applied on top of OS DPI scale.
- Parameters:
uiScaleCoeff – UI scale coefficient.
-
virtual float getUiScale() const = 0#
- Returns:
UI scale. Includes UI scale multiplier and OS DPI scale.
-
virtual const char *getActionMappingSetPath() = 0#
Gets current action mapping set settings path.
- Returns:
action mapping set settings path.
-
virtual carb::input::Keyboard *getKeyboard() = 0#
Gets the keyboard associated with the window.
- Returns:
The window keyboard.
-
virtual carb::input::Mouse *getMouse() = 0#
Gets the mouse associated with the window.
- Returns:
The window mouse.
-
virtual carb::input::Gamepad *getGamepad(size_t index) = 0#
Gets one of the gamepads available.
- Returns:
The window gamepad or nullptr if index is invalid.
-
virtual const char *getTitle() = 0#
- Returns:
Window title.
-
virtual float getDpiScale() const = 0#
- Returns:
DPI scale.
-
virtual void setDpiScaleOverride(float dpiScaleOverride) = 0#
Sets the DPI scale override.
Negative value means no override.
- Parameters:
dpiScaleOverride – DPI scale overrides.
-
virtual float getDpiScaleOverride() const = 0#
Gets DPI scale override.
- Returns:
DPI scale override.
- virtual void setInputBlockingState(
- carb::input::DeviceType deviceType,
- bool shouldBlock,
Sets the forced rejecting of all input events from a certain device type.
- Parameters:
deviceType – The input device type, e.g. keyboard, mouse or gamepad.
shouldBlock – Whether we should block the device input or not.
- virtual bool getInputBlockingState(
- carb::input::DeviceType deviceType,
Gets whether the input for a certain device types is being blocked.
- Parameters:
deviceType – The input device type, e.g. keyboard, mouse or gamepad.
- Returns:
whether the input for a certain device types is being blocked.
-
inline void broadcastInputBlockingState(bool shouldBlock)#
Sets the forced rejecting of all input events for all device types.
- Parameters:
shouldBlock – Whether we should block the device input or not.
-
virtual WindowType getWindowType() const = 0#
Gets the window type: Virtual/OS window.
- Returns:
Window Type: Virtual/OS window
-
virtual bool getCursorBlink() const = 0#
- Returns:
True if cursor (caret) blinks in input fields.
-
virtual const char *getClipboard() = 0#
Gets the text from the clipboard associated with the window.
- Returns:
The text in the window’s clipboard.
-
virtual void setClipboard(const char *text) = 0#
Sets the text in the clipboard associated with the window.
- Parameters:
text – The text in the window’s clipboard.
-
virtual void maximizeWindow() = 0#
Maximize the editor window.
-
virtual void restoreWindow() = 0#
Restore the editor window (exit maximize/minimize).
-
virtual bool isMaximized() = 0#
Gets the maxinized state of editor Window.
- Returns:
true if Editor is maximized.
-
virtual void setKeyboard(carb::input::Keyboard *keyboard) = 0#
Allows to replace the keyboard.
- Parameters:
keyboard – the keyboard this AppWindow should follow.
-
virtual void focusWindow() = 0#
Focus the window and bring to front, if applicable.
-
virtual bool startup(const char *name) = 0#