VLC 4.0.0-dev
Loading...
Searching...
No Matches

Window management. More...

Collaboration diagram for Video window:

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.
 
typedef struct vlc_window_cfg vlc_window_cfg_t
 Window (desired) configuration.
 
typedef void(* vlc_window_ack_cb) (struct vlc_window *, unsigned width, unsigned height, void *data)
 Callback prototype for window event acknowledgement.
 
typedef struct vlc_window_owner vlc_window_owner_t
 Window callbacks and opaque data.
 
typedef struct vlc_window vlc_window_t
 Window object.
 

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 ,
  VLC_WINDOW_TYPE_MMAL
}
 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_tvlc_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.
 
void vlc_window_Delete (vlc_window_t *window)
 Deletes a window.
 
void vlc_window_SetInhibition (vlc_window_t *window, bool enabled)
 Inhibits or deinhibits the screensaver.
 
static void vlc_window_SetState (vlc_window_t *window, unsigned state)
 Requests a new window state.
 
void vlc_window_SetSize (vlc_window_t *window, unsigned width, unsigned height)
 Requests a new window size.
 
void vlc_window_SetFullScreen (vlc_window_t *window, const char *id)
 Requests fullscreen mode.
 
void vlc_window_UnsetFullScreen (vlc_window_t *window)
 Requests windowed mode.
 
static void vlc_window_SetTitle (vlc_window_t *window, const char *title)
 Request a new window title.
 
int vlc_window_Enable (vlc_window_t *window)
 Enables a window.
 
void vlc_window_Disable (vlc_window_t *window)
 Disables a window.
 

Detailed Description

Window management.

Window management provides a partial abstraction for windowing systems and rendering targets (i.e. "windows"). See vlc_window_t.

Typedef Documentation

◆ vlc_icc_profile_t

◆ vlc_window_ack_cb

typedef void(* vlc_window_ack_cb) (struct vlc_window *, unsigned width, unsigned height, void *data)

Callback prototype for window event acknowledgement.

Parameters
widthpixel width as supplied to vlc_window_callbacks::resized
heightpixel height as supplied to vlc_window_callbacks::resized
dataopaque pointer as supplied to vlc_window_callbacks::resized

◆ vlc_window_cfg_t

Window (desired) configuration.

This structure describes the intended initial configuration of a vlc_window_t.

◆ vlc_window_mouse_event_t

Window mouse event.

This structure describes a pointer input event on a window.

◆ vlc_window_owner_t

Window callbacks and opaque data.

◆ vlc_window_t

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.

Enumeration Type Documentation

◆ vlc_window_mouse_event_type

Window mouse event types.

This enumeration defines the possible event types vlc_window_mouse_event_t::type.

Enumerator
VLC_WINDOW_MOUSE_MOVED 

Pointer position change.

VLC_WINDOW_MOUSE_PRESSED 

Pointer button press or single click.

VLC_WINDOW_MOUSE_RELEASED 

Pointer button release.

VLC_WINDOW_MOUSE_DOUBLE_CLICK 

Double click.

◆ 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)

◆ 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.

Enumerator
VLC_WINDOW_TYPE_DUMMY 

Dummy window (not an actual window)

VLC_WINDOW_TYPE_XID 

X11 window.

VLC_WINDOW_TYPE_HWND 

Win32 or OS/2 window.

VLC_WINDOW_TYPE_NSOBJECT 

macOS/iOS view

VLC_WINDOW_TYPE_ANDROID_NATIVE 

Android native window.

VLC_WINDOW_TYPE_WAYLAND 

Wayland surface.

VLC_WINDOW_TYPE_DCOMP 

Win32 DirectComposition.

VLC_WINDOW_TYPE_KMS 

DRM KMS CRTC.

VLC_WINDOW_TYPE_MMAL 

MMAL window.

Function Documentation

◆ vlc_window_Delete()

◆ vlc_window_Disable()

void vlc_window_Disable ( vlc_window_t window)

Disables a window.

This informs the window provider that the window is no longer needed.

Note
The window may be re-enabled later by a call to vlc_window_Enable().
Parameters
windowwindow 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().

◆ vlc_window_Enable()

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.

Parameters
windowwindow to enable

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_New()

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.

Parameters
objparent VLC object
moduleplugin name, NULL for default
ownercallbacks and private data
cfginitial window configuration, NULL for defaults
Returns
a new window, or NULL on error.

◆ vlc_window_SetFullScreen()

void vlc_window_SetFullScreen ( vlc_window_t window,
const char *  id 
)

Requests fullscreen mode.

Parameters
windowwindow to be brought to fullscreen mode.
idnul-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().

◆ vlc_window_SetInhibition()

void vlc_window_SetInhibition ( vlc_window_t window,
bool  enabled 
)

Inhibits or deinhibits the screensaver.

Parameters
windowwindow in respect to which the screensaver should be inhibited or deinhibited
enabledtrue 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().

◆ vlc_window_SetSize()

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().

Note
The size is expressed in terms of the "useful" area, i.e. it excludes any side decoration added by the windowing system.
Parameters
windowwindow whom a size change is requested for
widthpixel width
heightheight 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().

◆ vlc_window_SetState()

static void vlc_window_SetState ( vlc_window_t window,
unsigned  state 
)
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.

Parameters
windowwindow whose state to change
staterequested state

References vlc_window::ops, vlc_window_operations::set_state, and state.

Referenced by vout_ChangeWindowState(), and vout_Create().

◆ vlc_window_SetTitle()

static void vlc_window_SetTitle ( vlc_window_t window,
const char *  title 
)
inlinestatic

Request a new window title.

Parameters
windowwindow to change the title.
titlewindow title to use.

References vlc_window::ops, and vlc_window_operations::set_title.

◆ vlc_window_UnsetFullScreen()

void vlc_window_UnsetFullScreen ( vlc_window_t window)

Requests windowed mode.

Parameters
windowwindow 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().