]> git.sesse.net Git - vlc/blobdiff - plugins/gtk/gtk_callbacks.c
* Fixed the BeOS compile typo.
[vlc] / plugins / gtk / gtk_callbacks.c
index ee53c1ffc23c25539c13dde67657aa2bad6e783f..021521ba53ba946cabc80e8ac1679878aa12f5b5 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_callbacks.c : Callbacks for the Gtk+ plugin.
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_callbacks.c,v 1.18 2001/05/15 14:49:48 stef Exp $
+ * $Id: gtk_callbacks.c,v 1.22 2001/05/30 17:03:12 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -22,9 +22,6 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
-#define MODULE_NAME gtk
-#include "modules_inner.h"
-
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
@@ -57,6 +54,9 @@
 #include "intf_gtk.h"
 
 #include "main.h"
+#include "netutils.h"
+
+#include "modules_export.h"
 
 /*****************************************************************************
  * Callbacks
@@ -200,11 +200,12 @@ void GtkTitlePrev( GtkButton * button, gpointer user_data )
     if( i_id > 0 )
     {
         p_area = p_intf->p_input->stream.pp_areas[i_id];
-        p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
+        input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
 
         input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
 
         p_intf->p_sys->b_title_update = 1;
+        GtkSetupMenus( p_intf );
     }
 }
 
@@ -221,11 +222,12 @@ void GtkTitleNext( GtkButton * button, gpointer user_data )
     if( i_id < p_intf->p_input->stream.i_area_nb )
     {
         p_area = p_intf->p_input->stream.pp_areas[i_id];   
-        p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
+        input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
 
         input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
 
         p_intf->p_sys->b_title_update = 1;
+        GtkSetupMenus( p_intf );
     }
 
 }
@@ -242,11 +244,12 @@ void GtkChapterPrev( GtkButton * button, gpointer user_data )
     if( p_area->i_part > 0 )
     {
         p_area->i_part--;
-        p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
+        input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
 
         input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
 
         p_intf->p_sys->b_chapter_update = 1;
+        GtkSetupMenus( p_intf );
     }
 }
 
@@ -262,22 +265,52 @@ void GtkChapterNext( GtkButton * button, gpointer user_data )
     if( p_area->i_part < p_area->i_part_nb )
     {
         p_area->i_part++;
-        p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
+        input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
 
         input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
 
         p_intf->p_sys->b_chapter_update = 1;
+        GtkSetupMenus( p_intf );
     }
 }
 
+/****************************************************************************
+ * Network specific items
+ ****************************************************************************/
+void GtkNetworkJoin( GtkEditable * editable, gpointer user_data )
+{
+    int     i_channel;
+
+    i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( editable ) );
+    intf_WarnMsg( 3, "intf info: joining channel %d", i_channel );
+
+//    network_ChannelJoin( i_channel );
+}
+
+void GtkChannelGo( GtkButton * button, gpointer user_data )
+{
+    GtkWidget *     window;
+    GtkWidget *     spin;
+    int             i_channel;
+
+    window = gtk_widget_get_toplevel( GTK_WIDGET (button) );
+    spin = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( window ),
+                       "network_channel_spinbutton" ) );
+
+    i_channel = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spin ) );
+    intf_WarnMsg( 3, "intf info: joining channel %d", i_channel );
+
+    network_ChannelJoin( i_channel );
+}
+
+
 /****************************************************************************
  * About box
  ****************************************************************************/
 
-gboolean
-GtkAboutShow                           (GtkWidget       *widget,
-                                        GdkEventButton  *event,
-                                        gpointer         user_data)
+gboolean GtkAboutShow( GtkWidget       *widget,
+                       GdkEventButton  *event,
+                       gpointer         user_data)
 {
     intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
 
@@ -305,10 +338,9 @@ void GtkAboutOk( GtkButton * button, gpointer user_data)
  * Jump box
  ****************************************************************************/
 
-gboolean
-GtkJumpShow                            (GtkWidget       *widget,
-                                        GdkEventButton  *event,
-                                        gpointer         user_data)
+gboolean GtkJumpShow( GtkWidget       *widget,
+                      GdkEventButton  *event,
+                      gpointer         user_data)
 {
     intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
 
@@ -326,9 +358,8 @@ GtkJumpShow                            (GtkWidget       *widget,
 }
 
 
-void
-GtkJumpOk                              (GtkButton       *button,
-                                        gpointer         user_data)
+void GtkJumpOk( GtkButton       *button,
+                gpointer         user_data)
 {
     intf_thread_t * p_intf;
     off_t           i_seek;
@@ -365,9 +396,8 @@ GtkJumpOk                              (GtkButton       *button,
 }
 
 
-void
-GtkJumpCancel                          (GtkButton       *button,
-                                        gpointer         user_data)
+void GtkJumpCancel( GtkButton       *button,
+                    gpointer         user_data)
 {
     gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
 }
@@ -405,10 +435,3 @@ void GtkJumpActivate( GtkMenuItem * menuitem, gpointer user_data )
     GtkJumpShow( GTK_WIDGET( menuitem ), NULL, user_data );
 }
 
-void
-GtkPlaylistDestroy                     (GtkObject       *object,
-                                        gpointer         user_data)
-{
-
-}
-