*
* Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLC_VOUT_DISPLAY_H
/* Ask the module to acknowledge/refuse the display size change requested
* (externally or by VOUT_DISPLAY_EVENT_DISPLAY_SIZE) */
- VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, /* const vout_display_cfg_t *p_cfg, int is_forced */
+ VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, /* const vout_display_cfg_t *p_cfg */
/* Ask the module to acknowledge/refuse fill display state change after
* being requested externally */
* The cropping requested is stored by video_format_t::i_x/y_offset and
* video_format_t::i_visible_width/height */
VOUT_DISPLAY_CHANGE_SOURCE_CROP, /* const video_format_t *p_source */
-
- /* Ask an opengl interface if available. */
- VOUT_DISPLAY_GET_OPENGL, /* vout_opengl_t ** */
};
/**
VOUT_DISPLAY_EVENT_PICTURES_INVALID, /* The buffer are now invalid and need to be changed */
VOUT_DISPLAY_EVENT_FULLSCREEN,
+#if defined(_WIN32) || defined(__OS2__)
VOUT_DISPLAY_EVENT_WINDOW_STATE,
+#endif
- VOUT_DISPLAY_EVENT_DISPLAY_SIZE, /* The display size need to change : int i_width, int i_height, bool is_fullscreen */
+ VOUT_DISPLAY_EVENT_DISPLAY_SIZE, /* The display size need to change : int i_width, int i_height */
/* */
VOUT_DISPLAY_EVENT_CLOSE,
va_end(args);
}
-static inline void vout_display_SendEventDisplaySize(vout_display_t *vd, int width, int height, bool is_fullscreen)
+static inline void vout_display_SendEventDisplaySize(vout_display_t *vd, int width, int height)
{
- vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_DISPLAY_SIZE, width, height, is_fullscreen);
+ vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_DISPLAY_SIZE, width, height);
}
static inline void vout_display_SendEventPicturesInvalid(vout_display_t *vd)
{
{
vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_FULLSCREEN, is_fullscreen);
}
+#if defined(_WIN32)
static inline void vout_display_SendWindowState(vout_display_t *vd, unsigned state)
{
vout_display_SendEvent(vd, VOUT_DISPLAY_EVENT_WINDOW_STATE, state);
}
+#endif
/* The mouse position (State and Moved event) must be expressed against vout_display_t::source unit */
static inline void vout_display_SendEventMouseState(vout_display_t *vd, int x, int y, int button_mask)
{
vd->owner.window_del(vd, window);
}
+static inline bool vout_display_IsWindowed(vout_display_t *vd)
+{
+#ifndef __cplusplus
+ vout_window_cfg_t cfg = {
+ .width = vd->cfg->display.width,
+ .height = vd->cfg->display.height,
+ };
+#else
+ vout_window_cfg_t cfg;
+ memset(&cfg, 0, sizeof (cfg));
+ cfg.width = vd->cfg->display.width;
+ cfg.height = vd->cfg->display.height;
+#endif
+ vout_window_t *window = vout_display_NewWindow(vd, &cfg);
+ if (window != NULL)
+ vout_display_DeleteWindow(vd, window);
+ return window != NULL;
+}
+
/**
* Computes the default display size given the source and
* the display configuration.
*
* This asssumes that the picture is already cropped.
*/
-VLC_EXPORT( void, vout_display_GetDefaultDisplaySize, (unsigned *width, unsigned *height, const video_format_t *source, const vout_display_cfg_t *) );
+VLC_API void vout_display_GetDefaultDisplaySize(unsigned *width, unsigned *height, const video_format_t *source, const vout_display_cfg_t *);
/**
* \param p_cfg Display configuration
* \param b_clip If true, prevent the video to go outside the display (break zoom).
*/
-VLC_EXPORT( void, vout_display_PlacePicture, (vout_display_place_t *place, const video_format_t *source, const vout_display_cfg_t *cfg, bool do_clipping) );
+VLC_API void vout_display_PlacePicture(vout_display_place_t *place, const video_format_t *source, const vout_display_cfg_t *cfg, bool do_clipping);
+
+/**
+ * Helper function that applies the necessary transforms to the mouse position
+ * and then calls vout_display_SendEventMouseMoved.
+ *
+ * \param vd vout_display_t.
+ * \param orient_display The orientation of the picture as seen on screen (probably ORIENT_NORMAL).
+ * \param m_x Mouse x position (relative to place, origin is top left).
+ * \param m_y Mouse y position (relative to place, origin is top left).
+ * \param place Place of the picture.
+ */
+VLC_API void vout_display_SendMouseMovedDisplayCoordinates(vout_display_t *vd, video_orientation_t orient_display, int m_x, int m_y,
+ vout_display_place_t *place);
#endif /* VLC_VOUT_DISPLAY_H */