Window
Category | refcounted |
Type | hime_window_t |
Inherits | Object |
Top-level window.
Constructors
hime_window_t hime_window_create(options)
Create a new window.
Parameters
hime_window_options_t*
options
Return
hime_window_t
Methods
void hime_window_close(self)
Close the window.
Parameters
hime_window_t
self
Return
void
void hime_window_set_content_view(self, view)
Set the window's content view.
Parameters
hime_window_t
selfhime_view_t
view
Return
void
hime_view_t hime_window_get_content_view(self)
Get the window's content view.
Parameters
hime_window_const_t
self
Return
hime_view_t
void hime_window_activate(self)
Show and focus the window.
Parameters
hime_window_t
self
Return
void
void hime_window_deactivate(self)
Deactivate the window, making the next window in the Z order the active window.
Parameters
hime_window_t
self
Return
void
bool hime_window_is_active(self)
Return whether the window is the currently active window.
Parameters
hime_window_const_t
self
Return
bool
void hime_window_set_visible(self, visible)
Set whether window is visible.
Parameters
hime_window_t
selfbool
visible
Return
void
bool hime_window_is_visible(self)
Return whether the window is visible.
Parameters
hime_window_const_t
self
Return
bool
void hime_window_set_fullscreen(self, fullscreen)
Enter/leave fullscreen state.
Parameters
hime_window_t
selfbool
fullscreen
Return
void
bool hime_window_is_fullscreen(self)
Return whether window is in fullscreen.
Parameters
hime_window_const_t
self
Return
bool
void hime_window_maximize(self)
Maximize the window.
Parameters
hime_window_t
self
Return
void
bool hime_window_is_maximized(self)
Return whether window is maximized.
Parameters
hime_window_const_t
self
Return
bool
void hime_window_minimize(self)
Minimize the window.
Parameters
hime_window_t
self
Return
void
bool hime_window_is_minimized(self)
Return whether window is minimized.
Parameters
hime_window_const_t
self
Return
bool
void hime_window_restore(self)
Put the window into the normal state.
Parameters
hime_window_t
self
Return
void
void hime_window_set_resizable(self, resizable)
Set whether window can be resized.
Parameters
hime_window_t
selfbool
resizable
Return
void
bool hime_window_is_resizable(self)
Return whether window can be resized.
Parameters
hime_window_const_t
self
Return
bool
void hime_window_set_maximizable(self, maximizable)
Set whether window can be maximized.
Parameters
hime_window_t
selfbool
maximizable
Return
void
bool hime_window_is_maximizable(self)
Return whether window can be maximized.
Parameters
hime_window_const_t
self
Return
bool
void hime_window_set_minimizable(self, minimizable)
Set whether window can be minimized.
Parameters
hime_window_t
selfbool
minimizable
Return
void
bool hime_window_is_minimizable(self)
Return whether window can be minimized.
Parameters
hime_window_const_t
self
Return
bool
void hime_window_set_fullscreenable(self, fullscreenable)
Set whether window can enter fullscreen.
Parameters
hime_window_t
selfbool
fullscreenable
Return
void
bool hime_window_is_fullscreenable(self)
Return whether window can enter fullscreen.
Parameters
hime_window_const_t
self
Return
bool
void hime_window_set_bounds(self, bounds)
Resize and/or place the window to the specified bounds.
Parameters
hime_window_t
selfhime_rect_t
bounds
Return
void
hime_rect_t hime_window_get_bounds(self)
Return the bounds of the window in screen coordinates.
Parameters
hime_window_const_t
self
Return
hime_rect_t
void hime_window_set_size(self, size)
Resize the window to the specified size.
Parameters
hime_window_t
selfhime_size_t
size
Return
void
hime_size_t hime_window_get_size(self)
Return the restored size for the window.
Parameters
hime_window_const_t
self
Return
hime_size_t
void hime_window_center_to(self, size)
Resize the window to the specified size and center it.
Parameters
hime_window_t
selfhime_size_t
size
Return
void
void hime_window_set_title(self, title)
Set window title.
Parameters
hime_window_t
selfconst char16_t*
title
Return
void
const char16_t* hime_window_get_title(self)
Return window title.
Parameters
hime_window_const_t
self
Return
const char16_t*
void hime_window_set_opacity(self, opacity)
Set the opacity of the window.
This may allow windows behind the window in the Z-order to become visible, depending on the capabilities of the underlying windowing system.
Parameters
hime_window_t
selffloat
opacity
Return
void
void hime_window_set_aspect_ratio(self, aspect_ratio)
Set the aspect ratio of the window's client view, which will be maintained during interactive resizing.
Note that for windows that have a client view that is framed by
custom-drawn borders / window frame / etc, the window size will be chosen
so that the aspect ratio of client view, not the entire window, will be
aspect_ratio
.
Once set, some platforms ensure the content will only size to integer
multiples of aspect_ratio
.
Parameters
hime_window_t
selfhime_sizef_t
aspect_ratio
Return
void
void hime_window_flash_frame(self, flash) win
Flashes the frame of the window to draw attention to it.
Parameters
hime_window_t
selfbool
flash
Return
void
Events
void hime_window_on_close(window)
Emitted when window is closed.
Parameters
hime_window_t
window
Preventable
No.
void hime_window_on_visibility_change(window, visible)
Emitted when window's visibility has been changed.
Parameters
hime_window_t
windowbool
visible
Preventable
No.
void hime_window_on_activation_change(window, active)
Emitted when window is focused or blurred.
Parameters
hime_window_t
windowbool
active
Preventable
No.
void hime_window_on_bounds_change(window, new_bounds)
Emitted when window has been moved or resized.
Parameters
hime_window_t
windowhime_rect_t
new_bounds
Preventable
No.