]> git.sesse.net Git - vlc/blobdiff - modules/control/gestures.c
all: updated my name and e-mail address
[vlc] / modules / control / gestures.c
index 11471b0c4afe90ac0b81b46cffb27c99b0bbeaad..9c6110eb2956d1fc86c0da680f25a97ef460c7df 100644 (file)
@@ -1,16 +1,16 @@
 /*****************************************************************************
- * geatures.c: control vlc with mouse gestures
+ * gestures.c: control vlc with mouse gestures
  *****************************************************************************
- * Copyright (C) 2002 VideoLAN
- * $Id: gestures.c,v 1.1 2003/02/09 23:42:06 sigmunau Exp $
+ * Copyright (C) 2004 the VideoLAN team
+ * $Id$
  *
- * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
+ * Authors: Sigmund Augdal Helberg <dnumgis@videolan.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
  * (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
  *****************************************************************************/
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
-#include <unistd.h>
 
 #include <vlc/vlc.h>
 #include <vlc/intf.h>
 #include <vlc/vout.h>
 
-#include "stream_control.h"
-#include "input_ext-intf.h"
+#ifdef HAVE_UNISTD_H
+#    include <unistd.h>
+#endif
 
 /*****************************************************************************
  * intf_sys_t: description and status of interface
@@ -74,23 +74,27 @@ static void RunIntf        ( intf_thread_t *p_intf );
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-#define THRESHOLD_TEXT N_( "Motion threshold" )
+#define THRESHOLD_TEXT N_( "Motion threshold (10-100)" )
 #define THRESHOLD_LONGTEXT N_( \
-    "the amount of movement required for a mouse" \
-    " gesture to be recorded" )
+    "Amount of movement required for a mouse" \
+    " gesture to be recorded." )
 
-#define BUTTON_TEXT N_( "Mouse button" )
+#define BUTTON_TEXT N_( "Trigger button" )
 #define BUTTON_LONGTEXT N_( \
-    "the mouse button to be held down during mouse gestures" )
+    "You can set the trigger button for mouse gestures here." )
 
-static char *button_list[] = { "left", "middle", "right", NULL };
+static char *button_list[] = { "left", "middle", "right" };
+static char *button_list_text[] = { N_("Left"), N_("Middle"), N_("Right") };
 
 vlc_module_begin();
-    add_category_hint( N_( "Gestures" ), NULL );
-    add_integer( "gestures-threshold", 30, NULL, THRESHOLD_TEXT, THRESHOLD_LONGTEXT );
-    add_string_from_list( "gestures-button", "right", button_list, NULL,
-                          BUTTON_TEXT, BUTTON_LONGTEXT );
-    set_description( _("mouse gestures control module") );
+    set_shortname( _("Gestures"));
+    set_category( CAT_INTERFACE );
+    set_subcategory( SUBCAT_INTERFACE_CONTROL );
+    add_integer( "gestures-threshold", 30, NULL, THRESHOLD_TEXT, THRESHOLD_LONGTEXT, VLC_TRUE );
+    add_string( "gestures-button", "right", NULL,
+                BUTTON_TEXT, BUTTON_LONGTEXT, VLC_FALSE );
+        change_string_list( button_list, button_list_text, 0 );
+    set_description( _("Mouse gestures control interface") );
 
     set_capability( "interface", 0 );
     set_callbacks( E_(Open), E_(Close) );
@@ -185,16 +189,19 @@ static void RunIntf( intf_thread_t *p_intf )
                 playlist_Next( p_playlist );
                 vlc_object_release( p_playlist );
                 break;
-
-            case DOWN:
-                if (p_intf->p_sys->p_vout
-                    && ((vout_thread_t *)p_intf->p_sys->p_vout)->b_fullscreen )
+            case GESTURE(UP,RIGHT,NONE,NONE):
+                if (p_intf->p_sys->p_vout )
                 {
-                    ((vout_thread_t *)p_intf->p_sys->p_vout)->i_changes |= VOUT_FULLSCREEN_CHANGE;
+                    ((vout_thread_t *)p_intf->p_sys->p_vout)->i_changes |=
+                        VOUT_FULLSCREEN_CHANGE;
                 }
                 break;
+            case GESTURE(DOWN,RIGHT,NONE,NONE):
+                /* FIXME: Should close the vout!"*/
+                p_intf->p_vlc->b_die = VLC_TRUE;
+                break;
             case GESTURE(DOWN,LEFT,UP,RIGHT):
-                msg_Dbg(p_intf, "A square!" );
+                msg_Dbg(p_intf, "a square!" );
                 break;
             default:
                 break;