* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: gnome.c,v 1.19 2002/05/03 17:37:09 lool Exp $
+ * $Id: gnome.c,v 1.20 2002/05/04 02:05:03 lool 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
MODULE_CONFIG_START
ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
- ADD_BOOL ( "gnome-notooltips", NULL, TOOLTIPS_TEXT,
+ ADD_BOOL ( "gnome-notooltips", GtkHideTooltips, TOOLTIPS_TEXT,
TOOLTIPS_LONGTEXT )
- ADD_BOOL ( "gnome-notoolbartext", NULL, TOOLBAR_TEXT,
+ ADD_BOOL ( "gnome-notoolbartext", GtkHideToolbarText, TOOLBAR_TEXT,
TOOLBAR_LONGTEXT )
ADD_INTEGER ( "gnome-prefs-maxh", 480, NULL, PREFS_MAXH_TEXT,
PREFS_MAXH_LONGTEXT )
}
/* Update the playlist */
- GtkPlayListManage( p_intf );
+ GtkPlayListManage( p_intf );
if( p_input_bank->pp_input[0] != NULL && !p_intf->b_die )
{
{
float newvalue;
newvalue = p_intf->p_sys->p_adj->value;
-
+
#define p_area p_input_bank->pp_input[0]->stream.p_selected_area
/* If the user hasn't touched the slider since the last time,
* then the input can safely change it */
/* 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" );
}
else if( p_intf->p_sys->b_slider_free )
{
off_t i_seek = ( newvalue * p_area->i_size ) / 100;
-
+
vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );
input_Seek( p_input_bank->pp_input[0], i_seek );
vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
-
+
/* Update the old value */
p_intf->p_sys->f_adj_oldvalue = newvalue;
}
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
- * $Id: gtk.c,v 1.20 2002/04/23 14:16:20 sam Exp $
+ * $Id: gtk.c,v 1.21 2002/05/04 02:05:03 lool Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
MODULE_CONFIG_START
ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
- ADD_BOOL ( "gtk-notooltips", NULL, TOOLTIPS_TEXT, TOOLTIPS_LONGTEXT )
+ ADD_BOOL ( "gtk-notooltips", GtkHideTooltips, TOOLTIPS_TEXT,
+ TOOLTIPS_LONGTEXT )
ADD_INTEGER ( "gtk-prefs-maxh", 480, NULL, PREFS_MAXH_TEXT,
PREFS_MAXH_LONGTEXT )
MODULE_CONFIG_STOP
* gtk_display.c: Gtk+ tools for main interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_display.c,v 1.20 2002/04/23 14:16:20 sam Exp $
+ * $Id: gtk_display.c,v 1.21 2002/05/04 02:05:03 lool Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
void GtkDisplayDate( GtkAdjustment *p_adj )
{
intf_thread_t *p_intf;
-
+
p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" );
if( p_input_bank->pp_input[0] != NULL )
p_input_bank->pp_input[0]->psz_source );
break;
}
-
+
/* initialize and show slider for seekable streams */
if( p_input_bank->pp_input[0]->stream.b_seekable )
{
"value_changed" );
gtk_widget_show( GTK_WIDGET( p_slider ) );
}
-
+
/* control buttons for free pace streams */
b_control = p_input_bank->pp_input[0]->stream.b_pace_control;
p_intf->p_sys->b_audio_update = 1;
p_intf->p_sys->b_spu_update = 1;
p_intf->p_sys->i_part = 0;
-
+
p_input_bank->pp_input[0]->stream.b_changed = 0;
intf_WarnMsg( 3, "intf: stream has changed, refreshing interface" );
}
#undef GETWIDGET
return TRUE;
}
+
+/*****************************************************************************
+ * GtkHideTooltips: show or hide the tooltips depending on the configuration
+ * option gnome-notooltips
+ *****************************************************************************
+ * FIXME: we should get the intf as parameter
+ *****************************************************************************/
+void GtkHideTooltips( void )
+{
+ if( config_GetIntVariable( "gnome-notooltips" ) )
+ gtk_tooltips_disable( p_main->p_intf->p_sys->p_tooltips );
+ else gtk_tooltips_enable( p_main->p_intf->p_sys->p_tooltips );
+}
+
+#ifdef MODULE_NAME_IS_gnome
+/*****************************************************************************
+ * GtkHideToolbartext: show or hide the tooltips depending on the
+ * configuration option gnome-notoolbartext
+ *****************************************************************************
+ * FIXME: we should get the intf as parameter
+ * FIXME: GNOME only because of missing icons in gtk interface
+ *****************************************************************************/
+void GtkHideToolbarText( void )
+{
+ GtkToolbarStyle style;
+ GtkToolbar * p_toolbar;
+
+ style = config_GetIntVariable( "gnome-notoolbartext" )
+ ? GTK_TOOLBAR_ICONS
+ : GTK_TOOLBAR_BOTH;
+
+ p_toolbar = GTK_TOOLBAR(lookup_widget( p_main->p_intf->p_sys->p_window,
+ "toolbar" ));
+ gtk_toolbar_set_style( p_toolbar, style );
+}
+#endif
* gtk_dsiplay.h: Gtk+ tools for main interface.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_display.h,v 1.1 2001/05/23 23:08:20 stef Exp $
+ * $Id: gtk_display.h,v 1.2 2002/05/04 02:05:03 lool Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
* Prototypes
*****************************************************************************/
-gint GtkModeManage ( intf_thread_t * p_intf );
-void GtkDisplayDate ( GtkAdjustment *p_adj );
-
+gint GtkModeManage ( intf_thread_t * p_intf );
+void GtkDisplayDate ( GtkAdjustment *p_adj );
+void GtkHideTooltips ( void );
+void GtkHideToolbarText ( void );