[vlc-devel] [PATCH 14/15] core: move some internal inline functions in display.c
Steve Lhomme
robux4 at videolabs.io
Fri Nov 4 18:08:57 CET 2016
---
src/video_output/display.c | 39 +++++++++++++++++++++++++++++++++++++++
src/video_output/event.h | 37 -------------------------------------
2 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 6ac08c1..4ee4a7c 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -1665,6 +1665,45 @@ vout_display_t *vout_NewSplitter(vout_thread_t *vout,
* TODO move out
*****************************************************************************/
#include "vout_internal.h"
+static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
+{
+ int key = KEY_UNSET;
+ var_OrInteger(vout, "mouse-button-down", 1 << button);
+
+ switch (button)
+ {
+ case MOUSE_BUTTON_LEFT:
+ {
+ /* FIXME? */
+ int x, y;
+ var_GetCoords(vout, "mouse-moved", &x, &y);
+ var_SetCoords(vout, "mouse-clicked", x, y);
+ var_SetBool(vout->obj.libvlc, "intf-popupmenu", false);
+ return;
+ }
+ case MOUSE_BUTTON_CENTER:
+ var_ToggleBool(vout->obj.libvlc, "intf-toggle-fscontrol");
+ return;
+ case MOUSE_BUTTON_RIGHT:
+ var_SetBool(vout->obj.libvlc, "intf-popupmenu", true);
+ return;
+ case MOUSE_BUTTON_WHEEL_UP: key = KEY_MOUSEWHEELUP; break;
+ case MOUSE_BUTTON_WHEEL_DOWN: key = KEY_MOUSEWHEELDOWN; break;
+ case MOUSE_BUTTON_WHEEL_LEFT: key = KEY_MOUSEWHEELLEFT; break;
+ case MOUSE_BUTTON_WHEEL_RIGHT: key = KEY_MOUSEWHEELRIGHT; break;
+ }
+ vout_SendEventKey(vout, key);
+}
+static inline void vout_SendEventMouseReleased(vout_thread_t *vout, int button)
+{
+ var_NAndInteger(vout, "mouse-button-down", 1 << button);
+}
+
+static inline void vout_SendEventMouseMoved(vout_thread_t *vout, int x, int y)
+{
+ var_SetCoords(vout, "mouse-moved", x, y);
+}
+
void vout_SendDisplayEventMouse(vout_thread_t *vout, const vlc_mouse_t *m)
{
vlc_mouse_t tmp1, tmp2;
diff --git a/src/video_output/event.h b/src/video_output/event.h
index 8f11250..a9f4138 100644
--- a/src/video_output/event.h
+++ b/src/video_output/event.h
@@ -48,43 +48,6 @@ static inline void vout_SendEventKey(vout_thread_t *vout, int key)
{
var_SetInteger(vout->obj.libvlc, "key-pressed", key);
}
-static inline void vout_SendEventMouseMoved(vout_thread_t *vout, int x, int y)
-{
- var_SetCoords(vout, "mouse-moved", x, y);
-}
-static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
-{
- int key = KEY_UNSET;
- var_OrInteger(vout, "mouse-button-down", 1 << button);
-
- switch (button)
- {
- case MOUSE_BUTTON_LEFT:
- {
- /* FIXME? */
- int x, y;
- var_GetCoords(vout, "mouse-moved", &x, &y);
- var_SetCoords(vout, "mouse-clicked", x, y);
- var_SetBool(vout->obj.libvlc, "intf-popupmenu", false);
- return;
- }
- case MOUSE_BUTTON_CENTER:
- var_ToggleBool(vout->obj.libvlc, "intf-toggle-fscontrol");
- return;
- case MOUSE_BUTTON_RIGHT:
- var_SetBool(vout->obj.libvlc, "intf-popupmenu", true);
- return;
- case MOUSE_BUTTON_WHEEL_UP: key = KEY_MOUSEWHEELUP; break;
- case MOUSE_BUTTON_WHEEL_DOWN: key = KEY_MOUSEWHEELDOWN; break;
- case MOUSE_BUTTON_WHEEL_LEFT: key = KEY_MOUSEWHEELLEFT; break;
- case MOUSE_BUTTON_WHEEL_RIGHT: key = KEY_MOUSEWHEELRIGHT; break;
- }
- vout_SendEventKey(vout, key);
-}
-static inline void vout_SendEventMouseReleased(vout_thread_t *vout, int button)
-{
- var_NAndInteger(vout, "mouse-button-down", 1 << button);
-}
static inline void vout_SendEventMouseDoubleClick(vout_thread_t *vout)
{
//vout_ControlSetFullscreen(vout, !var_GetBool(vout, "fullscreen"));
--
2.10.1
More information about the vlc-devel
mailing list