Maemo: rename plugin to Hildon
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 19 Oct 2009 18:09:04 +0000 (21:09 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 19 Oct 2009 18:33:20 +0000 (21:33 +0300)
Hildon is not Maemo-specific (Ubuntu Mobile...).
And Maemo soon won't be Hildon-GTK anymore.

21 files changed:
configure.ac
modules/gui/Modules.am
modules/gui/hildon/Modules.am [new file with mode: 0644]
modules/gui/hildon/maemo.c [new file with mode: 0644]
modules/gui/hildon/maemo.h [new file with mode: 0644]
modules/gui/hildon/maemo_callbacks.c [new file with mode: 0644]
modules/gui/hildon/maemo_callbacks.h [new file with mode: 0644]
modules/gui/hildon/maemo_input.c [new file with mode: 0644]
modules/gui/hildon/maemo_input.h [new file with mode: 0644]
modules/gui/hildon/maemo_interface.c [new file with mode: 0644]
modules/gui/hildon/maemo_interface.h [new file with mode: 0644]
modules/gui/maemo/Modules.am [deleted file]
modules/gui/maemo/maemo.c [deleted file]
modules/gui/maemo/maemo.h [deleted file]
modules/gui/maemo/maemo_callbacks.c [deleted file]
modules/gui/maemo/maemo_callbacks.h [deleted file]
modules/gui/maemo/maemo_input.c [deleted file]
modules/gui/maemo/maemo_input.h [deleted file]
modules/gui/maemo/maemo_interface.c [deleted file]
modules/gui/maemo/maemo_interface.h [deleted file]
share/Makefile.am

index 27a269b..8dccdc4 100644 (file)
@@ -4327,25 +4327,24 @@ AM_CONDITIONAL(BUILD_SKINS, [test "${enable_skins2}" = "yes" ||
          test "${SYS}" != "mingwce" && test "${enable_skins2}" != "no")])
 
 dnl
-dnl Maemo
+dnl Hildon UI
 dnl
-AC_ARG_ENABLE(maemo,
-  [  --enable-maemo          Internet tablets based on Maemo SDK (default disabled)])
-if test "${enable_maemo}" = "yes"
-then
+AC_ARG_ENABLE(hildon,
+  [  --enable-hildon         Hildon touchscreen UI (default disabled)])
+AS_IF([test "${enable_hildon}" = "yes"], [
   PKG_CHECK_MODULES(HILDON, [hildon-1 hildon-fm-2], [
-    VLC_ADD_CFLAGS([maemo],[${HILDON_CFLAGS}])
-    VLC_ADD_LIBS([maemo],[${HILDON_LIBS}])
-    VLC_ADD_PLUGIN([maemo])
+    VLC_ADD_CFLAGS([hildon],[${HILDON_CFLAGS}])
+    VLC_ADD_LIBS([hildon],[${HILDON_LIBS}])
+    VLC_ADD_PLUGIN([hildon])
     ALIASES="${ALIASES} mvlc"
   ], [
-    AS_IF([test "${enable_maemo}" = "yes"],[
+    AS_IF([test "${enable_hildon}" = "yes"],[
       AC_MSG_ERROR([Hildon libraries not found])
     ])
-    enable_maemo="no"
+    enable_hildon="no"
   ])
-fi
-AM_CONDITIONAL(BUILD_MAEMO, [test "${enable_maemo}" = "yes"])
+])
+AM_CONDITIONAL(BUILD_HILDON, [test "${enable_hildon}" = "yes"])
 
 dnl
 dnl QT 4
@@ -5209,7 +5208,7 @@ AC_CONFIG_FILES([
   modules/gui/Makefile
   modules/gui/beos/Makefile
   modules/gui/macosx/Makefile
-  modules/gui/maemo/Makefile
+  modules/gui/hildon/Makefile
   modules/gui/minimal_macosx/Makefile
   modules/gui/qnx/Makefile
   modules/gui/qt4/Makefile
index 87f3042..7f298e1 100644 (file)
@@ -1,4 +1,4 @@
-DIST_SUBDIRS = beos macosx maemo minimal_macosx qnx qt4 skins2 wince
+DIST_SUBDIRS = beos macosx hildon minimal_macosx qnx qt4 skins2 wince
 SUBDIRS =
 
 if HAVE_BEOS
@@ -7,8 +7,8 @@ endif
 if HAVE_DARWIN
 SUBDIRS += macosx minimal_macosx
 endif
-if BUILD_MAEMO
-SUBDIRS += maemo
+if BUILD_HILDON
+SUBDIRS += hildon
 endif
 SUBDIRS += qnx
 if ENABLE_QT4
diff --git a/modules/gui/hildon/Modules.am b/modules/gui/hildon/Modules.am
new file mode 100644 (file)
index 0000000..f55147d
--- /dev/null
@@ -0,0 +1,8 @@
+SOURCES_hildon = maemo.c \
+               maemo.h \
+               maemo_callbacks.c \
+               maemo_callbacks.h \
+               maemo_input.c \
+               maemo_input.h \
+               maemo_interface.c \
+               maemo_interface.h
diff --git a/modules/gui/hildon/maemo.c b/modules/gui/hildon/maemo.c
new file mode 100644 (file)
index 0000000..2642171
--- /dev/null
@@ -0,0 +1,385 @@
+/*****************************************************************************
+* maemo.c : Maemo plugin for VLC
+*****************************************************************************
+* Copyright (C) 2008 the VideoLAN team
+* $Id$
+*
+* Authors: Antoine Lejeune <phytos@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
+* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+*****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <assert.h>
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
+#include <vlc_interface.h>
+#include <vlc_vout_window.h>
+
+#include <hildon/hildon-program.h>
+#include <hildon/hildon-banner.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+#include <stdio.h>
+#include <inttypes.h>
+
+#include "maemo.h"
+#include "maemo_callbacks.h"
+#include "maemo_input.h"
+#include "maemo_interface.h"
+
+/*****************************************************************************
+ * Local prototypes.
+ *****************************************************************************/
+static int      Open               ( vlc_object_t * );
+static void     Close              ( vlc_object_t * );
+static void     Run                ( intf_thread_t * );
+static gboolean should_die         ( gpointer );
+static int      OpenWindow         ( vlc_object_t * );
+static void     CloseWindow        ( vlc_object_t * );
+static int      ControlWindow      ( vout_window_t *, int, va_list );
+static uint32_t request_video      ( intf_thread_t *, vout_thread_t * );
+static void     release_video      ( intf_thread_t * );
+static gboolean video_widget_ready ( gpointer data );
+
+/*****************************************************************************
+* Module descriptor
+*****************************************************************************/
+vlc_module_begin();
+    set_shortname( "Maemo" );
+    set_description( N_("Maemo hildon interface") );
+    set_category( CAT_INTERFACE );
+    set_subcategory( SUBCAT_INTERFACE_MAIN );
+    set_capability( "interface", 70 );
+    set_callbacks( Open, Close );
+    add_shortcut( "maemo" );
+
+    add_submodule();
+        set_capability( "vout window xid", 50 );
+        set_callbacks( OpenWindow, CloseWindow );
+vlc_module_end();
+
+static struct
+{
+    vlc_mutex_t    lock;
+    vlc_cond_t     wait;
+    intf_thread_t *intf;
+    bool           enabled;
+} wnd_req = { VLC_STATIC_MUTEX, PTHREAD_COND_INITIALIZER, NULL, false };
+
+/*****************************************************************************
+ * Module callbacks
+ *****************************************************************************/
+static int Open( vlc_object_t *p_this )
+{
+    intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
+    /* Allocate instance and initialize some members */
+    p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
+    if( p_intf->p_sys == NULL )
+        return VLC_ENOMEM;
+
+    p_intf->pf_run = Run;
+
+    p_intf->p_sys->p_playlist = pl_Hold( p_intf );
+    p_intf->p_sys->p_input = NULL;
+    p_intf->p_sys->p_vout = NULL;
+
+    p_intf->p_sys->p_main_window = NULL;
+    p_intf->p_sys->p_video_window = NULL;
+
+    wnd_req.enabled = true;
+    /* ^no need to lock, interfacesare started before video outputs */
+    vlc_spin_init( &p_intf->p_sys->event_lock );
+
+    return VLC_SUCCESS;
+}
+
+static void Close( vlc_object_t *p_this )
+{
+    intf_thread_t *p_intf = (intf_thread_t *)p_this;
+
+    vlc_object_release( p_intf->p_sys->p_playlist );
+
+    vlc_spin_destroy( &p_intf->p_sys->event_lock );
+
+    /* Destroy structure */
+    free( p_intf->p_sys );
+}
+
+/*****************************************************************************
+* Initialize and launch the interface
+*****************************************************************************/
+static void Run( intf_thread_t *p_intf )
+{
+    char  *p_args[] = { (char *)"vlc", NULL };
+    char **pp_args  = p_args;
+    int    i_args   = 1;
+
+    HildonProgram *program;
+    HildonWindow *window;
+    GtkWidget *main_vbox;
+
+    GtkWidget *tabs;
+    GtkWidget *video;
+    GtkWidget *bottom_hbox;
+    GtkWidget *play_button;
+    GtkWidget *prev_button;
+    GtkWidget *next_button;
+    GtkWidget *stop_button;
+    GtkWidget *seekbar;
+
+    gtk_init( &i_args, &pp_args );
+
+    program = HILDON_PROGRAM( hildon_program_get_instance() );
+    g_set_application_name( "VLC Media Player" );
+
+    window = HILDON_WINDOW( hildon_window_new() );
+    hildon_program_add_window( program, window );
+    gtk_object_set_data( GTK_OBJECT( window ),
+                         "p_intf", p_intf );
+    p_intf->p_sys->p_main_window = window;
+
+    // A little theming
+    char *psz_rc_file = NULL;
+    if( asprintf( &psz_rc_file, "%s/maemo/vlc_intf.rc",
+                  config_GetDataDir() ) != -1 )
+    {
+        gtk_rc_parse( psz_rc_file );
+        free( psz_rc_file );
+    }
+
+    // We create the main vertical box
+    main_vbox = gtk_vbox_new( FALSE, 0 );
+    gtk_container_add( GTK_CONTAINER( window ), main_vbox );
+
+    tabs = gtk_notebook_new();
+    p_intf->p_sys->p_tabs = tabs;
+    gtk_notebook_set_tab_pos( GTK_NOTEBOOK( tabs ), GTK_POS_LEFT );
+    gtk_notebook_set_show_border( GTK_NOTEBOOK( tabs ), FALSE );
+    gtk_box_pack_start( GTK_BOX( main_vbox ), tabs, TRUE, TRUE, 0 );
+
+    // We put first the embedded video
+    video = gtk_event_box_new();
+    gtk_notebook_append_page( GTK_NOTEBOOK( tabs ),
+                video,
+                gtk_image_new_from_stock( "vlc",
+                                          GTK_ICON_SIZE_DIALOG ) );
+    gtk_notebook_set_tab_label_packing( GTK_NOTEBOOK( tabs ),
+                                        video,
+                                        FALSE, FALSE, 0 );
+    create_playlist( p_intf );
+
+    // We put the horizontal box which contains all the buttons
+    bottom_hbox = gtk_hbox_new( FALSE, 0 );
+
+    // We create the buttons
+    play_button = gtk_button_new();
+    gtk_button_set_image( GTK_BUTTON( play_button ),
+                   gtk_image_new_from_stock( "vlc-play", GTK_ICON_SIZE_BUTTON ) );
+    gtk_widget_set_size_request( play_button, 60, 60);
+    p_intf->p_sys->p_play_button = play_button;
+    stop_button = gtk_button_new();
+    gtk_button_set_image( GTK_BUTTON( stop_button ),
+                          gtk_image_new_from_stock( "vlc-stop", GTK_ICON_SIZE_BUTTON ) );
+    prev_button = gtk_button_new();
+    gtk_button_set_image( GTK_BUTTON( prev_button ),
+                      gtk_image_new_from_stock( "vlc-previous", GTK_ICON_SIZE_BUTTON ) );
+    next_button = gtk_button_new();
+    gtk_button_set_image( GTK_BUTTON( next_button ),
+                      gtk_image_new_from_stock( "vlc-next", GTK_ICON_SIZE_BUTTON ) );
+    seekbar = hildon_seekbar_new();
+    p_intf->p_sys->p_seekbar = HILDON_SEEKBAR( seekbar );
+
+    // We add them to the hbox
+    gtk_box_pack_start( GTK_BOX( bottom_hbox ), play_button, FALSE, FALSE, 5 );
+    gtk_box_pack_start( GTK_BOX( bottom_hbox ), stop_button, FALSE, FALSE, 0 );
+    gtk_box_pack_start( GTK_BOX( bottom_hbox ), prev_button, FALSE, FALSE, 0 );
+    gtk_box_pack_start( GTK_BOX( bottom_hbox ), next_button, FALSE, FALSE, 0 );
+    gtk_box_pack_start( GTK_BOX( bottom_hbox ), seekbar    , TRUE , TRUE , 5 );
+    // We add the hbox to the main vbox
+    gtk_box_pack_start( GTK_BOX( main_vbox ), bottom_hbox, FALSE, FALSE, 0 );
+
+    g_signal_connect( window, "delete_event",
+                      G_CALLBACK( delete_event_cb ), NULL );
+    g_signal_connect( play_button, "clicked", G_CALLBACK( play_cb ), NULL );
+    g_signal_connect( stop_button, "clicked", G_CALLBACK( stop_cb ), NULL );
+    g_signal_connect( prev_button, "clicked", G_CALLBACK( prev_cb ), NULL );
+    g_signal_connect( next_button, "clicked", G_CALLBACK( next_cb ), NULL );
+    g_signal_connect( seekbar, "change-value",
+                      G_CALLBACK( seekbar_changed_cb ), NULL );
+
+    gtk_widget_show_all( GTK_WIDGET( window ) );
+
+    create_menu( p_intf );
+
+    // Set callback with the vlc core
+    g_timeout_add( INTF_IDLE_SLEEP / 1000, process_events, p_intf );
+    g_timeout_add( 150 /* miliseconds */, should_die, p_intf );
+    var_AddCallback( p_intf->p_sys->p_playlist, "item-change",
+                     item_changed_cb, p_intf );
+    var_AddCallback( p_intf->p_sys->p_playlist, "item-current",
+                     playlist_current_cb, p_intf );
+    var_AddCallback( p_intf->p_sys->p_playlist, "activity",
+                     activity_cb, p_intf );
+
+    // Look if the playlist is already started
+    item_changed_pl( p_intf );
+
+    // The embedded video is only ready after gtk_main and windows are shown
+    g_idle_add( video_widget_ready, video );
+
+    gtk_main();
+
+    delete_input( p_intf );
+    var_DelCallback( p_intf->p_sys->p_playlist, "item-change",
+                     item_changed_cb, p_intf );
+    var_DelCallback( p_intf->p_sys->p_playlist, "item-current",
+                     playlist_current_cb, p_intf );
+    var_DelCallback( p_intf->p_sys->p_playlist, "activity",
+                     activity_cb, p_intf );
+
+    /* FIXME: we need to wait for vout to clean up... */
+    assert( !p_intf->p_sys->p_vout ); /* too late */
+    gtk_object_destroy( GTK_OBJECT( window ) );
+}
+
+static gboolean should_die( gpointer data )
+{
+    intf_thread_t *p_intf = (intf_thread_t *)data;
+    if( !vlc_object_alive( p_intf ) )
+        gtk_main_quit();
+    return TRUE;
+}
+
+/**
+* Video output window provider
+*/
+static int OpenWindow (vlc_object_t *obj)
+{
+    vout_window_t *wnd = (vout_window_t *)obj;
+    intf_thread_t *intf;
+
+    if (wnd->cfg->is_standalone || !wnd_req.enabled)
+        return VLC_EGENERIC;
+
+    /* FIXME it should NOT be needed */
+    vout_thread_t *vout = vlc_object_find (obj, VLC_OBJECT_VOUT, FIND_PARENT);
+    if (!vout)
+        return VLC_EGENERIC;
+
+    vlc_mutex_lock (&wnd_req.lock);
+    while ((intf = wnd_req.intf) == NULL)
+        vlc_cond_wait (&wnd_req.wait, &wnd_req.lock);
+
+    wnd->handle.xid = request_video( intf, vout );
+    vlc_mutex_unlock (&wnd_req.lock);
+
+    vlc_object_release( vout );
+
+    if (!wnd->handle.xid)
+        return VLC_EGENERIC;
+
+    msg_Dbg( intf, "Using handle %"PRIu32, wnd->handle.xid );
+
+    wnd->control = ControlWindow;
+    wnd->sys = (vout_window_sys_t*)intf;
+
+    return VLC_SUCCESS;
+}
+
+static int ControlWindow (vout_window_t *wnd, int query, va_list args)
+{
+    intf_thread_t *intf = (intf_thread_t *)wnd->sys;
+
+    switch( query )
+    {
+    case VOUT_WINDOW_SET_SIZE:
+    {
+        int i_width  = (int)va_arg( args, int );
+        int i_height = (int)va_arg( args, int );
+
+        int i_current_w, i_current_h;
+        gdk_drawable_get_size( GDK_DRAWABLE( intf->p_sys->p_video_window->window ),
+                               &i_current_w, &i_current_h );
+        if( i_width != i_current_w || i_height != i_current_h )
+            return VLC_EGENERIC;
+        return VLC_SUCCESS;
+    }
+    default:
+        return VLC_EGENERIC;
+    }
+}
+
+static void CloseWindow (vlc_object_t *obj)
+{
+    vout_window_t *wnd = (vout_window_t *)obj;
+    intf_thread_t *intf = (intf_thread_t *)wnd->sys;
+
+    vlc_mutex_lock( &wnd_req.lock );
+    release_video( intf );
+    vlc_mutex_unlock( &wnd_req.lock );
+}
+
+static uint32_t request_video( intf_thread_t *p_intf, vout_thread_t *p_nvout )
+{
+    if( p_intf->p_sys->p_vout )
+    {
+        msg_Dbg( p_intf, "Embedded video already in use" );
+        return 0;
+    }
+
+    p_intf->p_sys->p_vout = vlc_object_hold( p_nvout );
+    return GDK_WINDOW_XID( p_intf->p_sys->p_video_window->window );
+}
+
+static void release_video( intf_thread_t *p_intf )
+{
+    msg_Dbg( p_intf, "Releasing embedded video" );
+
+    vlc_object_release( p_intf->p_sys->p_vout );
+    p_intf->p_sys->p_vout = NULL;
+}
+
+static gboolean video_widget_ready( gpointer data )
+{
+    intf_thread_t *p_intf = NULL;
+    GtkWidget *top_window = NULL;
+    GtkWidget *video = (GtkWidget *)data;
+
+    top_window = gtk_widget_get_toplevel( GTK_WIDGET( video ) );
+    p_intf = (intf_thread_t *)gtk_object_get_data( GTK_OBJECT( top_window ),
+                                                   "p_intf" );
+    p_intf->p_sys->p_video_window = video;
+    gtk_widget_grab_focus( video );
+
+    vlc_mutex_lock( &wnd_req.lock );
+    wnd_req.intf = p_intf;
+    vlc_cond_signal( &wnd_req.wait );
+    vlc_mutex_unlock( &wnd_req.lock );
+
+    // We rewind the input
+    if( p_intf->p_sys->p_input )
+    {
+        input_Control( p_intf->p_sys->p_input, INPUT_SET_POSITION, 0.0 );
+    }
+
+    // We want it to be executed only one time
+    return FALSE;
+}
diff --git a/modules/gui/hildon/maemo.h b/modules/gui/hildon/maemo.h
new file mode 100644 (file)
index 0000000..7814dfc
--- /dev/null
@@ -0,0 +1,50 @@
+/*****************************************************************************
+ * maemo.h: private Maemo Interface Description
+ *****************************************************************************
+ * Copyright (C) 2008 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Antoine Lejeune <phytos@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
+ * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#include <hildon/hildon-program.h>
+#include <hildon/hildon-seekbar.h>
+#include <hildon/hildon-file-chooser-dialog.h>
+#include <hildon/hildon-banner.h>
+
+#include <vlc_playlist.h>
+#include <vlc_input.h>
+#include <vlc_vout.h>
+
+struct intf_sys_t
+{
+    playlist_t *p_playlist;
+    input_thread_t *p_input;
+
+    HildonWindow  *p_main_window;
+    HildonSeekbar *p_seekbar;
+    GtkWidget     *p_tabs;
+    GtkWidget     *p_play_button;
+
+    GtkWidget *p_playlist_store;
+
+    int i_event;
+    vlc_spinlock_t event_lock;
+
+    GtkWidget *p_video_window;
+    vout_thread_t *p_vout;
+};
diff --git a/modules/gui/hildon/maemo_callbacks.c b/modules/gui/hildon/maemo_callbacks.c
new file mode 100644 (file)
index 0000000..cf63951
--- /dev/null
@@ -0,0 +1,246 @@
+/*****************************************************************************
+* maemo_callbacks.c : Callbacks for the maemo plugin.
+*****************************************************************************
+* Copyright (C) 2008 the VideoLAN team
+* $Id$
+*
+* Authors: Antoine Lejeune <phytos@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
+* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+*****************************************************************************/
+
+#include <vlc_common.h>
+
+#include "maemo.h"
+#include "maemo_callbacks.h"
+
+/*
+ * Function used to retrieve an intf_thread_t object from a GtkWidget
+ */
+static intf_thread_t *get_intf_from_widget( GtkWidget *widget )
+{
+    if( GTK_IS_MENU_ITEM( widget ) )
+    {
+        /* Look for a GTK_MENU */
+        while( widget->parent && !GTK_IS_MENU( widget ) )
+        {
+            widget = widget->parent;
+        }
+
+        widget = gtk_menu_get_attach_widget( GTK_MENU( widget ) );
+    }
+    widget = gtk_widget_get_toplevel( GTK_WIDGET( widget ) );
+    return (intf_thread_t *)gtk_object_get_data( GTK_OBJECT( widget ),
+                                                 "p_intf" );
+}
+
+gboolean delete_event_cb( GtkWidget *widget,
+                          GdkEvent *event,
+                          gpointer user_data )
+{
+    (void)event; (void)user_data;
+    intf_thread_t *p_intf = get_intf_from_widget( widget );
+
+    libvlc_Quit( p_intf->p_libvlc );
+    gtk_main_quit();
+
+    return TRUE;
+}
+
+void play_cb( GtkButton *button, gpointer user_data )
+{
+    (void)user_data;
+    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( button ) );
+
+    // If there is no input, we ask the playlist to play
+    if( p_intf->p_sys->p_input == NULL )
+    {
+        playlist_Play( p_intf->p_sys->p_playlist );
+        return;
+    }
+
+    // If there is an input, we toggle its state
+    vlc_value_t state;
+    var_Get( p_intf->p_sys->p_input, "state", &state );
+    state.i_int = ( state.i_int != PLAYING_S ) ? PLAYING_S : PAUSE_S;
+    var_Set( p_intf->p_sys->p_input, "state", state );
+}
+
+void stop_cb( GtkButton *button, gpointer user_data )
+{
+    (void)user_data;
+    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( button ) );
+    playlist_Stop( p_intf->p_sys->p_playlist );
+}
+
+void prev_cb( GtkButton *button, gpointer user_data )
+{
+    (void)user_data;
+    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( button ) );
+    playlist_Prev( p_intf->p_sys->p_playlist );
+}
+
+void next_cb( GtkButton *button, gpointer user_data )
+{
+    (void)user_data;
+    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( button ) );
+    playlist_Next( p_intf->p_sys->p_playlist );
+}
+
+void seekbar_changed_cb( GtkRange *range, GtkScrollType scroll,
+                         gdouble value, gpointer data )
+{
+    (void)scroll; (void)data;
+    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( range ) );
+    if( p_intf->p_sys->p_input )
+    {
+        int i_length = hildon_seekbar_get_total_time( p_intf->p_sys->p_seekbar );
+        var_SetFloat( p_intf->p_sys->p_input, "position", (float)(value/i_length) );
+    }
+}
+
+void pl_row_activated_cb( GtkTreeView *tree_view , GtkTreePath *path,
+                          GtkTreeViewColumn *column, gpointer user_data )
+{
+    (void)column; (void)user_data;
+    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( tree_view ) );
+    input_item_t *p_input;
+    GtkTreeModel *model = gtk_tree_view_get_model( tree_view );
+    GtkTreeIter iter;
+    gchar *filename = NULL;
+
+    gtk_tree_model_get_iter( model, &iter, path );
+    gtk_tree_model_get( model, &iter, 0, &filename, -1 );
+
+    gtk_notebook_set_current_page( GTK_NOTEBOOK( p_intf->p_sys->p_tabs ), 0 );
+
+    p_input = input_item_New( p_intf, filename, NULL );
+    playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
+                       PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, true, false );
+    vlc_gc_decref( p_input );
+}
+
+void open_cb( GtkMenuItem *menuitem, gpointer user_data )
+{
+    (void)menuitem;
+    intf_thread_t *p_intf = (intf_thread_t *)user_data;
+    input_item_t *p_input;
+    GtkWidget *dialog;
+    char *psz_filename = NULL;
+
+    dialog = hildon_file_chooser_dialog_new( GTK_WINDOW( p_intf->p_sys->p_main_window ),
+                                             GTK_FILE_CHOOSER_ACTION_OPEN );
+    gtk_widget_show_all( GTK_WIDGET( dialog ) );
+
+    if( gtk_dialog_run( GTK_DIALOG( dialog ) ) == GTK_RESPONSE_OK )
+    {
+        psz_filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ) );
+    }
+    else
+    {
+        gtk_widget_destroy( dialog );
+        return;
+    }
+
+    gtk_widget_destroy( dialog );
+
+    p_input = input_item_New( p_intf, psz_filename, NULL );
+    playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
+                       PLAYLIST_APPEND | PLAYLIST_GO,
+                       PLAYLIST_END, true, false );
+    vlc_gc_decref( p_input );
+}
+
+void open_address_cb( GtkMenuItem *menuitem, gpointer user_data )
+{
+    (void)menuitem;
+    intf_thread_t *p_intf = (intf_thread_t *)user_data;
+    input_item_t *p_input;
+    GtkWidget *dialog, *hbox, *label, *entry;
+
+    dialog = gtk_dialog_new_with_buttons( "Open Address",
+                GTK_WINDOW( p_intf->p_sys->p_main_window ),
+                GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+                GTK_STOCK_OK, GTK_RESPONSE_OK,
+                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                NULL );
+    label = gtk_label_new( "Address :" );
+    entry = gtk_entry_new();
+    gtk_entry_set_width_chars( GTK_ENTRY( entry ), 30 );
+    hbox = gtk_hbox_new( FALSE, 0 );
+    gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, FALSE, 0 );
+    gtk_box_pack_start( GTK_BOX( hbox ), entry, TRUE, TRUE, 0 );
+    gtk_container_add( GTK_CONTAINER( GTK_DIALOG( dialog )->vbox ), hbox );
+
+    gtk_widget_show_all( dialog );
+    if( gtk_dialog_run( GTK_DIALOG( dialog ) ) == GTK_RESPONSE_CANCEL )
+    {
+        gtk_widget_destroy( dialog );
+        return;
+    }
+
+    p_input = input_item_New( p_intf,
+                              gtk_entry_get_text( GTK_ENTRY( entry ) ),
+                              NULL );
+    playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
+                       PLAYLIST_APPEND | PLAYLIST_GO,
+                       PLAYLIST_END, true, false );
+    vlc_gc_decref( p_input );
+
+    gtk_widget_destroy( dialog );
+}
+
+void open_webcam_cb( GtkMenuItem *menuitem, gpointer user_data )
+{
+    (void)menuitem;
+    intf_thread_t *p_intf = (intf_thread_t *)user_data;
+    input_item_t *p_input;
+
+    p_input = input_item_New( p_intf, "v4l2://", NULL );
+    playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
+                       PLAYLIST_APPEND | PLAYLIST_GO,
+                       PLAYLIST_END, true, false );
+    vlc_gc_decref( p_input );
+}
+
+void snapshot_cb( GtkMenuItem *menuitem, gpointer user_data )
+{
+    (void)menuitem;
+    intf_thread_t *p_intf = (intf_thread_t *)user_data;
+
+    if( !p_intf->p_sys->p_vout )
+    {
+        hildon_banner_show_information(
+                                GTK_WIDGET( p_intf->p_sys->p_main_window ),
+                                "gtk-dialog-error",
+                                "There is no video" );
+        return;
+    }
+
+    var_TriggerCallback( p_intf->p_sys->p_vout, "video-snapshot" );
+    hildon_banner_show_information( GTK_WIDGET( p_intf->p_sys->p_main_window ),
+                                    NULL,
+                                    "Snapshot taken" );
+}
+
+void dropframe_cb( GtkMenuItem *menuitem, gpointer user_data )
+{
+    intf_thread_t *p_intf = (intf_thread_t *)user_data;
+
+    if( gtk_check_menu_item_get_active( GTK_CHECK_MENU_ITEM( menuitem ) ) )
+        config_PutInt( p_intf, "ffmpeg-skip-frame", 1 );
+    else
+        config_PutInt( p_intf, "ffmpeg-skip-frame", 0 );
+}
diff --git a/modules/gui/hildon/maemo_callbacks.h b/modules/gui/hildon/maemo_callbacks.h
new file mode 100644 (file)
index 0000000..84e7550
--- /dev/null
@@ -0,0 +1,48 @@
+/*****************************************************************************
+* maemo_callbacks.h : Callbacks header file for the maemo plugin.
+*****************************************************************************
+* Copyright (C) 2008 the VideoLAN team
+* $Id$
+*
+* Authors: Antoine Lejeune <phytos@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
+* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+*****************************************************************************/
+
+#include <gtk/gtk.h>
+
+#include <vlc_common.h>
+#include <vlc_interface.h>
+
+gboolean delete_event_cb( GtkWidget *widget,
+                          GdkEvent *event,
+                          gpointer user_data );
+
+void play_cb( GtkButton *button, gpointer user_data );
+void stop_cb( GtkButton *button, gpointer user_data );
+void prev_cb( GtkButton *button, gpointer user_data );
+void next_cb( GtkButton *button, gpointer user_data );
+void seekbar_changed_cb( GtkRange *range, GtkScrollType scroll,
+                         gdouble value, gpointer data );
+
+void pl_row_activated_cb( GtkTreeView *, GtkTreePath *, GtkTreeViewColumn *,
+                          gpointer );
+
+void open_cb( GtkMenuItem *menuitem, gpointer user_data );
+void open_address_cb( GtkMenuItem *menuitem, gpointer user_data );
+void open_webcam_cb( GtkMenuItem *menuitem, gpointer user_data );
+
+void snapshot_cb( GtkMenuItem *menuitem, gpointer user_data );
+void dropframe_cb( GtkMenuItem *menuitem, gpointer user_data );
diff --git a/modules/gui/hildon/maemo_input.c b/modules/gui/hildon/maemo_input.c
new file mode 100644 (file)
index 0000000..de7ba98
--- /dev/null
@@ -0,0 +1,197 @@
+/*****************************************************************************
+* maemo_input.c : Input handling for the maemo plugin
+*****************************************************************************
+* Copyright (C) 2008 the VideoLAN team
+* $Id$
+*
+* Authors: Antoine Lejeune <phytos@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
+* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+*****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+
+#include "maemo.h"
+#include "maemo_input.h"
+
+static int input_event_cb( vlc_object_t *p_this, const char *psz_var,
+                           vlc_value_t oldval, vlc_value_t newval, void *param );
+
+
+gboolean process_events( gpointer data )
+{
+    intf_thread_t *p_intf = (intf_thread_t *)data;
+    vlc_spin_lock( &p_intf->p_sys->event_lock );
+
+    int i_event = p_intf->p_sys->i_event;
+    p_intf->p_sys->i_event = 0;
+
+    vlc_spin_unlock( &p_intf->p_sys->event_lock );
+    if( i_event )
+    {
+        if( i_event & EVENT_PLAYLIST_CURRENT )
+            item_changed_pl( p_intf );
+        if( i_event & EVENT_ACTIVITY )
+            item_changed_pl( p_intf );
+        if( i_event & EVENT_ITEM_CHANGED )
+            item_changed( p_intf );
+        if( i_event & EVENT_INTF_CHANGED )
+            update_position( p_intf );
+    }
+
+    return TRUE;
+}
+
+void set_input( intf_thread_t *p_intf, input_thread_t *p_input )
+{
+    if( p_input && !( p_input->b_die || p_input->b_dead ) )
+    {
+        p_intf->p_sys->p_input = p_input;
+        vlc_object_hold( p_input );
+        var_AddCallback( p_input, "intf-event", input_event_cb, p_intf );
+
+        // "Activate" the seekbar
+        gtk_widget_set_sensitive( GTK_WIDGET( p_intf->p_sys->p_seekbar ), TRUE );
+    }
+    else
+        p_intf->p_sys->p_input = NULL;
+}
+
+void delete_input( intf_thread_t *p_intf )
+{
+    if( p_intf->p_sys->p_input )
+    {
+        var_DelCallback( p_intf->p_sys->p_input, "intf-event",
+                         input_event_cb, p_intf );
+        vlc_object_release( p_intf->p_sys->p_input );
+        p_intf->p_sys->p_input = NULL;
+
+        // Reset the seekbar
+        hildon_seekbar_set_position( p_intf->p_sys->p_seekbar, 0 );
+        gtk_widget_set_sensitive( GTK_WIDGET( p_intf->p_sys->p_seekbar ), FALSE );
+    }
+}
+
+void item_changed_pl( intf_thread_t *p_intf )
+{
+    if( p_intf->p_sys->p_input &&
+        ( p_intf->p_sys->p_input->b_dead || p_intf->p_sys->p_input->b_die ) )
+    {
+        delete_input( p_intf );
+        return;
+    }
+
+    if( !p_intf->p_sys->p_input )
+    {
+        set_input( p_intf, playlist_CurrentInput( p_intf->p_sys->p_playlist ) );
+    }
+    return;
+}
+
+int playlist_current_cb( vlc_object_t *p_this, const char *psz_var,
+                         vlc_value_t oldval, vlc_value_t newval, void *param )
+{
+    (void)p_this; (void)psz_var; (void)oldval; (void)newval;
+    intf_thread_t *p_intf = (intf_thread_t *)param;
+    vlc_spin_lock( &p_intf->p_sys->event_lock );
+
+    p_intf->p_sys->i_event |= EVENT_PLAYLIST_CURRENT;
+
+    vlc_spin_unlock( &p_intf->p_sys->event_lock );
+    return VLC_SUCCESS;
+}
+
+int activity_cb( vlc_object_t *p_this, const char *psz_var,
+                 vlc_value_t oldval, vlc_value_t newval, void *param )
+{
+    (void)p_this; (void)psz_var; (void)oldval; (void)newval;
+    intf_thread_t *p_intf = (intf_thread_t *)param;
+    vlc_spin_lock( &p_intf->p_sys->event_lock );
+
+    p_intf->p_sys->i_event |= EVENT_ACTIVITY;
+
+    vlc_spin_unlock( &p_intf->p_sys->event_lock );
+    return VLC_SUCCESS;
+}
+
+void item_changed( intf_thread_t *p_intf )
+{
+    GtkButton *p_button = GTK_BUTTON( p_intf->p_sys->p_play_button );
+    vlc_value_t state;
+
+    if( !p_intf->p_sys->p_input )
+        return;
+
+    var_Get( p_intf->p_sys->p_input, "state", &state );
+
+    // We change the "play" button
+    if( state.i_int == PLAYING_S )
+        gtk_button_set_image( p_button, gtk_image_new_from_stock( "vlc-pause",
+                              GTK_ICON_SIZE_BUTTON ) );
+    else
+        gtk_button_set_image( p_button, gtk_image_new_from_stock( "vlc-play",
+                              GTK_ICON_SIZE_BUTTON ) );
+}
+
+int item_changed_cb( vlc_object_t *p_this, const char *psz_var,
+                     vlc_value_t oldval, vlc_value_t newval, void *param )
+{
+    (void)p_this; (void)psz_var; (void)oldval; (void)newval;
+    intf_thread_t *p_intf = (intf_thread_t *)param;
+    vlc_spin_lock( &p_intf->p_sys->event_lock );
+
+    p_intf->p_sys->i_event |= EVENT_ITEM_CHANGED;
+
+    vlc_spin_unlock( &p_intf->p_sys->event_lock );
+    return VLC_SUCCESS;
+}
+
+void update_position( intf_thread_t *p_intf )
+{
+    if( p_intf->p_sys->p_input )
+    {
+        hildon_seekbar_set_total_time( p_intf->p_sys->p_seekbar,
+                    var_GetTime( p_intf->p_sys->p_input, "length" )/1000000 );
+        hildon_seekbar_set_position( p_intf->p_sys->p_seekbar,
+                    var_GetTime( p_intf->p_sys->p_input, "time" )/1000000 );
+    }
+}
+
+int interface_changed_cb( vlc_object_t *p_this, const char *psz_var,
+                          vlc_value_t oldval, vlc_value_t newval, void *param )
+{
+    (void)p_this; (void)psz_var; (void)oldval; (void)newval;
+    intf_thread_t *p_intf = (intf_thread_t *)param;
+    vlc_spin_lock( &p_intf->p_sys->event_lock );
+
+    p_intf->p_sys->i_event |= EVENT_INTF_CHANGED;
+
+    vlc_spin_unlock( &p_intf->p_sys->event_lock );
+    return VLC_SUCCESS;
+}
+
+static int input_event_cb( vlc_object_t *p_this, const char *psz_var,
+                           vlc_value_t oldval, vlc_value_t newval, void *param )
+{
+    if( newval.i_int == INPUT_EVENT_STATE )
+        return item_changed_cb( p_this, psz_var, oldval, newval, param );
+    else
+        return interface_changed_cb( p_this, psz_var, oldval, newval, param );
+}
+
diff --git a/modules/gui/hildon/maemo_input.h b/modules/gui/hildon/maemo_input.h
new file mode 100644 (file)
index 0000000..03eae50
--- /dev/null
@@ -0,0 +1,52 @@
+/*****************************************************************************
+* maemo_input.h : Input handling header file for the maemo plugin.
+*****************************************************************************
+* Copyright (C) 2008 the VideoLAN team
+* $Id$
+*
+* Authors: Antoine Lejeune <phytos@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
+* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+*****************************************************************************/
+
+#include <gtk/gtk.h>
+
+#include <vlc_common.h>
+#include <vlc_interface.h>
+
+#define EVENT_ITEM_STATE_CHANGE (1<<0)
+#define EVENT_PLAYLIST_CURRENT  (1<<1)
+#define EVENT_ACTIVITY          (1<<2)
+#define EVENT_ITEM_CHANGED      (1<<3)
+#define EVENT_INTF_CHANGED      (1<<4)
+
+gboolean process_events( gpointer data );
+
+void set_input( intf_thread_t *p_intf, input_thread_t *p_input );
+void delete_input( intf_thread_t *p_intf );
+
+int playlist_current_cb( vlc_object_t *p_this, const char *psz_var,
+                         vlc_value_t oldval, vlc_value_t newval, void *param );
+int activity_cb( vlc_object_t *p_this, const char *psz_var,
+                 vlc_value_t oldval, vlc_value_t newval, void *param );
+void item_changed_pl( intf_thread_t *p_intf );
+
+int item_changed_cb( vlc_object_t *p_this, const char *psz_var,
+                     vlc_value_t oldval, vlc_value_t newval, void *param );
+void item_changed( intf_thread_t *p_intf );
+
+int interface_changed_cb( vlc_object_t *p_this, const char *psz_var,
+                          vlc_value_t oldval, vlc_value_t newval, void *param );
+void update_position( intf_thread_t *p_intf );
diff --git a/modules/gui/hildon/maemo_interface.c b/modules/gui/hildon/maemo_interface.c
new file mode 100644 (file)
index 0000000..16cf8f0
--- /dev/null
@@ -0,0 +1,189 @@
+/*****************************************************************************
+* maemo_interface.c : Interface creation of the maemo plugin
+*****************************************************************************
+* Copyright (C) 2008 the VideoLAN team
+* $Id$
+*
+* Authors: Antoine Lejeune <phytos@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
+* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+*****************************************************************************/
+
+#include <vlc_common.h>
+
+#include <gtk/gtk.h>
+
+#include "maemo.h"
+#include "maemo_callbacks.h"
+#include "maemo_interface.h"
+
+static void scan_maemo_for_media ( intf_thread_t *p_intf );
+static void find_media_in_dir    ( const char *psz_dir, GList **pp_list );
+
+static const char *ppsz_extensions[] =
+    { "aac", "flac", "m4a", "m4p", "mka", "mp1", "mp2", "mp3",
+      "ogg", "wav", "wma", "asf", "avi", "divx", "flv", "m1v",
+      "m2v", "m4v", "mkv", "mov", "mpeg", "mpeg1", "mpeg2", "mpeg4",
+      "mpg", "ogm", "wmv", NULL };
+
+static const char *ppsz_media_dirs[] =
+    { "/media/mmc1", "/media/mmc2", "/home/user/MyDocs/.videos", NULL };
+
+#define ADD_MENU_ITEM( label, callback ) \
+    item = gtk_menu_item_new_with_label( label ); \
+    gtk_menu_append( main_menu, item ); \
+    g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( callback ), \
+                      p_intf );
+#define ADD_CHECK_MENU_ITEM( label, callback ) \
+    item = gtk_check_menu_item_new_with_label( label ); \
+    gtk_menu_append( main_menu, item ); \
+    g_signal_connect( GTK_OBJECT( item ), "toggled", G_CALLBACK( callback ), \
+                      p_intf );
+#define ADD_SEPARATOR \
+    item = gtk_separator_menu_item_new(); \
+    gtk_menu_append( main_menu, item );
+
+void create_menu( intf_thread_t *p_intf )
+{
+    /* Needed variables */
+    GtkWidget *main_menu;
+    GtkWidget *item;
+    int i_skip;
+
+    /* Creating the main menu */
+    main_menu = gtk_menu_new();
+
+    /* Getting ffmpeg-skip-frame value */
+    i_skip = config_GetInt( p_intf, "ffmpeg-skip-frame" );
+
+    /* Filling the menu */
+    ADD_MENU_ITEM( "Open", open_cb );
+    ADD_MENU_ITEM( "Open Address", open_address_cb );
+    ADD_MENU_ITEM( "Open Webcam", open_webcam_cb );
+    ADD_SEPARATOR;
+    ADD_MENU_ITEM( "Take a snapshot", snapshot_cb );
+    ADD_CHECK_MENU_ITEM( "Drop frames", dropframe_cb );
+    if( i_skip )
+        gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), true );
+    ADD_SEPARATOR;
+    ADD_MENU_ITEM( "Close", delete_event_cb );
+
+    hildon_window_set_menu( HILDON_WINDOW( p_intf->p_sys->p_main_window ),
+                            GTK_MENU( main_menu ) );
+
+    gtk_widget_show_all( main_menu );
+}
+
+#undef ADD_MENU
+#undef ADD_CHECK_MENU_ITEM
+#undef ADD_SEPARATOR
+
+void create_playlist( intf_thread_t *p_intf )
+{
+    GtkWidget *playlist;
+    GtkWidget *scroll;
+    GtkListStore *playlist_store;
+    GtkTreeViewColumn *col;
+    GtkCellRenderer *renderer;
+
+    playlist = gtk_tree_view_new();
+
+    playlist_store = gtk_list_store_new( 1, G_TYPE_STRING );
+    p_intf->p_sys->p_playlist_store = GTK_WIDGET( playlist_store );
+
+    gtk_tree_view_set_model( GTK_TREE_VIEW( playlist ),
+                             GTK_TREE_MODEL( playlist_store ) );
+
+    renderer = gtk_cell_renderer_text_new();
+    col = gtk_tree_view_column_new_with_attributes( "File", renderer,
+                                                    "text", 0, NULL );
+    gtk_tree_view_append_column( GTK_TREE_VIEW( playlist ), col );
+
+    g_object_set( playlist, "headers-visible", TRUE, NULL );
+    scan_maemo_for_media( p_intf );
+
+    scroll = gtk_scrolled_window_new( NULL, NULL );
+    gtk_container_add( GTK_CONTAINER( scroll ), playlist );
+
+    gtk_notebook_append_page( GTK_NOTEBOOK( p_intf->p_sys->p_tabs ), scroll,
+                              gtk_image_new_from_stock( "vlc-playlist",
+                                                        GTK_ICON_SIZE_DIALOG ) );
+    gtk_notebook_set_tab_label_packing( GTK_NOTEBOOK( p_intf->p_sys->p_tabs ), scroll,
+                                        FALSE, FALSE, GTK_PACK_START );
+
+    g_signal_connect( playlist, "row-activated",
+                      G_CALLBACK( pl_row_activated_cb ), NULL );
+}
+
+static void scan_maemo_for_media( intf_thread_t *p_intf )
+{
+    GtkListStore *playlist_store = GTK_LIST_STORE( p_intf->p_sys->p_playlist_store );
+    GList *list = NULL;
+    GtkTreeIter iter;
+
+    for( int i = 0; ppsz_media_dirs[i]; i++ )
+    {
+        find_media_in_dir( ppsz_media_dirs[i], &list );
+        msg_Dbg( p_intf, "Looking for media in %s", ppsz_media_dirs[i] );
+    }
+
+    list = g_list_first( list );
+    while( list )
+    {
+        msg_Dbg( p_intf, "Adding : %s", (char *)list->data );
+        gtk_list_store_append( playlist_store, &iter );
+        gtk_list_store_set( playlist_store, &iter,
+                            0, list->data, -1 );
+        list = g_list_next( list );
+    }
+}
+
+static void find_media_in_dir( const char *psz_dir, GList **pp_list )
+{
+    GDir *dir = NULL;
+    const gchar *psz_name;
+    char *psz_path;
+
+    dir = g_dir_open( psz_dir, 0, NULL );
+    if( !dir )
+        return;
+    while( ( psz_name = g_dir_read_name( dir ) ) != NULL )
+    {
+        psz_path = g_build_path( "/", psz_dir, psz_name, NULL );
+        if( g_file_test( psz_path, G_FILE_TEST_IS_DIR ) &&
+            !g_file_test( psz_path, G_FILE_TEST_IS_SYMLINK ) )
+            find_media_in_dir( psz_path, pp_list );
+        else
+        {
+            char *psz_ext = strrchr( psz_name, '.' );
+            if( psz_ext )
+            {
+                psz_ext++;
+                for( int i = 0; ppsz_extensions[i]; i++ )
+                {
+                    if( strcmp( psz_ext, ppsz_extensions[i] ) == 0 )
+                    {
+                        *pp_list = g_list_append( *pp_list, g_strdup( psz_path ) );
+                        break;
+                    }
+                }
+            }
+        }
+        g_free( psz_path );
+    }
+
+    g_dir_close( dir );
+    return;
+}
diff --git a/modules/gui/hildon/maemo_interface.h b/modules/gui/hildon/maemo_interface.h
new file mode 100644 (file)
index 0000000..87b535e
--- /dev/null
@@ -0,0 +1,30 @@
+/*****************************************************************************
+* maemo_interface.h : Interface creation header file for the maemo plugin.
+*****************************************************************************
+* Copyright (C) 2008 the VideoLAN team
+* $Id$
+*
+* Authors: Antoine Lejeune <phytos@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
+* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+*****************************************************************************/
+
+#include <gtk/gtk.h>
+
+#include <vlc_common.h>
+
+void create_menu( intf_thread_t *p_intf );
+
+void create_playlist( intf_thread_t *p_intf );
diff --git a/modules/gui/maemo/Modules.am b/modules/gui/maemo/Modules.am
deleted file mode 100644 (file)
index 8a4cb70..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-SOURCES_maemo = maemo.c \
-               maemo.h \
-               maemo_callbacks.c \
-               maemo_callbacks.h \
-               maemo_input.c \
-               maemo_input.h \
-               maemo_interface.c \
-               maemo_interface.h
diff --git a/modules/gui/maemo/maemo.c b/modules/gui/maemo/maemo.c
deleted file mode 100644 (file)
index 2642171..0000000
+++ /dev/null
@@ -1,385 +0,0 @@
-/*****************************************************************************
-* maemo.c : Maemo plugin for VLC
-*****************************************************************************
-* Copyright (C) 2008 the VideoLAN team
-* $Id$
-*
-* Authors: Antoine Lejeune <phytos@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
-* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
-*****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <assert.h>
-
-#include <vlc_common.h>
-#include <vlc_plugin.h>
-#include <vlc_interface.h>
-#include <vlc_vout_window.h>
-
-#include <hildon/hildon-program.h>
-#include <hildon/hildon-banner.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-#include <stdio.h>
-#include <inttypes.h>
-
-#include "maemo.h"
-#include "maemo_callbacks.h"
-#include "maemo_input.h"
-#include "maemo_interface.h"
-
-/*****************************************************************************
- * Local prototypes.
- *****************************************************************************/
-static int      Open               ( vlc_object_t * );
-static void     Close              ( vlc_object_t * );
-static void     Run                ( intf_thread_t * );
-static gboolean should_die         ( gpointer );
-static int      OpenWindow         ( vlc_object_t * );
-static void     CloseWindow        ( vlc_object_t * );
-static int      ControlWindow      ( vout_window_t *, int, va_list );
-static uint32_t request_video      ( intf_thread_t *, vout_thread_t * );
-static void     release_video      ( intf_thread_t * );
-static gboolean video_widget_ready ( gpointer data );
-
-/*****************************************************************************
-* Module descriptor
-*****************************************************************************/
-vlc_module_begin();
-    set_shortname( "Maemo" );
-    set_description( N_("Maemo hildon interface") );
-    set_category( CAT_INTERFACE );
-    set_subcategory( SUBCAT_INTERFACE_MAIN );
-    set_capability( "interface", 70 );
-    set_callbacks( Open, Close );
-    add_shortcut( "maemo" );
-
-    add_submodule();
-        set_capability( "vout window xid", 50 );
-        set_callbacks( OpenWindow, CloseWindow );
-vlc_module_end();
-
-static struct
-{
-    vlc_mutex_t    lock;
-    vlc_cond_t     wait;
-    intf_thread_t *intf;
-    bool           enabled;
-} wnd_req = { VLC_STATIC_MUTEX, PTHREAD_COND_INITIALIZER, NULL, false };
-
-/*****************************************************************************
- * Module callbacks
- *****************************************************************************/
-static int Open( vlc_object_t *p_this )
-{
-    intf_thread_t *p_intf = (intf_thread_t *)p_this;
-
-    /* Allocate instance and initialize some members */
-    p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
-    if( p_intf->p_sys == NULL )
-        return VLC_ENOMEM;
-
-    p_intf->pf_run = Run;
-
-    p_intf->p_sys->p_playlist = pl_Hold( p_intf );
-    p_intf->p_sys->p_input = NULL;
-    p_intf->p_sys->p_vout = NULL;
-
-    p_intf->p_sys->p_main_window = NULL;
-    p_intf->p_sys->p_video_window = NULL;
-
-    wnd_req.enabled = true;
-    /* ^no need to lock, interfacesare started before video outputs */
-    vlc_spin_init( &p_intf->p_sys->event_lock );
-
-    return VLC_SUCCESS;
-}
-
-static void Close( vlc_object_t *p_this )
-{
-    intf_thread_t *p_intf = (intf_thread_t *)p_this;
-
-    vlc_object_release( p_intf->p_sys->p_playlist );
-
-    vlc_spin_destroy( &p_intf->p_sys->event_lock );
-
-    /* Destroy structure */
-    free( p_intf->p_sys );
-}
-
-/*****************************************************************************
-* Initialize and launch the interface
-*****************************************************************************/
-static void Run( intf_thread_t *p_intf )
-{
-    char  *p_args[] = { (char *)"vlc", NULL };
-    char **pp_args  = p_args;
-    int    i_args   = 1;
-
-    HildonProgram *program;
-    HildonWindow *window;
-    GtkWidget *main_vbox;
-
-    GtkWidget *tabs;
-    GtkWidget *video;
-    GtkWidget *bottom_hbox;
-    GtkWidget *play_button;
-    GtkWidget *prev_button;
-    GtkWidget *next_button;
-    GtkWidget *stop_button;
-    GtkWidget *seekbar;
-
-    gtk_init( &i_args, &pp_args );
-
-    program = HILDON_PROGRAM( hildon_program_get_instance() );
-    g_set_application_name( "VLC Media Player" );
-
-    window = HILDON_WINDOW( hildon_window_new() );
-    hildon_program_add_window( program, window );
-    gtk_object_set_data( GTK_OBJECT( window ),
-                         "p_intf", p_intf );
-    p_intf->p_sys->p_main_window = window;
-
-    // A little theming
-    char *psz_rc_file = NULL;
-    if( asprintf( &psz_rc_file, "%s/maemo/vlc_intf.rc",
-                  config_GetDataDir() ) != -1 )
-    {
-        gtk_rc_parse( psz_rc_file );
-        free( psz_rc_file );
-    }
-
-    // We create the main vertical box
-    main_vbox = gtk_vbox_new( FALSE, 0 );
-    gtk_container_add( GTK_CONTAINER( window ), main_vbox );
-
-    tabs = gtk_notebook_new();
-    p_intf->p_sys->p_tabs = tabs;
-    gtk_notebook_set_tab_pos( GTK_NOTEBOOK( tabs ), GTK_POS_LEFT );
-    gtk_notebook_set_show_border( GTK_NOTEBOOK( tabs ), FALSE );
-    gtk_box_pack_start( GTK_BOX( main_vbox ), tabs, TRUE, TRUE, 0 );
-
-    // We put first the embedded video
-    video = gtk_event_box_new();
-    gtk_notebook_append_page( GTK_NOTEBOOK( tabs ),
-                video,
-                gtk_image_new_from_stock( "vlc",
-                                          GTK_ICON_SIZE_DIALOG ) );
-    gtk_notebook_set_tab_label_packing( GTK_NOTEBOOK( tabs ),
-                                        video,
-                                        FALSE, FALSE, 0 );
-    create_playlist( p_intf );
-
-    // We put the horizontal box which contains all the buttons
-    bottom_hbox = gtk_hbox_new( FALSE, 0 );
-
-    // We create the buttons
-    play_button = gtk_button_new();
-    gtk_button_set_image( GTK_BUTTON( play_button ),
-                   gtk_image_new_from_stock( "vlc-play", GTK_ICON_SIZE_BUTTON ) );
-    gtk_widget_set_size_request( play_button, 60, 60);
-    p_intf->p_sys->p_play_button = play_button;
-    stop_button = gtk_button_new();
-    gtk_button_set_image( GTK_BUTTON( stop_button ),
-                          gtk_image_new_from_stock( "vlc-stop", GTK_ICON_SIZE_BUTTON ) );
-    prev_button = gtk_button_new();
-    gtk_button_set_image( GTK_BUTTON( prev_button ),
-                      gtk_image_new_from_stock( "vlc-previous", GTK_ICON_SIZE_BUTTON ) );
-    next_button = gtk_button_new();
-    gtk_button_set_image( GTK_BUTTON( next_button ),
-                      gtk_image_new_from_stock( "vlc-next", GTK_ICON_SIZE_BUTTON ) );
-    seekbar = hildon_seekbar_new();
-    p_intf->p_sys->p_seekbar = HILDON_SEEKBAR( seekbar );
-
-    // We add them to the hbox
-    gtk_box_pack_start( GTK_BOX( bottom_hbox ), play_button, FALSE, FALSE, 5 );
-    gtk_box_pack_start( GTK_BOX( bottom_hbox ), stop_button, FALSE, FALSE, 0 );
-    gtk_box_pack_start( GTK_BOX( bottom_hbox ), prev_button, FALSE, FALSE, 0 );
-    gtk_box_pack_start( GTK_BOX( bottom_hbox ), next_button, FALSE, FALSE, 0 );
-    gtk_box_pack_start( GTK_BOX( bottom_hbox ), seekbar    , TRUE , TRUE , 5 );
-    // We add the hbox to the main vbox
-    gtk_box_pack_start( GTK_BOX( main_vbox ), bottom_hbox, FALSE, FALSE, 0 );
-
-    g_signal_connect( window, "delete_event",
-                      G_CALLBACK( delete_event_cb ), NULL );
-    g_signal_connect( play_button, "clicked", G_CALLBACK( play_cb ), NULL );
-    g_signal_connect( stop_button, "clicked", G_CALLBACK( stop_cb ), NULL );
-    g_signal_connect( prev_button, "clicked", G_CALLBACK( prev_cb ), NULL );
-    g_signal_connect( next_button, "clicked", G_CALLBACK( next_cb ), NULL );
-    g_signal_connect( seekbar, "change-value",
-                      G_CALLBACK( seekbar_changed_cb ), NULL );
-
-    gtk_widget_show_all( GTK_WIDGET( window ) );
-
-    create_menu( p_intf );
-
-    // Set callback with the vlc core
-    g_timeout_add( INTF_IDLE_SLEEP / 1000, process_events, p_intf );
-    g_timeout_add( 150 /* miliseconds */, should_die, p_intf );
-    var_AddCallback( p_intf->p_sys->p_playlist, "item-change",
-                     item_changed_cb, p_intf );
-    var_AddCallback( p_intf->p_sys->p_playlist, "item-current",
-                     playlist_current_cb, p_intf );
-    var_AddCallback( p_intf->p_sys->p_playlist, "activity",
-                     activity_cb, p_intf );
-
-    // Look if the playlist is already started
-    item_changed_pl( p_intf );
-
-    // The embedded video is only ready after gtk_main and windows are shown
-    g_idle_add( video_widget_ready, video );
-
-    gtk_main();
-
-    delete_input( p_intf );
-    var_DelCallback( p_intf->p_sys->p_playlist, "item-change",
-                     item_changed_cb, p_intf );
-    var_DelCallback( p_intf->p_sys->p_playlist, "item-current",
-                     playlist_current_cb, p_intf );
-    var_DelCallback( p_intf->p_sys->p_playlist, "activity",
-                     activity_cb, p_intf );
-
-    /* FIXME: we need to wait for vout to clean up... */
-    assert( !p_intf->p_sys->p_vout ); /* too late */
-    gtk_object_destroy( GTK_OBJECT( window ) );
-}
-
-static gboolean should_die( gpointer data )
-{
-    intf_thread_t *p_intf = (intf_thread_t *)data;
-    if( !vlc_object_alive( p_intf ) )
-        gtk_main_quit();
-    return TRUE;
-}
-
-/**
-* Video output window provider
-*/
-static int OpenWindow (vlc_object_t *obj)
-{
-    vout_window_t *wnd = (vout_window_t *)obj;
-    intf_thread_t *intf;
-
-    if (wnd->cfg->is_standalone || !wnd_req.enabled)
-        return VLC_EGENERIC;
-
-    /* FIXME it should NOT be needed */
-    vout_thread_t *vout = vlc_object_find (obj, VLC_OBJECT_VOUT, FIND_PARENT);
-    if (!vout)
-        return VLC_EGENERIC;
-
-    vlc_mutex_lock (&wnd_req.lock);
-    while ((intf = wnd_req.intf) == NULL)
-        vlc_cond_wait (&wnd_req.wait, &wnd_req.lock);
-
-    wnd->handle.xid = request_video( intf, vout );
-    vlc_mutex_unlock (&wnd_req.lock);
-
-    vlc_object_release( vout );
-
-    if (!wnd->handle.xid)
-        return VLC_EGENERIC;
-
-    msg_Dbg( intf, "Using handle %"PRIu32, wnd->handle.xid );
-
-    wnd->control = ControlWindow;
-    wnd->sys = (vout_window_sys_t*)intf;
-
-    return VLC_SUCCESS;
-}
-
-static int ControlWindow (vout_window_t *wnd, int query, va_list args)
-{
-    intf_thread_t *intf = (intf_thread_t *)wnd->sys;
-
-    switch( query )
-    {
-    case VOUT_WINDOW_SET_SIZE:
-    {
-        int i_width  = (int)va_arg( args, int );
-        int i_height = (int)va_arg( args, int );
-
-        int i_current_w, i_current_h;
-        gdk_drawable_get_size( GDK_DRAWABLE( intf->p_sys->p_video_window->window ),
-                               &i_current_w, &i_current_h );
-        if( i_width != i_current_w || i_height != i_current_h )
-            return VLC_EGENERIC;
-        return VLC_SUCCESS;
-    }
-    default:
-        return VLC_EGENERIC;
-    }
-}
-
-static void CloseWindow (vlc_object_t *obj)
-{
-    vout_window_t *wnd = (vout_window_t *)obj;
-    intf_thread_t *intf = (intf_thread_t *)wnd->sys;
-
-    vlc_mutex_lock( &wnd_req.lock );
-    release_video( intf );
-    vlc_mutex_unlock( &wnd_req.lock );
-}
-
-static uint32_t request_video( intf_thread_t *p_intf, vout_thread_t *p_nvout )
-{
-    if( p_intf->p_sys->p_vout )
-    {
-        msg_Dbg( p_intf, "Embedded video already in use" );
-        return 0;
-    }
-
-    p_intf->p_sys->p_vout = vlc_object_hold( p_nvout );
-    return GDK_WINDOW_XID( p_intf->p_sys->p_video_window->window );
-}
-
-static void release_video( intf_thread_t *p_intf )
-{
-    msg_Dbg( p_intf, "Releasing embedded video" );
-
-    vlc_object_release( p_intf->p_sys->p_vout );
-    p_intf->p_sys->p_vout = NULL;
-}
-
-static gboolean video_widget_ready( gpointer data )
-{
-    intf_thread_t *p_intf = NULL;
-    GtkWidget *top_window = NULL;
-    GtkWidget *video = (GtkWidget *)data;
-
-    top_window = gtk_widget_get_toplevel( GTK_WIDGET( video ) );
-    p_intf = (intf_thread_t *)gtk_object_get_data( GTK_OBJECT( top_window ),
-                                                   "p_intf" );
-    p_intf->p_sys->p_video_window = video;
-    gtk_widget_grab_focus( video );
-
-    vlc_mutex_lock( &wnd_req.lock );
-    wnd_req.intf = p_intf;
-    vlc_cond_signal( &wnd_req.wait );
-    vlc_mutex_unlock( &wnd_req.lock );
-
-    // We rewind the input
-    if( p_intf->p_sys->p_input )
-    {
-        input_Control( p_intf->p_sys->p_input, INPUT_SET_POSITION, 0.0 );
-    }
-
-    // We want it to be executed only one time
-    return FALSE;
-}
diff --git a/modules/gui/maemo/maemo.h b/modules/gui/maemo/maemo.h
deleted file mode 100644 (file)
index 7814dfc..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*****************************************************************************
- * maemo.h: private Maemo Interface Description
- *****************************************************************************
- * Copyright (C) 2008 the VideoLAN team
- * $Id$
- *
- * Authors: Antoine Lejeune <phytos@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
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#include <hildon/hildon-program.h>
-#include <hildon/hildon-seekbar.h>
-#include <hildon/hildon-file-chooser-dialog.h>
-#include <hildon/hildon-banner.h>
-
-#include <vlc_playlist.h>
-#include <vlc_input.h>
-#include <vlc_vout.h>
-
-struct intf_sys_t
-{
-    playlist_t *p_playlist;
-    input_thread_t *p_input;
-
-    HildonWindow  *p_main_window;
-    HildonSeekbar *p_seekbar;
-    GtkWidget     *p_tabs;
-    GtkWidget     *p_play_button;
-
-    GtkWidget *p_playlist_store;
-
-    int i_event;
-    vlc_spinlock_t event_lock;
-
-    GtkWidget *p_video_window;
-    vout_thread_t *p_vout;
-};
diff --git a/modules/gui/maemo/maemo_callbacks.c b/modules/gui/maemo/maemo_callbacks.c
deleted file mode 100644 (file)
index cf63951..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*****************************************************************************
-* maemo_callbacks.c : Callbacks for the maemo plugin.
-*****************************************************************************
-* Copyright (C) 2008 the VideoLAN team
-* $Id$
-*
-* Authors: Antoine Lejeune <phytos@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
-* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
-*****************************************************************************/
-
-#include <vlc_common.h>
-
-#include "maemo.h"
-#include "maemo_callbacks.h"
-
-/*
- * Function used to retrieve an intf_thread_t object from a GtkWidget
- */
-static intf_thread_t *get_intf_from_widget( GtkWidget *widget )
-{
-    if( GTK_IS_MENU_ITEM( widget ) )
-    {
-        /* Look for a GTK_MENU */
-        while( widget->parent && !GTK_IS_MENU( widget ) )
-        {
-            widget = widget->parent;
-        }
-
-        widget = gtk_menu_get_attach_widget( GTK_MENU( widget ) );
-    }
-    widget = gtk_widget_get_toplevel( GTK_WIDGET( widget ) );
-    return (intf_thread_t *)gtk_object_get_data( GTK_OBJECT( widget ),
-                                                 "p_intf" );
-}
-
-gboolean delete_event_cb( GtkWidget *widget,
-                          GdkEvent *event,
-                          gpointer user_data )
-{
-    (void)event; (void)user_data;
-    intf_thread_t *p_intf = get_intf_from_widget( widget );
-
-    libvlc_Quit( p_intf->p_libvlc );
-    gtk_main_quit();
-
-    return TRUE;
-}
-
-void play_cb( GtkButton *button, gpointer user_data )
-{
-    (void)user_data;
-    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( button ) );
-
-    // If there is no input, we ask the playlist to play
-    if( p_intf->p_sys->p_input == NULL )
-    {
-        playlist_Play( p_intf->p_sys->p_playlist );
-        return;
-    }
-
-    // If there is an input, we toggle its state
-    vlc_value_t state;
-    var_Get( p_intf->p_sys->p_input, "state", &state );
-    state.i_int = ( state.i_int != PLAYING_S ) ? PLAYING_S : PAUSE_S;
-    var_Set( p_intf->p_sys->p_input, "state", state );
-}
-
-void stop_cb( GtkButton *button, gpointer user_data )
-{
-    (void)user_data;
-    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( button ) );
-    playlist_Stop( p_intf->p_sys->p_playlist );
-}
-
-void prev_cb( GtkButton *button, gpointer user_data )
-{
-    (void)user_data;
-    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( button ) );
-    playlist_Prev( p_intf->p_sys->p_playlist );
-}
-
-void next_cb( GtkButton *button, gpointer user_data )
-{
-    (void)user_data;
-    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( button ) );
-    playlist_Next( p_intf->p_sys->p_playlist );
-}
-
-void seekbar_changed_cb( GtkRange *range, GtkScrollType scroll,
-                         gdouble value, gpointer data )
-{
-    (void)scroll; (void)data;
-    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( range ) );
-    if( p_intf->p_sys->p_input )
-    {
-        int i_length = hildon_seekbar_get_total_time( p_intf->p_sys->p_seekbar );
-        var_SetFloat( p_intf->p_sys->p_input, "position", (float)(value/i_length) );
-    }
-}
-
-void pl_row_activated_cb( GtkTreeView *tree_view , GtkTreePath *path,
-                          GtkTreeViewColumn *column, gpointer user_data )
-{
-    (void)column; (void)user_data;
-    intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( tree_view ) );
-    input_item_t *p_input;
-    GtkTreeModel *model = gtk_tree_view_get_model( tree_view );
-    GtkTreeIter iter;
-    gchar *filename = NULL;
-
-    gtk_tree_model_get_iter( model, &iter, path );
-    gtk_tree_model_get( model, &iter, 0, &filename, -1 );
-
-    gtk_notebook_set_current_page( GTK_NOTEBOOK( p_intf->p_sys->p_tabs ), 0 );
-
-    p_input = input_item_New( p_intf, filename, NULL );
-    playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
-                       PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END, true, false );
-    vlc_gc_decref( p_input );
-}
-
-void open_cb( GtkMenuItem *menuitem, gpointer user_data )
-{
-    (void)menuitem;
-    intf_thread_t *p_intf = (intf_thread_t *)user_data;
-    input_item_t *p_input;
-    GtkWidget *dialog;
-    char *psz_filename = NULL;
-
-    dialog = hildon_file_chooser_dialog_new( GTK_WINDOW( p_intf->p_sys->p_main_window ),
-                                             GTK_FILE_CHOOSER_ACTION_OPEN );
-    gtk_widget_show_all( GTK_WIDGET( dialog ) );
-
-    if( gtk_dialog_run( GTK_DIALOG( dialog ) ) == GTK_RESPONSE_OK )
-    {
-        psz_filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER( dialog ) );
-    }
-    else
-    {
-        gtk_widget_destroy( dialog );
-        return;
-    }
-
-    gtk_widget_destroy( dialog );
-
-    p_input = input_item_New( p_intf, psz_filename, NULL );
-    playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
-                       PLAYLIST_APPEND | PLAYLIST_GO,
-                       PLAYLIST_END, true, false );
-    vlc_gc_decref( p_input );
-}
-
-void open_address_cb( GtkMenuItem *menuitem, gpointer user_data )
-{
-    (void)menuitem;
-    intf_thread_t *p_intf = (intf_thread_t *)user_data;
-    input_item_t *p_input;
-    GtkWidget *dialog, *hbox, *label, *entry;
-
-    dialog = gtk_dialog_new_with_buttons( "Open Address",
-                GTK_WINDOW( p_intf->p_sys->p_main_window ),
-                GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-                GTK_STOCK_OK, GTK_RESPONSE_OK,
-                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                NULL );
-    label = gtk_label_new( "Address :" );
-    entry = gtk_entry_new();
-    gtk_entry_set_width_chars( GTK_ENTRY( entry ), 30 );
-    hbox = gtk_hbox_new( FALSE, 0 );
-    gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, FALSE, 0 );
-    gtk_box_pack_start( GTK_BOX( hbox ), entry, TRUE, TRUE, 0 );
-    gtk_container_add( GTK_CONTAINER( GTK_DIALOG( dialog )->vbox ), hbox );
-
-    gtk_widget_show_all( dialog );
-    if( gtk_dialog_run( GTK_DIALOG( dialog ) ) == GTK_RESPONSE_CANCEL )
-    {
-        gtk_widget_destroy( dialog );
-        return;
-    }
-
-    p_input = input_item_New( p_intf,
-                              gtk_entry_get_text( GTK_ENTRY( entry ) ),
-                              NULL );
-    playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
-                       PLAYLIST_APPEND | PLAYLIST_GO,
-                       PLAYLIST_END, true, false );
-    vlc_gc_decref( p_input );
-
-    gtk_widget_destroy( dialog );
-}
-
-void open_webcam_cb( GtkMenuItem *menuitem, gpointer user_data )
-{
-    (void)menuitem;
-    intf_thread_t *p_intf = (intf_thread_t *)user_data;
-    input_item_t *p_input;
-
-    p_input = input_item_New( p_intf, "v4l2://", NULL );
-    playlist_AddInput( p_intf->p_sys->p_playlist, p_input,
-                       PLAYLIST_APPEND | PLAYLIST_GO,
-                       PLAYLIST_END, true, false );
-    vlc_gc_decref( p_input );
-}
-
-void snapshot_cb( GtkMenuItem *menuitem, gpointer user_data )
-{
-    (void)menuitem;
-    intf_thread_t *p_intf = (intf_thread_t *)user_data;
-
-    if( !p_intf->p_sys->p_vout )
-    {
-        hildon_banner_show_information(
-                                GTK_WIDGET( p_intf->p_sys->p_main_window ),
-                                "gtk-dialog-error",
-                                "There is no video" );
-        return;
-    }
-
-    var_TriggerCallback( p_intf->p_sys->p_vout, "video-snapshot" );
-    hildon_banner_show_information( GTK_WIDGET( p_intf->p_sys->p_main_window ),
-                                    NULL,
-                                    "Snapshot taken" );
-}
-
-void dropframe_cb( GtkMenuItem *menuitem, gpointer user_data )
-{
-    intf_thread_t *p_intf = (intf_thread_t *)user_data;
-
-    if( gtk_check_menu_item_get_active( GTK_CHECK_MENU_ITEM( menuitem ) ) )
-        config_PutInt( p_intf, "ffmpeg-skip-frame", 1 );
-    else
-        config_PutInt( p_intf, "ffmpeg-skip-frame", 0 );
-}
diff --git a/modules/gui/maemo/maemo_callbacks.h b/modules/gui/maemo/maemo_callbacks.h
deleted file mode 100644 (file)
index 84e7550..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*****************************************************************************
-* maemo_callbacks.h : Callbacks header file for the maemo plugin.
-*****************************************************************************
-* Copyright (C) 2008 the VideoLAN team
-* $Id$
-*
-* Authors: Antoine Lejeune <phytos@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
-* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
-*****************************************************************************/
-
-#include <gtk/gtk.h>
-
-#include <vlc_common.h>
-#include <vlc_interface.h>
-
-gboolean delete_event_cb( GtkWidget *widget,
-                          GdkEvent *event,
-                          gpointer user_data );
-
-void play_cb( GtkButton *button, gpointer user_data );
-void stop_cb( GtkButton *button, gpointer user_data );
-void prev_cb( GtkButton *button, gpointer user_data );
-void next_cb( GtkButton *button, gpointer user_data );
-void seekbar_changed_cb( GtkRange *range, GtkScrollType scroll,
-                         gdouble value, gpointer data );
-
-void pl_row_activated_cb( GtkTreeView *, GtkTreePath *, GtkTreeViewColumn *,
-                          gpointer );
-
-void open_cb( GtkMenuItem *menuitem, gpointer user_data );
-void open_address_cb( GtkMenuItem *menuitem, gpointer user_data );
-void open_webcam_cb( GtkMenuItem *menuitem, gpointer user_data );
-
-void snapshot_cb( GtkMenuItem *menuitem, gpointer user_data );
-void dropframe_cb( GtkMenuItem *menuitem, gpointer user_data );
diff --git a/modules/gui/maemo/maemo_input.c b/modules/gui/maemo/maemo_input.c
deleted file mode 100644 (file)
index de7ba98..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-/*****************************************************************************
-* maemo_input.c : Input handling for the maemo plugin
-*****************************************************************************
-* Copyright (C) 2008 the VideoLAN team
-* $Id$
-*
-* Authors: Antoine Lejeune <phytos@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
-* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
-*****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <vlc_common.h>
-
-#include "maemo.h"
-#include "maemo_input.h"
-
-static int input_event_cb( vlc_object_t *p_this, const char *psz_var,
-                           vlc_value_t oldval, vlc_value_t newval, void *param );
-
-
-gboolean process_events( gpointer data )
-{
-    intf_thread_t *p_intf = (intf_thread_t *)data;
-    vlc_spin_lock( &p_intf->p_sys->event_lock );
-
-    int i_event = p_intf->p_sys->i_event;
-    p_intf->p_sys->i_event = 0;
-
-    vlc_spin_unlock( &p_intf->p_sys->event_lock );
-    if( i_event )
-    {
-        if( i_event & EVENT_PLAYLIST_CURRENT )
-            item_changed_pl( p_intf );
-        if( i_event & EVENT_ACTIVITY )
-            item_changed_pl( p_intf );
-        if( i_event & EVENT_ITEM_CHANGED )
-            item_changed( p_intf );
-        if( i_event & EVENT_INTF_CHANGED )
-            update_position( p_intf );
-    }
-
-    return TRUE;
-}
-
-void set_input( intf_thread_t *p_intf, input_thread_t *p_input )
-{
-    if( p_input && !( p_input->b_die || p_input->b_dead ) )
-    {
-        p_intf->p_sys->p_input = p_input;
-        vlc_object_hold( p_input );
-        var_AddCallback( p_input, "intf-event", input_event_cb, p_intf );
-
-        // "Activate" the seekbar
-        gtk_widget_set_sensitive( GTK_WIDGET( p_intf->p_sys->p_seekbar ), TRUE );
-    }
-    else
-        p_intf->p_sys->p_input = NULL;
-}
-
-void delete_input( intf_thread_t *p_intf )
-{
-    if( p_intf->p_sys->p_input )
-    {
-        var_DelCallback( p_intf->p_sys->p_input, "intf-event",
-                         input_event_cb, p_intf );
-        vlc_object_release( p_intf->p_sys->p_input );
-        p_intf->p_sys->p_input = NULL;
-
-        // Reset the seekbar
-        hildon_seekbar_set_position( p_intf->p_sys->p_seekbar, 0 );
-        gtk_widget_set_sensitive( GTK_WIDGET( p_intf->p_sys->p_seekbar ), FALSE );
-    }
-}
-
-void item_changed_pl( intf_thread_t *p_intf )
-{
-    if( p_intf->p_sys->p_input &&
-        ( p_intf->p_sys->p_input->b_dead || p_intf->p_sys->p_input->b_die ) )
-    {
-        delete_input( p_intf );
-        return;
-    }
-
-    if( !p_intf->p_sys->p_input )
-    {
-        set_input( p_intf, playlist_CurrentInput( p_intf->p_sys->p_playlist ) );
-    }
-    return;
-}
-
-int playlist_current_cb( vlc_object_t *p_this, const char *psz_var,
-                         vlc_value_t oldval, vlc_value_t newval, void *param )
-{
-    (void)p_this; (void)psz_var; (void)oldval; (void)newval;
-    intf_thread_t *p_intf = (intf_thread_t *)param;
-    vlc_spin_lock( &p_intf->p_sys->event_lock );
-
-    p_intf->p_sys->i_event |= EVENT_PLAYLIST_CURRENT;
-
-    vlc_spin_unlock( &p_intf->p_sys->event_lock );
-    return VLC_SUCCESS;
-}
-
-int activity_cb( vlc_object_t *p_this, const char *psz_var,
-                 vlc_value_t oldval, vlc_value_t newval, void *param )
-{
-    (void)p_this; (void)psz_var; (void)oldval; (void)newval;
-    intf_thread_t *p_intf = (intf_thread_t *)param;
-    vlc_spin_lock( &p_intf->p_sys->event_lock );
-
-    p_intf->p_sys->i_event |= EVENT_ACTIVITY;
-
-    vlc_spin_unlock( &p_intf->p_sys->event_lock );
-    return VLC_SUCCESS;
-}
-
-void item_changed( intf_thread_t *p_intf )
-{
-    GtkButton *p_button = GTK_BUTTON( p_intf->p_sys->p_play_button );
-    vlc_value_t state;
-
-    if( !p_intf->p_sys->p_input )
-        return;
-
-    var_Get( p_intf->p_sys->p_input, "state", &state );
-
-    // We change the "play" button
-    if( state.i_int == PLAYING_S )
-        gtk_button_set_image( p_button, gtk_image_new_from_stock( "vlc-pause",
-                              GTK_ICON_SIZE_BUTTON ) );
-    else
-        gtk_button_set_image( p_button, gtk_image_new_from_stock( "vlc-play",
-                              GTK_ICON_SIZE_BUTTON ) );
-}
-
-int item_changed_cb( vlc_object_t *p_this, const char *psz_var,
-                     vlc_value_t oldval, vlc_value_t newval, void *param )
-{
-    (void)p_this; (void)psz_var; (void)oldval; (void)newval;
-    intf_thread_t *p_intf = (intf_thread_t *)param;
-    vlc_spin_lock( &p_intf->p_sys->event_lock );
-
-    p_intf->p_sys->i_event |= EVENT_ITEM_CHANGED;
-
-    vlc_spin_unlock( &p_intf->p_sys->event_lock );
-    return VLC_SUCCESS;
-}
-
-void update_position( intf_thread_t *p_intf )
-{
-    if( p_intf->p_sys->p_input )
-    {
-        hildon_seekbar_set_total_time( p_intf->p_sys->p_seekbar,
-                    var_GetTime( p_intf->p_sys->p_input, "length" )/1000000 );
-        hildon_seekbar_set_position( p_intf->p_sys->p_seekbar,
-                    var_GetTime( p_intf->p_sys->p_input, "time" )/1000000 );
-    }
-}
-
-int interface_changed_cb( vlc_object_t *p_this, const char *psz_var,
-                          vlc_value_t oldval, vlc_value_t newval, void *param )
-{
-    (void)p_this; (void)psz_var; (void)oldval; (void)newval;
-    intf_thread_t *p_intf = (intf_thread_t *)param;
-    vlc_spin_lock( &p_intf->p_sys->event_lock );
-
-    p_intf->p_sys->i_event |= EVENT_INTF_CHANGED;
-
-    vlc_spin_unlock( &p_intf->p_sys->event_lock );
-    return VLC_SUCCESS;
-}
-
-static int input_event_cb( vlc_object_t *p_this, const char *psz_var,
-                           vlc_value_t oldval, vlc_value_t newval, void *param )
-{
-    if( newval.i_int == INPUT_EVENT_STATE )
-        return item_changed_cb( p_this, psz_var, oldval, newval, param );
-    else
-        return interface_changed_cb( p_this, psz_var, oldval, newval, param );
-}
-
diff --git a/modules/gui/maemo/maemo_input.h b/modules/gui/maemo/maemo_input.h
deleted file mode 100644 (file)
index 03eae50..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*****************************************************************************
-* maemo_input.h : Input handling header file for the maemo plugin.
-*****************************************************************************
-* Copyright (C) 2008 the VideoLAN team
-* $Id$
-*
-* Authors: Antoine Lejeune <phytos@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
-* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
-*****************************************************************************/
-
-#include <gtk/gtk.h>
-
-#include <vlc_common.h>
-#include <vlc_interface.h>
-
-#define EVENT_ITEM_STATE_CHANGE (1<<0)
-#define EVENT_PLAYLIST_CURRENT  (1<<1)
-#define EVENT_ACTIVITY          (1<<2)
-#define EVENT_ITEM_CHANGED      (1<<3)
-#define EVENT_INTF_CHANGED      (1<<4)
-
-gboolean process_events( gpointer data );
-
-void set_input( intf_thread_t *p_intf, input_thread_t *p_input );
-void delete_input( intf_thread_t *p_intf );
-
-int playlist_current_cb( vlc_object_t *p_this, const char *psz_var,
-                         vlc_value_t oldval, vlc_value_t newval, void *param );
-int activity_cb( vlc_object_t *p_this, const char *psz_var,
-                 vlc_value_t oldval, vlc_value_t newval, void *param );
-void item_changed_pl( intf_thread_t *p_intf );
-
-int item_changed_cb( vlc_object_t *p_this, const char *psz_var,
-                     vlc_value_t oldval, vlc_value_t newval, void *param );
-void item_changed( intf_thread_t *p_intf );
-
-int interface_changed_cb( vlc_object_t *p_this, const char *psz_var,
-                          vlc_value_t oldval, vlc_value_t newval, void *param );
-void update_position( intf_thread_t *p_intf );
diff --git a/modules/gui/maemo/maemo_interface.c b/modules/gui/maemo/maemo_interface.c
deleted file mode 100644 (file)
index 16cf8f0..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/*****************************************************************************
-* maemo_interface.c : Interface creation of the maemo plugin
-*****************************************************************************
-* Copyright (C) 2008 the VideoLAN team
-* $Id$
-*
-* Authors: Antoine Lejeune <phytos@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
-* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
-*****************************************************************************/
-
-#include <vlc_common.h>
-
-#include <gtk/gtk.h>
-
-#include "maemo.h"
-#include "maemo_callbacks.h"
-#include "maemo_interface.h"
-
-static void scan_maemo_for_media ( intf_thread_t *p_intf );
-static void find_media_in_dir    ( const char *psz_dir, GList **pp_list );
-
-static const char *ppsz_extensions[] =
-    { "aac", "flac", "m4a", "m4p", "mka", "mp1", "mp2", "mp3",
-      "ogg", "wav", "wma", "asf", "avi", "divx", "flv", "m1v",
-      "m2v", "m4v", "mkv", "mov", "mpeg", "mpeg1", "mpeg2", "mpeg4",
-      "mpg", "ogm", "wmv", NULL };
-
-static const char *ppsz_media_dirs[] =
-    { "/media/mmc1", "/media/mmc2", "/home/user/MyDocs/.videos", NULL };
-
-#define ADD_MENU_ITEM( label, callback ) \
-    item = gtk_menu_item_new_with_label( label ); \
-    gtk_menu_append( main_menu, item ); \
-    g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( callback ), \
-                      p_intf );
-#define ADD_CHECK_MENU_ITEM( label, callback ) \
-    item = gtk_check_menu_item_new_with_label( label ); \
-    gtk_menu_append( main_menu, item ); \
-    g_signal_connect( GTK_OBJECT( item ), "toggled", G_CALLBACK( callback ), \
-                      p_intf );
-#define ADD_SEPARATOR \
-    item = gtk_separator_menu_item_new(); \
-    gtk_menu_append( main_menu, item );
-
-void create_menu( intf_thread_t *p_intf )
-{
-    /* Needed variables */
-    GtkWidget *main_menu;
-    GtkWidget *item;
-    int i_skip;
-
-    /* Creating the main menu */
-    main_menu = gtk_menu_new();
-
-    /* Getting ffmpeg-skip-frame value */
-    i_skip = config_GetInt( p_intf, "ffmpeg-skip-frame" );
-
-    /* Filling the menu */
-    ADD_MENU_ITEM( "Open", open_cb );
-    ADD_MENU_ITEM( "Open Address", open_address_cb );
-    ADD_MENU_ITEM( "Open Webcam", open_webcam_cb );
-    ADD_SEPARATOR;
-    ADD_MENU_ITEM( "Take a snapshot", snapshot_cb );
-    ADD_CHECK_MENU_ITEM( "Drop frames", dropframe_cb );
-    if( i_skip )
-        gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), true );
-    ADD_SEPARATOR;
-    ADD_MENU_ITEM( "Close", delete_event_cb );
-
-    hildon_window_set_menu( HILDON_WINDOW( p_intf->p_sys->p_main_window ),
-                            GTK_MENU( main_menu ) );
-
-    gtk_widget_show_all( main_menu );
-}
-
-#undef ADD_MENU
-#undef ADD_CHECK_MENU_ITEM
-#undef ADD_SEPARATOR
-
-void create_playlist( intf_thread_t *p_intf )
-{
-    GtkWidget *playlist;
-    GtkWidget *scroll;
-    GtkListStore *playlist_store;
-    GtkTreeViewColumn *col;
-    GtkCellRenderer *renderer;
-
-    playlist = gtk_tree_view_new();
-
-    playlist_store = gtk_list_store_new( 1, G_TYPE_STRING );
-    p_intf->p_sys->p_playlist_store = GTK_WIDGET( playlist_store );
-
-    gtk_tree_view_set_model( GTK_TREE_VIEW( playlist ),
-                             GTK_TREE_MODEL( playlist_store ) );
-
-    renderer = gtk_cell_renderer_text_new();
-    col = gtk_tree_view_column_new_with_attributes( "File", renderer,
-                                                    "text", 0, NULL );
-    gtk_tree_view_append_column( GTK_TREE_VIEW( playlist ), col );
-
-    g_object_set( playlist, "headers-visible", TRUE, NULL );
-    scan_maemo_for_media( p_intf );
-
-    scroll = gtk_scrolled_window_new( NULL, NULL );
-    gtk_container_add( GTK_CONTAINER( scroll ), playlist );
-
-    gtk_notebook_append_page( GTK_NOTEBOOK( p_intf->p_sys->p_tabs ), scroll,
-                              gtk_image_new_from_stock( "vlc-playlist",
-                                                        GTK_ICON_SIZE_DIALOG ) );
-    gtk_notebook_set_tab_label_packing( GTK_NOTEBOOK( p_intf->p_sys->p_tabs ), scroll,
-                                        FALSE, FALSE, GTK_PACK_START );
-
-    g_signal_connect( playlist, "row-activated",
-                      G_CALLBACK( pl_row_activated_cb ), NULL );
-}
-
-static void scan_maemo_for_media( intf_thread_t *p_intf )
-{
-    GtkListStore *playlist_store = GTK_LIST_STORE( p_intf->p_sys->p_playlist_store );
-    GList *list = NULL;
-    GtkTreeIter iter;
-
-    for( int i = 0; ppsz_media_dirs[i]; i++ )
-    {
-        find_media_in_dir( ppsz_media_dirs[i], &list );
-        msg_Dbg( p_intf, "Looking for media in %s", ppsz_media_dirs[i] );
-    }
-
-    list = g_list_first( list );
-    while( list )
-    {
-        msg_Dbg( p_intf, "Adding : %s", (char *)list->data );
-        gtk_list_store_append( playlist_store, &iter );
-        gtk_list_store_set( playlist_store, &iter,
-                            0, list->data, -1 );
-        list = g_list_next( list );
-    }
-}
-
-static void find_media_in_dir( const char *psz_dir, GList **pp_list )
-{
-    GDir *dir = NULL;
-    const gchar *psz_name;
-    char *psz_path;
-
-    dir = g_dir_open( psz_dir, 0, NULL );
-    if( !dir )
-        return;
-    while( ( psz_name = g_dir_read_name( dir ) ) != NULL )
-    {
-        psz_path = g_build_path( "/", psz_dir, psz_name, NULL );
-        if( g_file_test( psz_path, G_FILE_TEST_IS_DIR ) &&
-            !g_file_test( psz_path, G_FILE_TEST_IS_SYMLINK ) )
-            find_media_in_dir( psz_path, pp_list );
-        else
-        {
-            char *psz_ext = strrchr( psz_name, '.' );
-            if( psz_ext )
-            {
-                psz_ext++;
-                for( int i = 0; ppsz_extensions[i]; i++ )
-                {
-                    if( strcmp( psz_ext, ppsz_extensions[i] ) == 0 )
-                    {
-                        *pp_list = g_list_append( *pp_list, g_strdup( psz_path ) );
-                        break;
-                    }
-                }
-            }
-        }
-        g_free( psz_path );
-    }
-
-    g_dir_close( dir );
-    return;
-}
diff --git a/modules/gui/maemo/maemo_interface.h b/modules/gui/maemo/maemo_interface.h
deleted file mode 100644 (file)
index 87b535e..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*****************************************************************************
-* maemo_interface.h : Interface creation header file for the maemo plugin.
-*****************************************************************************
-* Copyright (C) 2008 the VideoLAN team
-* $Id$
-*
-* Authors: Antoine Lejeune <phytos@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
-* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
-*****************************************************************************/
-
-#include <gtk/gtk.h>
-
-#include <vlc_common.h>
-
-void create_menu( intf_thread_t *p_intf );
-
-void create_playlist( intf_thread_t *p_intf );
index 2460ce9..43f2347 100644 (file)
@@ -47,7 +47,7 @@ if BUILD_MOZILLA
 # TODO: move to the mozilla directory
 nobase_vlcdata_DATA += $(DIST_mozilla)
 endif
-if BUILD_MAEMO
+if BUILD_HILDON
 nobase_vlcdata_DATA += $(DIST_maemo) $(maemo_FILES)
 endif