[vlc-commits] commit: Remove useless mouse buttons table ( =?UTF-8?Q?R=C3=A9mi=20Denis=2DCourmont=20?=)

git at videolan.org git at videolan.org
Sun Dec 5 05:08:55 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec  5 05:59:57 2010 +0200| [938d8c45a0125d648b16e0b8eab91fd8b90409dc] | committer: Rémi Denis-Courmont 

Remove useless mouse buttons table

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=938d8c45a0125d648b16e0b8eab91fd8b90409dc
---

 include/vlc_mouse.h        |    5 +++--
 src/video_output/display.c |   11 +----------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/include/vlc_mouse.h b/include/vlc_mouse.h
index c7517d9..a4b1d6b 100644
--- a/include/vlc_mouse.h
+++ b/include/vlc_mouse.h
@@ -25,15 +25,16 @@
 #define _VLC_MOUSE_H 1
 
 /**
- * Mouse button
+ * Mouse buttons
  */
 enum
 {
-    MOUSE_BUTTON_LEFT,
+    MOUSE_BUTTON_LEFT=0,
     MOUSE_BUTTON_CENTER,
     MOUSE_BUTTON_RIGHT,
     MOUSE_BUTTON_WHEEL_UP,
     MOUSE_BUTTON_WHEEL_DOWN,
+    MOUSE_BUTTON_MAX
 };
 
 /**
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 72b3704..434ffbf 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -1627,16 +1627,7 @@ void vout_SendDisplayEventMouse(vout_thread_t *vout, const vlc_mouse_t *m)
         vout_SendEventMouseMoved(vout, m->i_x, m->i_y);
     }
     if (vlc_mouse_HasButton(&vout->p->mouse, m)) {
-        static const int buttons[] = {
-            MOUSE_BUTTON_LEFT,
-            MOUSE_BUTTON_CENTER,
-            MOUSE_BUTTON_RIGHT,
-            MOUSE_BUTTON_WHEEL_UP,
-            MOUSE_BUTTON_WHEEL_DOWN,
-            -1
-        };
-        for (int i = 0; buttons[i] >= 0; i++) {
-            const int button = buttons[i];
+        for (unsigned button = 0; button < MOUSE_BUTTON_MAX; button++) {
             if (vlc_mouse_HasPressed(&vout->p->mouse, m, button))
                 vout_SendEventMousePressed(vout, button);
             else if (vlc_mouse_HasReleased(&vout->p->mouse, m, button))



More information about the vlc-commits mailing list