Commit 03062ad3 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Hildon UI: remove dead technology

That plugin was written for Maemo 4. It barely worked with Maemo 5.
Maemo 6 did not have Hildon. Hildon is unmaintained and unused.
parent 23247a85
...@@ -568,7 +568,7 @@ doc: ...@@ -568,7 +568,7 @@ doc:
# Building aliases # Building aliases
############################################################################### ###############################################################################
ALL_ALIASES = cvlc rvlc svlc qvlc nvlc mvlc ALL_ALIASES = cvlc rvlc svlc qvlc nvlc
bin_SCRIPTS = $(ALIASES) bin_SCRIPTS = $(ALIASES)
CLEANFILES += $(ALIASES) $(noinst_SCRIPTS) CLEANFILES += $(ALIASES) $(noinst_SCRIPTS)
EXTRA_SCRIPTS = $(ALL_ALIASES) EXTRA_SCRIPTS = $(ALL_ALIASES)
...@@ -592,9 +592,6 @@ qvlc: make-alias Makefile ...@@ -592,9 +592,6 @@ qvlc: make-alias Makefile
nvlc: make-alias Makefile nvlc: make-alias Makefile
$(AM_V_GEN)$(MKALIAS) ncurses $(AM_V_GEN)$(MKALIAS) ncurses
mvlc: make-alias Makefile
$(AM_V_GEN)$(MKALIAS) maemo
if BUILD_VLC if BUILD_VLC
noinst_SCRIPTS = vlc$(EXEEXT) noinst_SCRIPTS = vlc$(EXEEXT)
endif endif
......
...@@ -66,6 +66,7 @@ Removed modules: ...@@ -66,6 +66,7 @@ Removed modules:
* Linux Framebuffer On Screen Display interface (fbosd) * Linux Framebuffer On Screen Display interface (fbosd)
* RTMP access: use libavformat avio instead * RTMP access: use libavformat avio instead
* RTMP access_output: use libavformat avio instead * RTMP access_output: use libavformat avio instead
* Hildon GUI
Changes between 2.0.2 and 2.0.3: Changes between 2.0.2 and 2.0.3:
......
...@@ -3551,32 +3551,6 @@ dnl ...@@ -3551,32 +3551,6 @@ dnl
EXTEND_HELP_STRING([Interface plugins:]) EXTEND_HELP_STRING([Interface plugins:])
dnl
dnl Hildon UI
dnl
AC_ARG_ENABLE(hildon,
[ --enable-hildon Hildon touchscreen UI (default disabled)])
AS_IF([test "${enable_hildon}" = "yes"], [
PKG_CHECK_MODULES(HILDON, [hildon-1], [
PKG_CHECK_MODULES(HILDON_FM, hildon-fm-2, [
VLC_ADD_CFLAGS([hildon],[${HILDON_FM_CFLAGS} -DHAVE_HILDON_FM])
VLC_ADD_LIBS([hildon],[${HILDON_FM_LIBS}])
], [
AC_MSG_WARN([${HILDON_FM_PKG_ERRORS}.])
])
VLC_ADD_CFLAGS([hildon],[${HILDON_CFLAGS} ${X_CFLAGS}])
VLC_ADD_LIBS([hildon],[${HILDON_LIBS} ${X_LIBS} ${X_PRE_LIBS} -lX11])
VLC_ADD_PLUGIN([hildon])
ALIASES="${ALIASES} mvlc"
], [
AS_IF([test "${enable_hildon}" = "yes"],[
AC_MSG_ERROR([${HILDON_PKG_ERRORS}.])
])
enable_hildon="no"
])
])
AM_CONDITIONAL(BUILD_HILDON, [test "${enable_hildon}" = "yes"])
dnl dnl
dnl QT dnl QT
dnl dnl
...@@ -4190,7 +4164,6 @@ AC_CONFIG_FILES([ ...@@ -4190,7 +4164,6 @@ AC_CONFIG_FILES([
modules/demux/playlist/Makefile modules/demux/playlist/Makefile
modules/gui/Makefile modules/gui/Makefile
modules/gui/macosx/Makefile modules/gui/macosx/Makefile
modules/gui/hildon/Makefile
modules/gui/minimal_macosx/Makefile modules/gui/minimal_macosx/Makefile
modules/gui/macosx_dialog_provider/Makefile modules/gui/macosx_dialog_provider/Makefile
modules/gui/qt4/Makefile modules/gui/qt4/Makefile
......
...@@ -143,7 +143,6 @@ $Id$ ...@@ -143,7 +143,6 @@ $Id$
* growl: announce currently playing stream to growl * growl: announce currently playing stream to growl
* h264: H264 decoder * h264: H264 decoder
* headphone_channel_mixer: headphone channel mixer with virtual spatialization effect * headphone_channel_mixer: headphone channel mixer with virtual spatialization effect
* hildon: Maemo interface based on Hildon
* hotkeys: hotkeys control module * hotkeys: hotkeys control module
* hqdn3d: High Quality denoising filter * hqdn3d: High Quality denoising filter
* htcpcp: HTCPCP access module * htcpcp: HTCPCP access module
......
DIST_SUBDIRS = macosx hildon minimal_macosx qt4 skins2 macosx_dialog_provider DIST_SUBDIRS = macosx minimal_macosx qt4 skins2 macosx_dialog_provider
SUBDIRS = SUBDIRS =
if HAVE_DARWIN if HAVE_DARWIN
SUBDIRS += macosx macosx_dialog_provider SUBDIRS += macosx macosx_dialog_provider
endif endif
if BUILD_HILDON
SUBDIRS += hildon
endif
if ENABLE_QT4 if ENABLE_QT4
SUBDIRS += qt4 SUBDIRS += qt4
endif endif
......
SOURCES_hildon = maemo.c \
maemo.h \
maemo_callbacks.c \
maemo_callbacks.h \
maemo_input.c \
maemo_input.h \
maemo_interface.c \
maemo_interface.h \
maemo_menus.c
/****************************************************************************
* maemo.c : Maemo plugin for VLC
*****************************************************************************
* Copyright (C) 2008 the VideoLAN team
* $Id$
*
* Authors: Antoine Lejeune <phytos@videolan.org>
* Gildas Bazin <gbazin@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 <vlc_plugin.h>
#include <vlc_interface.h>
#include <vlc_vout_window.h>
#include <vlc_xlib.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 *Thread ( void * );
static int OpenWindow ( vout_window_t *, const vout_window_cfg_t * );
static void CloseWindow ( vout_window_t * );
static int ControlWindow ( vout_window_t *, int, va_list );
static gboolean interface_ready ( gpointer );
/*****************************************************************************
* 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();
/*****************************************************************************
* Module callbacks
*****************************************************************************/
static int Open( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
intf_sys_t *p_sys;
vlc_value_t val;
if( !vlc_xlib_init( p_this ) )
return VLC_EGENERIC;
/* Allocate instance and initialize some members */
p_intf->p_sys = p_sys = malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
return VLC_ENOMEM;
p_sys->p_playlist = pl_Get( p_intf );
p_sys->p_input = NULL;
p_sys->p_main_window = NULL;
p_sys->p_video_window = NULL;
p_sys->p_control_window = NULL;
p_sys->b_fullscreen = false;
p_sys->i_event = 0;
vlc_spin_init( &p_sys->event_lock );
/* Create separate thread for main interface */
vlc_sem_init (&p_sys->ready, 0);
if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) )
{
free (p_sys);
return VLC_ENOMEM;
}
/* Wait for interface thread to be fully initialised */
vlc_sem_wait (&p_sys->ready);
vlc_sem_destroy (&p_sys->ready);
var_Create (p_this->p_libvlc, "hildon-iface", VLC_VAR_ADDRESS);
val.p_address = p_this;
var_Set (p_this->p_libvlc, "hildon-iface", val);
return VLC_SUCCESS;
}
static void Close( vlc_object_t *p_this )
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
var_Destroy (p_this->p_libvlc, "hildon-iface");
gtk_main_quit();
vlc_join (p_intf->p_sys->thread, NULL);
vlc_spin_destroy( &p_intf->p_sys->event_lock );
free( p_intf->p_sys );
}
static gint quit_event( GtkWidget *widget, GdkEvent *event, gpointer data )
{
intf_thread_t *p_intf = (intf_thread_t *)data;
(void)widget; (void)event;
libvlc_Quit( p_intf->p_libvlc );
return TRUE;
}
/*****************************************************************************
* Initialize and launch the interface
*****************************************************************************/
static void *Thread( void *obj )
{
intf_thread_t *p_intf = (intf_thread_t *)obj;
const char *p_args[] = { "vlc" };
int i_args = sizeof(p_args)/sizeof(char *);
char **pp_args = (char **)p_args;
HildonProgram *program;
HildonWindow *window;
GtkWidget *main_vbox, *bottom_hbox;
GtkWidget *video, *seekbar;
GtkWidget *play_button, *prev_button, *next_button;
GtkWidget *stop_button, *playlist_button;
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;
g_signal_connect( GTK_WIDGET(window), "key-press-event",
G_CALLBACK( key_cb ), p_intf );
g_signal_connect (GTK_WIDGET(window), "delete_event",
GTK_SIGNAL_FUNC( quit_event), p_intf );
// A little theming
char *psz_rc_file = NULL;
char *psz_data = config_GetDataDir();
if( asprintf( &psz_rc_file, "%s/maemo/vlc_intf.rc", psz_data ) != -1 )
{
gtk_rc_parse( psz_rc_file );
free( psz_rc_file );
}
free( psz_data );
// We create the main vertical box
main_vbox = gtk_vbox_new( FALSE, 0 );
gtk_container_add( GTK_CONTAINER( window ), main_vbox );
// Menubar
GtkWidget *main_menu = create_menu( p_intf );
#ifdef HAVE_MAEMO
hildon_window_set_menu( HILDON_WINDOW( p_intf->p_sys->p_main_window ),
GTK_MENU( main_menu ) );
#else
GtkWidget *menu_bar = gtk_menu_bar_new ();
GtkWidget *item = gtk_menu_item_new_with_label ("Menu");
gtk_menu_bar_append(menu_bar, item);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), main_menu);
gtk_widget_show_all (menu_bar);
gtk_box_pack_start(GTK_BOX(main_vbox), menu_bar, FALSE, FALSE, 0);
#endif
// We put first the embedded video
video = gtk_event_box_new();
GdkColor black = {0,0,0,0};
gtk_widget_modify_bg(video, GTK_STATE_NORMAL, &black);
p_intf->p_sys->p_video_window = video;
gtk_box_pack_start( GTK_BOX( main_vbox ), video, TRUE, TRUE, 0 );
create_playlist( p_intf );
gtk_box_pack_start( GTK_BOX( main_vbox ), p_intf->p_sys->p_playlist_window, TRUE, TRUE, 0 );
// We put the horizontal box which contains all the buttons
p_intf->p_sys->p_control_window = 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 ) );
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 ) );
playlist_button = gtk_button_new();
gtk_button_set_image( GTK_BUTTON( playlist_button ),
gtk_image_new_from_stock( "vlc-playlist", 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, 0 );
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 ), playlist_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( 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( playlist_button, "clicked", G_CALLBACK( playlist_cb ), NULL );
g_signal_connect( seekbar, "change-value",
G_CALLBACK( seekbar_changed_cb ), NULL );
gtk_widget_show_all( GTK_WIDGET( window ) );
gtk_widget_hide_all( p_intf->p_sys->p_playlist_window );
#if 1
/* HACK: Only one X11 client can subscribe to mouse button press events.
* VLC currently handles those in the video display.
* Force GTK to unsubscribe from mouse press and release events. */
Display *dpy = GDK_WINDOW_XDISPLAY( gtk_widget_get_window(p_intf->p_sys->p_video_window) );
Window w = GDK_WINDOW_XID( gtk_widget_get_window(p_intf->p_sys->p_video_window) );
XWindowAttributes attr;
XGetWindowAttributes( dpy, w, &attr );
attr.your_event_mask &= ~(ButtonPressMask|ButtonReleaseMask);
XSelectInput( dpy, w, attr.your_event_mask );
#endif
// The embedded video is only ready after gtk_main and windows are shown
g_idle_add( interface_ready, p_intf );
gtk_main();
delete_input( p_intf );
delete_playlist( p_intf );
gtk_object_destroy( GTK_OBJECT( main_menu ) );
gtk_object_destroy( GTK_OBJECT( window ) );
return NULL;
}
/**
* Video output window provider
*/
static int OpenWindow (vout_window_t *p_wnd, const vout_window_cfg_t *cfg)
{
intf_thread_t *p_intf;
vlc_value_t val;
if (cfg->is_standalone)
return VLC_EGENERIC;
if( var_Get( p_obj->p_libvlc, "hildon-iface", &val ) )
val.p_address = NULL;
p_intf = (intf_thread_t *)val.p_address;
if( !p_intf )
{ /* If another interface is used, this plugin cannot work */
msg_Dbg( p_obj, "Hildon interface not found" );
return VLC_EGENERIC;
}
p_wnd->handle.xid = p_intf->p_sys->xid;
if (!p_wnd->handle.xid)
return VLC_EGENERIC;
p_wnd->control = ControlWindow;
p_wnd->sys = (vout_window_sys_t*)p_intf;
return VLC_SUCCESS;
}
static int ControlWindow (vout_window_t *p_wnd, int query, va_list args)
{
intf_thread_t *p_intf = (intf_thread_t *)p_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( p_intf->p_sys->p_video_window ),
&i_current_w, &i_current_h );
if( i_width != i_current_w || i_height != i_current_h )
return VLC_EGENERIC;
return VLC_SUCCESS;
}
case VOUT_WINDOW_SET_FULLSCREEN:
{
bool b_fs = va_arg( args, int );
p_intf->p_sys->b_fullscreen = b_fs;
g_idle_add( fullscreen_cb, p_intf );
return VLC_SUCCESS;
}
default:
return VLC_EGENERIC;
}
}
static void CloseWindow (vout_window_t *p_wnd)
{
intf_thread_t *p_intf = (intf_thread_t *)p_wnd->sys;
if( p_intf->p_sys->b_fullscreen )
{
p_intf->p_sys->b_fullscreen = false;
g_idle_add( fullscreen_cb, p_intf );
}
}
static gboolean interface_ready( gpointer data )
{
intf_thread_t *p_intf = (intf_thread_t *)data;
p_intf->p_sys->xid =
GDK_WINDOW_XID( gtk_widget_get_window(p_intf->p_sys->p_video_window) );
// Refresh playlist
post_event( p_intf, EVENT_PLAYLIST_CURRENT );
// Everything is initialised
vlc_sem_post (&p_intf->p_sys->ready);
// We want it to be executed only one time
return FALSE;
}
/*****************************************************************************
* 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.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <hildon/hildon-program.h>
#include <hildon/hildon-seekbar.h>
#include <hildon/hildon-banner.h>
#include <vlc_interface.h>
#include <vlc_playlist.h>
#include <vlc_input.h>
#include <vlc_vout.h>
struct intf_sys_t
{
vlc_thread_t thread;
playlist_t *p_playlist;
input_thread_t *p_input;
vlc_sem_t ready;
HildonWindow *p_main_window;
HildonSeekbar *p_seekbar;
GtkWidget *p_play_button;
GtkListStore *p_playlist_store;
GtkWidget *p_playlist_window;
int i_event;
vlc_spinlock_t event_lock;
GtkWidget *p_video_window;
uint32_t xid; /* X11 windows ID */
bool b_fullscreen;
GtkWidget *p_control_window;
GtkMenuItem *menu_input;
GtkMenuItem *menu_audio;
GtkMenuItem *menu_video;
};
GtkWidget *create_menu( intf_thread_t *p_intf );
/*****************************************************************************
* maemo_callbacks.c : Callbacks for the maemo plugin.
*****************************************************************************
* Copyright (C) 2008 the VideoLAN team
* $Id$
*
* Authors: Antoine Lejeune <phytos@videolan.org>
* Gildas Bazin <gbazin@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"
#include <gdk/gdkkeysyms.h>
#include <vlc_keys.h>
#ifdef HAVE_HILDON_FM
# include <hildon/hildon-file-chooser-dialog.h>
#endif
/*
* 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" );
}
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 playlist_cb( GtkButton *button, gpointer user_data )
{
(void)user_data;
intf_thread_t *p_intf = get_intf_from_widget( GTK_WIDGET( button ) );
if( GTK_WIDGET_VISIBLE(p_intf->p_sys->p_playlist_window) )
{
gtk_widget_show_all( p_intf->p_sys->p_video_window );
gtk_widget_hide_all( p_intf->p_sys->p_playlist_window );
}
else
{
gtk_widget_hide_all( p_intf->p_sys->p_video_window );
gtk_widget_show_all( p_intf->p_sys->p_playlist_window );
}
}
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 );
p_input = input_item_New( 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;
#ifdef HAVE_HILDON_FM
dialog = hildon_file_chooser_dialog_new( GTK_WINDOW( p_intf->p_sys->p_main_window ),
GTK_FILE_CHOOSER_ACTION_OPEN );
#else
dialog = gtk_file_chooser_dialog_new( "Open File", GTK_WINDOW( p_intf->p_sys->p_main_window ),
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK, NULL );
#endif
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