]> git.sesse.net Git - vlc/blobdiff - plugins/gnome/gnome_callbacks.c
* Ported Glide and MGA plugins to the new module API. MGA never worked,
[vlc] / plugins / gnome / gnome_callbacks.c
index 36c299cf799e601b671abbb231b6c437cb9c8a98..53bb37631c4d6e9868a4ea5a904218b603190d1e 100644 (file)
+/*****************************************************************************
+ * gnome_callbacks.c : Callbacks for the Gnome plugin.
+ *****************************************************************************
+ * Copyright (C) 2000, 2001 VideoLAN
+ *
+ * Authors: Samuel Hocevar <sam@zoy.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
+ * GNU 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., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#define MODULE_NAME gnome
+#include "modules_inner.h"
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
 #include "defs.h"
 
+#include <gnome.h>
+
 #include "config.h"
 #include "common.h"
 #include "threads.h"
 #include "mtime.h"
 
-#include <gnome.h>
-
 #include "stream_control.h"
 #include "input_ext-intf.h"
 
 #include "interface.h"
+#include "intf_plst.h"
+#include "intf_msg.h"
 
 #include "gnome_sys.h"
 #include "gnome_callbacks.h"
 #include "gnome_interface.h"
 #include "gnome_support.h"
 
-#define GET_GNOME_STRUCT( item, parent ) \
-gtk_object_get_data( \
-    GTK_OBJECT( lookup_widget(GTK_WIDGET(item), parent) ), \
-    "p_intf" );
+#include "main.h"
 
-void
-on_modules_activate                    (GtkMenuItem     *menuitem,
-                                        gpointer         user_data)
+/*****************************************************************************
+ * Inline function to retrieve the interface structure
+ *****************************************************************************/
+static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent )
 {
-
+    return( gtk_object_get_data( GTK_OBJECT( lookup_widget(item, psz_parent) ),
+                                 "p_intf" ) );
 }
 
-
+/*****************************************************************************
+ * Callbacks
+ ******************************************************************************/
 void
-on_exit_activate                       (GtkMenuItem     *menuitem,
+on_menubar_open_activate               (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
 
-    p_intf = GET_GNOME_STRUCT( menuitem, "intf_window" );
+    /* If we have never used the file selector, open it */
+    if( p_intf->p_sys->p_fileopen == NULL)
+    {
+        p_intf->p_sys->p_fileopen = create_intf_fileopen();
+        gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
+                             "p_intf", p_intf );
+    }
 
-    p_intf->b_die = 1;
+    gtk_widget_show( p_intf->p_sys->p_fileopen );
+    gdk_window_raise( p_intf->p_sys->p_fileopen->window );
 }
 
 
 void
-on_open_activate                       (GtkMenuItem     *menuitem,
+on_menubar_exit_activate               (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
 
+    p_intf->b_die = 1;
 }
 
 
 void
-on_preferences_activate                (GtkMenuItem     *menuitem,
+on_menubar_playlist_activate           (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
 
+    if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
+    {
+        p_intf->p_sys->p_playlist = create_intf_playlist();
+        gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
+                             "p_intf", p_intf );
+    }
+    gtk_widget_show( p_intf->p_sys->p_playlist );
+    gdk_window_raise( p_intf->p_sys->p_playlist->window );
 }
 
 
 void
-on_plugins_activate                    (GtkMenuItem     *menuitem,
+on_menubar_preferences_activate        (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
 
@@ -67,342 +116,361 @@ on_plugins_activate                    (GtkMenuItem     *menuitem,
 
 
 void
-on_about_activate                      (GtkMenuItem     *menuitem,
+on_menubar_about_activate              (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
-
-    p_intf = GET_GNOME_STRUCT( menuitem, "intf_window" );
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
 
     if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) )
     {
-        p_intf->p_sys->p_about = create_intf_about ();
+        p_intf->p_sys->p_about = create_intf_about();
+        gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_about ),
+                             "p_intf", p_intf );
     }
     gtk_widget_show( p_intf->p_sys->p_about );
+    gdk_window_raise( p_intf->p_sys->p_about->window );
 }
 
 
 void
-on_stop_clicked                        (GtkButton       *button,
+on_toolbar_open_clicked                (GtkButton       *button,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
 
-    p_intf = GET_GNOME_STRUCT( button, "intf_window" );
+    /* If we have never used the file selector, open it */
+    if( p_intf->p_sys->p_fileopen == NULL)
+    {
+        p_intf->p_sys->p_fileopen = create_intf_fileopen();
+        gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
+                             "p_intf", p_intf );
+    }
 
+    gtk_widget_show( p_intf->p_sys->p_fileopen );
+    gdk_window_raise( p_intf->p_sys->p_fileopen->window );
 }
 
 
 void
-on_control_activate                    (GtkMenuItem     *menuitem,
+on_toolbar_back_clicked                (GtkButton       *button,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
 
-    p_intf = GET_GNOME_STRUCT( menuitem, "intf_window" );
+}
 
-    /* lock the change structure */
-    vlc_mutex_lock( &p_intf->p_sys->change_lock );
 
-    if( p_intf->p_sys->b_window )
-    {
-        gtk_widget_hide( p_intf->p_sys->p_window );
-        p_intf->p_sys->b_window = 0;
-    }
-    else
-    {
-        if( !GTK_IS_WIDGET( p_intf->p_sys->p_window ) )
-        {
-            p_intf->p_sys->p_window = create_intf_window ();
-        }
-        gtk_widget_show( p_intf->p_sys->p_window );
-        gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
-                             "p_intf", p_intf );
-        p_intf->p_sys->b_window = 1;
-    }
+void
+on_toolbar_stop_clicked                (GtkButton       *button,
+                                        gpointer         user_data)
+{
 
-    /* unlock the change structure */
-    vlc_mutex_unlock( &p_intf->p_sys->change_lock );
 }
 
 
 void
-on_playlist_activate                   (GtkMenuItem     *menuitem,
+on_toolbar_play_clicked                (GtkButton       *button,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
-
-    p_intf = GET_GNOME_STRUCT( menuitem, "intf_window" );
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
 
-    /* lock the change structure */
-    vlc_mutex_lock( &p_intf->p_sys->change_lock );
-
-    if( p_intf->p_sys->b_playlist )
+    if( p_intf->p_input != NULL )
     {
-        gtk_widget_hide( p_intf->p_sys->p_playlist );
-        p_intf->p_sys->b_playlist = 0;
-    }
-    else
-    {
-        if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
-        {
-            p_intf->p_sys->p_playlist = create_intf_playlist ();
-        }
-        gtk_widget_show( p_intf->p_sys->p_playlist );
-        gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_playlist),
-                             "p_intf", p_intf );
-        p_intf->p_sys->b_playlist = 1;
+        input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
     }
-
-    /* unlock the change structure */
-    vlc_mutex_unlock( &p_intf->p_sys->change_lock );
 }
 
+
 void
-on_popup_control_activate              (GtkMenuItem     *menuitem,
+on_toolbar_pause_clicked               (GtkButton       *button,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
 
-    p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" );
-
-    /* lock the change structure */
-    vlc_mutex_lock( &p_intf->p_sys->change_lock );
-
-    if( p_intf->p_sys->b_window )
-    {
-        gtk_widget_hide( p_intf->p_sys->p_window );
-        p_intf->p_sys->b_window = 0;
-    }
-    else
+    if( p_intf->p_input != NULL )
     {
-        if( !GTK_IS_WIDGET( p_intf->p_sys->p_window ) )
-        {
-            p_intf->p_sys->p_window = create_intf_window ();
-        }
-        gtk_widget_show( p_intf->p_sys->p_window );
-        gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
-                             "p_intf", p_intf );
-        p_intf->p_sys->b_window = 1;
+        input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE );
     }
-
-    /* unlock the change structure */
-    vlc_mutex_unlock( &p_intf->p_sys->change_lock );
 }
 
 
 void
-on_popup_playlist_activate             (GtkMenuItem     *menuitem,
+on_toolbar_playlist_clicked            (GtkButton       *button,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
 
-    p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" );
-
-    /* lock the change structure */
-    vlc_mutex_lock( &p_intf->p_sys->change_lock );
-
-    if( p_intf->p_sys->b_playlist )
-    {
-        gtk_widget_hide( p_intf->p_sys->p_playlist );
-        p_intf->p_sys->b_playlist = 0;
-    }
-    else
+    if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
     {
-        if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
-        {
-            p_intf->p_sys->p_playlist = create_intf_playlist ();
-        }
-        gtk_widget_show( p_intf->p_sys->p_playlist );
-        gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_playlist),
+        p_intf->p_sys->p_playlist = create_intf_playlist();
+        gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
                              "p_intf", p_intf );
-        p_intf->p_sys->b_playlist = 1;
     }
-
-    /* unlock the change structure */
-    vlc_mutex_unlock( &p_intf->p_sys->change_lock );
+    gtk_widget_show( p_intf->p_sys->p_playlist );
+    gdk_window_raise( p_intf->p_sys->p_playlist->window );
 }
 
 
-
 void
-on_popup_exit_activate                 (GtkMenuItem     *menuitem,
+on_toolbar_prev_clicked                (GtkButton       *button,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
-
-    p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" );
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
 
-    p_intf->b_die = 1;
+    if( p_intf->p_input != NULL )
+    {
+        /* FIXME: temporary hack */
+        intf_PlstPrev( p_main->p_playlist );
+        intf_PlstPrev( p_main->p_playlist );
+        p_intf->p_input->b_eof = 1;
+    }
 }
 
 
 void
-on_popup_about_activate                (GtkMenuItem     *menuitem,
+on_toolbar_next_clicked                (GtkButton       *button,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
-
-    p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" );
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
 
-    if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) )
+    if( p_intf->p_input != NULL )
     {
-        p_intf->p_sys->p_about = create_intf_about ();
+        /* FIXME: temporary hack */
+        p_intf->p_input->b_eof = 1;
     }
-    gtk_widget_show( p_intf->p_sys->p_about );
 }
 
 
 void
-on_intf_window_destroy                 (GtkObject       *object,
+on_popup_play_activate                 (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
-
-    p_intf = GET_GNOME_STRUCT( object, "intf_window" );
-
-    /* FIXME don't destroy the window, just hide it */
-    p_intf->p_sys->p_window = NULL;
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
 
-    p_intf->b_die = 1;
+    if( p_intf->p_input != NULL )
+    {
+        input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
+    }
 }
 
 
 void
-on_intf_playlist_destroy               (GtkObject       *object,
+on_popup_pause_activate                (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-   ;
-}
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
 
+    if( p_intf->p_input != NULL )
+    {
+        input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE );
+    }
+}
 
 
 void
-on_channel1_activate                   (GtkMenuItem     *menuitem,
+on_popup_exit_activate                 (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
 
+    p_intf->b_die = 1;
 }
 
 
 void
-on_channel2_activate                   (GtkMenuItem     *menuitem,
+on_intf_window_destroy                 (GtkObject       *object,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_window" );
 
+    /* FIXME don't destroy the window, just hide it */
+    p_intf->b_die = 1;
+    p_intf->p_sys->p_window = NULL;
 }
 
 
 void
-on_channel3_activate                   (GtkMenuItem     *menuitem,
+on_fileopen_ok_clicked                 (GtkButton       *button,
                                         gpointer         user_data)
 {
+    GtkWidget *filesel;
+    gchar *filename;
 
+    filesel = gtk_widget_get_toplevel (GTK_WIDGET (button));
+    gtk_widget_hide (filesel);
+    filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel));
+
+    intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename );
 }
 
 
 void
-on_channel4_activate                   (GtkMenuItem     *menuitem,
+on_fileopen_cancel_clicked             (GtkButton       *button,
                                         gpointer         user_data)
 {
-
+    gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
 }
 
 
 void
-on_channel5_activate                   (GtkMenuItem     *menuitem,
+on_intf_fileopen_destroy               (GtkObject       *object,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_fileopen" );
 
+    p_intf->p_sys->p_fileopen = NULL;
 }
 
 
 void
-on_popup_channel1_activate             (GtkMenuItem     *menuitem,
+on_popup_open_activate                 (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
+
+    /* If we have never used the file selector, open it */
+    if( p_intf->p_sys->p_fileopen == NULL)
+    {
+        p_intf->p_sys->p_fileopen = create_intf_fileopen();
+        gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
+                             "p_intf", p_intf );
+    }
 
+    gtk_widget_show( p_intf->p_sys->p_fileopen );
+    gdk_window_raise( p_intf->p_sys->p_fileopen->window );
 }
 
 
 void
-on_popup_channel2_activate             (GtkMenuItem     *menuitem,
+on_popup_about_activate                (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
 
+    if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) )
+    {
+        p_intf->p_sys->p_about = create_intf_about();
+        gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_about ),
+                             "p_intf", p_intf );
+    }
+    gtk_widget_show( p_intf->p_sys->p_about );
+    gdk_window_raise( p_intf->p_sys->p_about->window );
 }
 
 
 void
-on_popup_channel3_activate             (GtkMenuItem     *menuitem,
+on_intf_playlist_destroy               (GtkObject       *object,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_playlist" );
 
+    p_intf->p_sys->p_playlist = NULL;
 }
 
 
 void
-on_popup_channel4_activate             (GtkMenuItem     *menuitem,
+on_playlist_close_clicked              (GtkButton       *button,
                                         gpointer         user_data)
 {
-
+    gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
 }
 
 
 void
-on_popup_channel5_activate             (GtkMenuItem     *menuitem,
+on_popup_slow_activate                 (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
 
+    if( p_intf->p_input != NULL )
+    {
+        input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER );
+    }
 }
 
 
 void
-on_popup_config_channels_activate      (GtkMenuItem     *menuitem,
+on_popup_fast_activate                 (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
 
+    if( p_intf->p_input != NULL )
+    {
+        input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER );
+    }
 }
 
 
 void
-on_config_channels_activate            (GtkMenuItem     *menuitem,
+on_toolbar_slow_clicked                (GtkButton       *button,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
 
+    if( p_intf->p_input != NULL )
+    {
+        input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER );
+    }
 }
 
 
 void
-on_user_guide_activate                 (GtkMenuItem     *menuitem,
+on_toolbar_fast_clicked                (GtkButton       *button,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
 
+    if( p_intf->p_input != NULL )
+    {
+        input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER );
+    }
 }
 
 
-void
-on_popup_stop_activate                 (GtkMenuItem     *menuitem,
+gboolean
+on_hscale_button_release_event         (GtkWidget       *widget,
+                                        GdkEventButton  *event,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
+
+    GtkAdjustment *p_adj = gtk_range_get_adjustment( GTK_RANGE(widget) );
+    off_t i_seek;
 
+    vlc_mutex_lock( &p_intf->p_sys->change_lock );
+
+    if( p_intf->p_input != NULL )
+    {
+        i_seek = (p_adj->value *
+                  p_intf->p_input->stream.pp_areas[0]->i_size) / 100;
+        input_Seek( p_intf->p_input, i_seek );
+    }
+    p_intf->p_sys->b_scale_isfree = 1;
+
+    vlc_mutex_unlock( &p_intf->p_sys->change_lock );
+
+    return FALSE;
 }
 
 
-void
-on_popup_play_activate                 (GtkMenuItem     *menuitem,
+gboolean
+on_hscale_button_press_event           (GtkWidget       *widget,
+                                        GdkEventButton  *event,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
 
-    p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" );
+    vlc_mutex_lock( &p_intf->p_sys->change_lock );
+    p_intf->p_sys->b_scale_isfree = 0;
+    vlc_mutex_unlock( &p_intf->p_sys->change_lock );
 
-    input_Play( p_intf->p_input );
+    return FALSE;
 }
 
 
+
 void
-on_playlist_close_clicked              (GtkButton       *button,
+on_intf_modules_destroy                (GtkObject       *object,
                                         gpointer         user_data)
 {
 
@@ -410,19 +478,18 @@ on_playlist_close_clicked              (GtkButton       *button,
 
 
 void
-on_play_clicked                        (GtkButton       *button,
+on_modules_ok_clicked                  (GtkButton       *button,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" );
 
-    p_intf = GET_GNOME_STRUCT( button, "intf_window" );
+    gtk_widget_hide( p_intf->p_sys->p_modules );
 
-    input_Play( p_intf->p_input );
 }
 
 
 void
-on_channel0_activate                   (GtkMenuItem     *menuitem,
+on_modules_apply_clicked               (GtkButton       *button,
                                         gpointer         user_data)
 {
 
@@ -430,75 +497,90 @@ on_channel0_activate                   (GtkMenuItem     *menuitem,
 
 
 void
-on_popup_channel0_activate             (GtkMenuItem     *menuitem,
+on_modules_cancel_clicked              (GtkButton       *button,
                                         gpointer         user_data)
 {
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" );
 
+    gtk_widget_hide( p_intf->p_sys->p_modules );
 }
 
 
 void
-on_open_clicked                        (GtkButton       *button,
+on_playlist_ok_clicked                 (GtkButton       *button,
                                         gpointer         user_data)
 {
-    GnomeUIInfo test_uiinfo[] =
-    {
-        {
-            GNOME_APP_UI_ITEM, N_( "Barf" ),
-            NULL,
-            on_exit_activate, NULL, NULL,
-            GNOME_APP_PIXMAP_NONE, NULL,
-            0, 0, NULL
-        }
-    };
-
-    intf_thread_t *p_intf;
-
-    p_intf = GET_GNOME_STRUCT( button, "intf_window" );
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_playlist" );
 
-    gnome_app_insert_menus (GNOME_APP (p_intf->p_sys->p_window),
-                              "_View/Channel/None",
-                              test_uiinfo);
+    gtk_widget_hide( p_intf->p_sys->p_playlist );
 }
 
 
 void
-on_pause_clicked                       (GtkButton       *button,
+on_menubar_modules_activate            (GtkMenuItem     *menuitem,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
+    intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
 
-    p_intf = GET_GNOME_STRUCT( button, "intf_window" );
-
-    input_Pause( p_intf->p_input );
+    if( !GTK_IS_WIDGET( p_intf->p_sys->p_modules ) )
+    {
+        p_intf->p_sys->p_modules = create_intf_modules();
+        gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_modules ),
+                             "p_intf", p_intf );
+    }
+    gtk_widget_show( p_intf->p_sys->p_modules );
+    gdk_window_raise( p_intf->p_sys->p_modules->window );
 }
 
 
 void
-on_popup_pause_activate                (GtkMenuItem     *menuitem,
+on_intf_window_drag_data_received      (GtkWidget       *widget,
+                                        GdkDragContext  *drag_context,
+                                        gint             x,
+                                        gint             y,
+                                        GtkSelectionData *data,
+                                        guint            info,
+                                        guint            time,
                                         gpointer         user_data)
 {
-    intf_thread_t *p_intf;
+    char *psz_text = data->data;
+    int i_len      = strlen( psz_text );
 
-    p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" );
+    switch( info )
+    {
+    case DROP_ACCEPT_TEXT_PLAIN: /* FIXME: handle multiple files */
 
-    input_Pause( p_intf->p_input );
-}
+        if( i_len < 1 )
+        {
+            return;
+        }
 
+        /* get rid of ' ' at the end */
+        *( psz_text + i_len - 1 ) = 0;
 
+        intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'", psz_text );
+        intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_text );
 
-void
-on_mute_clicked                        (GtkButton       *button,
-                                        gpointer         user_data)
-{
+        break;
 
-}
+    case DROP_ACCEPT_TEXT_URI_LIST: /* FIXME: handle multiple files */
 
+        if( i_len < 2 )
+        {
+            return;
+        }
 
-void
-on_popup_mute_activate                 (GtkMenuItem     *menuitem,
-                                        gpointer         user_data)
-{
+        /* get rid of \r\n at the end */
+        *( psz_text + i_len - 2 ) = 0;
+
+        intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'", psz_text );
+        intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_text );
+        break;
 
+    default:
+
+        intf_ErrMsg( "intf error: unknown dropped type");
+        break;
+    }
 }