VLC 4.0.0-dev
|
Window management. More...
Modules | |
Window event reporting | |
Window provider event reporting. | |
Files | |
file | vlc_window.h |
Window modules interface. | |
Data Structures | |
struct | vlc_window_mouse_event |
Window mouse event. More... | |
struct | vlc_window_cfg |
Window (desired) configuration. More... | |
struct | vlc_window_callbacks |
Window event callbacks structure. More... | |
struct | vlc_window_owner |
Window callbacks and opaque data. More... | |
struct | vlc_window_operations |
Window implementation callbacks. More... | |
struct | vlc_window |
Window object. More... | |
Typedefs | |
typedef struct vlc_icc_profile_t | vlc_icc_profile_t |
typedef struct vlc_window_mouse_event | vlc_window_mouse_event_t |
Window mouse event. More... | |
typedef struct vlc_window_cfg | vlc_window_cfg_t |
Window (desired) configuration. More... | |
typedef void(* | vlc_window_ack_cb) (struct vlc_window *, unsigned width, unsigned height, void *data) |
Callback prototype for window event acknowledgement. More... | |
typedef struct vlc_window_owner | vlc_window_owner_t |
Window callbacks and opaque data. More... | |
typedef struct vlc_window | vlc_window_t |
Window object. More... | |
Enumerations | |
enum | vlc_window_type { VLC_WINDOW_TYPE_DUMMY , VLC_WINDOW_TYPE_XID , VLC_WINDOW_TYPE_HWND , VLC_WINDOW_TYPE_NSOBJECT , VLC_WINDOW_TYPE_ANDROID_NATIVE , VLC_WINDOW_TYPE_WAYLAND , VLC_WINDOW_TYPE_DCOMP , VLC_WINDOW_TYPE_KMS } |
Window handle type. More... | |
enum | vlc_window_state { VLC_WINDOW_STATE_NORMAL , VLC_WINDOW_STATE_ABOVE , VLC_WINDOW_STATE_BELOW } |
Window states. More... | |
enum | vlc_window_mouse_event_type { VLC_WINDOW_MOUSE_MOVED , VLC_WINDOW_MOUSE_PRESSED , VLC_WINDOW_MOUSE_RELEASED , VLC_WINDOW_MOUSE_DOUBLE_CLICK } |
Window mouse event types. More... | |
Functions | |
vlc_window_t * | vlc_window_New (vlc_object_t *obj, const char *module, const vlc_window_owner_t *owner, const vlc_window_cfg_t *cfg) |
Creates a new window. More... | |
void | vlc_window_Delete (vlc_window_t *window) |
Deletes a window. More... | |
void | vlc_window_SetInhibition (vlc_window_t *window, bool enabled) |
Inhibits or deinhibits the screensaver. More... | |
static void | vlc_window_SetState (vlc_window_t *window, unsigned state) |
Requests a new window state. More... | |
void | vlc_window_SetSize (vlc_window_t *window, unsigned width, unsigned height) |
Requests a new window size. More... | |
void | vlc_window_SetFullScreen (vlc_window_t *window, const char *id) |
Requests fullscreen mode. More... | |
void | vlc_window_UnsetFullScreen (vlc_window_t *window) |
Requests windowed mode. More... | |
static void | vlc_window_SetTitle (vlc_window_t *window, const char *title) |
Request a new window title. More... | |
int | vlc_window_Enable (vlc_window_t *window) |
Enables a window. More... | |
void | vlc_window_Disable (vlc_window_t *window) |
Disables a window. More... | |
Window management.
Window management provides a partial abstraction for windowing systems and rendering targets (i.e. "windows"). See vlc_window_t.
typedef struct vlc_icc_profile_t vlc_icc_profile_t |
typedef void(* vlc_window_ack_cb) (struct vlc_window *, unsigned width, unsigned height, void *data) |
Callback prototype for window event acknowledgement.
width | pixel width as supplied to vlc_window_callbacks::resized |
height | pixel height as supplied to vlc_window_callbacks::resized |
data | opaque pointer as supplied to vlc_window_callbacks::resized |
typedef struct vlc_window_cfg vlc_window_cfg_t |
Window (desired) configuration.
This structure describes the intended initial configuration of a vlc_window_t.
typedef struct vlc_window_mouse_event vlc_window_mouse_event_t |
Window mouse event.
This structure describes a pointer input event on a window.
typedef struct vlc_window_owner vlc_window_owner_t |
Window callbacks and opaque data.
typedef struct vlc_window vlc_window_t |
Window object.
This structure is an abstract interface to the windowing system. The window is normally used to draw video (and subpictures) into, but it can also be used for other purpose (e.g. OpenGL visualization).
The window is responsible for providing a window handle, whose exact meaning depends on the windowing system. It also must report some events such as user input (keyboard, mouse) and window resize.
Finally, it must support some control requests such as for fullscreen mode.
Window mouse event types.
This enumeration defines the possible event types vlc_window_mouse_event_t::type.
enum vlc_window_state |
Window states.
Currently, this only handles different window stacking orders. See also vlc_window_SetState().
Enumerator | |
---|---|
VLC_WINDOW_STATE_NORMAL | Normal stacking. |
VLC_WINDOW_STATE_ABOVE | Stacking above (a.k.a. always on top) |
VLC_WINDOW_STATE_BELOW | Stacking below (a.k.a. wall paper mode) |
enum vlc_window_type |
Window handle type.
The window handle type specifies the window system protocol that the window was created with. It determines which members of the vlc_window_t::handle and vlc_window_t::display unions are defined for the given window.
It also establishes some protocol-dependent semantics such as the exact interpretation of the window state (vlc_window_state) and the window size.
void vlc_window_Delete | ( | vlc_window_t * | window | ) |
Deletes a window.
This deletes a window created by vlc_window_New().
window | window object to delete |
References window_t::active, container_of, vlc_window_operations::destroy, window_t::inhibit, window_t::lock, vlc_window::ops, vlc_inhibit_Destroy(), vlc_mutex_lock(), vlc_mutex_unlock(), VLC_OBJECT, vlc_object_delete, and vlc_objres_clear().
Referenced by vlc_gl_surface_Create(), vlc_gl_surface_Destroy(), and vout_display_window_Delete().
void vlc_window_Disable | ( | vlc_window_t * | window | ) |
Disables a window.
This informs the window provider that the window is no longer needed.
window | window to disable |
References vlc_window_operations::disable, vlc_window::ops, and vlc_window_SetInhibition().
Referenced by vlc_gl_surface_Create(), vlc_gl_surface_Destroy(), and vout_DisableWindow().
int vlc_window_Enable | ( | vlc_window_t * | window | ) |
Enables a window.
This informs the window provider that the window is about to be taken into active use. A window is always initially disabled. This is so that the window provider can provide a persistent connection to the display server, and track any useful events, such as monitors hotplug.
The window handle (vlc_window_t.handle) must remain valid and constant while the window is enabled.
window | window to enable |
cfg | initial configuration for the window |
References window_t::cfg, container_of, vlc_window_operations::enable, vlc_window::ops, VLC_SUCCESS, and vlc_window_SetInhibition().
Referenced by EnableWindowLocked(), and vlc_gl_surface_Create().
vlc_window_t * vlc_window_New | ( | vlc_object_t * | obj, |
const char * | module, | ||
const vlc_window_owner_t * | owner, | ||
const vlc_window_cfg_t * | cfg | ||
) |
Creates a new window.
This function creates a window, or some other kind of rectangle render target.
obj | parent VLC object |
module | plugin name, NULL for default |
owner | callbacks and private data |
cfg | initial window configuration, NULL for defaults |
void vlc_window_SetFullScreen | ( | vlc_window_t * | window, |
const char * | id | ||
) |
Requests fullscreen mode.
window | window to be brought to fullscreen mode. |
id | nul-terminated output identifier, NULL for default |
References window_t::cfg, container_of, vlc_window_cfg::is_fullscreen, vlc_window::ops, and vlc_window_operations::set_fullscreen.
Referenced by vlc_window_New(), and vout_ChangeFullscreen().
void vlc_window_SetInhibition | ( | vlc_window_t * | window, |
bool | enabled | ||
) |
Inhibits or deinhibits the screensaver.
window | window in respect to which the screensaver should be inhibited or deinhibited |
enabled | true to inhibit, false to deinhibit |
References window_t::active, container_of, window_t::lock, vlc_mutex_lock(), vlc_mutex_unlock(), and vlc_window_UpdateInhibitionUnlocked().
Referenced by vlc_window_Disable(), vlc_window_Enable(), and vout_ChangePause().
void vlc_window_SetSize | ( | vlc_window_t * | window, |
unsigned | width, | ||
unsigned | height | ||
) |
Requests a new window size.
This requests a change of the window size. In general and unless otherwise stated, the size is expressed in pixels. However, the exact interpretation of the window size depends on the windowing system.
There is no return value as the request may be processed asynchronously, ignored and/or modified by the window system. The actual size of the window is determined by the vlc_window_callbacks::resized callback function that was supplied to vlc_window_New().
window | window whom a size change is requested for |
width | pixel width |
height | height width |
References window_t::cfg, container_of, vlc_window_cfg::height, vlc_window::ops, vlc_window_operations::resize, and vlc_window_cfg::width.
Referenced by vlc_window_New(), and vout_display_ResizeWindow().
|
inlinestatic |
Requests a new window state.
This requests a change of the state of a window from the windowing system. See vlc_window_state for possible states.
window | window whose state to change |
state | requested state |
References vlc_window::ops, vlc_window_operations::set_state, and state.
Referenced by vout_ChangeWindowState(), and vout_Create().
|
inlinestatic |
Request a new window title.
window | window to change the title. |
title | window title to use. |
References vlc_window::ops, and vlc_window_operations::set_title.
void vlc_window_UnsetFullScreen | ( | vlc_window_t * | window | ) |
Requests windowed mode.
window | window to be brought into windowed mode. |
References window_t::cfg, container_of, vlc_window_cfg::is_fullscreen, vlc_window::ops, and vlc_window_operations::unset_fullscreen.
Referenced by vout_ChangeWindowed().