VLC 4.0.0-dev
vlc_window.h
Go to the documentation of this file.
1/*****************************************************************************
2 * vlc_window.h: vlc_window definitions
3 *****************************************************************************
4 * Copyright (C) 2008 RĂ©mi Denis-Courmont
5 * Copyright (C) 2009 Laurent Aimar
6 *
7 * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
23
24#ifndef VLC_VOUT_WINDOW_H
25#define VLC_VOUT_WINDOW_H 1
26
27#include <stdarg.h>
28#include <vlc_common.h>
29
30/**
31 * \defgroup video_window Video window
32 * \ingroup video_output
33 * Window management
34 *
35 * Window management provides a partial abstraction for windowing systems and
36 * rendering targets (i.e. "windows"). See \ref vlc_window_t.
37 *
38 * @{
39 * \file
40 * Window modules interface
41 */
42
43struct vlc_window;
44struct wl_display;
45struct wl_surface;
48/**
49 * Window handle type.
50 *
51 * The window handle type specifies the window system protocol that the
52 * window was created with. It determines which members of the
53 * vlc_window_t::handle and vlc_window_t::display unions are defined
54 * for the given window.
55 *
56 * It also establishes some protocol-dependent semantics such as the exact
57 * interpretation of the window state (\ref vlc_window_state)
58 * and the window size.
59 */
60enum vlc_window_type {
61 VLC_WINDOW_TYPE_DUMMY /**< Dummy window (not an actual window) */,
62 VLC_WINDOW_TYPE_XID /**< X11 window */,
63 VLC_WINDOW_TYPE_HWND /**< Win32 or OS/2 window */,
64 VLC_WINDOW_TYPE_NSOBJECT /**< macOS/iOS view */,
65 VLC_WINDOW_TYPE_ANDROID_NATIVE /**< Android native window */,
66 VLC_WINDOW_TYPE_WAYLAND /**< Wayland surface */,
67 VLC_WINDOW_TYPE_DCOMP /**< Win32 DirectComposition */,
68 VLC_WINDOW_TYPE_KMS /**< DRM KMS CRTC */,
69};
70
71/**
72 * Window states.
73 *
74 * Currently, this only handles different window stacking orders.
75 * See also \ref vlc_window_SetState().
76 */
78 VLC_WINDOW_STATE_NORMAL /**< Normal stacking */,
79 VLC_WINDOW_STATE_ABOVE /**< Stacking above (a.k.a. always on top) */,
80 VLC_WINDOW_STATE_BELOW /**< Stacking below (a.k.a. wall paper mode) */,
81};
82
83/**
84 * Window mouse event types.
85 *
86 * This enumeration defines the possible event types
87 * vlc_window_mouse_event_t::type.
88 */
90 VLC_WINDOW_MOUSE_MOVED /**< Pointer position change */,
91 VLC_WINDOW_MOUSE_PRESSED /**< Pointer button press or single click */,
92 VLC_WINDOW_MOUSE_RELEASED /**< Pointer button release */,
93 VLC_WINDOW_MOUSE_DOUBLE_CLICK /**< Double click */,
94};
95
96/**
97 * Window mouse event.
98 *
99 * This structure describes a pointer input event on a window.
100 */
101typedef struct vlc_window_mouse_event
103 enum vlc_window_mouse_event_type type; /**< Event type. */
105 /**
106 * Pointer abscissa.
107 *
108 * The pointer abscissa is relative to the window and expressed in pixels.
109 * Abscissa goes from left to right, such that the left-most column is at 0
110 * and the right-most column is at width minus one.
111 *
112 * A negative abscissa refers to pixels to the left of the window, and
113 * an abscissa of width or larger refers to pixels to the right.
114 *
115 * This is only set if @c event equals \ref VLC_WINDOW_MOUSE_MOVED.
116 */
117 int x;
119 /**
120 * Pointer ordinate.
121 *
122 * The pointer ordinate is relative to the window and expressed in pixels.
123 * Ordinate goes from top to bottom, such that the top-most row is at 0
124 * and the bottom-most column is at height minus one.
125 *
126 * A negative ordinate refers to pixels above the window, and
127 * an ordinate of height or larger refers to pixels below the window.
128 *
129 * This is only set if @c event equals \ref VLC_WINDOW_MOUSE_MOVED.
130 */
131 int y;
133 /**
134 * Pressed button.
135 *
136 * See \ref vlc_mouse_button for possible values.
137 *
138 * This is set if @c event does not equal \ref VLC_WINDOW_MOUSE_MOVED.
139 */
140 int button_mask;
143/**
144 * Window (desired) configuration.
145 *
146 * This structure describes the intended initial configuration
147 * of a \ref vlc_window_t.
148 */
149typedef struct vlc_window_cfg {
150 /**
151 * Whether the window should be in full screen mode or not.
152 */
153 bool is_fullscreen;
155 /**
156 * Whether the window should have decorations or not.
157 */
158 bool is_decorated;
160#if defined(__APPLE__) || defined(_WIN32)
161 /* Window position hint */
162 int x;
163 int y;
164#endif
165
166 /**
167 * Intended pixel width of the window.
168 */
169 unsigned width;
171 /**
172 * Intended pixel height of the window.
173 */
174 unsigned height;
178/**
179 * Callback prototype for window event acknowledgement.
180 *
181 * @param width pixel width as supplied to vlc_window_callbacks::resized
182 * @param height pixel height as supplied to vlc_window_callbacks::resized
183 * @param data opaque pointer as supplied to vlc_window_callbacks::resized
184 */
185typedef void (*vlc_window_ack_cb)(struct vlc_window *, unsigned width,
186 unsigned height, void *data);
187
188/**
189 * Window event callbacks structure.
190 *
191 * This structure provided to vlc_window_New() conveys callbacks to handle
192 * window events.
193 *
194 * As a general rule, the events can occur synchronously or asynchronously from
195 * the time that the window is (successfully) being created by vlc_window_New()
196 * until the time that the window has been deleted by vlc_window_Delete().
197 *
198 * \warning
199 * Also, a window object functions are not reentrant, so the callbacks must not
200 * invoke the window object functions.
201 * Otherwise a deadlock or infinite recursion may occur.
202 */
204 /**
205 * Callback for window size changes.
206 *
207 * This callback function is invoked when the windowing
208 * system changes the window size.
209 *
210 * This event may occur synchronously when the window is created or a size
211 * change is requested. It may also occur asynchronously as a consequence
212 * of external events from the windowing system, or deferred processing of
213 * a size change request.
214 *
215 * If a non-NULL acknowledgement callback is specified, it is called
216 * synchronously after the consumer of the window has been notified of the
217 * size change, and before any further processing by the consumer. In other
218 * words, the callback invocation is after all rendering operations using
219 * the previous old window size, and before all rendering operations using
220 * the new window size.
221 *
222 * \param cb optional acknowledgement callback function (NULL to ignore)
223 * \param opaque opaque data pointer for the acknowledgement callback
224 */
225 void (*resized)(struct vlc_window *, unsigned width, unsigned height,
226 vlc_window_ack_cb cb, void *opaque);
227
228 /**
229 * Callback for window closing.
230 *
231 * This callback function (if non-NULL) is invoked upon an external request
232 * to close the window. Not all windowing systems support this.
233 *
234 * Soon after this callback, the window should be disabled with
235 * vlc_window_Disable().
236 *
237 * \warning Do not disable the window within the callback.
238 * That could lead to a dead lock.
239 */
240 void (*closed)(struct vlc_window *);
242 /**
243 * Callback for window state change.
244 *
245 * This callback function (if non-NULL) is invoked when the window state
246 * as changed, either as a consequence of vlc_window_SetSate() or external
247 * events.
248 *
249 * \bug Many window back-ends fail to invoke this callback when due.
250 *
251 * \param state new window state (see \ref vlc_window_state).
252 */
253 void (*state_changed)(struct vlc_window *, unsigned state);
255 /**
256 * Callback for windowed mode.
257 *
258 * This callback function (if non-NULL) is invoked when the window becomes
259 * windowed. It might also occur spuriously if the window remains windowed.
260 *
261 * \bug Many window back-ends fail to invoke this callback when due.
262 */
263 void (*windowed)(struct vlc_window *);
265 /**
266 * Callback for fullscreen mode.
267 *
268 * This callback function (if non-NULL) is invoked when the window becomes
269 * fullscreen, when it changes to a different fullscreen output, or
270 * spuriously when the window remains in fullscreen mode.
271 *
272 * \bug Many window back-ends fail to invoke this callback when due.
273 *
274 * \param id fullscreen output identifier (NULL if unspecified)
275 */
276 void (*fullscreened)(struct vlc_window *, const char *id);
278 /**
279 * Callback for pointer input events.
280 *
281 * This callback function (if non-NULL) is invoked upon any pointer input
282 * event on the window. See \ref vlc_window_mouse_event_t.
283 *
284 * \param mouse pointer to the input event.
285 */
286 void (*mouse_event)(struct vlc_window *,
288
289 /**
290 * Callback for keyboard input events.
291 *
292 * This callback function (if non-NULL) is invoked upon any keyboard key
293 * press event, or repetition event, on the window.
294 *
295 * \note No events are delivered for keyboard key releases.
296 *
297 * \param key VLC key code
298 */
299 void (*keyboard_event)(struct vlc_window *, unsigned key);
301 /**
302 * Callback for fullscreen output enumeration.
303 *
304 * This callback function (if non-NULL) indicates that a fullscreen output
305 * becomes available, changes human-readable description, or becomes
306 * unavailable.
307 *
308 * \param id nul-terminated id fullscreen output identifier
309 * (cannot be NULL)
310 * \param desc nul-terminated human-readable description,
311 * or NULL if the output has become unavailable
312 */
313 void (*output_event)(struct vlc_window *,
314 const char *id, const char *desc);
315
316 /**
317 * Callback for ICC profile update.
318 *
319 * This can happen either because of the window being moved to a different
320 * display, or because the ICC profile associated with a display is
321 * updated. Memory transfers to the callee.
322 *
323 * \param profile ICC profile associated with the window, or NULL to
324 * indicate absence of an ICC profile
325 */
326 void (*icc_event)(struct vlc_window *, vlc_icc_profile_t *profile);
328
329/**
330 * Window callbacks and opaque data.
331 */
332typedef struct vlc_window_owner {
333 const struct vlc_window_callbacks *cbs; /**< Callbacks */
334 void *sys; /**< Opaque data / private pointer for callbacks */
337/**
338 * Window implementation callbacks.
339 */
341 int (*enable)(struct vlc_window *, const vlc_window_cfg_t *);
342 void (*disable)(struct vlc_window *);
343 void (*resize)(struct vlc_window *, unsigned width, unsigned height);
345 /**
346 * Destroy the window.
347 *
348 * Destroys the window and releases all associated resources.
349 */
350 void (*destroy)(struct vlc_window *);
352 void (*set_state)(struct vlc_window *, unsigned state);
353 void (*unset_fullscreen)(struct vlc_window *);
354 void (*set_fullscreen)(struct vlc_window *, const char *id);
355 void (*set_title)(struct vlc_window *, const char *id);
357
358/**
359 * Window object.
360 *
361 * This structure is an abstract interface to the windowing system.
362 * The window is normally used to draw video (and subpictures) into, but it
363 * can also be used for other purpose (e.g. OpenGL visualization).
364 *
365 * The window is responsible for providing a window handle, whose exact
366 * meaning depends on the windowing system. It also must report some events
367 * such as user input (keyboard, mouse) and window resize.
368 *
369 * Finally, it must support some control requests such as for fullscreen mode.
370 */
371typedef struct vlc_window {
374 /**
375 * Window handle type
376 *
377 * This identified the windowing system and protocol that the window
378 * needs to use. This also selects which member of the \ref handle union
379 * and the \ref display union are to be set.
380 *
381 * The possible values are defined in \ref vlc_window_type.
382 */
383 unsigned type;
385 /**
386 * Window handle (mandatory)
387 *
388 * This must be filled by the plugin upon successful vlc_window_Enable().
389 *
390 * Depending on the \ref type above, a different member of this union is
391 * used.
392 */
393 union {
394 void *hwnd; /**< Win32 window handle */
395 uint32_t xid; /**< X11 windows ID */
396 void *nsobject; /**< macOS/iOS view object */
397 int android_id; /**< AWindow_ID */
398 struct wl_surface *wl; /**< Wayland surface (client pointer) */
399 void *dcomp_visual; /**< Win32 direct composition visual */
400 uint32_t crtc; /**< KMS CRTC identifier */
403 /** Display server (mandatory)
404 *
405 * This must be filled by the plugin upon activation.
406 *
407 * The window handle is relative to the display server. The exact meaning
408 * of the display server depends on the window handle type. Not all window
409 * handle type provide a display server field.
410 */
411 union {
412 char *x11; /**< X11 display string (NULL = use default) */
413 struct wl_display *wl; /**< Wayland display (client pointer) */
414 void* dcomp_device; /**< DirectComposition device */
415 int drm_fd; /**< KMS DRM device */
416 void* anativewindow; /**< Android native window */
419 const struct vlc_window_operations *ops; /**< operations handled by the
420 window. Once this is set it MUST NOT be changed */
421
422 struct {
423 bool has_double_click; /**< Whether double click events are sent,
424 or need to be emulated */
425 } info;
427 /* Private place holder for the vlc_window_t module (optional)
428 *
429 * A module is free to use it as it wishes.
430 */
431 void *sys;
436/**
437 * Creates a new window.
438 *
439 * This function creates a window, or some other kind of rectangle render
440 * target.
441 *
442 * \param obj parent VLC object
443 * \param module plugin name, NULL for default
444 * \param owner callbacks and private data
445 * \param cfg initial window configuration, NULL for defaults
446 * \return a new window, or NULL on error.
447 */
449 const char *module,
450 const vlc_window_owner_t *owner,
451 const vlc_window_cfg_t *cfg);
452
453/**
454 * Deletes a window.
455 *
456 * This deletes a window created by vlc_window_New().
457 *
458 * \param window window object to delete
459 */
461
462/**
463 * Inhibits or deinhibits the screensaver.
464 *
465 * \param window window in respect to which the screensaver should be inhibited
466 * or deinhibited
467 * \param enabled true to inhibit, false to deinhibit
468 */
469void vlc_window_SetInhibition(vlc_window_t *window, bool enabled);
470
471/**
472 * Requests a new window state.
473 *
474 * This requests a change of the state of a window from the windowing system.
475 * See \ref vlc_window_state for possible states.
476 *
477 * @param window window whose state to change
478 * @param state requested state
479 */
480static inline void vlc_window_SetState(vlc_window_t *window, unsigned state)
482 if (window->ops->set_state != NULL)
483 window->ops->set_state(window, state);
484}
485
486/**
487 * Requests a new window size.
488 *
489 * This requests a change of the window size. In general and unless otherwise
490 * stated, the size is expressed in pixels. However, the exact interpretation
491 * of the window size depends on the windowing system.
492 *
493 * There is no return value as the request may be processed asynchronously,
494 * ignored and/or modified by the window system. The actual size of the window
495 * is determined by the vlc_window_callbacks::resized callback function that
496 * was supplied to vlc_window_New().
497 *
498 * \note The size is expressed in terms of the "useful" area,
499 * i.e. it excludes any side decoration added by the windowing system.
500 *
501 * \param window window whom a size change is requested for
502 * \param width pixel width
503 * \param height height width
504 */
506 unsigned width, unsigned height);
507
508/**
509 * Requests fullscreen mode.
510 *
511 * \param window window to be brought to fullscreen mode.
512 * \param id nul-terminated output identifier, NULL for default
513 */
514VLC_API void vlc_window_SetFullScreen(vlc_window_t *window, const char *id);
515
516/**
517 * Requests windowed mode.
518 *
519 * \param window window to be brought into windowed mode.
520 */
522
523/**
524 * Request a new window title.
525 *
526 * \param window window to change the title.
527 * \param title window title to use.
528 */
529static inline void vlc_window_SetTitle(vlc_window_t *window, const char *title)
531 if (window->ops->set_title != NULL)
532 window->ops->set_title(window, title);
533}
534
535/**
536 * Enables a window.
537 *
538 * This informs the window provider that the window is about to be taken into
539 * active use. A window is always initially disabled. This is so that the
540 * window provider can provide a persistent connection to the display server,
541 * and track any useful events, such as monitors hotplug.
542 *
543 * The window handle (vlc_window_t.handle) must remain valid and constant
544 * while the window is enabled.
545 *
546 * \param window window to enable
547 */
550
551/**
552 * Disables a window.
553 *
554 * This informs the window provider that the window is no longer needed.
555 *
556 * \note
557 * The window may be re-enabled later by a call to vlc_window_Enable().
558 *
559 * \param window window to disable
560 */
562void vlc_window_Disable(vlc_window_t *window);
563
564/**
565 * \defgroup video_window_reporting Window event reporting
566 * Window provider event reporting
567 *
568 * The Window provider has to report some events to the core
569 * so that it can react appropriately to these events, for
570 * this the window provider calls the functions in this section
571 * when appropriate.
572 *
573 * \note These functions may only be called by the window provider
574 * implementation.
575 * @{
576 */
577
578/**
579 * Reports the current window size.
580 *
581 * This function is called by the window implementation and notifies the owner
582 * of the window what the pixel dimensions of the window are (or should be,
583 * depending on the windowing system).
584 *
585 * \note This function is thread-safe. In case of concurrent call, it is
586 * undefined which one is taken into account (but at least one is).
587 *
588 * \param window window implementation that reports the event
589 * \param width width of the usable window area in pixels
590 * \param height height of the usable window area in pixels
591 */
592static inline void vlc_window_ReportSize(vlc_window_t *window,
593 unsigned width, unsigned height)
594{
595 window->owner.cbs->resized(window, width, height, NULL, NULL);
596}
597
598/**
599 * Reports a request to close the window.
600 *
601 * This function is called by the window implementation to advise that the
602 * window is being closed externally, and should be disabled by the owner.
603 *
604 * \param window window implementation that reports the event
605 */
606static inline void vlc_window_ReportClose(vlc_window_t *window)
608 if (window->owner.cbs->closed != NULL)
609 window->owner.cbs->closed(window);
610}
611
612/**
613 * Reports the current window state.
614 *
615 * This function is called by the window implementation to notify the owner of
616 * the window that the state of the window changed.
617 *
618 * \param window the window reporting the state change
619 * \param state \see vlc_window_state
620 */
621static inline void vlc_window_ReportState(vlc_window_t *window,
622 unsigned state)
623{
624 if (window->owner.cbs->state_changed != NULL)
625 window->owner.cbs->state_changed(window, state);
626}
627
628/**
629 * Reports that the window is not in full screen.
630 *
631 * This notifies the owner of the window that the window is windowed, i.e. not
632 * in full screen mode.
633 *
634 * \param wnd window implementation that reports the event
635 */
637
638/**
639 * Reports that the window is in full screen.
640 *
641 * \param wnd the window reporting the fullscreen state
642 * \param id fullscreen output nul-terminated identifier, NULL for default
643 */
644VLC_API void vlc_window_ReportFullscreen(vlc_window_t *wnd, const char *id);
645
646static inline void vlc_window_SendMouseEvent(vlc_window_t *window,
648{
649 if (window->owner.cbs->mouse_event != NULL)
650 window->owner.cbs->mouse_event(window, mouse);
651}
652
653/**
654 * Reports a pointer movement.
655 *
656 * The mouse position must be expressed in window pixel units.
657 * See also \ref vlc_window_mouse_event_t.
658 *
659 * \param window window in focus
660 * \param x abscissa
661 * \param y ordinate
662 */
663static inline void vlc_window_ReportMouseMoved(vlc_window_t *window,
664 int x, int y)
665{
666 const vlc_window_mouse_event_t mouse = {
668 };
669 vlc_window_SendMouseEvent(window, &mouse);
670}
671
672/**
673 * Reports a mouse button press.
674 *
675 * \param window window in focus
676 * \param button pressed button (see \ref vlc_mouse_button)
677 */
678static inline void vlc_window_ReportMousePressed(vlc_window_t *window,
679 int button)
680{
681 const vlc_window_mouse_event_t mouse = {
682 VLC_WINDOW_MOUSE_PRESSED, 0, 0, button,
683 };
684 vlc_window_SendMouseEvent(window, &mouse);
685}
686
687/**
688 * Reports a mouse button release.
689 *
690 * \param window window in focus
691 * \param button released button (see \ref vlc_mouse_button)
692 */
693static inline void vlc_window_ReportMouseReleased(vlc_window_t *window,
694 int button)
695{
696 const vlc_window_mouse_event_t mouse = {
697 VLC_WINDOW_MOUSE_RELEASED, 0, 0, button,
698 };
699 vlc_window_SendMouseEvent(window, &mouse);
700}
701
702/**
703 * Reports a mouse double-click.
704 *
705 * \param window window in focus
706 * \param button double-clicked button (see \ref vlc_mouse_button)
707 */
708static inline void vlc_window_ReportMouseDoubleClick(vlc_window_t *window,
709 int button)
710{
711 const vlc_window_mouse_event_t mouse = {
712 VLC_WINDOW_MOUSE_DOUBLE_CLICK, 0, 0, button,
713 };
714 vlc_window_SendMouseEvent(window, &mouse);
715}
716
717/**
718 * Reports a keyboard key press.
719 *
720 * \param window window in focus
721 * \param key VLC key code
722 */
723static inline void vlc_window_ReportKeyPress(vlc_window_t *window, int key)
725 if (window->owner.cbs->keyboard_event != NULL)
726 window->owner.cbs->keyboard_event(window, key);
727}
728
729/**
730 * Adds/removes a fullscreen output.
731 *
732 * This notifies the owner of the window that a usable fullscreen output has
733 * been added, changed or removed.
734 *
735 * If an output with the same identifier is already known, its name will be
736 * updated. Otherwise it will be added.
737 * If the name parameter is NULL, the output will be removed.
738 *
739 * \param window the window reporting the output device
740 * \param id unique nul-terminated identifier for the output
741 * \param name human-readable name
742 */
743static inline void vlc_window_ReportOutputDevice(vlc_window_t *window,
744 const char *id,
745 const char *name)
746{
747 if (window->owner.cbs->output_event != NULL)
748 window->owner.cbs->output_event(window, id, name);
749}
750
751/**
752 * Reports a change to the currently active ICC profile.
753 *
754 * \param window the window reporting the ICC profile
755 * \param prof the profile data, or NULL. Ownership transfers to callee
756 */
757static inline void vlc_window_ReportICCProfile(vlc_window_t *window,
759{
760 if (window->owner.cbs->icc_event != NULL) {
761 window->owner.cbs->icc_event(window, prof);
762 } else {
763 free(prof);
764 }
765}
766
767/** @} */
768/** @} */
769#endif /* VLC_WINDOW_H */
#define VLC_API
Definition: fourcc_gen.c:31
static void vlc_window_ReportClose(vlc_window_t *window)
Reports a request to close the window.
Definition: vlc_window.h:607
static void vlc_window_ReportMouseReleased(vlc_window_t *window, int button)
Reports a mouse button release.
Definition: vlc_window.h:694
static void vlc_window_ReportSize(vlc_window_t *window, unsigned width, unsigned height)
Reports the current window size.
Definition: vlc_window.h:593
void vlc_window_ReportFullscreen(vlc_window_t *wnd, const char *id)
Reports that the window is in full screen.
Definition: window.c:221
static void vlc_window_ReportMouseMoved(vlc_window_t *window, int x, int y)
Reports a pointer movement.
Definition: vlc_window.h:664
static void vlc_window_SendMouseEvent(vlc_window_t *window, const vlc_window_mouse_event_t *mouse)
Definition: vlc_window.h:647
void vlc_window_ReportWindowed(vlc_window_t *wnd)
Reports that the window is not in full screen.
Definition: window.c:205
static void vlc_window_ReportOutputDevice(vlc_window_t *window, const char *id, const char *name)
Adds/removes a fullscreen output.
Definition: vlc_window.h:744
static void vlc_window_ReportKeyPress(vlc_window_t *window, int key)
Reports a keyboard key press.
Definition: vlc_window.h:724
static void vlc_window_ReportICCProfile(vlc_window_t *window, vlc_icc_profile_t *prof)
Reports a change to the currently active ICC profile.
Definition: vlc_window.h:758
static void vlc_window_ReportState(vlc_window_t *window, unsigned state)
Reports the current window state.
Definition: vlc_window.h:622
static void vlc_window_ReportMousePressed(vlc_window_t *window, int button)
Reports a mouse button press.
Definition: vlc_window.h:679
static void vlc_window_ReportMouseDoubleClick(vlc_window_t *window, int button)
Reports a mouse double-click.
Definition: vlc_window.h:709
void vlc_window_SetInhibition(vlc_window_t *window, bool enabled)
Inhibits or deinhibits the screensaver.
Definition: window.c:194
struct vlc_window vlc_window_t
Window object.
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.
static void vlc_window_SetTitle(vlc_window_t *window, const char *title)
Request a new window title.
Definition: vlc_window.h:530
void vlc_window_SetFullScreen(vlc_window_t *window, const char *id)
Requests fullscreen mode.
Definition: window.c:246
void(* vlc_window_ack_cb)(struct vlc_window *, unsigned width, unsigned height, void *data)
Callback prototype for window event acknowledgement.
Definition: vlc_window.h:186
vlc_window_type
Window handle type.
Definition: vlc_window.h:61
static void vlc_window_SetState(vlc_window_t *window, unsigned state)
Requests a new window state.
Definition: vlc_window.h:481
void vlc_window_SetSize(vlc_window_t *window, unsigned width, unsigned height)
Requests a new window size.
Definition: window.c:144
vlc_window_state
Window states.
Definition: vlc_window.h:78
struct vlc_window_cfg vlc_window_cfg_t
Window (desired) configuration.
int vlc_window_Enable(vlc_window_t *window)
Enables a window.
Definition: window.c:122
void vlc_window_Delete(vlc_window_t *window)
Deletes a window.
Definition: window.c:156
void vlc_window_Disable(vlc_window_t *window)
Disables a window.
Definition: window.c:136
void vlc_window_UnsetFullScreen(vlc_window_t *window)
Requests windowed mode.
Definition: window.c:236
struct vlc_window_owner vlc_window_owner_t
Window callbacks and opaque data.
struct vlc_window_mouse_event vlc_window_mouse_event_t
Window mouse event.
vlc_window_mouse_event_type
Window mouse event types.
Definition: vlc_window.h:90
@ VLC_WINDOW_TYPE_KMS
DRM KMS CRTC.
Definition: vlc_window.h:69
@ VLC_WINDOW_TYPE_XID
X11 window.
Definition: vlc_window.h:63
@ VLC_WINDOW_TYPE_DCOMP
Win32 DirectComposition.
Definition: vlc_window.h:68
@ VLC_WINDOW_TYPE_ANDROID_NATIVE
Android native window.
Definition: vlc_window.h:66
@ VLC_WINDOW_TYPE_DUMMY
Dummy window (not an actual window)
Definition: vlc_window.h:62
@ VLC_WINDOW_TYPE_WAYLAND
Wayland surface.
Definition: vlc_window.h:67
@ VLC_WINDOW_TYPE_NSOBJECT
macOS/iOS view
Definition: vlc_window.h:65
@ VLC_WINDOW_TYPE_HWND
Win32 or OS/2 window.
Definition: vlc_window.h:64
@ VLC_WINDOW_STATE_NORMAL
Normal stacking.
Definition: vlc_window.h:79
@ VLC_WINDOW_STATE_ABOVE
Stacking above (a.k.a.
Definition: vlc_window.h:80
@ VLC_WINDOW_STATE_BELOW
Stacking below (a.k.a.
Definition: vlc_window.h:81
@ VLC_WINDOW_MOUSE_RELEASED
Pointer button release.
Definition: vlc_window.h:93
@ VLC_WINDOW_MOUSE_PRESSED
Pointer button press or single click.
Definition: vlc_window.h:92
@ VLC_WINDOW_MOUSE_DOUBLE_CLICK
Double click.
Definition: vlc_window.h:94
@ VLC_WINDOW_MOUSE_MOVED
Pointer position change.
Definition: vlc_window.h:91
const char name[16]
Definition: httpd.c:1297
static thread_local struct @81 state
Definition: vlc_ancillary.h:216
VLC object common members.
Definition: vlc_objects.h:52
Window event callbacks structure.
Definition: vlc_window.h:204
void(* icc_event)(struct vlc_window *, vlc_icc_profile_t *profile)
Callback for ICC profile update.
Definition: vlc_window.h:327
void(* mouse_event)(struct vlc_window *, const vlc_window_mouse_event_t *mouse)
Callback for pointer input events.
Definition: vlc_window.h:287
void(* closed)(struct vlc_window *)
Callback for window closing.
Definition: vlc_window.h:241
void(* fullscreened)(struct vlc_window *, const char *id)
Callback for fullscreen mode.
Definition: vlc_window.h:277
void(* windowed)(struct vlc_window *)
Callback for windowed mode.
Definition: vlc_window.h:264
void(* keyboard_event)(struct vlc_window *, unsigned key)
Callback for keyboard input events.
Definition: vlc_window.h:300
void(* output_event)(struct vlc_window *, const char *id, const char *desc)
Callback for fullscreen output enumeration.
Definition: vlc_window.h:314
void(* state_changed)(struct vlc_window *, unsigned state)
Callback for window state change.
Definition: vlc_window.h:254
void(* resized)(struct vlc_window *, unsigned width, unsigned height, vlc_window_ack_cb cb, void *opaque)
Callback for window size changes.
Definition: vlc_window.h:226
Window (desired) configuration.
Definition: vlc_window.h:150
bool is_fullscreen
Whether the window should be in full screen mode or not.
Definition: vlc_window.h:154
unsigned height
Intended pixel height of the window.
Definition: vlc_window.h:175
unsigned width
Intended pixel width of the window.
Definition: vlc_window.h:170
bool is_decorated
Whether the window should have decorations or not.
Definition: vlc_window.h:159
Window mouse event.
Definition: vlc_window.h:103
int button_mask
Pressed button.
Definition: vlc_window.h:141
enum vlc_window_mouse_event_type type
Event type.
Definition: vlc_window.h:104
int x
Pointer abscissa.
Definition: vlc_window.h:118
int y
Pointer ordinate.
Definition: vlc_window.h:132
Window implementation callbacks.
Definition: vlc_window.h:341
int(* enable)(struct vlc_window *, const vlc_window_cfg_t *)
Definition: vlc_window.h:342
void(* unset_fullscreen)(struct vlc_window *)
Definition: vlc_window.h:354
void(* set_fullscreen)(struct vlc_window *, const char *id)
Definition: vlc_window.h:355
void(* destroy)(struct vlc_window *)
Destroy the window.
Definition: vlc_window.h:351
void(* set_state)(struct vlc_window *, unsigned state)
Definition: vlc_window.h:353
void(* set_title)(struct vlc_window *, const char *id)
Definition: vlc_window.h:356
void(* disable)(struct vlc_window *)
Definition: vlc_window.h:343
void(* resize)(struct vlc_window *, unsigned width, unsigned height)
Definition: vlc_window.h:344
Window callbacks and opaque data.
Definition: vlc_window.h:333
const struct vlc_window_callbacks * cbs
Callbacks.
Definition: vlc_window.h:334
void * sys
Opaque data / private pointer for callbacks.
Definition: vlc_window.h:335
Window object.
Definition: vlc_window.h:372
char * x11
X11 display string (NULL = use default)
Definition: vlc_window.h:413
const struct vlc_window_operations * ops
operations handled by the window.
Definition: vlc_window.h:420
uint32_t xid
X11 windows ID.
Definition: vlc_window.h:396
void * anativewindow
Android native window.
Definition: vlc_window.h:417
int android_id
AWindow_ID.
Definition: vlc_window.h:398
union vlc_window::@289 display
Display server (mandatory)
struct vlc_object_t obj
Definition: vlc_window.h:373
union vlc_window::@288 handle
Window handle (mandatory)
uint32_t crtc
KMS CRTC identifier.
Definition: vlc_window.h:401
unsigned type
Window handle type.
Definition: vlc_window.h:384
struct wl_surface * wl
Wayland surface (client pointer)
Definition: vlc_window.h:399
int drm_fd
KMS DRM device.
Definition: vlc_window.h:416
void * dcomp_device
DirectComposition device.
Definition: vlc_window.h:415
bool has_double_click
Whether double click events are sent, or need to be emulated.
Definition: vlc_window.h:424
void * dcomp_visual
Win32 direct composition visual.
Definition: vlc_window.h:400
struct wl_display * wl
Wayland display (client pointer)
Definition: vlc_window.h:414
struct vlc_window::@290 info
void * nsobject
macOS/iOS view object
Definition: vlc_window.h:397
vlc_window_owner_t owner
Definition: vlc_window.h:434
void * hwnd
Win32 window handle.
Definition: vlc_window.h:395
void * sys
Definition: vlc_window.h:432
This file is a collection of common definitions and types.