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