VLC
4.0.0-dev
|
Window management. More...
![]() |
Files | |
file | vlc_vout_window.h |
Window modules interface. | |
Data Structures | |
struct | vout_window_mouse_event_t |
Window mouse event. More... | |
struct | vout_window_cfg_t |
Window (desired) configuration. More... | |
struct | vout_window_callbacks |
Window event callbacks structure. More... | |
struct | vout_window_owner |
Window callbacks and opaque data. More... | |
struct | vout_window_operations |
Window implementation callbacks. More... | |
struct | vout_window_t |
Window object. More... | |
Typedefs | |
typedef struct vout_window_mouse_event_t | vout_window_mouse_event_t |
Window mouse event. More... | |
typedef struct vout_window_cfg_t | vout_window_cfg_t |
Window (desired) configuration. More... | |
typedef struct vout_window_owner | vout_window_owner_t |
Window callbacks and opaque data. More... | |
typedef struct vout_window_t | vout_window_t |
Window object. More... | |
Enumerations | |
enum | vout_window_type { VOUT_WINDOW_TYPE_DUMMY, VOUT_WINDOW_TYPE_XID, VOUT_WINDOW_TYPE_HWND, VOUT_WINDOW_TYPE_NSOBJECT, VOUT_WINDOW_TYPE_ANDROID_NATIVE, VOUT_WINDOW_TYPE_WAYLAND } |
Window handle type. More... | |
enum | vout_window_state { VOUT_WINDOW_STATE_NORMAL, VOUT_WINDOW_STATE_ABOVE, VOUT_WINDOW_STATE_BELOW } |
Window states. More... | |
enum | vout_window_mouse_event_type { VOUT_WINDOW_MOUSE_MOVED, VOUT_WINDOW_MOUSE_PRESSED, VOUT_WINDOW_MOUSE_RELEASED, VOUT_WINDOW_MOUSE_DOUBLE_CLICK } |
Window mouse event types. More... | |
Functions | |
vout_window_t * | vout_window_New (vlc_object_t *obj, const char *module, const vout_window_owner_t *owner) |
Creates a new window. More... | |
void | vout_window_Delete (vout_window_t *window) |
Deletes a window. More... | |
void | vout_window_SetInhibition (vout_window_t *window, bool enabled) |
Inhibits or deinhibits the screensaver. More... | |
static void | vout_window_SetState (vout_window_t *window, unsigned state) |
Requests a new window state. More... | |
static void | vout_window_SetSize (vout_window_t *window, unsigned width, unsigned height) |
Requests a new window size. More... | |
static void | vout_window_SetFullScreen (vout_window_t *window, const char *id) |
Requests fullscreen mode. More... | |
static void | vout_window_UnsetFullScreen (vout_window_t *window) |
Requests windowed mode. More... | |
static void | vout_window_SetTitle (vout_window_t *window, const char *title) |
Request a new window title. More... | |
int | vout_window_Enable (vout_window_t *window, const vout_window_cfg_t *cfg) |
Enables a window. More... | |
void | vout_window_Disable (vout_window_t *window) |
Disables a window. More... | |
static void | vout_window_ReportSize (vout_window_t *window, unsigned width, unsigned height) |
Reports the current window size. More... | |
static void | vout_window_ReportClose (vout_window_t *window) |
Reports a request to close the window. More... | |
static void | vout_window_ReportState (vout_window_t *window, unsigned state) |
Reports the current window state. More... | |
void | vout_window_ReportWindowed (vout_window_t *wnd) |
Reports that the window is not in full screen. More... | |
void | vout_window_ReportFullscreen (vout_window_t *wnd, const char *id) |
Reports that the window is in full screen. More... | |
static void | vout_window_SendMouseEvent (vout_window_t *window, const vout_window_mouse_event_t *mouse) |
static void | vout_window_ReportMouseMoved (vout_window_t *window, int x, int y) |
Reports a pointer movement. More... | |
static void | vout_window_ReportMousePressed (vout_window_t *window, int button) |
Reports a mouse button press. More... | |
static void | vout_window_ReportMouseReleased (vout_window_t *window, int button) |
Reports a mouse button release. More... | |
static void | vout_window_ReportMouseDoubleClick (vout_window_t *window, int button) |
Reports a mouse double-click. More... | |
static void | vout_window_ReportKeyPress (vout_window_t *window, int key) |
Reports a keyboard key press. More... | |
static void | vout_window_ReportOutputDevice (vout_window_t *window, const char *id, const char *name) |
Adds/removes a fullscreen output. More... | |
Window management.
Window management provides a partial abstraction for windowing systems and rendering targets (i.e. "windows"). See vout_window_t.
typedef struct vout_window_cfg_t vout_window_cfg_t |
Window (desired) configuration.
This structure describes the intended initial configuration of a vout_window_t.
typedef struct vout_window_mouse_event_t vout_window_mouse_event_t |
Window mouse event.
This structure describes a pointer input event on a window.
typedef struct vout_window_owner vout_window_owner_t |
Window callbacks and opaque data.
typedef struct vout_window_t vout_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 vout_window_mouse_event_t::type.
enum vout_window_state |
Window states.
Currently, this only handles different window stacking orders. See also vout_window_SetState().
Enumerator | |
---|---|
VOUT_WINDOW_STATE_NORMAL | Normal stacking. |
VOUT_WINDOW_STATE_ABOVE | Stacking above (a.k.a. always on top) |
VOUT_WINDOW_STATE_BELOW | Stacking below (a.k.a. wall paper mode) |
enum vout_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 vout_window_t::handle and vout_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 (vout_window_state) and the window size.
void vout_window_Delete | ( | vout_window_t * | window | ) |
Deletes a window.
This deletes a window created by vout_window_New().
window | window object to delete |
References window_t::active, container_of, vout_window_operations::destroy, window_t::inhibit, window_t::lock, vout_window_t::ops, vlc_inhibit_Destroy(), vlc_mutex_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 vout_window_Disable | ( | vout_window_t * | window | ) |
Disables a window.
This informs the window provider that the window is no longer needed.
References vout_window_operations::disable, vout_window_t::ops, and vout_window_SetInhibition().
Referenced by vlc_gl_surface_Destroy(), vout_DisableWindow(), and vout_window_SetTitle().
int vout_window_Enable | ( | vout_window_t * | window, |
const vout_window_cfg_t * | cfg | ||
) |
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 (vout_window_t.handle) must remain valid and constant while the window is enabled.
Referenced by vout_window_SetTitle().
vout_window_t* vout_window_New | ( | vlc_object_t * | obj, |
const char * | module, | ||
const vout_window_owner_t * | owner | ||
) |
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 |
References window_t::active, window_t::fullscreen, vout_window_t::handle, vout_window_t::has_double_click, vout_window_t::info, window_t::inhibit, window_t::inhibit_windowed, window_t::lock, window_t::module, vout_window_t::owner, vout_window_t::sys, var_InheritInteger(), vlc_custom_create, vlc_inhibit_Create(), vlc_module_load, vlc_mutex_destroy(), vlc_mutex_init(), vlc_mutex_lock(), vlc_mutex_unlock(), VLC_OBJECT, vlc_object_delete, vout_window_start(), and window_t::wnd.
Referenced by vlc_gl_surface_Create(), and vout_display_window_New().
|
inlinestatic |
Reports a request to close the window.
This function is called by the window implementation to advise that the window is being closed externally, and should be disabled by the owner.
References vout_window_owner::cbs, vout_window_callbacks::closed, and vout_window_t::owner.
void vout_window_ReportFullscreen | ( | vout_window_t * | wnd, |
const char * | id | ||
) |
Reports that the window is in full screen.
id | fullscreen output nul-terminated identifier, NULL for default |
References vout_window_owner::cbs, container_of, window_t::fullscreen, vout_window_callbacks::fullscreened, window_t::inhibit_windowed, window_t::lock, vout_window_t::owner, vlc_mutex_lock(), vlc_mutex_unlock(), and vout_window_UpdateInhibitionUnlocked().
Referenced by vout_window_ReportState().
|
inlinestatic |
Reports a keyboard key press.
window | window in focus |
key | VLC key code |
References vout_window_owner::cbs, vout_window_callbacks::keyboard_event, and vout_window_t::owner.
|
inlinestatic |
Reports a mouse double-click.
window | window in focus |
button | double-clicked button (see vlc_mouse_button) |
References VOUT_WINDOW_MOUSE_DOUBLE_CLICK, and vout_window_SendMouseEvent().
Referenced by vout_display_SendEventMouseDoubleClick().
|
inlinestatic |
Reports a pointer movement.
The mouse position must be expressed in window pixel units. See also vout_window_mouse_event_t.
window | window in focus |
x | abscissa |
y | ordinate |
References VOUT_WINDOW_MOUSE_MOVED, vout_window_SendMouseEvent(), vout_window_mouse_event_t::x, and vout_window_mouse_event_t::y.
Referenced by vout_display_SendMouseMovedDisplayCoordinates().
|
inlinestatic |
Reports a mouse button press.
window | window in focus |
button | pressed button (see vlc_mouse_button) |
References VOUT_WINDOW_MOUSE_PRESSED, and vout_window_SendMouseEvent().
Referenced by vout_display_SendEventMousePressed().
|
inlinestatic |
Reports a mouse button release.
window | window in focus |
button | released button (see vlc_mouse_button) |
References VOUT_WINDOW_MOUSE_RELEASED, and vout_window_SendMouseEvent().
Referenced by vout_display_SendEventMouseReleased().
|
inlinestatic |
Adds/removes a fullscreen output.
This notifies the owner of the window that a usable fullscreen output has been added, changed or removed.
If an output with the same identifier is already known, its name will be updated. Otherwise it will be added. If the name parameter is NULL, the output will be removed.
id | unique nul-terminated identifier for the output |
name | human-readable name |
References vout_window_owner::cbs, vout_window_callbacks::output_event, and vout_window_t::owner.
|
inlinestatic |
Reports the current window size.
This function is called by the window implementation and notifies the owner of the window what the pixel dimensions of the window are (or should be, depending on the windowing system).
References vout_window_owner::cbs, vout_window_t::owner, and vout_window_callbacks::resized.
|
inlinestatic |
Reports the current window state.
This function is called by the window implementation to notify the owner of the window that the state of the window changed.
state |
References vout_window_owner::cbs, vout_window_t::owner, vout_window_callbacks::state_changed, VLC_API, vout_window_ReportFullscreen(), and vout_window_ReportWindowed().
void vout_window_ReportWindowed | ( | vout_window_t * | wnd | ) |
Reports that the window is not in full screen.
This notifies the owner of the window that the window is windowed, i.e. not in full screen mode.
References vout_window_owner::cbs, container_of, window_t::fullscreen, window_t::inhibit_windowed, window_t::lock, vout_window_t::owner, vlc_mutex_lock(), vlc_mutex_unlock(), vout_window_UpdateInhibitionUnlocked(), and vout_window_callbacks::windowed.
Referenced by vout_window_ReportState().
|
inlinestatic |
|
inlinestatic |
Requests fullscreen mode.
window | window to be brought to fullscreen mode. |
id | nul-terminated output identifier, NULL for default |
References vout_window_t::ops, and vout_window_operations::set_fullscreen.
Referenced by vout_ChangeFullscreen().
void vout_window_SetInhibition | ( | vout_window_t * | window, |
bool | enabled | ||
) |
Inhibits or deinhibits the screensaver.
window | window in respect to which the screensaver should be inhibited or deinhibited |
true | to inhibit, false to deinhibit |
References window_t::active, container_of, window_t::lock, vlc_mutex_lock(), vlc_mutex_unlock(), and vout_window_UpdateInhibitionUnlocked().
Referenced by vout_ChangePause(), vout_window_Disable(), and vout_window_Enable().
|
inlinestatic |
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 vout_window_callbacks::resized callback function that was supplied to vout_window_New().
window | window whom a size change is requested for |
width | pixel width |
height | height width |
References vout_window_t::ops, and vout_window_operations::resize.
Referenced by vout_UpdateWindowSizeLocked().
|
inlinestatic |
Requests a new window state.
This requests a change of the state of a window from the windowing system. See vout_window_state for possible states.
window | window whose state to change |
state | requested state |
References vout_window_t::ops, and vout_window_operations::set_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 vout_window_t::ops, vout_window_operations::set_title, VLC_API, vout_window_Disable(), and vout_window_Enable().
|
inlinestatic |
Requests windowed mode.
window | window to be brought into windowed mode. |
References vout_window_t::ops, and vout_window_operations::unset_fullscreen.
Referenced by vout_ChangeWindowed().