VLC 4.0.0-dev
vlc_window_callbacks Struct Reference

Window event callbacks structure. More...

#include <vlc_window.h>

Data Fields

void(* resized )(struct vlc_window *, unsigned width, unsigned height, vlc_window_ack_cb cb, void *opaque)
 Callback for window size changes. More...
 
void(* closed )(struct vlc_window *)
 Callback for window closing. More...
 
void(* state_changed )(struct vlc_window *, unsigned state)
 Callback for window state change. More...
 
void(* windowed )(struct vlc_window *)
 Callback for windowed mode. More...
 
void(* fullscreened )(struct vlc_window *, const char *id)
 Callback for fullscreen mode. More...
 
void(* mouse_event )(struct vlc_window *, const vlc_window_mouse_event_t *mouse)
 Callback for pointer input events. More...
 
void(* keyboard_event )(struct vlc_window *, unsigned key)
 Callback for keyboard input events. More...
 
void(* output_event )(struct vlc_window *, const char *id, const char *desc)
 Callback for fullscreen output enumeration. More...
 
void(* icc_event )(struct vlc_window *, vlc_icc_profile_t *profile)
 Callback for ICC profile update. More...
 

Detailed Description

Window event callbacks structure.

This structure provided to vlc_window_New() conveys callbacks to handle window events.

As a general rule, the events can occur synchronously or asynchronously from the time that the window is (successfully) being created by vlc_window_New() until the time that the window has been deleted by vlc_window_Delete().

Warning
Also, a window object functions are not reentrant, so the callbacks must not invoke the window object functions. Otherwise a deadlock or infinite recursion may occur.

Field Documentation

◆ closed

void(* vlc_window_callbacks::closed) (struct vlc_window *)

Callback for window closing.

This callback function (if non-NULL) is invoked upon an external request to close the window. Not all windowing systems support this.

Soon after this callback, the window should be disabled with vlc_window_Disable().

Warning
Do not disable the window within the callback. That could lead to a dead lock.

Referenced by vlc_window_ReportClose().

◆ fullscreened

void(* vlc_window_callbacks::fullscreened) (struct vlc_window *, const char *id)

Callback for fullscreen mode.

This callback function (if non-NULL) is invoked when the window becomes fullscreen, when it changes to a different fullscreen output, or spuriously when the window remains in fullscreen mode.

Bug:
Many window back-ends fail to invoke this callback when due.
Parameters
idfullscreen output identifier (NULL if unspecified)

Referenced by vlc_window_ReportFullscreen().

◆ icc_event

void(* vlc_window_callbacks::icc_event) (struct vlc_window *, vlc_icc_profile_t *profile)

Callback for ICC profile update.

This can happen either because of the window being moved to a different display, or because the ICC profile associated with a display is updated. Memory transfers to the callee.

Parameters
profileICC profile associated with the window, or NULL to indicate absence of an ICC profile

Referenced by vlc_window_ReportICCProfile().

◆ keyboard_event

void(* vlc_window_callbacks::keyboard_event) (struct vlc_window *, unsigned key)

Callback for keyboard input events.

This callback function (if non-NULL) is invoked upon any keyboard key press event, or repetition event, on the window.

Note
No events are delivered for keyboard key releases.
Parameters
keyVLC key code

Referenced by vlc_window_ReportKeyPress().

◆ mouse_event

void(* vlc_window_callbacks::mouse_event) (struct vlc_window *, const vlc_window_mouse_event_t *mouse)

Callback for pointer input events.

This callback function (if non-NULL) is invoked upon any pointer input event on the window. See vlc_window_mouse_event_t.

Parameters
mousepointer to the input event.

Referenced by vlc_window_SendMouseEvent().

◆ output_event

void(* vlc_window_callbacks::output_event) (struct vlc_window *, const char *id, const char *desc)

Callback for fullscreen output enumeration.

This callback function (if non-NULL) indicates that a fullscreen output becomes available, changes human-readable description, or becomes unavailable.

Parameters
idnul-terminated id fullscreen output identifier (cannot be NULL)
descnul-terminated human-readable description, or NULL if the output has become unavailable

Referenced by vlc_window_ReportOutputDevice().

◆ resized

void(* vlc_window_callbacks::resized) (struct vlc_window *, unsigned width, unsigned height, vlc_window_ack_cb cb, void *opaque)

Callback for window size changes.

This callback function is invoked when the windowing system changes the window size.

This event may occur synchronously when the window is created or a size change is requested. It may also occur asynchronously as a consequence of external events from the windowing system, or deferred processing of a size change request.

If a non-NULL acknowledgement callback is specified, it is called synchronously after the consumer of the window has been notified of the size change, and before any further processing by the consumer. In other words, the callback invocation is after all rendering operations using the previous old window size, and before all rendering operations using the new window size.

Parameters
cboptional acknowledgement callback function (NULL to ignore)
opaqueopaque data pointer for the acknowledgement callback

Referenced by vlc_gl_surface_Create(), and vlc_window_ReportSize().

◆ state_changed

void(* vlc_window_callbacks::state_changed) (struct vlc_window *, unsigned state)

Callback for window state change.

This callback function (if non-NULL) is invoked when the window state as changed, either as a consequence of vlc_window_SetSate() or external events.

Bug:
Many window back-ends fail to invoke this callback when due.
Parameters
statenew window state (see vlc_window_state).

Referenced by vlc_window_ReportState().

◆ windowed

void(* vlc_window_callbacks::windowed) (struct vlc_window *)

Callback for windowed mode.

This callback function (if non-NULL) is invoked when the window becomes windowed. It might also occur spuriously if the window remains windowed.

Bug:
Many window back-ends fail to invoke this callback when due.

Referenced by vlc_window_ReportWindowed().


The documentation for this struct was generated from the following file: