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