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