# All possible plugin directories, needed for make clean
#
PLUGINS_DIR := alsa beos darwin dsp dummy \
- dvd esd fb ggi glide gnome gtk \
+ dvd esd fb ggi glide gtk \
downmix idct imdct \
macosx mga \
motion \
# All possible plugin objects
#
PLUGINS_TARGETS := alsa/alsa beos/beos darwin/darwin dsp/dsp dummy/dummy \
- dvd/dvd esd/esd fb/fb ggi/ggi glide/glide gnome/gnome gtk/gtk \
+ dvd/dvd esd/esd fb/fb ggi/ggi glide/glide gtk/gnome gtk/gtk \
downmix/downmix downmix/downmixsse downmix/downmix3dn \
idct/idct idct/idctclassic idct/idctmmx idct/idctmmxext \
imdct/imdct imdct/imdct3dn imdct/imdctsse \
AC3_SPDIF = src/ac3_spdif/ac3_spdif.o \
src/ac3_spdif/ac3_iec958.o
-LPCM_DECODER = src/lpcm_decoder/lpcm_decoder_thread.o \
- src/lpcm_decoder/lpcm_decoder.o
+LPCM_DECODER = src/lpcm_decoder/lpcm_decoder_thread.o
AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
src/audio_decoder/adec_generic.o \
+++ /dev/null
-*.bak
-.dep
+++ /dev/null
-###############################################################################
-# vlc (VideoLAN Client) gnome module Makefile
-# (c)2001 VideoLAN
-###############################################################################
-
-#
-# Objects
-#
-
-PLUGIN_GNOME = gnome.o intf_gnome.o gnome_callbacks.o gnome_interface.o gnome_support.o gnome_playlist.o
-BUILTIN_GNOME = $(PLUGIN_GNOME:%.o=BUILTIN_%.o)
-
-ALL_OBJ = $(PLUGIN_GNOME) $(BUILTIN_GNOME)
-
-#
-# Virtual targets
-#
-
-include ../../Makefile.modules
-
-$(PLUGIN_GNOME): %.o: .dep/%.d
-$(PLUGIN_GNOME): %.o: %.c
- $(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gtk gnomeui` -c -o $@ $<
-
-$(BUILTIN_GNOME): BUILTIN_%.o: .dep/%.d
-$(BUILTIN_GNOME): BUILTIN_%.o: %.c
- $(CC) $(CFLAGS) -DBUILTIN `gnome-config --cflags gtk gnomeui` -c -o $@ $<
-
-#
-# Real targets
-#
-
-../../lib/gnome.so: $(PLUGIN_GNOME)
- $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_GNOME)
-
-../../lib/gnome.a: $(BUILTIN_GNOME)
- ar r $@ $^
- $(RANLIB) $@
-
+++ /dev/null
-/*****************************************************************************
- * gnome_callbacks.c : Callbacks for the Gnome plugin.
- *****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gnome_callbacks.c,v 1.29 2001/05/15 01:01:44 stef Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- * Stéphane Borel <stef@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
-
-#define MODULE_NAME gnome
-#include "modules_inner.h"
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include "defs.h"
-
-#include <gnome.h>
-
-#include "config.h"
-#include "common.h"
-#include "threads.h"
-#include "mtime.h"
-
-#include "stream_control.h"
-#include "input_ext-intf.h"
-
-#include "interface.h"
-#include "intf_playlist.h"
-#include "intf_msg.h"
-
-#include "video.h"
-#include "video_output.h"
-#include "audio_output.h"
-
-#include "gnome_callbacks.h"
-#include "gnome_playlist.h"
-#include "gnome_interface.h"
-#include "gnome_support.h"
-#include "intf_gnome.h"
-
-#include "main.h"
-
-/*****************************************************************************
- * Interface callbacks
- *****************************************************************************
- * The following callbacks are related to the main interface window.
- *****************************************************************************/
-void
-on_intf_window_destroy (GtkObject *object,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_window" );
-
- vlc_mutex_lock( &p_intf->change_lock );
- p_intf->b_die = 1;
- vlc_mutex_unlock( &p_intf->change_lock );
-}
-
-
-gboolean
-on_slider_button_press_event (GtkWidget *widget,
- GdkEventButton *event,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
-
- vlc_mutex_lock( &p_intf->change_lock );
- p_intf->p_sys->b_slider_free = 0;
- vlc_mutex_unlock( &p_intf->change_lock );
-
- return FALSE;
-}
-
-
-gboolean
-on_slider_button_release_event (GtkWidget *widget,
- GdkEventButton *event,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
-
- vlc_mutex_lock( &p_intf->change_lock );
- p_intf->p_sys->b_slider_free = 1;
- vlc_mutex_unlock( &p_intf->change_lock );
-
- return FALSE;
-}
-
-
-void
-on_intf_window_drag_data_received (GtkWidget *widget,
- GdkDragContext *drag_context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET( widget ), "intf_window" );
- int i_end = p_main->p_playlist->i_size;
-
- GnomeDropDataReceived( p_intf, data, info, PLAYLIST_END );
-
- if( p_intf->p_input != NULL )
- {
- /* FIXME: temporary hack */
- p_intf->p_input->b_eof = 1;
- }
-
- intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
- p_main->p_playlist->b_stopped = 0;
-}
-
-
-void
-on_button_title_prev_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t * p_intf;
- input_area_t * p_area;
- int i_id;
-
- p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
- i_id = p_intf->p_input->stream.p_selected_area->i_id - 1;
-
- /* Disallow area 0 since it is used for video_ts.vob */
- if( i_id > 0 )
- {
- p_area = p_intf->p_input->stream.pp_areas[i_id];
- p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
-
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
-
- p_intf->p_sys->b_title_update = 1;
- }
-}
-
-
-void
-on_button_title_next_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t * p_intf;
- input_area_t * p_area;
- int i_id;
-
- p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
- i_id = p_intf->p_input->stream.p_selected_area->i_id + 1;
-
- if( i_id < p_intf->p_input->stream.i_area_nb )
- {
- p_area = p_intf->p_input->stream.pp_areas[i_id];
- p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
-
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
-
- p_intf->p_sys->b_title_update = 1;
- }
-}
-
-
-void
-on_button_chapter_prev_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t * p_intf;
- input_area_t * p_area;
-
- p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
- p_area = p_intf->p_input->stream.p_selected_area;
-
- if( p_area->i_part > 0 )
- {
- p_area->i_part--;
- p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
-
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
-
- p_intf->p_sys->b_chapter_update = 1;
- }
-}
-
-
-void
-on_button_chapter_next_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t * p_intf;
- input_area_t * p_area;
-
- p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
- p_area = p_intf->p_input->stream.p_selected_area;
-
- if( p_area->i_part < p_area->i_part_nb )
- {
- p_area->i_part++;
- p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
-
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
-
- p_intf->p_sys->b_chapter_update = 1;
- }
-}
-
-
-/*****************************************************************************
- * Menubar callbacks
- *****************************************************************************
- * The following callbacks are related to the menubar of the main
- * interface window.
- *****************************************************************************/
-void
-on_menubar_open_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
- {
- p_intf->p_sys->p_fileopen = create_intf_fileopen();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
- "p_intf", p_intf );
-
- gtk_file_selection_set_filename ( GTK_FILE_SELECTION(
- p_intf->p_sys->p_fileopen ),
- main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) );
- }
-
- gtk_widget_show( p_intf->p_sys->p_fileopen );
- gdk_window_raise( p_intf->p_sys->p_fileopen->window );
-}
-
-
-void
-on_menubar_disc_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) )
- {
- p_intf->p_sys->p_disc = create_intf_disc();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ),
- "p_intf", p_intf );
- }
-
- gtk_widget_show( p_intf->p_sys->p_disc );
- gdk_window_raise( p_intf->p_sys->p_disc->window );
-}
-
-
-void
-on_menubar_network_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_network ) )
- {
- p_intf->p_sys->p_network = create_intf_network();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
- "p_intf", p_intf );
- }
-
- gtk_widget_show( p_intf->p_sys->p_network );
- gdk_window_raise( p_intf->p_sys->p_network->window );
-}
-
-
-void
-on_menubar_exit_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- vlc_mutex_lock( &p_intf->change_lock );
- p_intf->b_die = 1;
- vlc_mutex_unlock( &p_intf->change_lock );
-}
-
-
-void
-on_menubar_playlist_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
- playlist_t * p_playlist ;
- GtkCList * p_list;
-
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
- {
- p_intf->p_sys->p_playlist = create_intf_playlist();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
- "p_intf", p_intf );
- }
-
- vlc_mutex_lock( &p_main->p_playlist->change_lock );
- if( p_main->p_playlist->i_size > 0 )
- {
- p_playlist = p_main->p_playlist;
- p_list = GTK_CLIST( lookup_widget( p_intf->p_sys->p_playlist,
- "playlist_clist" ) );
- GnomeRebuildCList( p_list, p_playlist );
- }
- vlc_mutex_unlock( &p_main->p_playlist->change_lock );
-
- gtk_widget_show( p_intf->p_sys->p_playlist );
- gdk_window_raise( p_intf->p_sys->p_playlist->window );
-}
-
-
-void
-on_menubar_audio_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t * p_intf;
- es_descriptor_t * p_es;
-
- p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- if( !p_intf->p_sys->b_audio_update )
- {
- p_es = (es_descriptor_t*)user_data;
-
- input_ToggleES( p_intf->p_input, p_es, menuitem->active );
-
- p_intf->p_sys->b_audio_update = menuitem->active;
- }
-}
-
-
-void
-on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t * p_intf;
- es_descriptor_t * p_es;
-
- p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- if( !p_intf->p_sys->b_spu_update )
- {
- p_es = (es_descriptor_t*)user_data;
-
- input_ToggleES( p_intf->p_input, p_es, menuitem->active );
-
- p_intf->p_sys->b_spu_update = menuitem->active;
- }
-}
-
-
-void
-on_menubar_fullscreen_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- if( p_vout_bank->i_count )
- {
- vlc_mutex_lock( &p_vout_bank->pp_vout[0]->change_lock );
- if( p_vout_bank->pp_vout[0]->b_fullscreen ==
- !GTK_CHECK_MENU_ITEM( menuitem )->active )
- p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;
- vlc_mutex_unlock( &p_vout_bank->pp_vout[0]->change_lock );
- }
-}
-
-
-
-void
-on_menubar_title_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- if( menuitem->active && !p_intf->p_sys->b_title_update )
- {
- gint i_title = (gint)user_data;
- p_intf->p_input->pf_set_area( p_intf->p_input,
- p_intf->p_input->stream.pp_areas[i_title] );
-
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
-
- p_intf->p_sys->b_title_update = 1;
- }
-}
-
-
-void
-on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
- input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
- gint i_chapter = (gint)user_data;
- char psz_chapter[5];
-
- if( menuitem->active && !p_intf->p_sys->b_chapter_update )
- {
- p_area->i_part = i_chapter;
- p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
-
- snprintf( psz_chapter, 3, "%02d", p_area->i_part );
- gtk_label_set_text( p_intf->p_sys->p_label_chapter, psz_chapter );
-
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
-
- p_intf->p_sys->b_chapter_update = 1;
- }
-
-}
-
-
-void
-on_menubar_angle_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
- input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
- gint i_angle = (gint)user_data;
-
- if( menuitem->active && !p_intf->p_sys->b_angle_update )
- {
- p_area->i_angle = i_angle;
- p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
-
- p_intf->p_sys->b_angle_update = 1;
- }
-}
-
-
-void
-on_menubar_modules_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_modules ) )
- {
- p_intf->p_sys->p_modules = create_intf_modules();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_modules ),
- "p_intf", p_intf );
- }
- gtk_widget_show( p_intf->p_sys->p_modules );
- gdk_window_raise( p_intf->p_sys->p_modules->window );
-}
-
-
-void
-on_menubar_preferences_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_preferences ) )
- {
- p_intf->p_sys->p_preferences = create_intf_preferences();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_preferences ),
- "p_intf", p_intf );
-#if 1
-#define ASSIGN_PSZ_ENTRY( var, default, name ) \
- gtk_entry_set_text( GTK_ENTRY( gtk_object_get_data( GTK_OBJECT( \
- p_intf->p_sys->p_preferences ), name ) ), \
- main_GetPszVariable( var, default ) )
-
-#define ASSIGN_INT_VALUE( var, default, name ) \
- gtk_spin_button_set_value( GTK_SPIN_BUTTON( gtk_object_get_data( \
- GTK_OBJECT( p_intf->p_sys->p_preferences ), name ) ), \
- main_GetIntVariable( var, default ) )
-
-#define ASSIGN_INT_TOGGLE( var, default, name ) \
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( gtk_object_get_data( \
- GTK_OBJECT( p_intf->p_sys->p_preferences ), name ) ), \
- main_GetIntVariable( var, default ) )
-
- /* Default path */
- ASSIGN_PSZ_ENTRY( INTF_PATH_VAR, INTF_PATH_DEFAULT,
- "preferences_file_entry" );
-
- /* Default DVD */
- ASSIGN_PSZ_ENTRY( INPUT_DVD_DEVICE_VAR,INPUT_DVD_DEVICE_DEFAULT,
- "preferences_disc_dvd_entry" );
-
- /* Default VCD */
- ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR, INPUT_VCD_DEVICE_DEFAULT,
- "preferences_disc_vcd_entry" );
-
- /* Default server */
- ASSIGN_PSZ_ENTRY( INPUT_SERVER_VAR, INPUT_SERVER_DEFAULT,
- "preferences_network_server_entry" );
-
- /* Default port */
- ASSIGN_INT_VALUE( INPUT_PORT_VAR, INPUT_PORT_DEFAULT,
- "preferences_network_port_spinbutton" );
-
- /* Broadcast address */
- ASSIGN_PSZ_ENTRY( INPUT_BCAST_ADRR_VAR, INPUT_BCAST_ADDR_DEFAULT,
- "preferences_network_broadcast_entry" );
-
- /* Broadcast stream by default ? */
- ASSIGN_INT_TOGGLE( INPUT_BROADCAST_VAR, INPUT_BROADCAST_DEFAULT,
- "preferences_network_broadcast_checkbutton" );
-
- /* XXX Protocol */
-
- /* Default interface */
- ASSIGN_PSZ_ENTRY( INTF_METHOD_VAR, INTF_METHOD_DEFAULT,
- "preferences_interface_entry" );
-
- /* Default video output */
- ASSIGN_PSZ_ENTRY( VOUT_METHOD_VAR, VOUT_METHOD_DEFAULT,
- "preferences_video_output_entry" );
-
- /* Default output width */
- ASSIGN_INT_VALUE( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT,
- "preferences_video_width_spinbutton" );
-
- /* Default output height */
- ASSIGN_INT_VALUE( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT,
- "preferences_video_height_spinbutton" );
-
- /* XXX Default screen depth */
-
- /* XXX Default fullscreen depth */
-
- /* XXX Default gamma */
-
- /* Fullscreen on play */
- ASSIGN_INT_TOGGLE( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT,
- "preferences_video_fullscreen_checkbutton" );
-
- /* Grayscale display */
- ASSIGN_INT_TOGGLE( VOUT_GRAYSCALE_VAR, VOUT_GRAYSCALE_DEFAULT,
- "preferences_video_grayscale_checkbutton" );
-
- /* Default audio output */
- ASSIGN_PSZ_ENTRY( AOUT_METHOD_VAR, AOUT_METHOD_DEFAULT,
- "preferences_audio_output_entry" );
-
- /* Default audio device */
- ASSIGN_PSZ_ENTRY( AOUT_DSP_VAR, AOUT_DSP_DEFAULT,
- "preferences_audio_device_entry" );
-
- /* XXX Default frequency */
-
- /* XXX Default quality */
-
- /* XXX Default number of channels */
-
- /* Use spdif output ? */
- ASSIGN_INT_TOGGLE( AOUT_SPDIF_VAR, AOUT_SPDIF_DEFAULT,
- "preferences_audio_spdif_checkbutton" );
-
- /* Launch playlist on startup */
- ASSIGN_INT_TOGGLE( PLAYLIST_STARTUP_VAR, PLAYLIST_STARTUP_DEFAULT,
- "preferences_playlist_launch_on_startup_checkbutton" );
-
- /* Enqueue drag'n dropped item as default */
- ASSIGN_INT_TOGGLE( PLAYLIST_ENQUEUE_VAR, PLAYLIST_ENQUEUE_DEFAULT,
- "preferences_playlist_enqueue_as_default_checkbutton" );
-
- /* Loop on playlist end */
- ASSIGN_INT_TOGGLE( PLAYLIST_LOOP_VAR, PLAYLIST_LOOP_DEFAULT,
- "preferences_playlist_loop_checkbutton" );
-
- /* Verbosity of warning messages */
- ASSIGN_INT_VALUE( INTF_WARNING_VAR, INTF_WARNING_DEFAULT,
- "preferences_misc_messages_spinbutton" );
-#undef ASSIGN_PSZ_ENTRY
-#undef ASSIGN_INT_VALUE
-#undef ASSIGN_INT_TOGGLE
-#endif
- }
-
- gtk_widget_show( p_intf->p_sys->p_preferences );
- gdk_window_raise( p_intf->p_sys->p_preferences->window );
-}
-
-
-void
-on_menubar_about_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) )
- {
- p_intf->p_sys->p_about = create_intf_about();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_about ),
- "p_intf", p_intf );
- }
- gtk_widget_show( p_intf->p_sys->p_about );
- gdk_window_raise( p_intf->p_sys->p_about->window );
-}
-
-
-/*****************************************************************************
- * Toolbar callbacks
- *****************************************************************************
- * The following callbacks are related to the toolbar of the main
- * interface window.
- *****************************************************************************/
-void
-on_toolbar_open_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
- {
- p_intf->p_sys->p_fileopen = create_intf_fileopen();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
- "p_intf", p_intf );
-
- if( main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) != NULL )
- {
- gtk_file_selection_set_filename( GTK_FILE_SELECTION(
- p_intf->p_sys->p_fileopen ),
- main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) );
- }
- }
-
- gtk_widget_show( p_intf->p_sys->p_fileopen );
- gdk_window_raise( p_intf->p_sys->p_fileopen->window );
-}
-
-
-void
-on_toolbar_disc_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) )
- {
- p_intf->p_sys->p_disc = create_intf_disc();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ),
- "p_intf", p_intf );
- }
-
- gtk_widget_show( p_intf->p_sys->p_disc );
- gdk_window_raise( p_intf->p_sys->p_disc->window );
-}
-
-
-void
-on_toolbar_network_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_network ) )
- {
- p_intf->p_sys->p_network = create_intf_network();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
- "p_intf", p_intf );
- }
-
- gtk_widget_show( p_intf->p_sys->p_network );
- gdk_window_raise( p_intf->p_sys->p_network->window );
-}
-
-
-void
-on_toolbar_back_clicked (GtkButton *button,
- gpointer user_data)
-{
-
-}
-
-
-void
-on_toolbar_stop_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- if( p_intf->p_input != NULL )
- {
- p_intf->p_input->b_eof = 1;
- p_main->p_playlist->i_index--;
- }
- p_main->p_playlist->b_stopped = 1;
-}
-
-
-void
-on_toolbar_play_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- if( p_intf->p_input != NULL )
- {
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
- }
- else if( p_main->p_playlist->b_stopped )
- {
- if( p_main->p_playlist->i_size )
- {
- intf_PlaylistJumpto( p_main->p_playlist,
- p_main->p_playlist->i_index );
- p_main->p_playlist->b_stopped = 0;
- }
- else
- {
- on_toolbar_open_clicked( button, user_data );
- }
- }
-
-}
-
-
-void
-on_toolbar_pause_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- if( p_intf->p_input != NULL )
- {
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE );
- }
-}
-
-
-void
-on_toolbar_slow_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- if( p_intf->p_input != NULL )
- {
- input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER );
- }
-}
-
-
-void
-on_toolbar_fast_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- if( p_intf->p_input != NULL )
- {
- input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER );
- }
-}
-
-
-void
-on_toolbar_playlist_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
- {
- p_intf->p_sys->p_playlist = create_intf_playlist();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
- "p_intf", p_intf );
- }
-
- if( GTK_WIDGET_VISIBLE( p_intf->p_sys->p_playlist ) )
- {
- gtk_widget_hide( p_intf->p_sys->p_playlist );
- }
- else
- {
- GtkCList * p_clist;
-
- p_clist = GTK_CLIST( gtk_object_get_data(
- GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
- GnomeRebuildCList( p_clist , p_main->p_playlist );
- gtk_widget_show( p_intf->p_sys->p_playlist );
- gdk_window_raise( p_intf->p_sys->p_playlist->window );
- }
-}
-
-
-void
-on_toolbar_prev_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- if( p_intf->p_input != NULL )
- {
- /* FIXME: temporary hack */
- intf_PlaylistPrev( p_main->p_playlist );
- intf_PlaylistPrev( p_main->p_playlist );
- p_intf->p_input->b_eof = 1;
- }
-
- p_intf->p_sys->b_mode_changed = 1;
-}
-
-
-void
-on_toolbar_next_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" );
-
- if( p_intf->p_input != NULL )
- {
- /* FIXME: temporary hack */
- p_intf->p_input->b_eof = 1;
- }
-
- p_intf->p_sys->b_mode_changed = 1;
-}
-
-
-/*****************************************************************************
- * Popup callbacks
- *****************************************************************************
- * The following callbacks are related to the popup menu. The popup
- * menu is activated when right-clicking on the video output window.
- *****************************************************************************/
-void
-on_popup_play_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- if( p_intf->p_input != NULL )
- {
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
- p_main->p_playlist->b_stopped = 0;
- }
-}
-
-
-void
-on_popup_back_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
-
-}
-
-
-void
-on_popup_pause_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- if( p_intf->p_input != NULL )
- {
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE );
- }
-}
-
-
-void
-on_popup_slow_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- if( p_intf->p_input != NULL )
- {
- input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER );
- }
-}
-
-
-void
-on_popup_fast_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- if( p_intf->p_input != NULL )
- {
- input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER );
- }
-}
-
-
-void
-on_popup_fullscreen_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- if( p_vout_bank->i_count )
- {
- vlc_mutex_lock( &p_vout_bank->pp_vout[0]->change_lock );
- if( p_vout_bank->pp_vout[0]->b_fullscreen ==
- !GTK_CHECK_MENU_ITEM( menuitem )->active )
- p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;
- vlc_mutex_unlock( &p_vout_bank->pp_vout[0]->change_lock );
- }
-}
-
-
-void
-on_popup_audio_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
- es_descriptor_t * p_es;
-
- p_es = (es_descriptor_t*)user_data;
-
- if( !p_intf->p_sys->b_audio_update )
- {
- input_ToggleES( p_intf->p_input, p_es, menuitem->active );
-
- p_intf->p_sys->b_audio_update = menuitem->active;
- }
-}
-
-
-void
-on_popup_subtitle_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
- es_descriptor_t * p_es;
-
- p_es = (es_descriptor_t*)user_data;
-
- if( !p_intf->p_sys->b_spu_update )
- {
- input_ToggleES( p_intf->p_input, p_es, menuitem->active );
-
- p_intf->p_sys->b_spu_update = menuitem->active;
- }
-}
-
-
-void
-on_popup_navigation_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- if( menuitem->active &&
- !p_intf->p_sys->b_title_update &&
- !p_intf->p_sys->b_chapter_update )
- {
- input_area_t *p_area = p_intf->p_input->stream.p_selected_area;
-
- gint i_title = DATA2TITLE( user_data );
- gint i_chapter = DATA2CHAPTER( user_data );
-
- if( p_area != p_intf->p_input->stream.pp_areas[i_title] )
- {
- p_area = p_intf->p_input->stream.pp_areas[i_title];
- p_intf->p_sys->b_title_update = 1;
- }
-
- p_area->i_part = i_chapter;
- p_intf->p_sys->b_chapter_update = 1;
-
- p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
-
- input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
- }
-}
-
-
-void
-on_popup_angle_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
- input_area_t * p_area = p_intf->p_input->stream.p_selected_area;
- gint i_angle = (gint)user_data;
-
- if( menuitem->active && !p_intf->p_sys->b_angle_update )
- {
- p_area->i_angle = i_angle;
- p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
-
- p_intf->p_sys->b_angle_update = 1;
- }
-}
-
-
-void
-on_popup_open_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
- {
- p_intf->p_sys->p_fileopen = create_intf_fileopen();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
- "p_intf", p_intf );
-
- if( main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) != NULL )
- {
- gtk_file_selection_set_filename( GTK_FILE_SELECTION(
- p_intf->p_sys->p_fileopen ),
- main_GetPszVariable( INTF_PATH_VAR, INTF_PATH_DEFAULT ) );
- }
- }
-
- gtk_widget_show( p_intf->p_sys->p_fileopen );
- gdk_window_raise( p_intf->p_sys->p_fileopen->window );
-}
-
-
-void
-on_popup_disc_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- gtk_widget_show( p_intf->p_sys->p_disc );
- gdk_window_raise( p_intf->p_sys->p_disc->window );
-}
-
-
-void
-on_popup_network_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- gtk_widget_show( p_intf->p_sys->p_network );
- gdk_window_raise( p_intf->p_sys->p_network->window );
-}
-
-
-void
-on_popup_about_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) )
- {
- p_intf->p_sys->p_about = create_intf_about();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_about ),
- "p_intf", p_intf );
- }
- gtk_widget_show( p_intf->p_sys->p_about );
- gdk_window_raise( p_intf->p_sys->p_about->window );
-}
-
-
-void
-on_popup_exit_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- vlc_mutex_lock( &p_intf->change_lock );
- p_intf->b_die = 1;
- vlc_mutex_unlock( &p_intf->change_lock );
-}
-
-
-void
-on_popup_stop_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- if( p_intf->p_input != NULL )
- {
- p_intf->p_input->b_die = 1;
- }
-}
-
-
-void
-on_popup_playlist_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
-
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) )
- {
- p_intf->p_sys->p_playlist = create_intf_playlist();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
- "p_intf", p_intf );
- }
- gtk_widget_show( p_intf->p_sys->p_playlist );
- gdk_window_raise( p_intf->p_sys->p_playlist->window );
-}
-
-
-void
-on_popup_jump_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_jump ) )
- {
- p_intf->p_sys->p_jump = create_intf_jump();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_jump ),
- "p_intf", p_intf );
- }
-
- gtk_widget_show( p_intf->p_sys->p_jump );
- gdk_window_raise( p_intf->p_sys->p_jump->window );
-}
-
-
-void
-on_popup_preferences_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
-
- gtk_widget_show( p_intf->p_sys->p_preferences );
- gdk_window_raise( p_intf->p_sys->p_preferences->window );
-
-}
-
-
-/*****************************************************************************
- * Fileopen callbacks
- *****************************************************************************
- * The following callbacks are related to the file requester.
- *****************************************************************************/
-void
-on_intf_fileopen_destroy (GtkObject *object,
- gpointer user_data)
-{
- gtk_widget_hide( GTK_WIDGET( object ) );
-}
-
-
-void
-on_fileopen_ok_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_fileopen" );
- GtkCList * p_playlist_clist;
- GtkWidget * p_filesel;
- gchar * psz_filename;
- int i_end = p_main->p_playlist->i_size;
-
- p_filesel = gtk_widget_get_toplevel( GTK_WIDGET(button) );
- gtk_widget_hide( p_filesel );
- psz_filename =
- gtk_file_selection_get_filename( GTK_FILE_SELECTION( p_filesel ) );
-
- intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)psz_filename );
-
- /* catch the GTK CList */
- p_playlist_clist = GTK_CLIST( gtk_object_get_data(
- GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
- /* update the display */
- GnomeRebuildCList( p_playlist_clist, p_main->p_playlist );
-
- /* Select added item and switch to file interface */
- if( p_intf->p_input != NULL )
- {
- p_intf->p_input->b_eof = 1;
- }
-
- intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
- p_main->p_playlist->b_stopped = 0;
-}
-
-
-void
-on_fileopen_cancel_clicked (GtkButton *button,
- gpointer user_data)
-{
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
-
-
-/*****************************************************************************
- * Module manager callbacks
- *****************************************************************************
- * The following callbacks are related to the module manager.
- *****************************************************************************/
-void
-on_intf_modules_destroy (GtkObject *object,
- gpointer user_data)
-{
-
-}
-
-
-void
-on_modules_ok_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" );
-
- gtk_widget_hide( p_intf->p_sys->p_modules );
-}
-
-
-void
-on_modules_apply_clicked (GtkButton *button,
- gpointer user_data)
-{
-
-}
-
-
-void
-on_modules_cancel_clicked (GtkButton *button,
- gpointer user_data)
-{
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
-
-
-/*****************************************************************************
- * Open disc callbacks
- *****************************************************************************
- * The following callbacks are related to the disc manager.
- *****************************************************************************/
-void
-on_disc_dvd_toggled (GtkToggleButton *togglebutton,
- gpointer user_data)
-{
- if( togglebutton->active )
- {
- gtk_entry_set_text( GTK_ENTRY( lookup_widget(
- GTK_WIDGET(togglebutton), "disc_name" ) ), "/dev/dvd" );
- }
-}
-
-
-void
-on_disc_vcd_toggled (GtkToggleButton *togglebutton,
- gpointer user_data)
-{
- if( togglebutton->active )
- {
- gtk_entry_set_text( GTK_ENTRY( lookup_widget(
- GTK_WIDGET(togglebutton), "disc_name" ) ), "/dev/cdrom" );
- }
-}
-
-
-void
-on_disc_ok_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_disc" );
- GtkCList * p_playlist_clist;
- char * psz_device, *psz_source, *psz_method;
- int i_end = p_main->p_playlist->i_size;
-
- gtk_widget_hide( p_intf->p_sys->p_disc );
- psz_device = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
- GTK_WIDGET(button), "disc_name" ) ) );
-
- /* "dvd:foo" has size 5 + strlen(foo) */
- psz_source = malloc( 3 /* "dvd" */ + 1 /* ":" */
- + strlen( psz_device ) + 1 /* "\0" */ );
- if( psz_source == NULL )
- {
- return;
- }
-
- /* Check which method was activated */
- if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
- "disc_dvd" ) )->active )
- {
- psz_method = "dvd";
- p_intf->p_sys->i_intf_mode = DVD_MODE;
- }
- else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
- "disc_vcd" ) )->active )
- {
- psz_method = "vcd";
- }
- else
- {
- intf_ErrMsg( "intf error: unknown disc type toggle button position" );
- free( psz_source );
- return;
- }
-
- /* Select title and chapter */
- main_PutIntVariable( INPUT_TITLE_VAR, gtk_spin_button_get_value_as_int(
- GTK_SPIN_BUTTON( lookup_widget(
- GTK_WIDGET(button), "disc_title" ) ) ) );
-
- main_PutIntVariable( INPUT_CHAPTER_VAR, gtk_spin_button_get_value_as_int(
- GTK_SPIN_BUTTON( lookup_widget(
- GTK_WIDGET(button), "disc_chapter" ) ) ) );
-
- /* Build source name and add it to playlist */
- sprintf( psz_source, "%s:%s", psz_method, psz_device );
- intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
- free( psz_source );
-
- /* catch the GTK CList */
- p_playlist_clist = GTK_CLIST( gtk_object_get_data(
- GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
- /* update the display */
- GnomeRebuildCList( p_playlist_clist, p_main->p_playlist );
-
- /* Select added item and switch to DVD interface */
- if( p_intf->p_input != NULL )
- {
- p_intf->p_input->b_eof = 1;
- }
-
- intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
- p_main->p_playlist->b_stopped = 0;
-}
-
-
-void
-on_disc_cancel_clicked (GtkButton *button,
- gpointer user_data)
-{
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
-
-
-/*****************************************************************************
- * Network stream callbacks
- *****************************************************************************
- * The following callbacks are related to the network stream manager.
- *****************************************************************************/
-void
-on_network_ok_clicked (GtkButton *button,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET(button), "intf_network" );
- GtkCList * p_playlist_clist;
- char * psz_source, *psz_server, *psz_protocol;
- unsigned int i_port;
- boolean_t b_broadcast;
- int i_end = p_main->p_playlist->i_size;
-
- gtk_widget_hide( p_intf->p_sys->p_network );
- psz_server = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
- GTK_WIDGET(button), "network_server" ) ) );
-
- /* Check which protocol was activated */
- if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
- "network_ts" ) )->active )
- {
- psz_protocol = "ts";
- }
- else if( GTK_TOGGLE_BUTTON( lookup_widget( GTK_WIDGET(button),
- "network_rtp" ) )->active )
- {
- psz_protocol = "rtp";
- }
- else
- {
- intf_ErrMsg( "intf error: unknown protocol toggle button position" );
- return;
- }
-
- /* Get the port number and make sure it will not overflow 5 characters */
- i_port = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(
- lookup_widget( GTK_WIDGET(button), "network_port" ) ) );
- if( i_port > 65535 )
- {
- intf_ErrMsg( "intf error: invalid port %i", i_port );
- }
-
- /* do we have a broadcast address */
- b_broadcast = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(
- lookup_widget( GTK_WIDGET(button), "broadcast_check" ) ) );
- if( b_broadcast )
- {
- char * psz_broadcast;
- psz_broadcast = gtk_entry_get_text( GTK_ENTRY( lookup_widget(
- GTK_WIDGET(button), "network_broadcast" ) ) );
- /* Allocate room for "protocol://server:port" */
- psz_source = malloc( strlen( psz_protocol ) + 3 /* "://" */
- + strlen( psz_server ) + 1 /* ":" */
- + 5 /* 0-65535 */
- + strlen( psz_broadcast ) + 2 /* "::" */
- + 1 /* "\0" */ );
- if( psz_source == NULL )
- {
- return;
- }
-
- /* Build source name and add it to playlist */
- sprintf( psz_source, "%s://%s:%i::%s", psz_protocol,
- psz_server,
- i_port,
- psz_broadcast );
- }
- else
- {
- /* Allocate room for "protocol://server:port" */
- psz_source = malloc( strlen( psz_protocol ) + 3 /* "://" */
- + strlen( psz_server ) + 1 /* ":" */
- + 5 /* 0-65535 */ + 1 /* "\0" */ );
- if( psz_source == NULL )
- {
- return;
- }
-
- /* Build source name and add it to playlist */
- sprintf( psz_source, "%s://%s:%i", psz_protocol, psz_server, i_port );
- }
-
- intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, psz_source );
- free( psz_source );
-
- /* catch the GTK CList */
- p_playlist_clist = GTK_CLIST( gtk_object_get_data(
- GTK_OBJECT( p_intf->p_sys->p_playlist ), "playlist_clist" ) );
- /* update the display */
- GnomeRebuildCList( p_playlist_clist, p_main->p_playlist );
-
- /* Select added item and switch to network interface */
- if( p_intf->p_input != NULL )
- {
- p_intf->p_input->b_eof = 1;
- }
-
- intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
- p_main->p_playlist->b_stopped = 0;
-}
-
-
-void
-on_network_cancel_clicked (GtkButton *button,
- gpointer user_data)
-{
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
-
-
-void
-on_broadcast_check_toggled (GtkToggleButton *togglebutton,
- gpointer user_data)
-{
- GtkWidget * p_network;
-
- p_network = gtk_widget_get_toplevel( GTK_WIDGET (togglebutton) );
- gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
- "network_broadcast_combo" ),
- gtk_toggle_button_get_active( togglebutton ) );
- gtk_widget_set_sensitive( gtk_object_get_data( GTK_OBJECT( p_network ),
- "network_broadcast" ),
- gtk_toggle_button_get_active( togglebutton ) );
-}
-
-
-/****************************************************************************
- * Jump window
- ****************************************************************************
- * Those callback are received from the jump window that allow to select
- * an arbitrary position of the stream.
- ****************************************************************************/
-void
-on_jump_ok_clicked (GtkButton *button,
- gpointer user_data)
-{
- on_jump_apply_clicked( button, user_data );
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
-
-
-void
-on_jump_apply_clicked (GtkButton *button,
- gpointer user_data)
-{
-#if 1
- intf_thread_t * p_intf;
- off_t i_seek;
- off_t i_size;
- int i_hours;
- int i_minutes;
- int i_seconds;
-
- p_intf = GetIntf( GTK_WIDGET( button ), "intf_jump" );
-
-#define GET_VALUE( name ) \
- gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( gtk_object_get_data( \
- GTK_OBJECT( p_intf->p_sys->p_jump ), name ) ) )
-
- i_hours = GET_VALUE( "jump_hour_spinbutton" );
- i_minutes = GET_VALUE( "jump_minute_spinbutton" );
- i_seconds = GET_VALUE( "jump_second_spinbutton" );
-
-#undef GET_VALUE
-
- i_seconds += 60 *i_minutes + 3600* i_hours;
-
- vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
- i_seek = i_seconds * 50 * p_intf->p_input->stream.i_mux_rate;
- i_size = p_intf->p_input->stream.p_selected_area->i_size;
- vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
-
- if( i_seek < i_size )
- {
- input_Seek( p_intf->p_input, i_seek );
- }
- p_main->p_playlist->b_stopped = 0;
-#endif
-}
-
-
-void
-on_jump_cancel_clicked (GtkButton *button,
- gpointer user_data)
-{
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
-
-
-/****************************************************************************
- * Preferences window callbacks
- ****************************************************************************/
-void
-on_preferences_ok_clicked (GtkButton *button,
- gpointer user_data)
-{
- on_preferences_apply_clicked( button, user_data );
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
-
-
-void
-on_preferences_apply_clicked (GtkButton *button,
- gpointer user_data)
-{
-#if 1
- GtkWidget * p_preferences;
-
- /* get preferences window */
- p_preferences = gtk_widget_get_toplevel( GTK_WIDGET( button ) );
-
-#define ASSIGN_PSZ_ENTRY( var, name ) \
- main_PutPszVariable( var, gtk_entry_get_text( \
- GTK_ENTRY( gtk_object_get_data( GTK_OBJECT( p_preferences ), name ) ) ) )
-
-#define ASSIGN_INT_VALUE( var, name ) \
- main_PutIntVariable( var, gtk_spin_button_get_value_as_int( \
- GTK_SPIN_BUTTON( gtk_object_get_data( GTK_OBJECT( p_preferences ), \
- name ) ) ) )
-
-#define ASSIGN_INT_TOGGLE( var, name ) \
- main_PutIntVariable( var, gtk_toggle_button_get_active( \
- GTK_TOGGLE_BUTTON( gtk_object_get_data( GTK_OBJECT( p_preferences ), \
- name ) ) ) )
-
- /* Default path */
- ASSIGN_PSZ_ENTRY( INTF_PATH_VAR, "preferences_file_entry" );
-
- /* Default DVD */
- ASSIGN_PSZ_ENTRY( INPUT_DVD_DEVICE_VAR, "preferences_disc_dvd_entry" );
-
- /* Default VCD */
- ASSIGN_PSZ_ENTRY( INPUT_VCD_DEVICE_VAR, "preferences_disc_vcd_entry" );
-
- /* Default server */
- ASSIGN_PSZ_ENTRY( INPUT_SERVER_VAR, "preferences_network_server_entry" );
-
- /* Default port */
- ASSIGN_INT_VALUE( INPUT_PORT_VAR, "preferences_network_port_spinbutton" );
-
- /* Broadcast address */
- ASSIGN_PSZ_ENTRY( INPUT_BCAST_ADRR_VAR,
- "preferences_network_broadcast_entry" );
-
- /* Broadcast stream by default ? */
- ASSIGN_INT_TOGGLE( INPUT_BROADCAST_VAR,
- "preferences_network_broadcast_checkbutton" );
-
- /* XXX Protocol */
-
- /* Default interface */
- ASSIGN_PSZ_ENTRY( INTF_METHOD_VAR, "preferences_interface_entry" );
-
- /* Default video output */
- ASSIGN_PSZ_ENTRY( VOUT_METHOD_VAR, "preferences_video_output_entry" );
-
- /* Default output width */
- ASSIGN_INT_VALUE( VOUT_WIDTH_VAR, "preferences_video_width_spinbutton" );
-
- /* Default output height */
- ASSIGN_INT_VALUE( VOUT_HEIGHT_VAR, "preferences_video_height_spinbutton" );
-
- /* XXX Default screen depth */
-
- /* XXX Default fullscreen depth */
-
- /* XXX Default gamma */
-
- /* Fullscreen on play */
- ASSIGN_INT_TOGGLE( VOUT_FULLSCREEN_VAR,
- "preferences_video_fullscreen_checkbutton" );
-
- /* Grayscale display */
- ASSIGN_INT_TOGGLE( VOUT_GRAYSCALE_VAR,
- "preferences_video_grayscale_checkbutton" );
-
- /* Default audio output */
- ASSIGN_PSZ_ENTRY( AOUT_METHOD_VAR, "preferences_audio_output_entry" );
-
- /* Default audio device */
- ASSIGN_PSZ_ENTRY( AOUT_DSP_VAR, "preferences_audio_device_entry" );
-
- /* XXX Default frequency */
-
- /* XXX Default quality */
-
- /* XXX Default number of channels */
-
- /* Use spdif output ? */
- ASSIGN_INT_TOGGLE( AOUT_SPDIF_VAR, "preferences_audio_spdif_checkbutton" );
-
- /* Launch playlist on startup */
- ASSIGN_INT_TOGGLE( PLAYLIST_STARTUP_VAR,
- "preferences_playlist_launch_on_startup_checkbutton" );
-
- /* Enqueue drag'n dropped item as default */
- ASSIGN_INT_TOGGLE( PLAYLIST_ENQUEUE_VAR,
- "preferences_playlist_enqueue_as_default_checkbutton" );
-
- /* Loop on playlist end */
- ASSIGN_INT_TOGGLE( PLAYLIST_LOOP_VAR,
- "preferences_playlist_loop_checkbutton" );
-
- /* Verbosity of warning messages */
- ASSIGN_INT_VALUE( INTF_WARNING_VAR,
- "preferences_misc_messages_spinbutton" );
-#undef ASSIGN_PSZ_ENTRY
-#undef ASSIGN_INT_VALUE
-#undef ASSIGN_INT_TOGGLE
-#endif
-}
-
-
-void
-on_preferences_cancel_clicked (GtkButton *button,
- gpointer user_data)
-{
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
+++ /dev/null
-/*****************************************************************************
- * gnome_callbacks.h : Callbacks for the Gnome plugin.
- *****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gnome_callbacks.h,v 1.17 2001/05/15 01:01:44 stef Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include "config.h"
-#include <gnome.h>
-
-/*****************************************************************************
- * Callback prototypes
- *****************************************************************************/
-void
-on_menubar_open_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_menubar_exit_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_menubar_playlist_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_menubar_plugins_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_menubar_preferences_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_menubar_about_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_toolbar_open_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_toolbar_back_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_toolbar_stop_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_toolbar_play_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_toolbar_pause_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_toolbar_playlist_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_toolbar_prev_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_toolbar_next_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_popup_play_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_pause_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_exit_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_intf_window_destroy (GtkObject *object,
- gpointer user_data);
-
-void
-on_fileopen_ok_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_fileopen_cancel_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_intf_fileopen_destroy (GtkObject *object,
- gpointer user_data);
-
-void
-on_popup_open_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_about_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_slow_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_fast_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_toolbar_slow_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_toolbar_fast_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_intf_modules_destroy (GtkObject *object,
- gpointer user_data);
-
-void
-on_modules_ok_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_modules_apply_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_modules_cancel_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_menubar_modules_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_intf_window_drag_data_received (GtkWidget *widget,
- GdkDragContext *drag_context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- gpointer user_data);
-
-void
-on_menubar_audio_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_menubar_disc_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_toolbar_disc_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_disc_ok_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_disc_cancel_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_disc_dvd_toggled (GtkToggleButton *togglebutton,
- gpointer user_data);
-
-void
-on_disc_vcd_toggled (GtkToggleButton *togglebutton,
- gpointer user_data);
-
-void
-on_popup_disc_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_menubar_audio_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_menubar_subtitle_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_audio_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_subtitle_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_navigation_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_menubar_title_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_menubar_network_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_toolbar_network_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_network_ok_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_network_cancel_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_popup_network_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-gboolean
-on_slider_button_press_event (GtkWidget *widget,
- GdkEventButton *event,
- gpointer user_data);
-
-gboolean
-on_slider_button_release_event (GtkWidget *widget,
- GdkEventButton *event,
- gpointer user_data);
-
-void
-on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_button_chapter_prev_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_button_chapter_next_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_button_title_prev_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_button_title_next_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_menubar_angle_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_angle_toggle (GtkCheckMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_stop_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_jump_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_preferences_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_broadcast_check_toggled (GtkToggleButton *togglebutton,
- gpointer user_data);
-
-void
-on_jump_ok_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_jump_apply_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_jump_cancel_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_popup_playlist_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_preferences_ok_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_preferences_apply_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_preferences_cancel_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_menubar_fullscreen_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_popup_fullscreen_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_playlist_close_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_intf_playlist_destroy (GtkObject *object,
- gpointer user_data);
-
-void
-on_intf_playlist_destroy (GtkObject *object,
- gpointer user_data);
-
-void
-on_playlist_ok_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_playlist_disc_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_playlist_file_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_playlist_network_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_playlist_url_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_playlist_crop_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_playlist_invert_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_playlist_select_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-gboolean
-on_playlist_clist_event (GtkWidget *widget,
- GdkEvent *event,
- gpointer user_data);
-
-void
-on_playlist_clist_drag_data_received (GtkWidget *widget,
- GdkDragContext *drag_context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- gpointer user_data);
-
-gboolean
-on_playlist_clist_drag_motion (GtkWidget *widget,
- GdkDragContext *drag_context,
- gint x,
- gint y,
- guint time,
- gpointer user_data);
-
-
-
-void
-on_playlist_delete_all_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_playlist_delete_item_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_playlist_ok_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_playlist_apply_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_playlist_cancel_clicked (GtkButton *button,
- gpointer user_data);
-
-void
-on_popup_back_activate (GtkMenuItem *menuitem,
- gpointer user_data);
-
-void
-on_playlist_destroy (GtkObject *object,
- gpointer user_data);
+++ /dev/null
-/*****************************************************************************
- * gnome_playlist.c : Interface for the playlist dialog
- *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: gnome_playlist.c,v 1.3 2001/05/15 01:01:44 stef Exp $
- *
- * Authors: Pierre Baillet <oct@zoy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
-
-#define MODULE_NAME gnome
-#include "modules_inner.h"
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include "defs.h"
-
-#include <stdlib.h>
-
-#include <gtk/gtk.h>
-
-#include <string.h>
-
-#include <sys/types.h> /* for readdir and stat stuff */
-#include <dirent.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "config.h"
-#include "common.h"
-#include "threads.h"
-#include "mtime.h"
-
-#include "stream_control.h"
-#include "input_ext-intf.h"
-
-#include "interface.h"
-#include "intf_playlist.h"
-#include "intf_msg.h"
-#include "intf_urldecode.h"
-
-#include "gnome_callbacks.h"
-#include "gnome_interface.h"
-#include "gnome_support.h"
-#include "gnome_playlist.h"
-#include "intf_gnome.h"
-
-
-#include "main.h"
-
-/*****************************************************************************
- * Playlist callbacks
- *****************************************************************************
- * The following callbacks are related to the playlist.
- *****************************************************************************/
-void
-on_playlist_destroy (GtkObject *object,
- gpointer user_data)
-{
- gtk_widget_hide( GTK_WIDGET(object));
-}
-
-
-void
-on_playlist_ok_clicked (GtkButton *button,
- gpointer user_data)
-{
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
-
-
-void
-on_playlist_apply_clicked (GtkButton *button,
- gpointer user_data)
-{
-
-}
-
-
-void
-on_playlist_cancel_clicked (GtkButton *button,
- gpointer user_data)
-{
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
-
-
-void
-on_playlist_close_clicked (GtkButton *button,
- gpointer user_data)
-{
- gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) );
-}
-
-
-void
-on_playlist_disc_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_playlist" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_disc ) )
- {
- p_intf->p_sys->p_disc = create_intf_disc();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_disc ),
- "p_intf", p_intf );
- }
-
- gtk_widget_show( p_intf->p_sys->p_disc );
- gdk_window_raise( p_intf->p_sys->p_disc->window );
-
-}
-
-
-void
-on_playlist_file_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_playlist" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_fileopen ) )
- {
- p_intf->p_sys->p_fileopen = create_intf_fileopen();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ),
- "p_intf", p_intf );
- }
-
- gtk_widget_show( p_intf->p_sys->p_fileopen );
- gdk_window_raise( p_intf->p_sys->p_fileopen->window );
-}
-
-
-void
-on_playlist_network_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_playlist" );
-
- /* If we have never used the file selector, open it */
- if( !GTK_IS_WIDGET( p_intf->p_sys->p_network ) )
- {
- p_intf->p_sys->p_network = create_intf_network();
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_network ),
- "p_intf", p_intf );
- }
-
- gtk_widget_show( p_intf->p_sys->p_network );
- gdk_window_raise( p_intf->p_sys->p_network->window );
-}
-
-
-void
-on_playlist_url_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
-
-}
-
-
-void
-on_playlist_delete_all_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
-
-}
-
-
-void
-on_playlist_delete_item_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- /* user wants to delete a file in the queue */
- GList * p_selection;
- GtkCList * p_clist;
- playlist_t *p_playlist;
-
- /* catch the thread back */
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_playlist" );
-
- p_playlist = p_main->p_playlist;
-
- /* lock the struct */
- vlc_mutex_lock( &p_intf->change_lock );
-
- p_clist = GTK_CLIST( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_playlist ), "playlist_clist" ) );
-
- /* I use UNDOCUMENTED features to retrieve the selection... */
- p_selection = p_clist->selection;
-
- if( g_list_length( p_selection ) > 0 )
- {
- /* reverse-sort so that we can delete from the furthest
- * to the closest item to delete...
- */
- p_selection = g_list_sort( p_selection, GnomeCompareItems );
- g_list_foreach( p_selection, GnomeDeleteGListItem, p_intf );
- /* rebuild the CList */
- GnomeRebuildCList( p_clist, p_playlist );
- }
-
- vlc_mutex_unlock( &p_intf->change_lock );
-}
-
-
-void
-on_playlist_crop_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- /* Ok, this is a really small thing, but, hey, it works and
- might be useful, who knows ? */
- on_playlist_invert_activate( menuitem, user_data );
- on_playlist_delete_item_activate( menuitem, user_data );
-}
-
-
-void
-on_playlist_invert_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
- playlist_t *p_playlist;
- GtkCList * p_clist;
- int * pi_selected;
- int i_sel_l;
- int i_dummy;
-
- /* catch the thread back */
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_playlist" );
-
- p_playlist = p_main->p_playlist;
-
- /* lock the struct */
- vlc_mutex_lock( &p_intf->change_lock );
-
- p_clist = GTK_CLIST( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_playlist ), "playlist_clist" ) );
-
- /* have to copy the selection to an int *
- I wasn't able to copy the g_list to another g_list
- glib only does pointer copies, not real copies :( */
-
- pi_selected = malloc( sizeof(int) *g_list_length( p_clist->selection ) );
- i_sel_l = g_list_length( p_clist->selection );
-
- for( i_dummy = 0 ; i_dummy < i_sel_l ; i_dummy++)
- {
- pi_selected[i_dummy] = (int)g_list_nth_data( p_clist->selection,
- i_dummy );
- }
-
- gtk_clist_freeze( p_clist );
- gtk_clist_select_all( p_clist );
-
- for( i_dummy = 0; i_dummy < i_sel_l; i_dummy++)
- {
- gtk_clist_unselect_row( p_clist, pi_selected[i_dummy], 0 );
- gtk_clist_unselect_row( p_clist, pi_selected[i_dummy], 1 );
- }
-
- free( pi_selected );
- gtk_clist_thaw( p_clist );
-
- vlc_mutex_unlock( &p_intf->change_lock );
-}
-
-
-void
-on_playlist_select_activate (GtkMenuItem *menuitem,
- gpointer user_data)
-{
-
-}
-
-
-gboolean
-on_playlist_clist_event (GtkWidget *widget,
- GdkEvent *event,
- gpointer user_data)
-{
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET( widget ), "intf_playlist" );
-
- if( ( event->button ).type == GDK_2BUTTON_PRESS )
- {
- GtkCList * p_clist;
- gint i_row;
- gint i_col;
-
- p_clist = GTK_CLIST( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_playlist ), "playlist_clist" ) );
-
- if( gtk_clist_get_selection_info( p_clist, (event->button).x,
- (event->button).y, &i_row, &i_col ) == 1 )
- {
- /* clicked is in range. */
- if( p_intf->p_input != NULL )
- {
- /* FIXME: temporary hack */
- p_intf->p_input->b_eof = 1;
- }
- intf_PlaylistJumpto( p_main->p_playlist, i_row - 1 );
- p_main->p_playlist->b_stopped = 0;
- }
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-void
-on_playlist_clist_drag_data_received (GtkWidget *widget,
- GdkDragContext *drag_context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- gpointer user_data)
-{
- /* catch the interface back */
- intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), "intf_playlist" );
- GtkCList * p_clist;
- gint i_row;
- gint i_col;
- int i_end = p_main->p_playlist->i_size;
-
- p_clist = GTK_CLIST( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_playlist ), "playlist_clist" ) );
-
- if( gtk_clist_get_selection_info( p_clist, x, y, &i_row, &i_col ) == 1 )
- {
- /* we are dropping somewhere into the clist items */
- GnomeDropDataReceived( p_intf, data, info, i_row );
- }
- else
- {
- /* else, put that at the end of the playlist */
- GnomeDropDataReceived( p_intf, data, info, PLAYLIST_END );
- }
-
- intf_PlaylistJumpto( p_main->p_playlist, i_end - 1 );
- p_main->p_playlist->b_stopped = 0;
-
-}
-
-
-gboolean
-on_playlist_clist_drag_motion (GtkWidget *widget,
- GdkDragContext *drag_context,
- gint x,
- gint y,
- guint time,
- gpointer user_data)
-{
- GtkCList * p_clist;
- gint i_row;
- gint i_col;
- int i_dummy;
- GdkColor color;
- intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_playlist" );
-
- p_clist = GTK_CLIST( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_playlist ), "playlist_clist" ) );
-
- if( !GTK_WIDGET_TOPLEVEL(widget) )
- {
- gdk_window_raise( p_intf->p_sys->p_playlist->window );
- }
-
- color.red = 0xffff;
- color.blue = 0xffff;
- color.green = 0xffff;
-
- gtk_clist_freeze( p_clist );
-
- for( i_dummy = 0; i_dummy < p_clist->rows; i_dummy++)
- {
- gtk_clist_set_background ( p_clist, i_dummy , &color);
- }
-
- color.red = 0xffff;
- color.blue = 0;
- color.green = 0;
- gtk_clist_set_background( p_clist, p_main->p_playlist->i_index , &color );
-
- if( gtk_clist_get_selection_info( p_clist, x, y, &i_row, &i_col ) == 1)
- {
- color.red = 0;
- color.blue = 0xf000;
- color.green = 0x9000;
- gtk_clist_set_background ( p_clist, i_row - 1, &color);
- gtk_clist_set_background ( p_clist, i_row, &color);
- }
-
- gtk_clist_thaw( p_clist );
-
- return TRUE;
-}
-
-
-void GnomeDropDataReceived( intf_thread_t * p_intf,
- GtkSelectionData * p_data, guint i_info, int i_position)
-{
- /* first we'll have to split against all the '\n' we have */
- gchar * p_protocol;
- gchar * p_temp;
- gchar * p_string = p_data->data ;
- GList * p_files = NULL;
- GtkCList * p_clist;
-
-
- /* catch the playlist back */
- playlist_t * p_playlist = p_main->p_playlist;
-
-
- /* if this has been URLencoded, decode it
- *
- * Is it a good thing to do it in place ?
- * probably not...
- */
- if( i_info == DROP_ACCEPT_TEXT_URI_LIST )
- {
- urldecode_path( p_string );
- }
-
- /* this cuts string into single file drops */
- /* this code was borrowed from xmms, thx guys :) */
- while( *p_string)
- {
- p_temp = strchr( p_string, '\n' );
- if( p_temp )
- {
- if( *( p_temp - 1 ) == '\r' )
- {
- *( p_temp - 1) = '\0';
- }
- *p_temp = '\0';
- }
-
- /* do we have a protocol or something ? */
- p_protocol = strstr( p_string, ":/" );
- if( p_protocol != NULL )
- {
- p_protocol = calloc( p_protocol - p_string + 2, sizeof(char) );
- p_protocol = strncpy( p_protocol, p_string,
- strstr( p_string, ":/" ) + 1 - p_string );
-
- intf_WarnMsg( 4, "Protocol dropped is %s", p_protocol );
- p_string += strlen( p_protocol );
-
- /* Allowed things are proto: or proto:// */
- if( p_string[0] == '/' && p_string[1] == '/')
- {
- /* eat one '/' */
- p_string++;
- }
- intf_WarnMsg( 4, " Dropped %s", p_string );
- }
- else
- {
- p_protocol = strdup( "" );
- }
-
- /* if it uses the file protocol we can do something, else, sorry :(
- * I think this is a good choice for now, as we don't have any
- * ability to read http:// or ftp:// files
- * what about adding dvd:// to the list of authorized proto ? */
-
- if( strcmp( p_protocol, "file:" ) == 0 )
- {
- p_files = g_list_concat( p_files, GnomeReadFiles( p_string ) );
- }
-
- /* free the malloc and go on... */
- free( p_protocol );
- if( !p_temp )
- {
- break;
- }
- p_string = p_temp + 1;
- }
-
- /* At this point, we have a nice big list maybe NULL */
- if( p_files != NULL )
- {
- /* lock the interface */
- vlc_mutex_lock( &p_intf->change_lock );
-
- intf_WarnMsg( 4, "List has %d elements", g_list_length( p_files ) );
- GnomeAppendList( p_playlist, i_position, p_files );
-
- /* get the CList and rebuild it. */
- p_clist = GTK_CLIST( lookup_widget( p_intf->p_sys->p_playlist,
- "playlist_clist" ) );
- GnomeRebuildCList( p_clist , p_playlist );
-
- /* unlock the interface */
- vlc_mutex_unlock( &p_intf->change_lock );
-
- p_main->p_playlist->b_stopped = 0;
- }
-}
-
-
-void GnomeDeleteGListItem( gpointer data, gpointer param )
-{
- int i_cur_row = ( int )data;
- intf_thread_t * p_intf = param;
-
- intf_PlaylistDelete( p_main->p_playlist, i_cur_row );
-
- /* are we deleting the current played stream */
- if( p_intf->p_sys->i_playing == i_cur_row )
- {
- /* next ! */
- p_intf->p_input->b_eof = 1;
- /* this has to set the slider to 0 */
-
- /* step minus one */
- p_intf->p_sys->i_playing-- ;
- p_main->p_playlist->i_index-- ;
- }
-}
-
-
-gint GnomeCompareItems( gconstpointer a, gconstpointer b )
-{
- return b - a;
-}
-
-
-/* check a file (string) against supposed valid extension */
-int GnomeHasValidExtension( gchar * psz_filename )
-{
- char * ppsz_ext[6] = { "mpg", "mpeg", "vob", "mp2", "ts", "ps" };
- int i_ext = 6;
- int i_dummy;
-
- gchar * psz_ext = strrchr( psz_filename, '.' ) + sizeof( char );
-
- for( i_dummy = 0 ; i_dummy < i_ext ; i_dummy++ )
- {
- if( strcmp( psz_ext, ppsz_ext[i_dummy] ) == 0 )
- {
- return 1;
- }
- }
-
- return 0;
-}
-
-/* recursive function: descend into folders and build a list of
- * valid filenames */
-GList * GnomeReadFiles( gchar * psz_fsname )
-{
- struct stat statbuf;
- GList * p_current = NULL;
-
- /* get the attributes of this file */
- stat( psz_fsname, &statbuf );
-
- /* is it a regular file ? */
- if( S_ISREG( statbuf.st_mode ) )
- {
- if( GnomeHasValidExtension( psz_fsname ) )
- {
- intf_WarnMsg( 2, "%s is a valid file. Stacking on the playlist",
- psz_fsname );
- return g_list_append( NULL, g_strdup( psz_fsname ) );
- }
- else
- {
- return NULL;
- }
- }
- /* is it a directory (should we check for symlinks ?) */
- else if( S_ISDIR( statbuf.st_mode ) )
- {
- /* have to cd into this dir */
- DIR * p_current_dir = opendir( psz_fsname );
- struct dirent * p_dir_content;
-
- intf_WarnMsg( 2, "%s is a folder.", psz_fsname );
-
- if( p_current_dir == NULL )
- {
- /* something went bad, get out of here ! */
- return p_current;
- }
- p_dir_content = readdir( p_current_dir );
-
- /* while we still have entries in the directory */
- while( p_dir_content != NULL )
- {
- /* if it is "." or "..", forget it */
- if( ( strcmp( p_dir_content->d_name, "." ) != 0 ) &&
- ( strcmp( p_dir_content->d_name, ".." ) != 0 ) )
- {
- /* else build the new directory by adding
- fsname "/" and the current entry name
- (kludgy :()
- */
- char * psz_newfs = malloc ( 2 + strlen( psz_fsname ) +
- strlen( p_dir_content->d_name ) * sizeof(char) );
- strcpy( psz_newfs, psz_fsname );
- strcpy( psz_newfs + strlen( psz_fsname ) + 1,
- p_dir_content->d_name );
- psz_newfs[strlen( psz_fsname )] = '/';
-
- p_current = g_list_concat( p_current,
- GnomeReadFiles( psz_newfs ) );
-
- g_free( psz_newfs );
- }
- p_dir_content = readdir( p_current_dir );
- }
- return p_current;
- }
- return NULL;
-}
-
-/* add items in a playlist
- * when i_pos==-1 add to the end of the list...
- */
-int GnomeAppendList( playlist_t * p_playlist, int i_pos, GList * p_list )
-{
- guint i_dummy;
- guint i_length;
-
- i_length = g_list_length( p_list );
-
- for( i_dummy = 0; i_dummy < i_length ; i_dummy++ )
- {
- intf_PlaylistAdd( p_playlist,
- /* ok; this is a really nasty trick to insert
- the item where they are suppose to go but, hey
- this works :P (btw, you are really nasty too) */
- i_pos==PLAYLIST_END?PLAYLIST_END:( i_pos + i_dummy ),
- g_list_nth_data( p_list, i_dummy ) );
- }
- return 0;
-}
-/* statis timeouted function */
-void GnomePlayListManage( intf_thread_t * p_intf )
-{
- /* this thing really sucks for now :( */
-
- /* TODO speak more with interface/intf_playlist.c */
-
- playlist_t * p_playlist = p_main->p_playlist ;
- GtkCList * p_clist;
-
- p_clist = GTK_CLIST( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_playlist ), "playlist_clist" ) );
-
- if( p_intf->p_sys->i_playing != p_playlist->i_index )
- {
- GdkColor color;
-
- color.red = 0xffff;
- color.blue = 0;
- color.green = 0;
-
- gtk_clist_set_background( p_clist, p_playlist->i_index, &color );
-
- if( p_intf->p_sys->i_playing != -1 )
- {
- color.red = 0xffff;
- color.blue = 0xffff;
- color.green = 0xffff;
- gtk_clist_set_background( p_clist, p_intf->p_sys->i_playing,
- &color);
- }
- p_intf->p_sys->i_playing = p_playlist->i_index;
- }
-}
-
-void GnomeRebuildCList( GtkCList * p_clist, playlist_t * p_playlist )
-{
- int i_dummy;
- gchar * ppsz_text[2];
- GdkColor red;
- red.red = 65535;
- red.blue = 0;
- red.green = 0;
-
- gtk_clist_freeze( p_clist );
- gtk_clist_clear( p_clist );
-
- for( i_dummy = 0; i_dummy < p_playlist->i_size ; i_dummy++ )
- {
-#ifdef WIN32 /* WIN32 HACK */
- ppsz_text[0] = g_strdup( "" );
-#else
- ppsz_text[0] = g_strdup( rindex( (char *)(p_playlist->p_item[
- p_playlist->i_size - 1 - i_dummy].psz_name ), '/' ) + 1 );
-#endif
- ppsz_text[1] = g_strdup( "no info");
-
- gtk_clist_insert( p_clist, 0, ppsz_text );
-
- free( ppsz_text[0] );
- free( ppsz_text[1] );
- }
- gtk_clist_set_background( p_clist, p_playlist->i_index, &red);
- gtk_clist_thaw( p_clist );
-}
-
+++ /dev/null
-/*****************************************************************************
- * intf_gnome.c: Gnome interface
- *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gnome.c,v 1.39 2001/05/15 01:01:44 stef Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- * Stéphane Borel <stef@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
-
-#define MODULE_NAME gnome
-#include "modules_inner.h"
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include "defs.h"
-
-#include <errno.h> /* ENOMEM */
-#include <stdlib.h> /* free() */
-#include <string.h> /* strerror() */
-#include <stdio.h>
-
-#include <gnome.h>
-
-#include "config.h"
-#include "common.h"
-#include "threads.h"
-#include "mtime.h"
-#include "tests.h"
-#include "modules.h"
-
-#include "stream_control.h"
-#include "input_ext-intf.h"
-
-#include "intf_msg.h"
-#include "interface.h"
-#include "intf_playlist.h"
-
-#include "video.h"
-#include "video_output.h"
-
-#include "gnome_callbacks.h"
-#include "gnome_playlist.h"
-#include "gnome_interface.h"
-#include "gnome_support.h"
-#include "intf_gnome.h"
-
-#include "main.h"
-
-/*****************************************************************************
- * Local prototypes.
- *****************************************************************************/
-static int intf_Probe ( probedata_t *p_data );
-static int intf_Open ( intf_thread_t *p_intf );
-static void intf_Close ( intf_thread_t *p_intf );
-static void intf_Run ( intf_thread_t *p_intf );
-
-static gint GnomeManage ( gpointer p_data );
-static gint GnomeLanguageMenus( gpointer, GtkWidget *, es_descriptor_t *, gint,
- void (*pf_toggle)(GtkCheckMenuItem *, gpointer) );
-static gint GnomeTitleMenu ( gpointer, GtkWidget *,
- void (*pf_toggle)(GtkCheckMenuItem *, gpointer) );
-static gint GnomeSetupMenu ( intf_thread_t * p_intf );
-static void GnomeDisplayDate ( GtkAdjustment *p_adj );
-static gint GnomeModeManage ( intf_thread_t * p_intf );
-
-/*****************************************************************************
- * g_atexit: kludge to avoid the Gnome thread to segfault at exit
- *****************************************************************************
- * gtk_init() makes several calls to g_atexit() which calls atexit() to
- * register tidying callbacks to be called at program exit. Since the Gnome
- * plugin is likely to be unloaded at program exit, we have to export this
- * symbol to intercept the g_atexit() calls. Talk about crude hack.
- *****************************************************************************/
-void g_atexit( GVoidFunc func )
-{
- intf_thread_t *p_intf = p_main->p_intf;
-
- if( p_intf->p_sys->pf_gdk_callback == NULL )
- {
- p_intf->p_sys->pf_gdk_callback = func;
- }
- else if( p_intf->p_sys->pf_gtk_callback == NULL )
- {
- p_intf->p_sys->pf_gtk_callback = func;
- }
- /* else nothing, but we could do something here */
- return;
-}
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( intf_getfunctions )( function_list_t * p_function_list )
-{
- p_function_list->pf_probe = intf_Probe;
- p_function_list->functions.intf.pf_open = intf_Open;
- p_function_list->functions.intf.pf_close = intf_Close;
- p_function_list->functions.intf.pf_run = intf_Run;
-}
-
-/*****************************************************************************
- * intf_Probe: probe the interface and return a score
- *****************************************************************************
- * This function tries to initialize Gnome and returns a score to the
- * plugin manager so that it can select the best plugin.
- *****************************************************************************/
-static int intf_Probe( probedata_t *p_data )
-{
- if( TestMethod( INTF_METHOD_VAR, "gnome" ) )
- {
- return( 999 );
- }
-
- if( TestProgram( "gnome-vlc" ) )
- {
- return( 200 );
- }
-
- return( 100 );
-}
-
-/*****************************************************************************
- * intf_Open: initialize and create window
- *****************************************************************************/
-static int intf_Open( intf_thread_t *p_intf )
-{
- /* Allocate instance and initialize some members */
- p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
- if( p_intf->p_sys == NULL )
- {
- intf_ErrMsg("error: %s", strerror(ENOMEM));
- return( 1 );
- }
-
- /* Initialize Gnome thread */
- p_intf->p_sys->b_popup_changed = 0;
- p_intf->p_sys->b_window_changed = 0;
- p_intf->p_sys->b_playlist_changed = 0;
-
- p_intf->p_sys->b_slider_free = 1;
-
- p_intf->p_sys->b_mode_changed = 1;
- p_intf->p_sys->i_intf_mode = FILE_MODE;
-
- p_intf->p_sys->pf_gtk_callback = NULL;
- p_intf->p_sys->pf_gdk_callback = NULL;
-
- return( 0 );
-}
-
-/*****************************************************************************
- * intf_Close: destroy interface window
- *****************************************************************************/
-static void intf_Close( intf_thread_t *p_intf )
-{
- /* Destroy structure */
- free( p_intf->p_sys );
-}
-
-/*****************************************************************************
- * intf_Run: Gnome thread
- *****************************************************************************
- * this part of the interface is in a separate thread so that we can call
- * gtk_main() from within it without annoying the rest of the program.
- * XXX: the approach may look kludgy, and probably is, but I could not find
- * a better way to dynamically load a Gnome interface at runtime.
- *****************************************************************************/
-static void intf_Run( intf_thread_t *p_intf )
-{
- /* gnome_init needs to know the command line. We don't care, so we
- * give it an empty one */
- char *p_args[] = { "" };
- int i_args = 1;
-
- /* The data types we are allowed to receive */
- static GtkTargetEntry target_table[] =
- {
- { "text/uri-list", 0, DROP_ACCEPT_TEXT_URI_LIST },
- { "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN }
- };
-
- /* intf_Manage callback timeout */
- int i_timeout;
-
- /* Initialize Gnome */
- gnome_init( p_main->psz_arg0, VERSION, i_args, p_args );
-
- /* Create some useful widgets that will certainly be used */
- p_intf->p_sys->p_window = create_intf_window( );
- p_intf->p_sys->p_popup = create_intf_popup( );
- p_intf->p_sys->p_playlist = create_intf_playlist();
-
- /* Set the title of the main window */
- gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
- VOUT_TITLE " (Gnome interface)");
-
- /* Accept file drops on the main window */
- gtk_drag_dest_set( GTK_WIDGET( p_intf->p_sys->p_window ),
- GTK_DEST_DEFAULT_ALL, target_table,
- 1, GDK_ACTION_COPY );
- /* Accept file drops on the playlist window */
- gtk_drag_dest_set( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_playlist ), "playlist_clist") ),
- GTK_DEST_DEFAULT_ALL, target_table,
- 1, GDK_ACTION_COPY );
-
- /* Get the interface labels */
- p_intf->p_sys->p_slider_frame = gtk_object_get_data(
- GTK_OBJECT( p_intf->p_sys->p_window ), "slider_frame" );
- #define P_LABEL( name ) GTK_LABEL( gtk_object_get_data( \
- GTK_OBJECT( p_intf->p_sys->p_window ), name ) )
- p_intf->p_sys->p_label_title = P_LABEL( "label_title" );
- p_intf->p_sys->p_label_chapter = P_LABEL( "label_chapter" );
- #undef P_LABEL
-
- /* Connect the date display to the slider */
- #define P_SLIDER GTK_RANGE( gtk_object_get_data( \
- GTK_OBJECT( p_intf->p_sys->p_window ), "slider" ) )
- p_intf->p_sys->p_adj = gtk_range_get_adjustment( P_SLIDER );
-
- gtk_signal_connect ( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed",
- GTK_SIGNAL_FUNC( GnomeDisplayDate ), NULL );
- p_intf->p_sys->f_adj_oldvalue = 0;
- #undef P_SLIDER
-
- /* We don't create these ones yet because we perhaps won't need them */
- p_intf->p_sys->p_about = NULL;
- p_intf->p_sys->p_modules = NULL;
- p_intf->p_sys->p_fileopen = NULL;
- p_intf->p_sys->p_disc = NULL;
- p_intf->p_sys->p_network = NULL;
- p_intf->p_sys->p_preferences = NULL;
- p_intf->p_sys->p_jump = NULL;
-
- /* Store p_intf to keep an eye on it */
- gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
- "p_intf", p_intf );
-
- gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_popup),
- "p_intf", p_intf );
-
- gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
- "p_intf", p_intf );
-
- gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj),
- "p_intf", p_intf );
-
- /* Show the control window */
- gtk_widget_show( p_intf->p_sys->p_window );
-
- /* Sleep to avoid using all CPU - since some interfaces needs to access
- * keyboard events, a 100ms delay is a good compromise */
- i_timeout = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, GnomeManage, p_intf );
-
- /* Enter gnome mode */
- gtk_main();
-
- /* Remove the timeout */
- gtk_timeout_remove( i_timeout );
-
- /* Get rid of stored callbacks so we can unload the plugin */
- if( p_intf->p_sys->pf_gtk_callback != NULL )
- {
- p_intf->p_sys->pf_gtk_callback( );
- p_intf->p_sys->pf_gtk_callback = NULL;
-
- }
-
- if( p_intf->p_sys->pf_gdk_callback != NULL )
- {
- p_intf->p_sys->pf_gdk_callback( );
- p_intf->p_sys->pf_gdk_callback = NULL;
- }
-}
-
-/* following functions are local */
-
-/*****************************************************************************
- * GnomeManage: manage main thread messages
- *****************************************************************************
- * In this function, called approx. 10 times a second, we check what the
- * main program wanted to tell us.
- *****************************************************************************/
-static gint GnomeManage( gpointer p_data )
-{
-#define p_intf ((intf_thread_t *)p_data)
-
- vlc_mutex_lock( &p_intf->change_lock );
-
- /* If the "display popup" flag has changed */
- if( p_intf->b_menu_change )
- {
- gnome_popup_menu_do_popup( p_intf->p_sys->p_popup,
- NULL, NULL, NULL, NULL );
- p_intf->b_menu_change = 0;
- }
-
- /* update the playlist */
- GnomePlayListManage( p_intf );
-
- if( p_intf->p_input != NULL && !p_intf->b_die/*&& !p_intf->p_input->b_die*/ )
- {
- float newvalue;
-
-// vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
- /* New input or stream map change */
- if( p_intf->p_input->stream.b_changed || p_intf->p_sys->b_mode_changed )
- {
- GnomeModeManage( p_intf );
- }
-
-// vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
-
- /* Update language/chapter menus after user request */
- GnomeSetupMenu( p_intf );
-
-#define p_area p_intf->p_input->stream.p_selected_area
- /* Update menus when chapter changes */
- p_intf->p_sys->b_chapter_update =
- ( p_intf->p_sys->i_part != p_area->i_part );
-
- if( p_intf->p_input->stream.b_seekable )
- {
- /* Manage the slider */
- newvalue = p_intf->p_sys->p_adj->value;
-
- /* If the user hasn't touched the slider since the last time,
- * then the input can safely change it */
- if( newvalue == p_intf->p_sys->f_adj_oldvalue )
- {
- /* Update the value */
- p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue =
- ( 100. * p_area->i_tell ) / p_area->i_size;
-
- gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
- "value_changed" );
- }
- /* Otherwise, send message to the input if the user has
- * finished dragging the slider */
- else if( p_intf->p_sys->b_slider_free )
- {
- off_t i_seek = ( newvalue * p_area->i_size ) / 100;
-
- input_Seek( p_intf->p_input, i_seek );
-
- /* Update the old value */
- p_intf->p_sys->f_adj_oldvalue = newvalue;
- }
- }
-#undef p_area
- }
-
- /* Manage core vlc functions through the callback */
- p_intf->pf_manage( p_intf );
-
- if( p_intf->b_die )
- {
- vlc_mutex_unlock( &p_intf->change_lock );
-
- /* Prepare to die, young Skywalker */
- gtk_main_quit();
-
- /* Just in case */
- return( FALSE );
- }
-
- vlc_mutex_unlock( &p_intf->change_lock );
-
- return( TRUE );
-
-#undef p_intf
-}
-
-/*****************************************************************************
- * GnomeRadioMenu: update interactive menus of the interface
- *****************************************************************************
- * Sets up menus with information from input
- * Warning: since this function is designed to be called by management
- * function, the interface lock has to be taken
- *****************************************************************************/
-static gint GnomeRadioMenu( intf_thread_t * p_intf,
- GtkWidget * p_root, GSList * p_menu_group,
- char * psz_item_name,
- int i_nb, int i_selected,
- void( *pf_toggle )( GtkCheckMenuItem *, gpointer ) )
-{
- char psz_name[ GNOME_MENU_LABEL_SIZE ];
- GtkWidget * p_menu;
- GtkWidget * p_submenu;
- GtkWidget * p_item_group;
- GtkWidget * p_item;
- GtkWidget * p_item_selected;
- GSList * p_group;
- gint i_item;
-
- /* temporary hack to avoid blank menu when an open menu is removed */
- if( GTK_MENU_ITEM(p_root)->submenu != NULL )
- {
- gtk_menu_popdown( GTK_MENU( GTK_MENU_ITEM(p_root)->submenu ) );
- }
- /* removes previous menu */
- gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_root ) );
- gtk_widget_set_sensitive( p_root, FALSE );
-
- p_item_group = NULL;
- p_submenu = NULL;
- p_item_selected = NULL;
- p_group = p_menu_group;
-
- p_menu = gtk_menu_new();
-
- for( i_item = 0 ; i_item < i_nb ; i_item++ )
- {
- /* we group chapters in packets of ten for small screens */
- if( ( i_item % 10 == 0 ) && ( i_nb > 20 ) )
- {
- if( i_item != 0 )
- {
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_item_group ),
- p_submenu );
- gtk_menu_append( GTK_MENU( p_menu ), p_item_group );
- }
-
- snprintf( psz_name, GNOME_MENU_LABEL_SIZE,
- "%ss %d to %d", psz_item_name, i_item + 1, i_item + 10);
- psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0';
- p_item_group = gtk_menu_item_new_with_label( psz_name );
- gtk_widget_show( p_item_group );
- p_submenu = gtk_menu_new();
- }
-
- snprintf( psz_name, GNOME_MENU_LABEL_SIZE, "%s %d",
- psz_item_name, i_item + 1 );
- psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0';
-
- p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
- p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
-
- if( i_selected == i_item + 1 )
- {
- p_item_selected = p_item;
- }
-
- gtk_widget_show( p_item );
-
- /* setup signal hanling */
- gtk_signal_connect( GTK_OBJECT( p_item ),
- "toggled",
- GTK_SIGNAL_FUNC( pf_toggle ),
- (gpointer)(i_item + 1) );
-
- if( i_nb > 20 )
- {
- gtk_menu_append( GTK_MENU( p_submenu ), p_item );
- }
- else
- {
- gtk_menu_append( GTK_MENU( p_menu ), p_item );
- }
- }
-
- if( i_nb > 20 )
- {
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_item_group ), p_submenu );
- gtk_menu_append( GTK_MENU( p_menu ), p_item_group );
- }
-
- /* link the new menu to the title menu item */
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_root ), p_menu );
-
- /* toggle currently selected chapter */
- if( p_item_selected != NULL )
- {
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_selected ),
- TRUE );
- }
-
- /* be sure that menu is sensitive, if there are several items */
- if( i_nb > 0 )
- {
- gtk_widget_set_sensitive( p_root, TRUE );
- }
-
- return TRUE;
-}
-
-/*****************************************************************************
- * GnomeLanguageMenus: update interactive menus of the interface
- *****************************************************************************
- * Sets up menus with information from input:
- * -languages
- * -sub-pictures
- * Warning: since this function is designed to be called by management
- * function, the interface lock has to be taken
- *****************************************************************************/
-static gint GnomeLanguageMenus( gpointer p_data,
- GtkWidget * p_root,
- es_descriptor_t * p_es,
- gint i_cat,
- void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
-{
- intf_thread_t * p_intf;
- GtkWidget * p_menu;
- GtkWidget * p_separator;
- GtkWidget * p_item;
- GtkWidget * p_item_active;
- GSList * p_group;
- char psz_name[ GNOME_MENU_LABEL_SIZE ];
- gint i_item;
- gint i;
-
-
-
- /* cast */
- p_intf = (intf_thread_t *)p_data;
-
- /* temporary hack to avoid blank menu when an open menu is removed */
- if( GTK_MENU_ITEM(p_root)->submenu != NULL )
- {
- gtk_menu_popdown( GTK_MENU( GTK_MENU_ITEM(p_root)->submenu ) );
- }
- /* removes previous menu */
- gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_root ) );
- gtk_widget_set_sensitive( p_root, FALSE );
-
- p_group = NULL;
-
- /* menu container */
- p_menu = gtk_menu_new();
-
- /* special case for "off" item */
- snprintf( psz_name, GNOME_MENU_LABEL_SIZE, "None" );
- psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0';
-
- p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
- p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
-
- gtk_widget_show( p_item );
-
- /* signal hanling for off */
- gtk_signal_connect( GTK_OBJECT( p_item ), "toggled",
- GTK_SIGNAL_FUNC ( pf_toggle ), NULL );
-
- gtk_menu_append( GTK_MENU( p_menu ), p_item );
-
- p_separator = gtk_menu_item_new();
- gtk_widget_set_sensitive( p_separator, FALSE );
- gtk_widget_show( p_separator );
- gtk_menu_append( GTK_MENU( p_menu ), p_separator );
-
- vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
- p_item_active = NULL;
- i_item = 0;
-
- /* create a set of language buttons and append them to the container */
- for( i = 0 ; i < p_intf->p_input->stream.i_es_number ; i++ )
- {
- if( p_intf->p_input->stream.pp_es[i]->i_cat == i_cat )
- {
- i_item++;
- strcpy( psz_name, p_intf->p_input->stream.pp_es[i]->psz_desc );
- if( psz_name[0] == '\0' )
- {
- snprintf( psz_name, GNOME_MENU_LABEL_SIZE,
- "Language %d", i_item );
- psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0';
- }
-
- p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
- p_group =
- gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
-
- if( p_es == p_intf->p_input->stream.pp_es[i] )
- {
- /* don't lose p_item when we append into menu */
- p_item_active = p_item;
- }
-
- gtk_widget_show( p_item );
-
- /* setup signal hanling */
- gtk_signal_connect( GTK_OBJECT( p_item ), "toggled",
- GTK_SIGNAL_FUNC( pf_toggle ),
- (gpointer)( p_intf->p_input->stream.pp_es[i] ) );
-
- gtk_menu_append( GTK_MENU( p_menu ), p_item );
- }
- }
-
- vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
-
- /* link the new menu to the menubar item */
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_root ), p_menu );
-
- /* acitvation will call signals so we can only do it
- * when submenu is attached to menu - to get intf_window */
- if( p_item_active != NULL )
- {
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_active ),
- TRUE );
- }
-
- /* be sure that menu is sensitive if non empty */
- if( i_item > 0 )
- {
- gtk_widget_set_sensitive( p_root, TRUE );
- }
-
- return TRUE;
-}
-#if 1
-/*****************************************************************************
- * GnomeTitleMenu: sets menus for titles and chapters selection
- *****************************************************************************
- * Generates two types of menus:
- * -simple list of titles
- * -cascaded lists of chapters for each title
- *****************************************************************************/
-static gint GnomeTitleMenu( gpointer p_data,
- GtkWidget * p_navigation,
- void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
-{
- intf_thread_t * p_intf;
- char psz_name[ GNOME_MENU_LABEL_SIZE ];
- GtkWidget * p_title_menu;
- GtkWidget * p_title_submenu;
- GtkWidget * p_title_item;
- GtkWidget * p_item_active;
- GtkWidget * p_chapter_menu;
- GtkWidget * p_chapter_submenu;
- GtkWidget * p_title_menu_item;
- GtkWidget * p_chapter_menu_item;
- GtkWidget * p_item;
- GSList * p_title_group;
- GSList * p_chapter_group;
- gint i_title;
- gint i_chapter;
- gint i_title_nb;
- gint i_chapter_nb;
-
- /* cast */
- p_intf = (intf_thread_t*)p_data;
-
- /* temporary hack to avoid blank menu when an open menu is removed */
- if( GTK_MENU_ITEM(p_navigation)->submenu != NULL )
- {
- gtk_menu_popdown( GTK_MENU( GTK_MENU_ITEM(p_navigation)->submenu ) );
- }
- /* removes previous menu */
- gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_navigation ) );
- gtk_widget_set_sensitive( p_navigation, FALSE );
-
- p_title_menu = gtk_menu_new();
- p_title_group = NULL;
- p_title_submenu = NULL;
- p_title_menu_item = NULL;
- p_chapter_group = NULL;
- p_chapter_submenu = NULL;
- p_chapter_menu_item = NULL;
- p_item_active = NULL;
- i_title_nb = p_intf->p_input->stream.i_area_nb;
-
- /* loop on titles */
- for( i_title = 1 ; i_title < i_title_nb ; i_title++ )
- {
- /* we group titles in packets of ten for small screens */
- if( ( i_title % 10 == 1 ) && ( i_title_nb > 20 ) )
- {
- if( i_title != 1 )
- {
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_menu_item ),
- p_title_submenu );
- gtk_menu_append( GTK_MENU( p_title_menu ), p_title_menu_item );
- }
-
- snprintf( psz_name, GNOME_MENU_LABEL_SIZE,
- "%d - %d", i_title, i_title + 9 );
- psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0';
- p_title_menu_item = gtk_menu_item_new_with_label( psz_name );
- gtk_widget_show( p_title_menu_item );
- p_title_submenu = gtk_menu_new();
- }
-
- snprintf( psz_name, GNOME_MENU_LABEL_SIZE, "Title %d (%d)", i_title,
- p_intf->p_input->stream.pp_areas[i_title]->i_part_nb );
- psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0';
-#if 0
- if( pf_toggle == on_menubar_title_toggle )
- {
- p_title_item = gtk_radio_menu_item_new_with_label( p_title_group,
- psz_name );
- p_title_group =
- gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_title_item ) );
-
- if( p_intf->p_input->stream.pp_areas[i_title] ==
- p_intf->p_input->stream.p_selected_area )
- {
- p_item_active = p_title_item;
- }
-
- /* setup signal hanling */
- gtk_signal_connect( GTK_OBJECT( p_title_item ),
- "toggled",
- GTK_SIGNAL_FUNC( pf_toggle ),
- (gpointer)(p_intf->p_input->stream.pp_areas[i_title]) );
-
- if( p_intf->p_input->stream.i_area_nb > 1 )
- {
- /* be sure that menu is sensitive */
- gtk_widget_set_sensitive( p_navigation, TRUE );
- }
- }
- else
-#endif
- {
- p_title_item = gtk_menu_item_new_with_label( psz_name );
-
-#if 1
- p_chapter_menu = gtk_menu_new();
- i_chapter_nb =
- p_intf->p_input->stream.pp_areas[i_title]->i_part_nb;
-
- for( i_chapter = 0 ; i_chapter < i_chapter_nb ; i_chapter++ )
- {
- /* we group chapters in packets of ten for small screens */
- if( ( i_chapter % 10 == 0 ) && ( i_chapter_nb > 20 ) )
- {
- if( i_chapter != 0 )
- {
- gtk_menu_item_set_submenu(
- GTK_MENU_ITEM( p_chapter_menu_item ),
- p_chapter_submenu );
- gtk_menu_append( GTK_MENU( p_chapter_menu ),
- p_chapter_menu_item );
- }
-
- snprintf( psz_name, GNOME_MENU_LABEL_SIZE,
- "%d - %d", i_chapter + 1, i_chapter + 10 );
- psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0';
- p_chapter_menu_item =
- gtk_menu_item_new_with_label( psz_name );
- gtk_widget_show( p_chapter_menu_item );
- p_chapter_submenu = gtk_menu_new();
- }
-
- snprintf( psz_name, GNOME_MENU_LABEL_SIZE,
- "Chapter %d", i_chapter + 1 );
- psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0';
-
- p_item = gtk_radio_menu_item_new_with_label(
- p_chapter_group, psz_name );
- p_chapter_group = gtk_radio_menu_item_group(
- GTK_RADIO_MENU_ITEM( p_item ) );
- gtk_widget_show( p_item );
-
-#define p_area p_intf->p_input->stream.pp_areas[i_title]
- if( ( p_area == p_intf->p_input->stream.p_selected_area ) &&
- ( p_area->i_part == i_chapter + 1 ) )
- {
- p_item_active = p_item;
- }
-#undef p_area
-
- /* setup signal hanling */
- gtk_signal_connect( GTK_OBJECT( p_item ),
- "toggled",
- GTK_SIGNAL_FUNC( pf_toggle ),
- (gpointer)POS2DATA( i_title, i_chapter + 1) );
-
- if( i_chapter_nb > 20 )
- {
- gtk_menu_append( GTK_MENU( p_chapter_submenu ), p_item );
- }
- else
- {
- gtk_menu_append( GTK_MENU( p_chapter_menu ), p_item );
- }
- }
-
- if( i_chapter_nb > 20 )
- {
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_chapter_menu_item ),
- p_chapter_submenu );
- gtk_menu_append( GTK_MENU( p_chapter_menu ),
- p_chapter_menu_item );
- }
-
- /* link the new menu to the title menu item */
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_item ),
- p_chapter_menu );
-
- if( p_intf->p_input->stream.pp_areas[i_title]->i_part_nb > 1 )
- {
- /* be sure that menu is sensitive */
- gtk_widget_set_sensitive( p_navigation, TRUE );
- }
-#else
- GnomeRadioMenu( p_intf, p_title_item, p_chapter_group, "Chapter",
- p_intf->p_input->stream.pp_areas[i_title]->i_part_nb,
- i_title * 100,
- p_intf->p_input->stream.p_selected_area->i_part +
- p_intf->p_input->stream.p_selected_area->i_id *100,
- pf_toggle );
-
-#endif
- }
- gtk_widget_show( p_title_item );
-
- if( i_title_nb > 20 )
- {
- gtk_menu_append( GTK_MENU( p_title_submenu ), p_title_item );
- }
- else
- {
- gtk_menu_append( GTK_MENU( p_title_menu ), p_title_item );
- }
- }
-
- if( i_title_nb > 20 )
- {
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_title_menu_item ),
- p_title_submenu );
- gtk_menu_append( GTK_MENU( p_title_menu ), p_title_menu_item );
- }
-
- /* be sure that menu is sensitive */
- gtk_widget_set_sensitive( p_title_menu, TRUE );
-
- /* link the new menu to the menubar item */
- gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_navigation ), p_title_menu );
-
- if( p_item_active != NULL )
- {
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_item_active ),
- TRUE );
- }
-#if 0
- if( p_intf->p_input->stream.i_area_nb > 1 )
- {
- /* be sure that menu is sensitive */
- gtk_widget_set_sensitive( p_navigation, TRUE );
- }
-#endif
-
- return TRUE;
-}
-#endif
-/*****************************************************************************
- * GnomeSetupMenu: function that generates title/chapter/audio/subpic
- * menus with help from preceding functions
- *****************************************************************************/
-static gint GnomeSetupMenu( intf_thread_t * p_intf )
-{
- es_descriptor_t * p_audio_es;
- es_descriptor_t * p_spu_es;
- GtkWidget * p_menubar_menu;
- GtkWidget * p_popup_menu;
- gint i;
-
- p_intf->p_sys->b_chapter_update |= p_intf->p_sys->b_title_update;
- p_intf->p_sys->b_angle_update |= p_intf->p_sys->b_title_update;
- p_intf->p_sys->b_audio_update |= p_intf->p_sys->b_title_update;
- p_intf->p_sys->b_spu_update |= p_intf->p_sys->b_title_update;
-
- if( p_intf->p_sys->b_title_update )
- {
- char psz_title[5];
-
- p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "menubar_title" ) );
- GnomeRadioMenu( p_intf, p_menubar_menu, NULL, "Title",
- p_intf->p_input->stream.i_area_nb - 1,
- p_intf->p_input->stream.p_selected_area->i_id,
- on_menubar_title_toggle );
-
- snprintf( psz_title, 4, "%d",
- p_intf->p_input->stream.p_selected_area->i_id );
- psz_title[ 4 ] = '\0';
- gtk_label_set_text( p_intf->p_sys->p_label_title, psz_title );
-
- p_intf->p_sys->b_title_update = 0;
- }
-
- if( p_intf->p_sys->b_chapter_update )
- {
- char psz_chapter[5];
-
- p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_popup ), "popup_navigation" ) );
- GnomeTitleMenu( p_intf, p_popup_menu, on_popup_navigation_toggle );
-#if 0
- GnomeRadioMenu( p_intf, p_menubar_menu, NULL, "Title",
- p_intf->p_input->stream.i_area_nb - 1,
- p_intf->p_input->stream.p_selected_area->i_id,
- on_menubar_chapter_toggle );
-#endif
-
- p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "menubar_chapter" ) );
- GnomeRadioMenu( p_intf, p_menubar_menu, NULL, "Chapter",
- p_intf->p_input->stream.p_selected_area->i_part_nb,
- p_intf->p_input->stream.p_selected_area->i_part,
- on_menubar_chapter_toggle );
-
-
- snprintf( psz_chapter, 4, "%d",
- p_intf->p_input->stream.p_selected_area->i_part );
- psz_chapter[ 4 ] = '\0';
- gtk_label_set_text( p_intf->p_sys->p_label_chapter, psz_chapter );
-
- p_intf->p_sys->i_part =
- p_intf->p_input->stream.p_selected_area->i_part;
-
- p_intf->p_sys->b_chapter_update = 0;
- }
-
- if( p_intf->p_sys->b_angle_update )
- {
- p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "menubar_angle" ) );
- GnomeRadioMenu( p_intf, p_menubar_menu, NULL, "Angle",
- p_intf->p_input->stream.p_selected_area->i_angle_nb,
- p_intf->p_input->stream.p_selected_area->i_angle,
- on_menubar_angle_toggle );
-
- p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_popup ), "popup_angle" ) );
- GnomeRadioMenu( p_intf, p_popup_menu, NULL, "Angle",
- p_intf->p_input->stream.p_selected_area->i_angle_nb,
- p_intf->p_input->stream.p_selected_area->i_angle,
- on_popup_angle_toggle );
-
- p_intf->p_sys->b_angle_update = 0;
- }
-
- /* look for selected ES */
- p_audio_es = NULL;
- p_spu_es = NULL;
-
- for( i = 0 ; i < p_intf->p_input->stream.i_selected_es_number ; i++ )
- {
- if( p_intf->p_input->stream.pp_selected_es[i]->i_cat == AUDIO_ES )
- {
- p_audio_es = p_intf->p_input->stream.pp_selected_es[i];
- }
-
- if( p_intf->p_input->stream.pp_selected_es[i]->i_cat == SPU_ES )
- {
- p_spu_es = p_intf->p_input->stream.pp_selected_es[i];
- }
- }
-
- /* audio menus */
- if( p_intf->p_sys->b_audio_update )
- {
- /* find audio root menu */
- p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "menubar_audio" ) );
-
- p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_popup ), "popup_audio" ) );
-
- GnomeLanguageMenus( p_intf, p_menubar_menu, p_audio_es, AUDIO_ES,
- on_menubar_audio_toggle );
- GnomeLanguageMenus( p_intf, p_popup_menu, p_audio_es, AUDIO_ES,
- on_popup_audio_toggle );
-
- p_intf->p_sys->b_audio_update = 0;
- }
-
- /* sub picture menus */
- if( p_intf->p_sys->b_spu_update )
- {
- /* find spu root menu */
- p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "menubar_subtitle" ) );
-
- p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_popup ), "popup_subtitle" ) );
-
- GnomeLanguageMenus( p_intf, p_menubar_menu, p_spu_es, SPU_ES,
- on_menubar_subtitle_toggle );
- GnomeLanguageMenus( p_intf, p_popup_menu, p_spu_es, SPU_ES,
- on_popup_subtitle_toggle );
-
- p_intf->p_sys->b_spu_update = 0;
- }
-
- /* handle fullscreen check items */
- if( p_vout_bank->i_count )
- {
- p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "menubar_fullscreen" ) );
-
- p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_popup ), "popup_fullscreen" ) );
-
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_menubar_menu ),
- p_vout_bank->pp_vout[0]->b_fullscreen );
- gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( p_popup_menu ),
- p_vout_bank->pp_vout[0]->b_fullscreen );
-
- }
-
- return TRUE;
-}
-
-/*****************************************************************************
- * GnomeDisplayDate: display stream date
- *****************************************************************************
- * This function displays the current date related to the position in
- * the stream. It is called whenever the slider changes its value.
- *****************************************************************************/
-void GnomeDisplayDate( GtkAdjustment *p_adj )
-{
- intf_thread_t *p_intf;
-
- p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" );
-
- if( p_intf->p_input != NULL )
- {
-#define p_area p_intf->p_input->stream.p_selected_area
- char psz_time[ OFFSETTOTIME_MAX_SIZE ];
-
- vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
-
- gtk_frame_set_label( GTK_FRAME( p_intf->p_sys->p_slider_frame ),
- input_OffsetToTime( p_intf->p_input, psz_time,
- ( p_area->i_size * p_adj->value ) / 100 ) );
-
- vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
-#undef p_area
- }
-}
-
-
-/*****************************************************************************
- * GnomeModeManage
- *****************************************************************************/
-static gint GnomeModeManage( intf_thread_t * p_intf )
-{
- GtkWidget * p_dvd_box;
- GtkWidget * p_file_box;
- GtkWidget * p_network_box;
- GtkWidget * p_slider;
- GtkWidget * p_label;
- boolean_t b_control;
-
-#define GETWIDGET( ptr, name ) GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( \
- p_intf->p_sys->ptr ) , ( name ) ) )
- /* hide all boxes */
- p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "file_box" ) );
- gtk_widget_hide( GTK_WIDGET( p_file_box ) );
-
- p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "network_box" ) );
- gtk_widget_hide( GTK_WIDGET( p_network_box ) );
-
- p_dvd_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "dvd_box" ) );
- gtk_widget_hide( GTK_WIDGET( p_dvd_box ) );
-
- /* show the box related to current input mode */
- switch( p_intf->p_input->stream.i_method & 0xf0 )
- {
- case INPUT_METHOD_FILE:
- gtk_widget_show( GTK_WIDGET( p_file_box ) );
- p_label = gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ),
- "label_status" );
- gtk_label_set_text( GTK_LABEL( p_label ),
- p_intf->p_input->p_source );
- break;
- case INPUT_METHOD_DISC:
- gtk_widget_show( GTK_WIDGET( p_dvd_box ) );
- break;
- case INPUT_METHOD_NETWORK:
- gtk_widget_show( GTK_WIDGET( p_network_box ) );
- p_label = gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ),
- "network_address_label" );
- gtk_label_set_text( GTK_LABEL( p_label ),
- p_intf->p_input->p_source );
- break;
- default:
- intf_ErrMsg( "intf error: can't determine input method" );
- break;
- }
-
- p_slider = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "slider_handlebox" ) );
-
- /* slider for seekable streams */
- if( p_intf->p_input->stream.b_seekable )
- {
- gtk_widget_show( GTK_WIDGET( p_slider ) );
- }
- else
- {
- gtk_widget_hide( GTK_WIDGET( p_slider ) );
- }
-
- /* control buttons for free pace streams */
- b_control = p_intf->p_input->stream.b_pace_control;
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_stop"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_play"), TRUE );
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_pause"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_slow"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_fast"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_back"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_stop"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_play"), TRUE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_pause"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_slow"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_fast"), b_control );
-
- /* get ready for menu regeneration */
- p_intf->p_sys->b_title_update = 1;
- p_intf->p_sys->b_chapter_update = 1;
- p_intf->p_sys->b_angle_update = 1;
- p_intf->p_sys->b_audio_update = 1;
- p_intf->p_sys->b_spu_update = 1;
- p_intf->p_sys->i_part = 0;
-
- p_intf->p_input->stream.b_changed = 0;
- p_intf->p_sys->b_mode_changed = 0;
- intf_WarnMsg( 3,
- "intf info: menus refreshed as stream has changed" );
-
-#undef GETWIDGET
- return TRUE;
-}
+++ /dev/null
-/*****************************************************************************
- * intf_gnome.h: private Gnome interface description
- *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gnome.h,v 1.11 2001/05/10 06:47:31 sam Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Drag'n'drop stuff
- *****************************************************************************/
-#define DROP_ACCEPT_TEXT_URI_LIST 0
-#define DROP_ACCEPT_TEXT_PLAIN 1
-
-/*****************************************************************************
- * Interface modes
- *****************************************************************************/
-#define FILE_MODE 0
-#define NET_MODE 1
-#define DVD_MODE 2
-#define VCD_MODE 3
-
-/*****************************************************************************
- * String sizes
- *****************************************************************************/
-#define GNOME_MENU_LABEL_SIZE 64
-
-/*****************************************************************************
- * Convert user_data structures to title and chapter information
- *****************************************************************************/
-#define DATA2TITLE( user_data ) ( (gint)(user_data) >> 16 )
-#define DATA2CHAPTER( user_data ) ( (gint)(user_data) & 0xffff )
-#define POS2DATA( title, chapter ) ( ((title) << 16) | ((chapter) & 0xffff) )
-
-/*****************************************************************************
- * Inline function to retrieve the interface structure
- *****************************************************************************/
-static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent )
-{
- return( gtk_object_get_data( GTK_OBJECT( lookup_widget(item, psz_parent) ),
- "p_intf" ) );
-}
-
-/*****************************************************************************
- * intf_sys_t: description and status of Gnome interface
- *****************************************************************************/
-typedef struct intf_sys_s
-{
- /* special actions */
- boolean_t b_popup_changed; /* display menu ? */
- boolean_t b_window_changed; /* window display toggled ? */
- boolean_t b_playlist_changed; /* playlist display toggled ? */
- boolean_t b_slider_free; /* slider status */
- boolean_t b_title_update; /* do we need to update title menus */
- boolean_t b_chapter_update; /* do we need to update
- chapter menus */
- boolean_t b_angle_update; /* do we need to update angle menus */
- boolean_t b_audio_update; /* do we need to update audio menus */
- boolean_t b_spu_update; /* do we need to update spu menus */
-
- /* Windows and widgets */
- GtkWidget * p_window; /* main window */
- GtkWidget * p_popup; /* popup menu */
- GtkWidget * p_playlist; /* playlist */
- GtkWidget * p_modules; /* module manager */
- GtkWidget * p_about; /* about window */
- GtkWidget * p_fileopen; /* file open window */
- GtkWidget * p_disc; /* disc selection window */
- GtkWidget * p_network; /* network stream window */
- GtkWidget * p_preferences; /* preferences window */
- GtkWidget * p_jump; /* jump window */
-
- /* The slider */
- GtkFrame * p_slider_frame;
- GtkAdjustment * p_adj; /* slider adjustment object */
- float f_adj_oldvalue; /* previous value */
-
- /* The window labels */
- GtkLabel * p_label_title;
- GtkLabel * p_label_chapter;
-
- /* Playlist management */
- int i_list_timeout;
- int i_playing; /* playlist selected item */
-
- /* input mode management */
- boolean_t b_mode_changed;
- gint i_intf_mode; /* interface mode: file, net, disc */
-
- gint i_part; /* current chapter */
-
- /* XXX: Ugly kludge, see intf_gnome.c */
- void ( *pf_gtk_callback ) ( void );
- void ( *pf_gdk_callback ) ( void );
-
-} intf_sys_t;
-
###############################################################################
-# vlc (VideoLAN Client) gtk module Makefile
+# vlc (VideoLAN Client) gtk/gnome module Makefile
# (c)2001 VideoLAN
###############################################################################
# Objects
#
-PLUGIN_C = gtk.o intf_gtk.o gtk_callbacks.o gtk_interface.o gtk_support.o gtk_open.o gtk_control.o gtk_menu.o gtk_playlist.o gtk_modules.o gtk_preferences.o
-BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
+PLUGIN_GTK = gtk.o intf_gtk.o gtk_interface.o gtk_support.o
+PLUGIN_GNOME = gnome.o intf_gnome.o gnome_interface.o gnome_support.o gnome_callbacks.o
+PLUGIN_GTKCOMMON = gtk_display.o gtk_callbacks.o gtk_open.o gtk_control.o gtk_menu.o gtk_playlist.o gtk_modules.o gtk_preferences.o
-ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
+BUILTIN_GTK = $(PLUGIN_GTK:%.o=BUILTIN_GTK_%.o) \
+ $(PLUGIN_GTKCOMMON:%.o=BUILTIN_GTK_%.o)
+BUILTIN_GNOME = $(PLUGIN_GNOME:%.o=BUILTIN_GNOME_%.o) \
+ $(PLUGIN_GTKCOMMON:%.o=BUILTIN_GNOME_%.o)
-#
-# Special plugin modifications
-#
-
-CFLAGS += $(CFLAGS_GTK)
+ALL_OBJ = $(PLUGIN_GTK) $(PLUGIN_GNOME) $(PLUGIN_GTKCOMMON) \
+ $(BUILTIN_GTK) $(BUILTIN_GNOME)
#
# Virtual targets
include ../../Makefile.modules
+$(PLUGIN_GTKCOMMON): %.o: .dep/%.d
+$(PLUGIN_GTKCOMMON): %.o: %.c
+ $(CC) $(CFLAGS) $(PCFLAGS) $(CFLAGS_GTK) -c -o $@ $<
+
+$(PLUGIN_GTK): %.o: .dep/%.d
+$(PLUGIN_GTK): %.o: %.c
+ $(CC) $(CFLAGS) $(PCFLAGS) $(CFLAGS_GTK) -DMODULE_NAME=gtk -c -o $@ $<
+
+$(PLUGIN_GNOME): %.o: .dep/%.d
+$(PLUGIN_GNOME): %.o: %.c
+ $(CC) $(CFLAGS) $(PCFLAGS) -DMODULE_NAME=gnome `gnome-config --cflags gtk gnomeui` -c -o $@ $<
+
+$(BUILTIN_GTK): BUILTIN_GTK_%.o: .dep/%.d
+$(BUILTIN_GTK): BUILTIN_GTK_%.o: %.c
+ $(CC) $(CFLAGS) $(CFLAGS_GTK) -DBUILTIN -DMODULE_NAME=gtk -c -o $@ $<
+
+$(BUILTIN_GNOME): BUILTIN_GNOME_%.o: .dep/%.d
+$(BUILTIN_GNOME): BUILTIN_GNOME_%.o: %.c
+ $(CC) $(CFLAGS) -DBUILTIN -DMODULE_NAME=gnome `gnome-config --cflags gtk gnomeui` -c -o $@ $<
+
+
#
# Real targets
#
-../../lib/gtk.so: $(PLUGIN_C)
+../../lib/gtk.so: $(PLUGIN_GTK) $(PLUGIN_GTKCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_GTK)
-../../lib/gtk.a: $(BUILTIN_C)
+../../lib/gtk.a: $(BUILTIN_GTK)
ar r $@ $^
$(RANLIB) $@
+
+../../lib/gnome.so: $(PLUGIN_GNOME) $(PLUGIN_GTKCOMMON)
+ $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_GNOME)
+
+../../lib/gnome.a: $(BUILTIN_GNOME)
+ ar r $@ $^
+ $(RANLIB) $@
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: gnome.c,v 1.7 2001/04/28 03:36:25 sam Exp $
+ * $Id: gnome.c,v 1.1 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <gnome.h>
+
+#include "gnome_callbacks.h"
+#include "gnome_interface.h"
+#include "gnome_support.h"
+
+/*
+ * These wrappers are made necessary by a bug in glade that seems not
+ * to put user_data in c source of menuitems.
+ */
+
+void
+GnomeMenubarFileOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkFileOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
+}
+
+
+void
+GnomeMenubarDiscOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkDiscOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
+}
+
+
+void
+GnomeMenbarNetworkOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkNetworkOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
+}
+
+
+void
+GnomeMenubarExitActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkExit( GTK_WIDGET( menuitem ), NULL, "intf_window" );
+}
+
+
+void
+GnomeMenubarWindowToggleActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkWindowToggle( GTK_WIDGET( menuitem ), NULL, "intf_window" );
+}
+
+
+void
+GnomeMenubarFullscreenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkFullscreen( GTK_WIDGET( menuitem ), NULL, "intf_window" );
+}
+
+
+void
+GnomeMenubarPlaylistActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkPlaylistShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
+}
+
+
+void
+GnomeMenubarModulesActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkModulesShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
+}
+
+
+void
+GnomeMenubarPreferencesActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkPreferencesShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
+}
+
+
+void
+GnomeMenubarAboutActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkAboutShow( GTK_WIDGET( menuitem ), NULL, "intf_window" );
+}
+
+
+void
+GnomePopupPlayActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkControlPlay( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupPauseActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkControlPause( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupStopActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkControlStop( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupBackActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkControlBack( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupSlowActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkControlSlow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupFastActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkControlFast( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupWindowToggleActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkWindowToggle( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupFullscreenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkFullscreen( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupNextActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkPlaylistNext( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupPrevActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkPlaylistPrev( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupFileOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkFileOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupDiscOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkDiscOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupNetworkOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkNetworkOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupAboutActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkAboutShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupPlaylistActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkPlaylistShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupPreferencesActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkPreferencesShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePopupExitActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkExit( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
+
+
+void
+GnomePlaylistDiscOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkDiscOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_playlist" );
+}
+
+
+void
+GnomePlaylistFileOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkFileOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_playlist" );
+}
+
+
+void
+GnomePlaylistNetworkOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkNetworkOpenShow( GTK_WIDGET( menuitem ), NULL, "intf_playlist" );
+}
+
+
+void
+GnomePopupJumpActivate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ GtkJumpShow( GTK_WIDGET( menuitem ), NULL, "intf_popup" );
+}
--- /dev/null
+#include <gnome.h>
+
+#include "gtk_callbacks.h"
+
+void
+GnomeMenubarFileOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomeMenubarDiscOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomeMenbarNetworkOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomeMenubarExitActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomeMenubarWindowToggleActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomeMenubarFullscreenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomeMenubarPlaylistActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomeMenubarModulesActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomeMenubarPreferencesActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomeMenubarAboutActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupPlayActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupPauseActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupStopActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupBackActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupSlowActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupFastActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupWindowToggleActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupFullscreenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupNextActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupPrevActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupFileOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupDiscOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupNetworkOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupAboutActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupPlaylistActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupPreferencesActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupExitActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePlaylistDiscOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePlaylistFileOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePlaylistNetworkOpenActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+GnomePopupJumpActivate (GtkMenuItem *menuitem,
+ gpointer user_data);
{
GNOME_APP_UI_ITEM, N_("_Open File..."),
N_("Open a File"),
- (gpointer) on_menubar_open_activate, NULL, NULL,
+ (gpointer) GnomeMenubarFileOpenActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Open _Disc..."),
N_("Open a DVD or VCD"),
- (gpointer) on_menubar_disc_activate, NULL, NULL,
+ (gpointer) GnomeMenubarDiscOpenActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("_Network Stream..."),
N_("Select a Network Stream"),
- (gpointer) on_menubar_network_activate, NULL, NULL,
+ (gpointer) GnomeMenbarNetworkOpenActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REFRESH,
0, (GdkModifierType) 0, NULL
},
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_MENU_EXIT_ITEM (on_menubar_exit_activate, NULL),
+ GNOMEUIINFO_MENU_EXIT_ITEM (GnomeMenubarExitActivate, NULL),
GNOMEUIINFO_END
};
static GnomeUIInfo menubar_view_menu_uiinfo[] =
{
{
- GNOME_APP_UI_TOGGLEITEM, N_("_Fullscreen"),
+ GNOME_APP_UI_ITEM, N_("_Hide interface"),
NULL,
- (gpointer) on_menubar_fullscreen_activate, NULL, NULL,
+ (gpointer) GnomeMenubarWindowToggleActivate, NULL, NULL,
+ GNOME_APP_PIXMAP_NONE, NULL,
+ 0, (GdkModifierType) 0, NULL
+ },
+ {
+ GNOME_APP_UI_ITEM, N_("_Fullscreen"),
+ NULL,
+ (gpointer) GnomeMenubarFullscreenActivate, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("_Playlist..."),
N_("Open the playlist window"),
- (gpointer) on_menubar_playlist_activate, NULL, NULL,
+ (gpointer) GnomeMenubarPlaylistActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("_Modules..."),
N_("Open the plugin manager"),
- (gpointer) on_menubar_modules_activate, NULL, NULL,
+ (gpointer) GnomeMenubarModulesActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ATTACH,
0, (GdkModifierType) 0, NULL
},
0, (GdkModifierType) 0, NULL
},
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_menubar_preferences_activate, NULL),
+ GNOMEUIINFO_MENU_PREFERENCES_ITEM (GnomeMenubarPreferencesActivate, NULL),
GNOMEUIINFO_END
};
static GnomeUIInfo menubar_help_menu_uiinfo[] =
{
- GNOMEUIINFO_MENU_ABOUT_ITEM (on_menubar_about_activate, NULL),
+ GNOMEUIINFO_MENU_ABOUT_ITEM (GnomeMenubarAboutActivate, NULL),
GNOMEUIINFO_END
};
GtkWidget *toolbar_prev;
GtkWidget *toolbar_next;
GtkWidget *vbox8;
- GtkWidget *slider_handlebox;
GtkWidget *slider_frame;
GtkWidget *slider;
GtkWidget *file_box;
GtkWidget *label21;
GtkWidget *title_chapter_box;
GtkWidget *label19;
- GtkWidget *label_title;
+ GtkWidget *title_label;
GtkWidget *button_title_prev;
GtkWidget *button_title_next;
GtkWidget *vseparator1;
GtkWidget *dvd_chapter_box;
GtkWidget *label20;
- GtkWidget *label_chapter;
+ GtkWidget *chapter_label;
GtkWidget *button_chapter_prev;
GtkWidget *button_chapter_next;
GtkWidget *network_box;
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (menubar_view_menu_uiinfo[0].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_fullscreen",
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_hide_interface",
menubar_view_menu_uiinfo[0].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (menubar_view_menu_uiinfo[1].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator9",
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_fullscreen",
menubar_view_menu_uiinfo[1].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (menubar_view_menu_uiinfo[2].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_title",
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator9",
menubar_view_menu_uiinfo[2].widget,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_set_sensitive (menubar_view_menu_uiinfo[2].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[3].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_chapter",
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_title",
menubar_view_menu_uiinfo[3].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[3].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[4].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_angle",
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_chapter",
menubar_view_menu_uiinfo[4].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_view_menu_uiinfo[4].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[5].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator7",
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_angle",
menubar_view_menu_uiinfo[5].widget,
(GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_set_sensitive (menubar_view_menu_uiinfo[5].widget, FALSE);
gtk_widget_ref (menubar_view_menu_uiinfo[6].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist",
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator7",
menubar_view_menu_uiinfo[6].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (menubar_view_menu_uiinfo[7].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules",
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist",
menubar_view_menu_uiinfo[7].widget,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_set_sensitive (menubar_view_menu_uiinfo[7].widget, FALSE);
+
+ gtk_widget_ref (menubar_view_menu_uiinfo[8].widget);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules",
+ menubar_view_menu_uiinfo[8].widget,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_set_sensitive (menubar_view_menu_uiinfo[8].widget, FALSE);
gtk_widget_ref (menubar_uiinfo[2].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings",
gtk_widget_set_sensitive (menubar_settings_menu_uiinfo[0].widget, FALSE);
gtk_widget_ref (menubar_settings_menu_uiinfo[1].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_subtitle",
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_subpictures",
menubar_settings_menu_uiinfo[1].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (menubar_settings_menu_uiinfo[1].widget, FALSE);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_play", toolbar_play,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_play);
- gtk_widget_set_sensitive (toolbar_play, FALSE);
tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_BOTTOM);
toolbar_pause = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
gtk_widget_show (vbox8);
gnome_app_set_contents (GNOME_APP (intf_window), vbox8);
- slider_handlebox = gtk_handle_box_new ();
- gtk_widget_ref (slider_handlebox);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "slider_handlebox", slider_handlebox,
- (GtkDestroyNotify) gtk_widget_unref);
- gtk_box_pack_start (GTK_BOX (vbox8), slider_handlebox, TRUE, TRUE, 0);
-
slider_frame = gtk_frame_new (_("-:--:--"));
gtk_widget_ref (slider_frame);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "slider_frame", slider_frame,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (slider_frame);
- gtk_container_add (GTK_CONTAINER (slider_handlebox), slider_frame);
+ gtk_box_pack_start (GTK_BOX (vbox8), slider_frame, TRUE, TRUE, 0);
gtk_frame_set_label_align (GTK_FRAME (slider_frame), 0.05, 0.5);
slider = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 6.25, 0)));
gtk_widget_show (label19);
gtk_box_pack_start (GTK_BOX (title_chapter_box), label19, FALSE, FALSE, 0);
- label_title = gtk_label_new (_("--"));
- gtk_widget_ref (label_title);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_title", label_title,
+ title_label = gtk_label_new (_("--"));
+ gtk_widget_ref (title_label);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "title_label", title_label,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (label_title);
- gtk_box_pack_start (GTK_BOX (title_chapter_box), label_title, FALSE, FALSE, 0);
+ gtk_widget_show (title_label);
+ gtk_box_pack_start (GTK_BOX (title_chapter_box), title_label, FALSE, FALSE, 0);
button_title_prev = gnome_stock_button (GNOME_STOCK_BUTTON_PREV);
gtk_widget_ref (button_title_prev);
gtk_widget_show (button_title_prev);
gtk_box_pack_start (GTK_BOX (title_chapter_box), button_title_prev, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, button_title_prev, _("Select previous title"), NULL);
- gtk_button_set_relief (GTK_BUTTON (button_title_prev), GTK_RELIEF_NONE);
button_title_next = gnome_stock_button (GNOME_STOCK_BUTTON_NEXT);
gtk_widget_ref (button_title_next);
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (button_title_next);
gtk_box_pack_start (GTK_BOX (title_chapter_box), button_title_next, FALSE, FALSE, 0);
- gtk_button_set_relief (GTK_BUTTON (button_title_next), GTK_RELIEF_NONE);
vseparator1 = gtk_vseparator_new ();
gtk_widget_ref (vseparator1);
gtk_widget_show (label20);
gtk_box_pack_start (GTK_BOX (dvd_chapter_box), label20, FALSE, FALSE, 0);
- label_chapter = gtk_label_new (_("---"));
- gtk_widget_ref (label_chapter);
- gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_chapter", label_chapter,
+ chapter_label = gtk_label_new (_("---"));
+ gtk_widget_ref (chapter_label);
+ gtk_object_set_data_full (GTK_OBJECT (intf_window), "chapter_label", chapter_label,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (label_chapter);
- gtk_box_pack_start (GTK_BOX (dvd_chapter_box), label_chapter, FALSE, FALSE, 0);
+ gtk_widget_show (chapter_label);
+ gtk_box_pack_start (GTK_BOX (dvd_chapter_box), chapter_label, FALSE, FALSE, 0);
button_chapter_prev = gnome_stock_button (GNOME_STOCK_BUTTON_PREV);
gtk_widget_ref (button_chapter_prev);
gtk_widget_show (button_chapter_prev);
gtk_box_pack_start (GTK_BOX (dvd_chapter_box), button_chapter_prev, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, button_chapter_prev, _("Select previous chapter"), NULL);
- gtk_button_set_relief (GTK_BUTTON (button_chapter_prev), GTK_RELIEF_NONE);
button_chapter_next = gnome_stock_button (GNOME_STOCK_BUTTON_NEXT);
gtk_widget_ref (button_chapter_next);
gtk_widget_show (button_chapter_next);
gtk_box_pack_start (GTK_BOX (dvd_chapter_box), button_chapter_next, FALSE, FALSE, 0);
gtk_tooltips_set_tip (tooltips, button_chapter_next, _("Select next chapter"), NULL);
- gtk_button_set_relief (GTK_BUTTON (button_chapter_next), GTK_RELIEF_NONE);
network_box = gtk_hbox_new (TRUE, 0);
gtk_widget_ref (network_box);
gnome_app_set_statusbar (GNOME_APP (intf_window), appbar);
gtk_widget_set_usize (appbar, 500, -2);
- gtk_signal_connect (GTK_OBJECT (intf_window), "destroy",
- GTK_SIGNAL_FUNC (on_intf_window_destroy),
- NULL);
+ gtk_signal_connect (GTK_OBJECT (intf_window), "delete_event",
+ GTK_SIGNAL_FUNC (GtkWindowDelete),
+ "intf_window");
gtk_signal_connect (GTK_OBJECT (intf_window), "drag_data_received",
- GTK_SIGNAL_FUNC (on_intf_window_drag_data_received),
- NULL);
+ GTK_SIGNAL_FUNC (GtkWindowDrag),
+ "intf_window");
gnome_app_install_menu_hints (GNOME_APP (intf_window), menubar_uiinfo);
- gtk_signal_connect (GTK_OBJECT (toolbar_file), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_open_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_disc), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_disc_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_network), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_network_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_back), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_back_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_stop), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_stop_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_play), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_play_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_pause), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_pause_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_slow), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_slow_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_fast), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_fast_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_playlist), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_playlist_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_prev), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_prev_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (toolbar_next), "clicked",
- GTK_SIGNAL_FUNC (on_toolbar_next_clicked),
- NULL);
+ gtk_signal_connect (GTK_OBJECT (toolbar_file), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkFileOpenShow),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_disc), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkDiscOpenShow),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_network), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkNetworkOpenShow),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_back), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkControlBack),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_stop), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkControlStop),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_play), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkControlPlay),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_pause), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkControlPause),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_slow), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkControlSlow),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_fast), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkControlFast),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_playlist), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkPlaylistShow),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_prev), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkPlaylistPrev),
+ "intf_window");
+ gtk_signal_connect (GTK_OBJECT (toolbar_next), "button_press_event",
+ GTK_SIGNAL_FUNC (GtkPlaylistNext),
+ "intf_window");
gtk_signal_connect (GTK_OBJECT (slider), "button_press_event",
- GTK_SIGNAL_FUNC (on_slider_button_press_event),
- NULL);
+ GTK_SIGNAL_FUNC (GtkSliderPress),
+ "intf_window");
gtk_signal_connect (GTK_OBJECT (slider), "button_release_event",
- GTK_SIGNAL_FUNC (on_slider_button_release_event),
- NULL);
+ GTK_SIGNAL_FUNC (GtkSliderRelease),
+ "intf_window");
gtk_signal_connect (GTK_OBJECT (button_title_prev), "clicked",
- GTK_SIGNAL_FUNC (on_button_title_prev_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkTitlePrev),
+ "intf_window");
gtk_signal_connect (GTK_OBJECT (button_title_next), "clicked",
- GTK_SIGNAL_FUNC (on_button_title_next_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkTitleNext),
+ "intf_window");
gtk_signal_connect (GTK_OBJECT (button_chapter_prev), "clicked",
- GTK_SIGNAL_FUNC (on_button_chapter_prev_clicked),
+ GTK_SIGNAL_FUNC (GtkChapterPrev),
NULL);
gtk_signal_connect (GTK_OBJECT (button_chapter_next), "clicked",
- GTK_SIGNAL_FUNC (on_button_chapter_next_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkChapterNext),
+ "intf_window");
gtk_object_set_data (GTK_OBJECT (intf_window), "tooltips", tooltips);
{
GNOME_APP_UI_ITEM, N_("_Open File..."),
N_("Open a File"),
- (gpointer) on_popup_open_activate, NULL, NULL,
+ (gpointer) GnomePopupFileOpenActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Open _Disc..."),
N_("Open a DVD or VCD"),
- (gpointer) on_popup_disc_activate, NULL, NULL,
+ (gpointer) GnomePopupDiscOpenActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("_Network Stream..."),
N_("Select a Network Stream"),
- (gpointer) on_popup_network_activate, NULL, NULL,
+ (gpointer) GnomePopupNetworkOpenActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REFRESH,
0, (GdkModifierType) 0, NULL
},
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_MENU_ABOUT_ITEM (on_popup_about_activate, NULL),
+ GNOMEUIINFO_MENU_ABOUT_ITEM (GnomePopupAboutActivate, NULL),
GNOMEUIINFO_END
};
{
GNOME_APP_UI_ITEM, N_("Play"),
NULL,
- (gpointer) on_popup_play_activate, NULL, NULL,
+ (gpointer) GnomePopupPlayActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_FORWARD,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Pause"),
NULL,
- (gpointer) on_popup_pause_activate, NULL, NULL,
+ (gpointer) GnomePopupPauseActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_BOTTOM,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Stop"),
NULL,
- (gpointer) on_popup_stop_activate, NULL, NULL,
+ (gpointer) GnomePopupStopActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_STOP,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Back"),
NULL,
- (gpointer) on_popup_back_activate, NULL, NULL,
+ (gpointer) GnomePopupBackActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_BACK,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Slow"),
NULL,
- (gpointer) on_popup_slow_activate, NULL, NULL,
+ (gpointer) GnomePopupSlowActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_TIMER_STOP,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Fast"),
NULL,
- (gpointer) on_popup_fast_activate, NULL, NULL,
+ (gpointer) GnomePopupFastActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_TIMER,
0, (GdkModifierType) 0, NULL
},
GNOMEUIINFO_SEPARATOR,
{
- GNOME_APP_UI_TOGGLEITEM, N_("_Fullscreen"),
+ GNOME_APP_UI_ITEM, N_("Toggle _Interface"),
+ NULL,
+ (gpointer) GnomePopupWindowToggleActivate, NULL, NULL,
+ GNOME_APP_PIXMAP_NONE, NULL,
+ 0, (GdkModifierType) 0, NULL
+ },
+ {
+ GNOME_APP_UI_ITEM, N_("_Fullscreen"),
N_("Toggle fullscreen mode"),
- (gpointer) on_popup_fullscreen_activate, NULL, NULL,
+ (gpointer) GnomePopupFullscreenActivate, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
GNOMEUIINFO_SEPARATOR,
+ {
+ GNOME_APP_UI_ITEM, N_("Next"),
+ NULL,
+ (gpointer) GnomePopupNextActivate, NULL, NULL,
+ GNOME_APP_PIXMAP_NONE, NULL,
+ 0, (GdkModifierType) 0, NULL
+ },
+ {
+ GNOME_APP_UI_ITEM, N_("Prev"),
+ NULL,
+ (gpointer) GnomePopupPrevActivate, NULL, NULL,
+ GNOME_APP_PIXMAP_NONE, NULL,
+ 0, (GdkModifierType) 0, NULL
+ },
{
GNOME_APP_UI_ITEM, N_("_Jump..."),
N_("Got directly so specified point"),
- (gpointer) on_popup_jump_activate, NULL, NULL,
+ (gpointer) GnomePopupJumpActivate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_JUMP_TO,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Playlist..."),
NULL,
- (gpointer) on_popup_playlist_activate, NULL, NULL,
+ (gpointer) GnomePopupPlaylistActivate, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
- GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_popup_preferences_activate, NULL),
+ GNOMEUIINFO_MENU_PREFERENCES_ITEM (GnomePopupPreferencesActivate, NULL),
GNOMEUIINFO_SEPARATOR,
- GNOMEUIINFO_MENU_EXIT_ITEM (on_popup_exit_activate, NULL),
+ GNOMEUIINFO_MENU_EXIT_ITEM (GnomePopupExitActivate, NULL),
GNOMEUIINFO_END
};
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (intf_popup_uiinfo[7].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_fullscreen",
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_interface_toggle",
intf_popup_uiinfo[7].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (intf_popup_uiinfo[8].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator8",
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_fullscreen",
intf_popup_uiinfo[8].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (intf_popup_uiinfo[9].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_jump",
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator8",
intf_popup_uiinfo[9].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (intf_popup_uiinfo[10].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_navigation",
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_next",
intf_popup_uiinfo[10].widget,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_set_sensitive (intf_popup_uiinfo[10].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[11].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_angle",
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_prev",
intf_popup_uiinfo[11].widget,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_set_sensitive (intf_popup_uiinfo[11].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[12].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio",
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_jump",
intf_popup_uiinfo[12].widget,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_set_sensitive (intf_popup_uiinfo[12].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[13].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_subtitle",
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_navigation",
intf_popup_uiinfo[13].widget,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_set_sensitive (intf_popup_uiinfo[13].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[14].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator13",
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_angle",
intf_popup_uiinfo[14].widget,
(GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_set_sensitive (intf_popup_uiinfo[14].widget, FALSE);
gtk_widget_ref (intf_popup_uiinfo[15].widget);
- gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_file",
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio",
intf_popup_uiinfo[15].widget,
(GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_set_sensitive (intf_popup_uiinfo[15].widget, FALSE);
+
+ gtk_widget_ref (intf_popup_uiinfo[16].widget);
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_subpictures",
+ intf_popup_uiinfo[16].widget,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_set_sensitive (intf_popup_uiinfo[16].widget, FALSE);
+
+ gtk_widget_ref (intf_popup_uiinfo[17].widget);
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator13",
+ intf_popup_uiinfo[17].widget,
+ (GtkDestroyNotify) gtk_widget_unref);
+
+ gtk_widget_ref (intf_popup_uiinfo[18].widget);
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_file",
+ intf_popup_uiinfo[18].widget,
+ (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_ref (popup_file_menu_uiinfo[0].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_open",
popup_file_menu_uiinfo[4].widget,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_ref (intf_popup_uiinfo[16].widget);
+ gtk_widget_ref (intf_popup_uiinfo[19].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_playlist",
- intf_popup_uiinfo[16].widget,
+ intf_popup_uiinfo[19].widget,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_ref (intf_popup_uiinfo[17].widget);
+ gtk_widget_ref (intf_popup_uiinfo[20].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_preferences",
- intf_popup_uiinfo[17].widget,
+ intf_popup_uiinfo[20].widget,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_ref (intf_popup_uiinfo[18].widget);
+ gtk_widget_ref (intf_popup_uiinfo[21].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator2",
- intf_popup_uiinfo[18].widget,
+ intf_popup_uiinfo[21].widget,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_ref (intf_popup_uiinfo[19].widget);
+ gtk_widget_ref (intf_popup_uiinfo[22].widget);
gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_exit",
- intf_popup_uiinfo[19].widget,
+ intf_popup_uiinfo[22].widget,
(GtkDestroyNotify) gtk_widget_unref);
return intf_popup;
gtk_widget_show (fileopen_cancel);
GTK_WIDGET_SET_FLAGS (fileopen_cancel, GTK_CAN_DEFAULT);
- gtk_signal_connect (GTK_OBJECT (intf_fileopen), "destroy",
- GTK_SIGNAL_FUNC (on_intf_fileopen_destroy),
- NULL);
gtk_signal_connect (GTK_OBJECT (fileopen_ok), "clicked",
- GTK_SIGNAL_FUNC (on_fileopen_ok_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkFileOpenOk),
+ "intf_fileopen");
gtk_signal_connect (GTK_OBJECT (fileopen_cancel), "clicked",
- GTK_SIGNAL_FUNC (on_fileopen_cancel_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkFileOpenCancel),
+ "intf_fileopen");
return intf_fileopen;
}
gtk_widget_show (modules_cancel);
GTK_WIDGET_SET_FLAGS (modules_cancel, GTK_CAN_DEFAULT);
- gtk_signal_connect (GTK_OBJECT (intf_modules), "destroy",
- GTK_SIGNAL_FUNC (on_intf_modules_destroy),
- NULL);
- gtk_signal_connect (GTK_OBJECT (modules_ok), "clicked",
- GTK_SIGNAL_FUNC (on_modules_ok_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (modules_apply), "clicked",
- GTK_SIGNAL_FUNC (on_modules_apply_clicked),
- NULL);
- gtk_signal_connect (GTK_OBJECT (modules_cancel), "clicked",
- GTK_SIGNAL_FUNC (on_modules_cancel_clicked),
- NULL);
-
return intf_modules;
}
GTK_WIDGET_SET_FLAGS (disc_cancel, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (disc_dvd), "toggled",
- GTK_SIGNAL_FUNC (on_disc_dvd_toggled),
- NULL);
+ GTK_SIGNAL_FUNC (GtkDiscOpenDvd),
+ "intf_disc");
gtk_signal_connect (GTK_OBJECT (disc_vcd), "toggled",
- GTK_SIGNAL_FUNC (on_disc_vcd_toggled),
- NULL);
+ GTK_SIGNAL_FUNC (GtkDiscOpenVcd),
+ "intf_disc");
gtk_signal_connect (GTK_OBJECT (disc_ok), "clicked",
- GTK_SIGNAL_FUNC (on_disc_ok_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkDiscOpenOk),
+ "intf_disc");
gtk_signal_connect (GTK_OBJECT (disc_cancel), "clicked",
- GTK_SIGNAL_FUNC (on_disc_cancel_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkDiscOpenCancel),
+ "intf_disc");
return intf_disc;
}
GTK_WIDGET_SET_FLAGS (network_cancel, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (broadcast_check), "toggled",
- GTK_SIGNAL_FUNC (on_broadcast_check_toggled),
+ GTK_SIGNAL_FUNC (GtkNetworkOpenBroadcast),
NULL);
gtk_signal_connect (GTK_OBJECT (network_ok), "clicked",
- GTK_SIGNAL_FUNC (on_network_ok_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkNetworkOpenOk),
+ "intf_network");
gtk_signal_connect (GTK_OBJECT (network_cancel), "clicked",
- GTK_SIGNAL_FUNC (on_network_cancel_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkNetworkOpenCancel),
+ "intf_network");
gtk_object_set_data (GTK_OBJECT (intf_network), "tooltips", tooltips);
{
GNOME_APP_UI_ITEM, N_("Disc"),
NULL,
- (gpointer) on_playlist_disc_activate, NULL, NULL,
+ (gpointer) GnomePlaylistDiscOpenActivate, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("File"),
NULL,
- (gpointer) on_playlist_file_activate, NULL, NULL,
+ (gpointer) GnomePlaylistFileOpenActivate, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Network"),
NULL,
- (gpointer) on_playlist_network_activate, NULL, NULL,
+ (gpointer) GnomePlaylistNetworkOpenActivate, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Url"),
NULL,
- (gpointer) on_playlist_url_activate, NULL, NULL,
+ (gpointer) GtkPlaylistAddUrl, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("All"),
NULL,
- (gpointer) on_playlist_delete_all_activate, NULL, NULL,
+ (gpointer) GtkPlaylistDeleteAll, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Item"),
NULL,
- (gpointer) on_playlist_delete_item_activate, NULL, NULL,
+ (gpointer) GtkPlaylistDeleteSelected, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Crop"),
NULL,
- (gpointer) on_playlist_crop_activate, NULL, NULL,
+ (gpointer) GtkPlaylistCrop, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Invert"),
NULL,
- (gpointer) on_playlist_invert_activate, NULL, NULL,
+ (gpointer) GtkPlaylistInvert, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
{
GNOME_APP_UI_ITEM, N_("Select"),
NULL,
- (gpointer) on_playlist_select_activate, NULL, NULL,
+ (gpointer) GtkPlaylistSelect, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, (GdkModifierType) 0, NULL
},
GTK_WIDGET_SET_FLAGS (playlist_cancel, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (intf_playlist), "destroy",
- GTK_SIGNAL_FUNC (on_playlist_destroy),
- NULL);
+ GTK_SIGNAL_FUNC (gtk_widget_hide),
+ "intf_playlist");
+ gtk_signal_connect (GTK_OBJECT (intf_playlist), "delete_event",
+ GTK_SIGNAL_FUNC (gtk_widget_hide),
+ "intf_playlist");
gtk_signal_connect (GTK_OBJECT (playlist_clist), "event",
- GTK_SIGNAL_FUNC (on_playlist_clist_event),
- NULL);
+ GTK_SIGNAL_FUNC (GtkPlaylistEvent),
+ "intf_playlist");
gtk_signal_connect (GTK_OBJECT (playlist_clist), "drag_data_received",
- GTK_SIGNAL_FUNC (on_playlist_clist_drag_data_received),
- NULL);
+ GTK_SIGNAL_FUNC (GtkPlaylistDragData),
+ "intf_playlist");
gtk_signal_connect (GTK_OBJECT (playlist_clist), "drag_motion",
- GTK_SIGNAL_FUNC (on_playlist_clist_drag_motion),
- NULL);
+ GTK_SIGNAL_FUNC (GtkPlaylistDragMotion),
+ "intf_playlist");
gtk_signal_connect (GTK_OBJECT (playlist_ok), "clicked",
- GTK_SIGNAL_FUNC (on_playlist_ok_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkPlaylistOk),
+ "intf_playlist");
gtk_signal_connect (GTK_OBJECT (playlist_cancel), "clicked",
- GTK_SIGNAL_FUNC (on_playlist_cancel_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkPlaylistCancel),
+ "intf_playlist");
return intf_playlist;
}
GTK_WIDGET_SET_FLAGS (jump_cancel, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (jump_ok), "clicked",
- GTK_SIGNAL_FUNC (on_jump_ok_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkJumpOk),
+ "intf_jump");
gtk_signal_connect (GTK_OBJECT (jump_cancel), "clicked",
- GTK_SIGNAL_FUNC (on_jump_cancel_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkJumpCancel),
+ "intf_jump");
return intf_jump;
}
GtkWidget *preferences_notebook;
GtkWidget *preferences_file_table;
GtkWidget *preferences_file_combo;
- GtkWidget *preferences_file_entry;
+ GtkWidget *preferences_file_path_entry;
GtkWidget *preferences_file_path_label;
GtkWidget *preferences_file;
GtkWidget *preferences_disc_table;
GtkWidget *preferences_audio_device_entry;
GtkWidget *preferences_audio;
GtkWidget *preference_playlist_table;
- GtkWidget *preferences_playlist_launch_on_startup_checkbutton;
+ GtkWidget *preferences_playlist_startup_checkbutton;
GtkWidget *preferences_playlist_loop_checkbutton;
- GtkWidget *preferences_playlist_enqueue_as_default_checkbutton;
+ GtkWidget *preferences_playlist_enqueue_checkbutton;
GtkWidget *preferences_playlist;
GtkWidget *preferences_misc_table;
GtkWidget *preferences_misc_associated_files_frame;
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
(GtkAttachOptions) (GTK_EXPAND), 0, 0);
- preferences_file_entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (preferences_file_combo));
- gtk_widget_ref (preferences_file_entry);
- gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_file_entry", preferences_file_entry,
+ preferences_file_path_entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (preferences_file_combo));
+ gtk_widget_ref (preferences_file_path_entry);
+ gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_file_path_entry", preferences_file_path_entry,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (preferences_file_entry);
+ gtk_widget_show (preferences_file_path_entry);
preferences_file_path_label = gtk_label_new (_("Default path: "));
gtk_widget_ref (preferences_file_path_label);
gtk_table_set_row_spacings (GTK_TABLE (preference_playlist_table), 5);
gtk_table_set_col_spacings (GTK_TABLE (preference_playlist_table), 5);
- preferences_playlist_launch_on_startup_checkbutton = gtk_check_button_new_with_label (_("Launch on startup"));
- gtk_widget_ref (preferences_playlist_launch_on_startup_checkbutton);
- gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_playlist_launch_on_startup_checkbutton", preferences_playlist_launch_on_startup_checkbutton,
+ preferences_playlist_startup_checkbutton = gtk_check_button_new_with_label (_("Launch on startup"));
+ gtk_widget_ref (preferences_playlist_startup_checkbutton);
+ gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_playlist_startup_checkbutton", preferences_playlist_startup_checkbutton,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (preferences_playlist_launch_on_startup_checkbutton);
- gtk_table_attach (GTK_TABLE (preference_playlist_table), preferences_playlist_launch_on_startup_checkbutton, 0, 1, 0, 1,
+ gtk_widget_show (preferences_playlist_startup_checkbutton);
+ gtk_table_attach (GTK_TABLE (preference_playlist_table), preferences_playlist_startup_checkbutton, 0, 1, 0, 1,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (GTK_EXPAND), 0, 0);
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (GTK_EXPAND), 0, 0);
- preferences_playlist_enqueue_as_default_checkbutton = gtk_check_button_new_with_label (_("Enqueue as default"));
- gtk_widget_ref (preferences_playlist_enqueue_as_default_checkbutton);
- gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_playlist_enqueue_as_default_checkbutton", preferences_playlist_enqueue_as_default_checkbutton,
+ preferences_playlist_enqueue_checkbutton = gtk_check_button_new_with_label (_("Enqueue as default"));
+ gtk_widget_ref (preferences_playlist_enqueue_checkbutton);
+ gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "preferences_playlist_enqueue_checkbutton", preferences_playlist_enqueue_checkbutton,
(GtkDestroyNotify) gtk_widget_unref);
- gtk_widget_show (preferences_playlist_enqueue_as_default_checkbutton);
- gtk_table_attach (GTK_TABLE (preference_playlist_table), preferences_playlist_enqueue_as_default_checkbutton, 0, 1, 1, 2,
+ gtk_widget_show (preferences_playlist_enqueue_checkbutton);
+ gtk_table_attach (GTK_TABLE (preference_playlist_table), preferences_playlist_enqueue_checkbutton, 0, 1, 1, 2,
(GtkAttachOptions) (GTK_EXPAND),
(GtkAttachOptions) (GTK_EXPAND), 0, 0);
GTK_WIDGET_SET_FLAGS (preferences_cancel, GTK_CAN_DEFAULT);
gtk_signal_connect (GTK_OBJECT (preferences_ok), "clicked",
- GTK_SIGNAL_FUNC (on_preferences_ok_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkPreferencesOk),
+ "intf_preferences");
gtk_signal_connect (GTK_OBJECT (preferences_apply), "clicked",
- GTK_SIGNAL_FUNC (on_preferences_apply_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkPreferencesApply),
+ "intf_preferences");
gtk_signal_connect (GTK_OBJECT (preferences_cancel), "clicked",
- GTK_SIGNAL_FUNC (on_preferences_cancel_clicked),
- NULL);
+ GTK_SIGNAL_FUNC (GtkPreferencesCancel),
+ "intf_preferences");
return intf_preferences;
}
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_callbacks.c,v 1.19 2001/05/19 00:39:30 stef Exp $
+ * $Id: gtk_callbacks.c,v 1.20 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define MODULE_NAME gtk
-#include "modules_inner.h"
-
/*****************************************************************************
* Preamble
*****************************************************************************/
+/*****************************************************************************
+ * gtk_callbacks.h : Callbacks for the gtk plugin.
+ *****************************************************************************
+ * Copyright (C) 2000, 2001 VideoLAN
+ * $Id: gtk_callbacks.h,v 1.13 2001/05/23 23:08:20 stef Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ * Stéphane Borel <stef@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
#include <gtk/gtk.h>
+
+#include "config.h"
+
#include "gtk_control.h"
#include "gtk_menu.h"
#include "gtk_open.h"
/* General glade callbacks */
-/* main window callbacks: specific prototypes are in headers listed before */
+/*****************************************************************************
+ * main window callbacks: specific prototypes are in headers listed before
+ *****************************************************************************/
gboolean GtkExit ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkWindowToggle ( GtkWidget *, GdkEventButton *, gpointer );
* gtk_control.c : functions to handle stream control buttons.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_control.c,v 1.2 2001/05/15 14:49:48 stef Exp $
+ * $Id: gtk_control.c,v 1.3 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define MODULE_NAME gtk
-#include "modules_inner.h"
-
/*****************************************************************************
* Preamble
*****************************************************************************/
--- /dev/null
+/*****************************************************************************
+ * gtk_display.c: Gtk+ tools for main interface
+ *****************************************************************************
+ * Copyright (C) 1999, 2000 VideoLAN
+ * $Id: gtk_display.c,v 1.1 2001/05/23 23:08:20 stef Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ * Stéphane Borel <stef@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "defs.h"
+
+#include <errno.h> /* ENOMEM */
+#include <stdlib.h> /* free() */
+#include <string.h> /* strerror() */
+#include <stdio.h>
+
+#include <gtk/gtk.h>
+
+#include "config.h"
+#include "common.h"
+#include "threads.h"
+#include "mtime.h"
+#include "tests.h"
+#include "modules.h"
+
+#include "stream_control.h"
+#include "input_ext-intf.h"
+
+#include "interface.h"
+#include "intf_msg.h"
+#include "intf_playlist.h"
+
+#include "video.h"
+#include "video_output.h"
+
+#include "gtk_callbacks.h"
+#include "gtk_interface.h"
+#include "gtk_support.h"
+#include "gtk_menu.h"
+#include "gtk_display.h"
+#include "intf_gtk.h"
+
+#include "main.h"
+
+/*****************************************************************************
+ * GtkDisplayDate: display stream date
+ *****************************************************************************
+ * This function displays the current date related to the position in
+ * the stream. It is called whenever the slider changes its value.
+ * The lock has to be taken before you call the function.
+ *****************************************************************************/
+void GtkDisplayDate( GtkAdjustment *p_adj )
+{
+ intf_thread_t *p_intf;
+
+ p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" );
+
+ if( p_intf->p_input != NULL )
+ {
+#define p_area p_intf->p_input->stream.p_selected_area
+ char psz_time[ OFFSETTOTIME_MAX_SIZE ];
+
+ gtk_frame_set_label( GTK_FRAME( p_intf->p_sys->p_slider_frame ),
+ input_OffsetToTime( p_intf->p_input, psz_time,
+ ( p_area->i_size * p_adj->value ) / 100 ) );
+#undef p_area
+ }
+}
+
+
+/*****************************************************************************
+ * GtkModeManage: actualise the aspect of the interface whenever the input
+ * changes.
+ *****************************************************************************
+ * The lock has to be taken before you call the function.
+ *****************************************************************************/
+gint GtkModeManage( intf_thread_t * p_intf )
+{
+ GtkWidget * p_dvd_box;
+ GtkWidget * p_file_box;
+ GtkWidget * p_network_box;
+ GtkWidget * p_slider;
+ GtkWidget * p_label;
+ boolean_t b_control;
+
+#define GETWIDGET( ptr, name ) GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( \
+ p_intf->p_sys->ptr ) , ( name ) ) )
+ /* hide all boxes except default file box */
+ p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "file_box" ) );
+ gtk_widget_hide( GTK_WIDGET( p_file_box ) );
+
+ p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "network_box" ) );
+ gtk_widget_hide( GTK_WIDGET( p_network_box ) );
+
+ p_dvd_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "dvd_box" ) );
+ gtk_widget_hide( GTK_WIDGET( p_dvd_box ) );
+
+ /* hide slider */
+ p_slider = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ), "slider_frame" ) );
+ gtk_widget_hide( GTK_WIDGET( p_slider ) );
+
+ /* controls unavailable */
+ b_control = 0;
+
+ /* show the box related to current input mode */
+ if( p_intf->p_input != NULL )
+ {
+ switch( p_intf->p_input->stream.i_method & 0xf0 )
+ {
+ case INPUT_METHOD_FILE:
+ gtk_widget_show( GTK_WIDGET( p_file_box ) );
+ p_label = gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ),
+ "label_status" );
+ gtk_label_set_text( GTK_LABEL( p_label ),
+ p_intf->p_input->p_source );
+ break;
+ case INPUT_METHOD_DISC:
+ gtk_widget_show( GTK_WIDGET( p_dvd_box ) );
+ break;
+ case INPUT_METHOD_NETWORK:
+ gtk_widget_show( GTK_WIDGET( p_network_box ) );
+ p_label = gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ),
+ "network_address_label" );
+ gtk_label_set_text( GTK_LABEL( p_label ),
+ p_intf->p_input->p_source );
+ break;
+ default:
+ intf_ErrMsg( "intf error: can't determine input method" );
+ break;
+ }
+
+ /* slider for seekable streams */
+ if( p_intf->p_input->stream.b_seekable )
+ {
+ gtk_widget_show( GTK_WIDGET( p_slider ) );
+ }
+
+ /* control buttons for free pace streams */
+ b_control = p_intf->p_input->stream.b_pace_control;
+
+ /* get ready for menu regeneration */
+ p_intf->p_sys->b_title_update = 1;
+ p_intf->p_sys->b_chapter_update = 1;
+ p_intf->p_sys->b_angle_update = 1;
+ p_intf->p_sys->b_audio_update = 1;
+ p_intf->p_sys->b_spu_update = 1;
+ p_intf->p_sys->i_part = 0;
+
+ p_intf->p_input->stream.b_changed = 0;
+ intf_WarnMsg( 3,
+ "intf info: menus refreshed as stream has changed" );
+ }
+ else
+ {
+ /* default mode */
+ p_label = gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_window ),
+ "label_status" );
+ gtk_label_set_text( GTK_LABEL( p_label ), "" );
+ gtk_widget_show( GTK_WIDGET( p_file_box ) );
+
+ /* unsensitize menus */
+ gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_title"), FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_chapter"),
+ FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_angle"), FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_audio"), FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_subpictures"),
+ FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_navigation"),
+ FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_angle"), FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_audio"), FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_subpictures"),
+ FALSE );
+ }
+
+ /* set control items */
+ gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_stop"), b_control );
+ gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_pause"), b_control );
+ gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_slow"), b_control );
+ gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_fast"), b_control );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_back"), FALSE );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_stop"), b_control );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_pause"), b_control );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_slow"), b_control );
+ gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_fast"), b_control );
+
+#undef GETWIDGET
+ return TRUE;
+}
/*****************************************************************************
- * gnome_playlist.h : Playlist functions for the Gnome plugin.
+ * gtk_dsiplay.h: Gtk+ tools for main interface.
*****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN
- * $Id: gnome_playlist.h,v 1.1 2001/05/06 18:41:52 stef Exp $
+ * Copyright (C) 1999, 2000 VideoLAN
+ * $Id: gtk_display.h,v 1.1 2001/05/23 23:08:20 stef Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ * Stéphane Borel <stef@via.ecp.fr>
*
- * Authors: Pierre Baillet <oct@zoy.org>
- *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-void GnomeDropDataReceived ( intf_thread_t *, GtkSelectionData *,
- guint, int );
-void GnomeRebuildCList ( GtkCList *, playlist_t * );
-int GnomeHasValidExtension( gchar * );
-int GnomeAppendList ( playlist_t *, int, GList * );
-void GnomePlayListManage ( intf_thread_t * );
-gint GnomeCompareItems ( gconstpointer, gconstpointer );
-GList * GnomeReadFiles ( gchar * );
-void GnomeDeleteGListItem ( gpointer, gpointer );
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+gint GtkModeManage ( intf_thread_t * p_intf );
+void GtkDisplayDate ( GtkAdjustment *p_adj );
gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_interface_hide);
gtk_tooltips_set_tip (tooltips, menubar_interface_hide, _("Hide the main interface window"), NULL);
- menubar_fullscreen = gtk_check_menu_item_new_with_label ("");
+ menubar_fullscreen = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_fullscreen)->child),
_("_Fullscreen"));
gtk_widget_add_accelerator (menubar_fullscreen, "activate_item", menubar_view_menu_accels,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (menubar_fullscreen);
gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_fullscreen);
- gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (menubar_fullscreen), TRUE);
separator13 = gtk_menu_item_new ();
gtk_widget_ref (separator13);
* gtk_menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_menu.c,v 1.3 2001/05/19 00:39:30 stef Exp $
+ * $Id: gtk_menu.c,v 1.4 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define MODULE_NAME gtk
-#include "modules_inner.h"
-
/*****************************************************************************
* Preamble
*****************************************************************************/
* gtk_modules.c : functions to build modules configuration boxes.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_modules.c,v 1.2 2001/05/15 14:49:48 stef Exp $
+ * $Id: gtk_modules.c,v 1.3 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define MODULE_NAME gtk
-#include "modules_inner.h"
-
/*****************************************************************************
* Preamble
*****************************************************************************/
* gtk_open.c : functions to handle file/disc/network open widgets.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_open.c,v 1.2 2001/05/15 14:49:48 stef Exp $
+ * $Id: gtk_open.c,v 1.3 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define MODULE_NAME gtk
-#include "modules_inner.h"
-
/*****************************************************************************
* Preamble
*****************************************************************************/
void GtkNetworkOpenActivate( GtkMenuItem * menuitem, gpointer user_data )
{
GtkNetworkOpenShow( GTK_WIDGET( menuitem ), NULL, user_data );
-
}
* gtk_playlist.c : Interface for the playlist dialog
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: gtk_playlist.c,v 1.13 2001/05/15 14:49:48 stef Exp $
+ * $Id: gtk_playlist.c,v 1.14 2001/05/23 23:08:20 stef Exp $
*
* Authors: Pierre Baillet <oct@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define MODULE_NAME gtk
-#include "modules_inner.h"
-
/*****************************************************************************
* Preamble
*****************************************************************************/
* gtk_control.c : functions to handle stream control buttons.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: gtk_preferences.c,v 1.2 2001/05/15 14:49:48 stef Exp $
+ * $Id: gtk_preferences.c,v 1.3 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
-#define MODULE_NAME gtk
-#include "modules_inner.h"
-
/*****************************************************************************
* Preamble
*****************************************************************************/
--- /dev/null
+/*****************************************************************************
+ * intf_gnome.c: Gnome interface
+ *****************************************************************************
+ * Copyright (C) 1999, 2000 VideoLAN
+ * $Id: intf_gnome.c,v 1.1 2001/05/23 23:08:20 stef Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ * Stéphane Borel <stef@via.ecp.fr>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ *****************************************************************************/
+
+#define MODULE_NAME gnome
+#include "modules_inner.h"
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "defs.h"
+
+#include <errno.h> /* ENOMEM */
+#include <stdlib.h> /* free() */
+#include <string.h> /* strerror() */
+#include <stdio.h>
+
+#include <gnome.h>
+
+#include "config.h"
+#include "common.h"
+#include "threads.h"
+#include "mtime.h"
+#include "tests.h"
+#include "modules.h"
+
+#include "stream_control.h"
+#include "input_ext-intf.h"
+
+#include "intf_msg.h"
+#include "interface.h"
+#include "intf_playlist.h"
+
+#include "video.h"
+#include "video_output.h"
+
+#include "gnome_callbacks.h"
+#include "gnome_interface.h"
+#include "gnome_support.h"
+#include "gtk_display.h"
+#include "intf_gtk.h"
+
+#include "main.h"
+
+/*****************************************************************************
+ * Local prototypes.
+ *****************************************************************************/
+static int intf_Probe ( probedata_t *p_data );
+static int intf_Open ( intf_thread_t *p_intf );
+static void intf_Close ( intf_thread_t *p_intf );
+static void intf_Run ( intf_thread_t *p_intf );
+
+static gint GnomeManage ( gpointer p_data );
+
+/*****************************************************************************
+ * g_atexit: kludge to avoid the Gnome thread to segfault at exit
+ *****************************************************************************
+ * gtk_init() makes several calls to g_atexit() which calls atexit() to
+ * register tidying callbacks to be called at program exit. Since the Gnome
+ * plugin is likely to be unloaded at program exit, we have to export this
+ * symbol to intercept the g_atexit() calls. Talk about crude hack.
+ *****************************************************************************/
+void g_atexit( GVoidFunc func )
+{
+ intf_thread_t *p_intf = p_main->p_intf;
+
+ if( p_intf->p_sys->pf_gdk_callback == NULL )
+ {
+ p_intf->p_sys->pf_gdk_callback = func;
+ }
+ else if( p_intf->p_sys->pf_gtk_callback == NULL )
+ {
+ p_intf->p_sys->pf_gtk_callback = func;
+ }
+ /* else nothing, but we could do something here */
+ return;
+}
+
+/*****************************************************************************
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+void _M( intf_getfunctions )( function_list_t * p_function_list )
+{
+ p_function_list->pf_probe = intf_Probe;
+ p_function_list->functions.intf.pf_open = intf_Open;
+ p_function_list->functions.intf.pf_close = intf_Close;
+ p_function_list->functions.intf.pf_run = intf_Run;
+}
+
+/*****************************************************************************
+ * intf_Probe: probe the interface and return a score
+ *****************************************************************************
+ * This function tries to initialize Gnome and returns a score to the
+ * plugin manager so that it can select the best plugin.
+ *****************************************************************************/
+static int intf_Probe( probedata_t *p_data )
+{
+ if( TestMethod( INTF_METHOD_VAR, "gnome" ) )
+ {
+ return( 999 );
+ }
+
+ if( TestProgram( "gnome-vlc" ) )
+ {
+ return( 200 );
+ }
+
+ return( 100 );
+}
+
+/*****************************************************************************
+ * intf_Open: initialize and create window
+ *****************************************************************************/
+static int intf_Open( intf_thread_t *p_intf )
+{
+ /* Allocate instance and initialize some members */
+ p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
+ if( p_intf->p_sys == NULL )
+ {
+ intf_ErrMsg("error: %s", strerror(ENOMEM));
+ return( 1 );
+ }
+
+ /* Initialize Gnome thread */
+ p_intf->p_sys->b_popup_changed = 0;
+ p_intf->p_sys->b_window_changed = 0;
+ p_intf->p_sys->b_playlist_changed = 0;
+
+ p_intf->p_sys->i_playing = -1;
+ p_intf->p_sys->b_slider_free = 1;
+
+ p_intf->p_sys->pf_gtk_callback = NULL;
+ p_intf->p_sys->pf_gdk_callback = NULL;
+
+ return( 0 );
+}
+
+/*****************************************************************************
+ * intf_Close: destroy interface window
+ *****************************************************************************/
+static void intf_Close( intf_thread_t *p_intf )
+{
+ /* Destroy structure */
+ free( p_intf->p_sys );
+}
+
+/*****************************************************************************
+ * intf_Run: Gnome thread
+ *****************************************************************************
+ * this part of the interface is in a separate thread so that we can call
+ * gtk_main() from within it without annoying the rest of the program.
+ * XXX: the approach may look kludgy, and probably is, but I could not find
+ * a better way to dynamically load a Gnome interface at runtime.
+ *****************************************************************************/
+static void intf_Run( intf_thread_t *p_intf )
+{
+ /* gnome_init needs to know the command line. We don't care, so we
+ * give it an empty one */
+ char *p_args[] = { "" };
+ int i_args = 1;
+
+ /* The data types we are allowed to receive */
+ static GtkTargetEntry target_table[] =
+ {
+ { "text/uri-list", 0, DROP_ACCEPT_TEXT_URI_LIST },
+ { "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN }
+ };
+
+ /* intf_Manage callback timeout */
+ int i_timeout;
+
+ /* Initialize Gnome */
+ gnome_init( p_main->psz_arg0, VERSION, i_args, p_args );
+
+ /* Create some useful widgets that will certainly be used */
+ p_intf->p_sys->p_window = create_intf_window( );
+ p_intf->p_sys->p_popup = create_intf_popup( );
+ p_intf->p_sys->p_playlist = create_intf_playlist();
+
+ /* Set the title of the main window */
+ gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
+ VOUT_TITLE " (Gnome interface)");
+
+ /* Accept file drops on the main window */
+ gtk_drag_dest_set( GTK_WIDGET( p_intf->p_sys->p_window ),
+ GTK_DEST_DEFAULT_ALL, target_table,
+ 1, GDK_ACTION_COPY );
+ /* Accept file drops on the playlist window */
+ gtk_drag_dest_set( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_playlist ), "playlist_clist") ),
+ GTK_DEST_DEFAULT_ALL, target_table,
+ 1, GDK_ACTION_COPY );
+
+ /* Get the interface labels */
+ p_intf->p_sys->p_slider_frame = gtk_object_get_data(
+ GTK_OBJECT( p_intf->p_sys->p_window ), "slider_frame" );
+ #define P_LABEL( name ) GTK_LABEL( gtk_object_get_data( \
+ GTK_OBJECT( p_intf->p_sys->p_window ), name ) )
+ p_intf->p_sys->p_label_title = P_LABEL( "title_label" );
+ p_intf->p_sys->p_label_chapter = P_LABEL( "chapter_label" );
+ #undef P_LABEL
+
+ /* Connect the date display to the slider */
+ #define P_SLIDER GTK_RANGE( gtk_object_get_data( \
+ GTK_OBJECT( p_intf->p_sys->p_window ), "slider" ) )
+ p_intf->p_sys->p_adj = gtk_range_get_adjustment( P_SLIDER );
+
+ gtk_signal_connect ( GTK_OBJECT( p_intf->p_sys->p_adj ), "value_changed",
+ GTK_SIGNAL_FUNC( GtkDisplayDate ), NULL );
+ p_intf->p_sys->f_adj_oldvalue = 0;
+ #undef P_SLIDER
+
+ /* We don't create these ones yet because we perhaps won't need them */
+ p_intf->p_sys->p_about = NULL;
+ p_intf->p_sys->p_modules = NULL;
+ p_intf->p_sys->p_fileopen = NULL;
+ p_intf->p_sys->p_disc = NULL;
+ p_intf->p_sys->p_network = NULL;
+ p_intf->p_sys->p_preferences = NULL;
+ p_intf->p_sys->p_jump = NULL;
+
+ /* Store p_intf to keep an eye on it */
+ gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window),
+ "p_intf", p_intf );
+
+ gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_popup),
+ "p_intf", p_intf );
+
+ gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ),
+ "p_intf", p_intf );
+
+ gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj),
+ "p_intf", p_intf );
+
+ /* Show the control window */
+ gtk_widget_show( p_intf->p_sys->p_window );
+
+ /* Sleep to avoid using all CPU - since some interfaces needs to access
+ * keyboard events, a 100ms delay is a good compromise */
+ i_timeout = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, GnomeManage, p_intf );
+
+ /* Enter gnome mode */
+ gtk_main();
+
+ /* Remove the timeout */
+ gtk_timeout_remove( i_timeout );
+
+ /* Get rid of stored callbacks so we can unload the plugin */
+ if( p_intf->p_sys->pf_gtk_callback != NULL )
+ {
+ p_intf->p_sys->pf_gtk_callback( );
+ p_intf->p_sys->pf_gtk_callback = NULL;
+
+ }
+
+ if( p_intf->p_sys->pf_gdk_callback != NULL )
+ {
+ p_intf->p_sys->pf_gdk_callback( );
+ p_intf->p_sys->pf_gdk_callback = NULL;
+ }
+}
+
+/* following functions are local */
+
+/*****************************************************************************
+ * GnomeManage: manage main thread messages
+ *****************************************************************************
+ * In this function, called approx. 10 times a second, we check what the
+ * main program wanted to tell us.
+ *****************************************************************************/
+static gint GnomeManage( gpointer p_data )
+{
+#define p_intf ((intf_thread_t *)p_data)
+
+ vlc_mutex_lock( &p_intf->change_lock );
+
+ /* If the "display popup" flag has changed */
+ if( p_intf->b_menu_change )
+ {
+ if( !GTK_IS_WIDGET( p_intf->p_sys->p_popup ) )
+ {
+ p_intf->p_sys->p_popup = create_intf_popup();
+ gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_popup ),
+ "p_popup", p_intf );
+ }
+
+ gnome_popup_menu_do_popup( p_intf->p_sys->p_popup,
+ NULL, NULL, NULL, NULL );
+ p_intf->b_menu_change = 0;
+ }
+
+ /* update the playlist */
+ GtkPlayListManage( p_intf );
+
+ if( p_intf->p_input != NULL && !p_intf->b_die )
+ {
+ vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
+
+ /* New input or stream map change */
+ if( p_intf->p_input->stream.b_changed )
+ {
+ GtkModeManage( p_intf );
+ }
+
+ /* Manage the slider */
+ if( p_intf->p_input->stream.b_seekable )
+ {
+ float newvalue;
+ newvalue = p_intf->p_sys->p_adj->value;
+
+#define p_area p_intf->p_input->stream.p_selected_area
+ /* If the user hasn't touched the slider since the last time,
+ * then the input can safely change it */
+ if( newvalue == p_intf->p_sys->f_adj_oldvalue )
+ {
+ /* Update the value */
+ p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue =
+ ( 100. * p_area->i_tell ) / p_area->i_size;
+
+ gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
+ "value_changed" );
+ }
+ /* Otherwise, send message to the input if the user has
+ * finished dragging the slider */
+ else if( p_intf->p_sys->b_slider_free )
+ {
+ off_t i_seek = ( newvalue * p_area->i_size ) / 100;
+
+ vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
+ input_Seek( p_intf->p_input, i_seek );
+ vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
+
+ /* Update the old value */
+ p_intf->p_sys->f_adj_oldvalue = newvalue;
+ }
+#undef p_area
+ }
+ vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
+
+ if( p_intf->p_sys->i_part !=
+ p_intf->p_input->stream.p_selected_area->i_part )
+ {
+ p_intf->p_sys->b_chapter_update = 1;
+ GtkSetupMenus( p_intf );
+ }
+
+ }
+ else if( !p_intf->b_die )
+ {
+ GtkModeManage( p_intf );
+ }
+
+ /* Manage core vlc functions through the callback */
+ p_intf->pf_manage( p_intf );
+
+ if( p_intf->b_die )
+ {
+ vlc_mutex_unlock( &p_intf->change_lock );
+
+ /* Prepare to die, young Skywalker */
+ gtk_main_quit();
+
+ /* Just in case */
+ return( FALSE );
+ }
+
+ vlc_mutex_unlock( &p_intf->change_lock );
+
+ return( TRUE );
+
+#undef p_intf
+}
<class>GnomeApp</class>
<name>intf_window</name>
<signal>
- <name>destroy</name>
- <handler>on_intf_window_destroy</handler>
- <last_modification_time>Sun, 11 Feb 2001 17:41:57 GMT</last_modification_time>
+ <name>delete_event</name>
+ <handler>GtkWindowDelete</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:20:57 GMT</last_modification_time>
</signal>
<signal>
<name>drag_data_received</name>
- <handler>on_intf_window_drag_data_received</handler>
- <last_modification_time>Fri, 16 Feb 2001 01:59:35 GMT</last_modification_time>
+ <handler>GtkWindowDrag</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 02:30:24 GMT</last_modification_time>
</signal>
<title>VideoLAN Client</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<tooltip>Open a File</tooltip>
<signal>
<name>activate</name>
- <handler>on_menubar_open_activate</handler>
- <last_modification_time>Sun, 04 Mar 2001 21:01:45 GMT</last_modification_time>
+ <handler>GnomeMenubarFileOpenActivate</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 16:27:02 GMT</last_modification_time>
</signal>
<label>_Open File...</label>
<right_justify>False</right_justify>
<tooltip>Open a DVD or VCD</tooltip>
<signal>
<name>activate</name>
- <handler>on_menubar_disc_activate</handler>
- <last_modification_time>Sun, 04 Mar 2001 01:28:32 GMT</last_modification_time>
+ <handler>GnomeMenubarDiscOpenActivate</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 16:27:10 GMT</last_modification_time>
</signal>
<label>Open _Disc...</label>
<right_justify>False</right_justify>
<tooltip>Select a Network Stream</tooltip>
<signal>
<name>activate</name>
- <handler>on_menubar_network_activate</handler>
- <last_modification_time>Mon, 12 Mar 2001 14:33:42 GMT</last_modification_time>
+ <handler>GnomeMenbarNetworkOpenActivate</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 16:27:39 GMT</last_modification_time>
</signal>
<label>_Network Stream...</label>
<right_justify>False</right_justify>
<name>menubar_exit</name>
<signal>
<name>activate</name>
- <handler>on_menubar_exit_activate</handler>
- <last_modification_time>Sun, 11 Feb 2001 16:55:04 GMT</last_modification_time>
+ <handler>GnomeMenubarExitActivate</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 16:27:52 GMT</last_modification_time>
</signal>
<stock_item>GNOMEUIINFO_MENU_EXIT_ITEM</stock_item>
</widget>
<name>menubar_view_menu</name>
<widget>
- <class>GtkCheckMenuItem</class>
+ <class>GtkMenuItem</class>
+ <name>menubar_hide_interface</name>
+ <signal>
+ <name>activate</name>
+ <handler>GnomeMenubarWindowToggleActivate</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 16:28:06 GMT</last_modification_time>
+ </signal>
+ <label>_Hide interface</label>
+ <right_justify>False</right_justify>
+ </widget>
+
+ <widget>
+ <class>GtkMenuItem</class>
<name>menubar_fullscreen</name>
<signal>
<name>activate</name>
- <handler>on_menubar_fullscreen_activate</handler>
- <last_modification_time>Wed, 02 May 2001 23:35:36 GMT</last_modification_time>
+ <handler>GnomeMenubarFullscreenActivate</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 16:28:15 GMT</last_modification_time>
</signal>
<label>_Fullscreen</label>
- <active>False</active>
- <always_show_toggle>True</always_show_toggle>
+ <right_justify>False</right_justify>
</widget>
<widget>
<tooltip>Open the playlist window</tooltip>
<signal>
<name>activate</name>
- <handler>on_menubar_playlist_activate</handler>
- <last_modification_time>Sun, 11 Feb 2001 16:55:04 GMT</last_modification_time>
+ <handler>GnomeMenubarPlaylistActivate</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 16:28:41 GMT</last_modification_time>
</signal>
<label>_Playlist...</label>
<right_justify>False</right_justify>
<tooltip>Open the plugin manager</tooltip>
<signal>
<name>activate</name>
- <handler>on_menubar_modules_activate</handler>
- <last_modification_time>Tue, 13 Feb 2001 17:19:41 GMT</last_modification_time>
+ <handler>GnomeMenubarModulesActivate</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 16:28:53 GMT</last_modification_time>
</signal>
<label>_Modules...</label>
<right_justify>False</right_justify>
<widget>
<class>GtkMenuItem</class>
- <name>menubar_subtitle</name>
+ <name>menubar_subpictures</name>
<sensitive>False</sensitive>
<tooltip>Select subtitle unit</tooltip>
<label>_Subtitles</label>
<name>menubar_preferences</name>
<signal>
<name>activate</name>
- <handler>on_menubar_preferences_activate</handler>
- <last_modification_time>Sun, 11 Feb 2001 16:55:04 GMT</last_modification_time>
+ <handler>GnomeMenubarPreferencesActivate</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 16:29:03 GMT</last_modification_time>
</signal>
<stock_item>GNOMEUIINFO_MENU_PREFERENCES_ITEM</stock_item>
</widget>
<name>menubar_about</name>
<signal>
<name>activate</name>
- <handler>on_menubar_about_activate</handler>
- <last_modification_time>Sun, 11 Feb 2001 16:55:04 GMT</last_modification_time>
+ <handler>GnomeMenubarAboutActivate</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 16:29:19 GMT</last_modification_time>
</signal>
<stock_item>GNOMEUIINFO_MENU_ABOUT_ITEM</stock_item>
</widget>
<name>toolbar_file</name>
<tooltip>Open a File</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_open_clicked</handler>
- <last_modification_time>Sun, 04 Mar 2001 21:01:24 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkFileOpenShow</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:14:43 GMT</last_modification_time>
</signal>
<label>File</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_OPEN</stock_pixmap>
<name>toolbar_disc</name>
<tooltip>Open a DVD or VCD</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_disc_clicked</handler>
- <last_modification_time>Sun, 04 Mar 2001 01:27:51 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkDiscOpenShow</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:14:38 GMT</last_modification_time>
</signal>
<label>Disc</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_CDROM</stock_pixmap>
<name>toolbar_network</name>
<tooltip>Select a Network Stream</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_network_clicked</handler>
- <last_modification_time>Mon, 12 Mar 2001 14:32:18 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkNetworkOpenShow</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:14:33 GMT</last_modification_time>
</signal>
<label>Net</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_REFRESH</stock_pixmap>
<sensitive>False</sensitive>
<tooltip>Go Backwards</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_back_clicked</handler>
- <last_modification_time>Sun, 11 Feb 2001 17:06:28 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkControlBack</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:14:27 GMT</last_modification_time>
</signal>
<label>Back</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_BACK</stock_pixmap>
<sensitive>False</sensitive>
<tooltip>Stop Stream</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_stop_clicked</handler>
- <last_modification_time>Sun, 11 Feb 2001 17:06:33 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkControlStop</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:14:22 GMT</last_modification_time>
</signal>
<label>Stop</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_STOP</stock_pixmap>
<class>GtkButton</class>
<child_name>Toolbar:button</child_name>
<name>toolbar_play</name>
- <sensitive>False</sensitive>
<tooltip>Play Stream</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_play_clicked</handler>
- <last_modification_time>Sun, 11 Feb 2001 17:06:39 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkControlPlay</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:14:17 GMT</last_modification_time>
</signal>
<label>Play</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_FORWARD</stock_pixmap>
<sensitive>False</sensitive>
<tooltip>Pause Stream</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_pause_clicked</handler>
- <last_modification_time>Sun, 11 Feb 2001 17:06:43 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkControlPause</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:14:05 GMT</last_modification_time>
</signal>
<label>Pause</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_BOTTOM</stock_pixmap>
<sensitive>False</sensitive>
<tooltip>Play Slower</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_slow_clicked</handler>
- <last_modification_time>Mon, 12 Feb 2001 07:20:42 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkControlSlow</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:13:58 GMT</last_modification_time>
</signal>
<label>Slow</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_TIMER_STOP</stock_pixmap>
<sensitive>False</sensitive>
<tooltip>Play Faster</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_fast_clicked</handler>
- <last_modification_time>Mon, 12 Feb 2001 07:20:48 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkControlFast</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:13:53 GMT</last_modification_time>
</signal>
<label>Fast</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_TIMER</stock_pixmap>
<name>toolbar_playlist</name>
<tooltip>Open Playlist</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_playlist_clicked</handler>
- <last_modification_time>Sun, 11 Feb 2001 17:06:48 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkPlaylistShow</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:13:48 GMT</last_modification_time>
</signal>
<label>Playlist</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_INDEX</stock_pixmap>
<name>toolbar_prev</name>
<tooltip>Previous File</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_prev_clicked</handler>
- <last_modification_time>Sun, 11 Feb 2001 17:06:52 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkPlaylistPrev</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:13:44 GMT</last_modification_time>
</signal>
<label>Prev</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_FIRST</stock_pixmap>
<name>toolbar_next</name>
<tooltip>Next File</tooltip>
<signal>
- <name>clicked</name>
- <handler>on_toolbar_next_clicked</handler>
- <last_modification_time>Sun, 11 Feb 2001 17:06:56 GMT</last_modification_time>
+ <name>button_press_event</name>
+ <handler>GtkPlaylistNext</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:13:40 GMT</last_modification_time>
</signal>
<label>Next</label>
<stock_pixmap>GNOME_STOCK_PIXMAP_LAST</stock_pixmap>
<spacing>0</spacing>
<widget>
- <class>GtkHandleBox</class>
- <name>slider_handlebox</name>
+ <class>GtkFrame</class>
+ <name>slider_frame</name>
<visible>False</visible>
- <shadow_type>GTK_SHADOW_OUT</shadow_type>
- <handle_position>GTK_POS_LEFT</handle_position>
- <snap_edge>GTK_POS_TOP</snap_edge>
+ <label>-:--:--</label>
+ <label_xalign>0.05</label_xalign>
+ <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
<child>
<padding>0</padding>
<expand>True</expand>
</child>
<widget>
- <class>GtkFrame</class>
- <name>slider_frame</name>
- <label>-:--:--</label>
- <label_xalign>0.05</label_xalign>
- <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-
- <widget>
- <class>GtkHScale</class>
- <name>slider</name>
- <can_focus>True</can_focus>
- <signal>
- <name>button_press_event</name>
- <handler>on_slider_button_press_event</handler>
- <last_modification_time>Wed, 14 Mar 2001 13:46:55 GMT</last_modification_time>
- </signal>
- <signal>
- <name>button_release_event</name>
- <handler>on_slider_button_release_event</handler>
- <last_modification_time>Wed, 14 Mar 2001 13:46:59 GMT</last_modification_time>
- </signal>
- <draw_value>False</draw_value>
- <value_pos>GTK_POS_TOP</value_pos>
- <digits>3</digits>
- <policy>GTK_UPDATE_CONTINUOUS</policy>
- <value>0</value>
- <lower>0</lower>
- <upper>100</upper>
- <step>1</step>
- <page>6.25</page>
- <page_size>0</page_size>
- </widget>
+ <class>GtkHScale</class>
+ <name>slider</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>button_press_event</name>
+ <handler>GtkSliderPress</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:12:57 GMT</last_modification_time>
+ </signal>
+ <signal>
+ <name>button_release_event</name>
+ <handler>GtkSliderRelease</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:13:00 GMT</last_modification_time>
+ </signal>
+ <draw_value>False</draw_value>
+ <value_pos>GTK_POS_TOP</value_pos>
+ <digits>3</digits>
+ <policy>GTK_UPDATE_CONTINUOUS</policy>
+ <value>0</value>
+ <lower>0</lower>
+ <upper>100</upper>
+ <step>1</step>
+ <page>6.25</page>
+ <page_size>0</page_size>
</widget>
</widget>
<widget>
<class>GtkLabel</class>
- <name>label_title</name>
+ <name>title_label</name>
<label>--</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_button_title_prev_clicked</handler>
- <last_modification_time>Tue, 03 Apr 2001 03:46:25 GMT</last_modification_time>
+ <handler>GtkTitlePrev</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:13:28 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_PREV</stock_button>
- <relief>GTK_RELIEF_NONE</relief>
+ <relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_button_title_next_clicked</handler>
- <last_modification_time>Tue, 03 Apr 2001 03:47:01 GMT</last_modification_time>
+ <handler>GtkTitleNext</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:13:23 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_NEXT</stock_button>
- <relief>GTK_RELIEF_NONE</relief>
+ <relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<widget>
<class>GtkLabel</class>
- <name>label_chapter</name>
+ <name>chapter_label</name>
<label>---</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_button_chapter_prev_clicked</handler>
- <last_modification_time>Tue, 03 Apr 2001 00:53:47 GMT</last_modification_time>
+ <handler>GtkChapterPrev</handler>
+ <last_modification_time>Sat, 19 May 2001 02:46:07 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_PREV</stock_button>
- <relief>GTK_RELIEF_NONE</relief>
+ <relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_button_chapter_next_clicked</handler>
- <last_modification_time>Tue, 03 Apr 2001 00:53:40 GMT</last_modification_time>
+ <handler>GtkChapterNext</handler>
+ <data>"intf_window"</data>
+ <last_modification_time>Sat, 19 May 2001 03:13:08 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_NEXT</stock_button>
- <relief>GTK_RELIEF_NONE</relief>
+ <relief>GTK_RELIEF_NORMAL</relief>
<child>
<padding>0</padding>
<expand>False</expand>
<name>popup_play</name>
<signal>
<name>activate</name>
- <handler>on_popup_play_activate</handler>
- <last_modification_time>Sun, 11 Feb 2001 16:52:11 GMT</last_modification_time>
+ <handler>GnomePopupPlayActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:16:58 GMT</last_modification_time>
</signal>
<label>Play</label>
<right_justify>False</right_justify>
<name>popup_pause</name>
<signal>
<name>activate</name>
- <handler>on_popup_pause_activate</handler>
- <last_modification_time>Sun, 11 Feb 2001 16:52:11 GMT</last_modification_time>
+ <handler>GnomePopupPauseActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:17:31 GMT</last_modification_time>
</signal>
<label>Pause</label>
<right_justify>False</right_justify>
<name>popup_stop</name>
<signal>
<name>activate</name>
- <handler>on_popup_stop_activate</handler>
- <last_modification_time>Tue, 01 May 2001 22:18:09 GMT</last_modification_time>
+ <handler>GnomePopupStopActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:18:10 GMT</last_modification_time>
</signal>
<label>Stop</label>
<right_justify>False</right_justify>
<sensitive>False</sensitive>
<signal>
<name>activate</name>
- <handler>on_popup_back_activate</handler>
- <last_modification_time>Sun, 06 May 2001 15:33:13 GMT</last_modification_time>
+ <handler>GnomePopupBackActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:18:21 GMT</last_modification_time>
</signal>
<label>Back</label>
<right_justify>False</right_justify>
<name>popup_slow</name>
<signal>
<name>activate</name>
- <handler>on_popup_slow_activate</handler>
- <last_modification_time>Mon, 12 Feb 2001 07:19:57 GMT</last_modification_time>
+ <handler>GnomePopupSlowActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:18:29 GMT</last_modification_time>
</signal>
<label>Slow</label>
<right_justify>False</right_justify>
<name>popup_fast</name>
<signal>
<name>activate</name>
- <handler>on_popup_fast_activate</handler>
- <last_modification_time>Mon, 12 Feb 2001 07:19:57 GMT</last_modification_time>
+ <handler>GnomePopupFastActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:18:37 GMT</last_modification_time>
</signal>
<label>Fast</label>
<right_justify>False</right_justify>
</widget>
<widget>
- <class>GtkCheckMenuItem</class>
+ <class>GtkMenuItem</class>
+ <name>popup_interface_toggle</name>
+ <signal>
+ <name>activate</name>
+ <handler>GnomePopupWindowToggleActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:18:51 GMT</last_modification_time>
+ </signal>
+ <label>Toggle _Interface</label>
+ <right_justify>False</right_justify>
+ </widget>
+
+ <widget>
+ <class>GtkMenuItem</class>
<name>popup_fullscreen</name>
<tooltip>Toggle fullscreen mode</tooltip>
<signal>
<name>activate</name>
- <handler>on_popup_fullscreen_activate</handler>
- <last_modification_time>Wed, 02 May 2001 23:36:07 GMT</last_modification_time>
+ <handler>GnomePopupFullscreenActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:19:07 GMT</last_modification_time>
</signal>
<label>_Fullscreen</label>
- <active>False</active>
- <always_show_toggle>True</always_show_toggle>
+ <right_justify>False</right_justify>
</widget>
<widget>
<right_justify>False</right_justify>
</widget>
+ <widget>
+ <class>GtkMenuItem</class>
+ <name>popup_next</name>
+ <signal>
+ <name>activate</name>
+ <handler>GnomePopupNextActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:19:18 GMT</last_modification_time>
+ </signal>
+ <label>Next</label>
+ <right_justify>False</right_justify>
+ </widget>
+
+ <widget>
+ <class>GtkMenuItem</class>
+ <name>popup_prev</name>
+ <signal>
+ <name>activate</name>
+ <handler>GnomePopupPrevActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:19:26 GMT</last_modification_time>
+ </signal>
+ <label>Prev</label>
+ <right_justify>False</right_justify>
+ </widget>
+
<widget>
<class>GtkPixmapMenuItem</class>
<name>popup_jump</name>
<tooltip>Got directly so specified point</tooltip>
<signal>
<name>activate</name>
- <handler>on_popup_jump_activate</handler>
- <last_modification_time>Tue, 01 May 2001 22:22:49 GMT</last_modification_time>
+ <handler>GnomePopupJumpActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:34:46 GMT</last_modification_time>
</signal>
<label>_Jump...</label>
<right_justify>False</right_justify>
<widget>
<class>GtkPixmapMenuItem</class>
- <name>popup_subtitle</name>
+ <name>popup_subpictures</name>
<sensitive>False</sensitive>
<tooltip>Select subtitle channel</tooltip>
<label>_Subtitles</label>
<tooltip>Open a File</tooltip>
<signal>
<name>activate</name>
- <handler>on_popup_open_activate</handler>
- <last_modification_time>Sun, 04 Mar 2001 21:01:58 GMT</last_modification_time>
+ <handler>GnomePopupFileOpenActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:20:08 GMT</last_modification_time>
</signal>
<label>_Open File...</label>
<right_justify>False</right_justify>
<tooltip>Open a DVD or VCD</tooltip>
<signal>
<name>activate</name>
- <handler>on_popup_disc_activate</handler>
- <last_modification_time>Sun, 04 Mar 2001 02:57:11 GMT</last_modification_time>
+ <handler>GnomePopupDiscOpenActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:20:44 GMT</last_modification_time>
</signal>
<label>Open _Disc...</label>
<right_justify>False</right_justify>
<tooltip>Select a Network Stream</tooltip>
<signal>
<name>activate</name>
- <handler>on_popup_network_activate</handler>
- <last_modification_time>Mon, 12 Mar 2001 14:57:25 GMT</last_modification_time>
+ <handler>GnomePopupNetworkOpenActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:20:54 GMT</last_modification_time>
</signal>
<label>_Network Stream...</label>
<right_justify>False</right_justify>
<name>popup_about</name>
<signal>
<name>activate</name>
- <handler>on_popup_about_activate</handler>
- <last_modification_time>Mon, 12 Feb 2001 00:00:08 GMT</last_modification_time>
+ <handler>GnomePopupAboutActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:21:02 GMT</last_modification_time>
</signal>
<stock_item>GNOMEUIINFO_MENU_ABOUT_ITEM</stock_item>
</widget>
<name>popup_playlist</name>
<signal>
<name>activate</name>
- <handler>on_popup_playlist_activate</handler>
- <last_modification_time>Wed, 02 May 2001 14:16:23 GMT</last_modification_time>
+ <handler>GnomePopupPlaylistActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:21:14 GMT</last_modification_time>
</signal>
<label>Playlist...</label>
<right_justify>False</right_justify>
<name>popup_preferences</name>
<signal>
<name>activate</name>
- <handler>on_popup_preferences_activate</handler>
- <last_modification_time>Tue, 01 May 2001 22:17:08 GMT</last_modification_time>
+ <handler>GnomePopupPreferencesActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:21:25 GMT</last_modification_time>
</signal>
<stock_item>GNOMEUIINFO_MENU_PREFERENCES_ITEM</stock_item>
</widget>
<name>popup_exit</name>
<signal>
<name>activate</name>
- <handler>on_popup_exit_activate</handler>
- <last_modification_time>Sun, 11 Feb 2001 16:49:30 GMT</last_modification_time>
+ <handler>GnomePopupExitActivate</handler>
+ <data>"intf_popup"</data>
+ <last_modification_time>Sat, 19 May 2001 16:21:45 GMT</last_modification_time>
</signal>
<stock_item>GNOMEUIINFO_MENU_EXIT_ITEM</stock_item>
</widget>
<class>GtkFileSelection</class>
<name>intf_fileopen</name>
<border_width>10</border_width>
- <signal>
- <name>destroy</name>
- <handler>on_intf_fileopen_destroy</handler>
- <last_modification_time>Sun, 11 Feb 2001 18:36:13 GMT</last_modification_time>
- </signal>
<title>Open File</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_fileopen_ok_clicked</handler>
- <last_modification_time>Sun, 11 Feb 2001 18:22:44 GMT</last_modification_time>
+ <handler>GtkFileOpenOk</handler>
+ <data>"intf_fileopen"</data>
+ <last_modification_time>Sat, 19 May 2001 03:10:36 GMT</last_modification_time>
</signal>
<label>OK</label>
<relief>GTK_RELIEF_NORMAL</relief>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_fileopen_cancel_clicked</handler>
- <last_modification_time>Sun, 11 Feb 2001 18:22:50 GMT</last_modification_time>
+ <handler>GtkFileOpenCancel</handler>
+ <data>"intf_fileopen"</data>
+ <last_modification_time>Sat, 19 May 2001 03:10:31 GMT</last_modification_time>
</signal>
<label>Cancel</label>
<relief>GTK_RELIEF_NORMAL</relief>
<widget>
<class>GnomeDialog</class>
<name>intf_modules</name>
- <signal>
- <name>destroy</name>
- <handler>on_intf_modules_destroy</handler>
- <last_modification_time>Tue, 13 Feb 2001 09:19:08 GMT</last_modification_time>
- </signal>
<title>Modules</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<name>modules_ok</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
- <signal>
- <name>clicked</name>
- <handler>on_modules_ok_clicked</handler>
- <last_modification_time>Tue, 13 Feb 2001 09:21:29 GMT</last_modification_time>
- </signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<name>modules_apply</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
- <signal>
- <name>clicked</name>
- <handler>on_modules_apply_clicked</handler>
- <last_modification_time>Tue, 13 Feb 2001 09:21:25 GMT</last_modification_time>
- </signal>
<stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
</widget>
<name>modules_cancel</name>
<can_default>True</can_default>
<can_focus>True</can_focus>
- <signal>
- <name>clicked</name>
- <handler>on_modules_cancel_clicked</handler>
- <last_modification_time>Tue, 13 Feb 2001 09:21:34 GMT</last_modification_time>
- </signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
</widget>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_disc_ok_clicked</handler>
- <last_modification_time>Sun, 04 Mar 2001 01:33:55 GMT</last_modification_time>
+ <handler>GtkDiscOpenOk</handler>
+ <data>"intf_disc"</data>
+ <last_modification_time>Sat, 19 May 2001 03:10:12 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_disc_cancel_clicked</handler>
- <last_modification_time>Sun, 04 Mar 2001 01:33:50 GMT</last_modification_time>
+ <handler>GtkDiscOpenCancel</handler>
+ <data>"intf_disc"</data>
+ <last_modification_time>Sat, 19 May 2001 03:10:07 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
- <handler>on_disc_dvd_toggled</handler>
- <last_modification_time>Sun, 04 Mar 2001 02:12:52 GMT</last_modification_time>
+ <handler>GtkDiscOpenDvd</handler>
+ <data>"intf_disc"</data>
+ <last_modification_time>Sat, 19 May 2001 03:18:29 GMT</last_modification_time>
</signal>
<label>DVD</label>
<active>False</active>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
- <handler>on_disc_vcd_toggled</handler>
- <last_modification_time>Sun, 04 Mar 2001 02:12:58 GMT</last_modification_time>
+ <handler>GtkDiscOpenVcd</handler>
+ <data>"intf_disc"</data>
+ <last_modification_time>Sat, 19 May 2001 03:22:10 GMT</last_modification_time>
</signal>
<label>VCD</label>
<active>False</active>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_network_ok_clicked</handler>
- <last_modification_time>Mon, 12 Mar 2001 14:56:40 GMT</last_modification_time>
+ <handler>GtkNetworkOpenOk</handler>
+ <data>"intf_network"</data>
+ <last_modification_time>Sat, 19 May 2001 03:09:40 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_network_cancel_clicked</handler>
- <last_modification_time>Mon, 12 Mar 2001 14:56:51 GMT</last_modification_time>
+ <handler>GtkNetworkOpenCancel</handler>
+ <data>"intf_network"</data>
+ <last_modification_time>Sat, 19 May 2001 03:09:44 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
<can_focus>True</can_focus>
<signal>
<name>toggled</name>
- <handler>on_broadcast_check_toggled</handler>
- <last_modification_time>Wed, 02 May 2001 00:28:21 GMT</last_modification_time>
+ <handler>GtkNetworkOpenBroadcast</handler>
+ <last_modification_time>Sat, 19 May 2001 02:57:46 GMT</last_modification_time>
</signal>
<label>Broadcast</label>
<active>False</active>
<name>intf_playlist</name>
<signal>
<name>destroy</name>
- <handler>on_playlist_destroy</handler>
- <last_modification_time>Tue, 08 May 2001 23:21:39 GMT</last_modification_time>
+ <handler>gtk_widget_hide</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:09:08 GMT</last_modification_time>
+ </signal>
+ <signal>
+ <name>delete_event</name>
+ <handler>gtk_widget_hide</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:09:12 GMT</last_modification_time>
</signal>
<title>Playlist</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_playlist_ok_clicked</handler>
- <last_modification_time>Sun, 06 May 2001 04:14:54 GMT</last_modification_time>
+ <handler>GtkPlaylistOk</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:09:00 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_playlist_cancel_clicked</handler>
- <last_modification_time>Sun, 06 May 2001 03:41:33 GMT</last_modification_time>
+ <handler>GtkPlaylistCancel</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:08:56 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
<can_focus>True</can_focus>
<signal>
<name>event</name>
- <handler>on_playlist_clist_event</handler>
- <last_modification_time>Tue, 01 May 2001 22:13:12 GMT</last_modification_time>
+ <handler>GtkPlaylistEvent</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:08:43 GMT</last_modification_time>
</signal>
<signal>
<name>drag_data_received</name>
- <handler>on_playlist_clist_drag_data_received</handler>
- <last_modification_time>Tue, 01 May 2001 22:13:32 GMT</last_modification_time>
+ <handler>GtkPlaylistDragData</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:08:45 GMT</last_modification_time>
</signal>
<signal>
<name>drag_motion</name>
- <handler>on_playlist_clist_drag_motion</handler>
- <last_modification_time>Tue, 01 May 2001 22:13:52 GMT</last_modification_time>
+ <handler>GtkPlaylistDragMotion</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:08:49 GMT</last_modification_time>
</signal>
<columns>2</columns>
<column_widths>287,70</column_widths>
<name>playlist_add_disc</name>
<signal>
<name>activate</name>
- <handler>on_playlist_disc_activate</handler>
- <last_modification_time>Tue, 01 May 2001 19:07:11 GMT</last_modification_time>
+ <handler>GnomePlaylistDiscOpenActivate</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 16:22:26 GMT</last_modification_time>
</signal>
<label>Disc</label>
<right_justify>False</right_justify>
<name>playlist_add_file</name>
<signal>
<name>activate</name>
- <handler>on_playlist_file_activate</handler>
- <last_modification_time>Tue, 01 May 2001 19:07:11 GMT</last_modification_time>
+ <handler>GnomePlaylistFileOpenActivate</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 16:22:37 GMT</last_modification_time>
</signal>
<label>File</label>
<right_justify>False</right_justify>
<name>playlist_add_network</name>
<signal>
<name>activate</name>
- <handler>on_playlist_network_activate</handler>
- <last_modification_time>Tue, 01 May 2001 19:07:11 GMT</last_modification_time>
+ <handler>GnomePlaylistNetworkOpenActivate</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 16:22:52 GMT</last_modification_time>
</signal>
<label>Network</label>
<right_justify>False</right_justify>
<name>playlist_add_url</name>
<signal>
<name>activate</name>
- <handler>on_playlist_url_activate</handler>
- <last_modification_time>Tue, 01 May 2001 19:07:11 GMT</last_modification_time>
+ <handler>GtkPlaylistAddUrl</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 16:24:27 GMT</last_modification_time>
</signal>
<label>Url</label>
<right_justify>False</right_justify>
<name>playlist_delete_all</name>
<signal>
<name>activate</name>
- <handler>on_playlist_delete_all_activate</handler>
- <last_modification_time>Sun, 06 May 2001 01:51:40 GMT</last_modification_time>
+ <handler>GtkPlaylistDeleteAll</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:08:11 GMT</last_modification_time>
</signal>
<label>All</label>
<right_justify>False</right_justify>
<name>playmist_delete_item</name>
<signal>
<name>activate</name>
- <handler>on_playlist_delete_item_activate</handler>
- <last_modification_time>Sun, 06 May 2001 01:51:28 GMT</last_modification_time>
+ <handler>GtkPlaylistDeleteSelected</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:08:05 GMT</last_modification_time>
</signal>
<label>Item</label>
<right_justify>False</right_justify>
<name>playlist_selection_crop</name>
<signal>
<name>activate</name>
- <handler>on_playlist_crop_activate</handler>
- <last_modification_time>Tue, 01 May 2001 18:47:42 GMT</last_modification_time>
+ <handler>GtkPlaylistCrop</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:07:56 GMT</last_modification_time>
</signal>
<label>Crop</label>
<right_justify>False</right_justify>
<name>playlist_selection_invert</name>
<signal>
<name>activate</name>
- <handler>on_playlist_invert_activate</handler>
- <last_modification_time>Tue, 01 May 2001 18:47:42 GMT</last_modification_time>
+ <handler>GtkPlaylistInvert</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:07:51 GMT</last_modification_time>
</signal>
<label>Invert</label>
<right_justify>False</right_justify>
<name>playlist_selection_select</name>
<signal>
<name>activate</name>
- <handler>on_playlist_select_activate</handler>
- <last_modification_time>Tue, 01 May 2001 18:47:42 GMT</last_modification_time>
+ <handler>GtkPlaylistSelect</handler>
+ <data>"intf_playlist"</data>
+ <last_modification_time>Sat, 19 May 2001 03:07:45 GMT</last_modification_time>
</signal>
<label>Select</label>
<right_justify>False</right_justify>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_jump_ok_clicked</handler>
- <last_modification_time>Wed, 02 May 2001 02:20:21 GMT</last_modification_time>
+ <handler>GtkJumpOk</handler>
+ <data>"intf_jump"</data>
+ <last_modification_time>Sat, 19 May 2001 03:07:27 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_jump_cancel_clicked</handler>
- <last_modification_time>Wed, 02 May 2001 02:20:54 GMT</last_modification_time>
+ <handler>GtkJumpCancel</handler>
+ <data>"intf_jump"</data>
+ <last_modification_time>Sat, 19 May 2001 03:07:20 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_preferences_ok_clicked</handler>
- <last_modification_time>Wed, 02 May 2001 17:04:42 GMT</last_modification_time>
+ <handler>GtkPreferencesOk</handler>
+ <data>"intf_preferences"</data>
+ <last_modification_time>Sat, 19 May 2001 03:06:57 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_OK</stock_button>
</widget>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_preferences_apply_clicked</handler>
- <last_modification_time>Wed, 02 May 2001 17:04:50 GMT</last_modification_time>
+ <handler>GtkPreferencesApply</handler>
+ <data>"intf_preferences"</data>
+ <last_modification_time>Sat, 19 May 2001 03:06:53 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_APPLY</stock_button>
</widget>
<can_focus>True</can_focus>
<signal>
<name>clicked</name>
- <handler>on_preferences_cancel_clicked</handler>
- <last_modification_time>Wed, 02 May 2001 17:05:00 GMT</last_modification_time>
+ <handler>GtkPreferencesCancel</handler>
+ <data>"intf_preferences"</data>
+ <last_modification_time>Sat, 19 May 2001 03:07:05 GMT</last_modification_time>
</signal>
<stock_button>GNOME_STOCK_BUTTON_CANCEL</stock_button>
</widget>
<widget>
<class>GtkEntry</class>
<child_name>GnomeEntry:entry</child_name>
- <name>preferences_file_entry</name>
+ <name>preferences_file_path_entry</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<widget>
<class>GtkCheckButton</class>
- <name>preferences_playlist_launch_on_startup_checkbutton</name>
+ <name>preferences_playlist_startup_checkbutton</name>
<can_focus>True</can_focus>
<label>Launch on startup</label>
<active>False</active>
<widget>
<class>GtkCheckButton</class>
- <name>preferences_playlist_enqueue_as_default_checkbutton</name>
+ <name>preferences_playlist_enqueue_checkbutton</name>
<can_focus>True</can_focus>
<label>Enqueue as default</label>
<active>False</active>
* intf_gtk.c: Gtk+ interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gtk.c,v 1.20 2001/05/19 00:39:30 stef Exp $
+ * $Id: intf_gtk.c,v 1.21 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
#include "gtk_interface.h"
#include "gtk_support.h"
#include "gtk_menu.h"
+#include "gtk_display.h"
#include "intf_gtk.h"
#include "main.h"
static void intf_Run ( intf_thread_t *p_intf );
static gint GtkManage ( gpointer p_data );
-static gint GtkModeManage ( intf_thread_t * p_intf );
-static void GtkDisplayDate ( GtkAdjustment *p_adj );
/*****************************************************************************
* g_atexit: kludge to avoid the Gtk+ thread to segfault at exit
p_intf->p_sys->b_window_changed = 0;
p_intf->p_sys->b_playlist_changed = 0;
+ p_intf->p_sys->i_playing = -1;
p_intf->p_sys->b_slider_free = 1;
p_intf->p_sys->pf_gtk_callback = NULL;
* In this function, called approx. 10 times a second, we check what the
* main program wanted to tell us.
*****************************************************************************/
-
static gint GtkManage( gpointer p_data )
{
#define p_intf ((intf_thread_t *)p_data)
}
/* update the playlist */
-// GtkPlayListManage( p_data );
+ GtkPlayListManage( p_data );
if( p_intf->p_input != NULL && !p_intf->b_die )
{
#undef p_intf
}
-
-/*****************************************************************************
- * GtkDisplayDate: display stream date
- *****************************************************************************
- * This function displays the current date related to the position in
- * the stream. It is called whenever the slider changes its value.
- * The lock has to be taken before you call the function.
- *****************************************************************************/
-void GtkDisplayDate( GtkAdjustment *p_adj )
-{
- intf_thread_t *p_intf;
-
- p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" );
-
- if( p_intf->p_input != NULL )
- {
-#define p_area p_intf->p_input->stream.p_selected_area
- char psz_time[ OFFSETTOTIME_MAX_SIZE ];
-
- gtk_frame_set_label( GTK_FRAME( p_intf->p_sys->p_slider_frame ),
- input_OffsetToTime( p_intf->p_input, psz_time,
- ( p_area->i_size * p_adj->value ) / 100 ) );
-#undef p_area
- }
-}
-
-
-/*****************************************************************************
- * GtkModeManage: actualise the aspect of the interface whenever the input
- * changes.
- *****************************************************************************
- * The lock has to be taken before you call the function.
- *****************************************************************************/
-static gint GtkModeManage( intf_thread_t * p_intf )
-{
- GtkWidget * p_dvd_box;
- GtkWidget * p_file_box;
- GtkWidget * p_network_box;
- GtkWidget * p_slider;
- GtkWidget * p_label;
- boolean_t b_control;
-
-#define GETWIDGET( ptr, name ) GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( \
- p_intf->p_sys->ptr ) , ( name ) ) )
- /* hide all boxes except default file box */
- p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "file_box" ) );
- gtk_widget_hide( GTK_WIDGET( p_file_box ) );
-
- p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "network_box" ) );
- gtk_widget_hide( GTK_WIDGET( p_network_box ) );
-
- p_dvd_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "dvd_box" ) );
- gtk_widget_hide( GTK_WIDGET( p_dvd_box ) );
-
- /* hide slider */
- p_slider = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ), "slider_frame" ) );
- gtk_widget_hide( GTK_WIDGET( p_slider ) );
-
- /* controls unavailable */
- b_control = 0;
-
- /* show the box related to current input mode */
- if( p_intf->p_input != NULL )
- {
- switch( p_intf->p_input->stream.i_method & 0xf0 )
- {
- case INPUT_METHOD_FILE:
- gtk_widget_show( GTK_WIDGET( p_file_box ) );
- p_label = gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ),
- "label_status" );
- gtk_label_set_text( GTK_LABEL( p_label ),
- p_intf->p_input->p_source );
- break;
- case INPUT_METHOD_DISC:
- gtk_widget_show( GTK_WIDGET( p_dvd_box ) );
- break;
- case INPUT_METHOD_NETWORK:
- gtk_widget_show( GTK_WIDGET( p_network_box ) );
- p_label = gtk_object_get_data( GTK_OBJECT(
- p_intf->p_sys->p_window ),
- "network_address_label" );
- gtk_label_set_text( GTK_LABEL( p_label ),
- p_intf->p_input->p_source );
- break;
- default:
- intf_ErrMsg( "intf error: can't determine input method" );
- break;
- }
-
- /* slider for seekable streams */
- if( p_intf->p_input->stream.b_seekable )
- {
- gtk_widget_show( GTK_WIDGET( p_slider ) );
- }
-
- /* control buttons for free pace streams */
- b_control = p_intf->p_input->stream.b_pace_control;
-
- /* get ready for menu regeneration */
- p_intf->p_sys->b_title_update = 1;
- p_intf->p_sys->b_chapter_update = 1;
- p_intf->p_sys->b_angle_update = 1;
- p_intf->p_sys->b_audio_update = 1;
- p_intf->p_sys->b_spu_update = 1;
- p_intf->p_sys->i_part = 0;
-
- p_intf->p_input->stream.b_changed = 0;
- intf_WarnMsg( 3,
- "intf info: menus refreshed as stream has changed" );
- }
- else
- {
- /* default mode */
- p_label = gtk_object_get_data( GTK_OBJECT( p_intf->p_sys->p_window ),
- "label_status" );
- gtk_label_set_text( GTK_LABEL( p_label ), "" );
- gtk_widget_show( GTK_WIDGET( p_file_box ) );
-
- /* unsensitize menus */
- gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_title"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_chapter"),
- FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_angle"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_audio"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_window,"menubar_subpictures"),
- FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_navigation"),
- FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_angle"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_audio"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup,"popup_subpictures"),
- FALSE );
- }
-
- /* set control items */
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_back"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_stop"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_pause"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_slow"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_window, "toolbar_fast"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_back"), FALSE );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_stop"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_pause"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_slow"), b_control );
- gtk_widget_set_sensitive( GETWIDGET(p_popup, "popup_fast"), b_control );
-
-#undef GETWIDGET
- return TRUE;
-}
</widget>
<widget>
- <class>GtkCheckMenuItem</class>
+ <class>GtkMenuItem</class>
<name>menubar_fullscreen</name>
<signal>
<name>activate</name>
<last_modification_time>Mon, 14 May 2001 21:29:21 GMT</last_modification_time>
</signal>
<label>_Fullscreen</label>
- <active>False</active>
- <always_show_toggle>True</always_show_toggle>
+ <right_justify>False</right_justify>
</widget>
<widget>
* intf_gtk.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gtk.h,v 1.5 2001/05/19 00:39:30 stef Exp $
+ * $Id: intf_gtk.h,v 1.6 2001/05/23 23:08:20 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
boolean_t b_popup_changed; /* display menu ? */
boolean_t b_window_changed; /* window display toggled ? */
boolean_t b_playlist_changed; /* playlist display toggled ? */
- boolean_t b_menus_update; /* menus have changed ? */
boolean_t b_slider_free; /* slider status */
/* menus handlers */
} intf_sys_t;
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+
+gint GtkModeManage ( intf_thread_t * p_intf );
+void GtkDisplayDate ( GtkAdjustment *p_adj );
+