Commit 6d254dc9 authored by Loïc Minier's avatar Loïc Minier

* ./plugins/gtk/gnome.c, ./plugins/gtk/gtk.c, ./plugins/gtk/gtk_display.*:

    callbacks for the hide tooltips and toolbar text options
parent cf7a11cd
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
* gnome.c : Gnome plugin for vlc * gnome.c : Gnome plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
...@@ -73,9 +73,9 @@ static gint GnomeManage ( gpointer p_data ); ...@@ -73,9 +73,9 @@ static gint GnomeManage ( gpointer p_data );
MODULE_CONFIG_START MODULE_CONFIG_START
ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL ) ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL )
ADD_BOOL ( "gnome-notooltips", NULL, TOOLTIPS_TEXT, ADD_BOOL ( "gnome-notooltips", GtkHideTooltips, TOOLTIPS_TEXT,
TOOLTIPS_LONGTEXT ) TOOLTIPS_LONGTEXT )
ADD_BOOL ( "gnome-notoolbartext", NULL, TOOLBAR_TEXT, ADD_BOOL ( "gnome-notoolbartext", GtkHideToolbarText, TOOLBAR_TEXT,
TOOLBAR_LONGTEXT ) TOOLBAR_LONGTEXT )
ADD_INTEGER ( "gnome-prefs-maxh", 480, NULL, PREFS_MAXH_TEXT, ADD_INTEGER ( "gnome-prefs-maxh", 480, NULL, PREFS_MAXH_TEXT,
PREFS_MAXH_LONGTEXT ) PREFS_MAXH_LONGTEXT )
...@@ -395,7 +395,7 @@ static gint GnomeManage( gpointer p_data ) ...@@ -395,7 +395,7 @@ static gint GnomeManage( gpointer p_data )
} }
/* Update the playlist */ /* Update the playlist */
GtkPlayListManage( p_intf ); GtkPlayListManage( p_intf );
if( p_input_bank->pp_input[0] != NULL && !p_intf->b_die ) if( p_input_bank->pp_input[0] != NULL && !p_intf->b_die )
{ {
...@@ -417,7 +417,7 @@ static gint GnomeManage( gpointer p_data ) ...@@ -417,7 +417,7 @@ static gint GnomeManage( gpointer p_data )
{ {
float newvalue; float newvalue;
newvalue = p_intf->p_sys->p_adj->value; newvalue = p_intf->p_sys->p_adj->value;
#define p_area p_input_bank->pp_input[0]->stream.p_selected_area #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, /* If the user hasn't touched the slider since the last time,
* then the input can safely change it */ * then the input can safely change it */
...@@ -426,7 +426,7 @@ static gint GnomeManage( gpointer p_data ) ...@@ -426,7 +426,7 @@ static gint GnomeManage( gpointer p_data )
/* Update the value */ /* Update the value */
p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue = p_intf->p_sys->p_adj->value = p_intf->p_sys->f_adj_oldvalue =
( 100. * p_area->i_tell ) / p_area->i_size; ( 100. * p_area->i_tell ) / p_area->i_size;
gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ), gtk_signal_emit_by_name( GTK_OBJECT( p_intf->p_sys->p_adj ),
"value_changed" ); "value_changed" );
} }
...@@ -435,11 +435,11 @@ static gint GnomeManage( gpointer p_data ) ...@@ -435,11 +435,11 @@ static gint GnomeManage( gpointer p_data )
else if( p_intf->p_sys->b_slider_free ) else if( p_intf->p_sys->b_slider_free )
{ {
off_t i_seek = ( newvalue * p_area->i_size ) / 100; off_t i_seek = ( newvalue * p_area->i_size ) / 100;
vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock ); vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );
input_Seek( p_input_bank->pp_input[0], i_seek ); input_Seek( p_input_bank->pp_input[0], i_seek );
vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock ); vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
/* Update the old value */ /* Update the old value */
p_intf->p_sys->f_adj_oldvalue = newvalue; p_intf->p_sys->f_adj_oldvalue = newvalue;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc * gtk.c : Gtk+ plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -72,7 +72,8 @@ static gint GtkManage ( gpointer p_data ); ...@@ -72,7 +72,8 @@ static gint GtkManage ( gpointer p_data );
MODULE_CONFIG_START MODULE_CONFIG_START
ADD_CATEGORY_HINT( N_("Miscellaneous"), NULL ) 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, ADD_INTEGER ( "gtk-prefs-maxh", 480, NULL, PREFS_MAXH_TEXT,
PREFS_MAXH_LONGTEXT ) PREFS_MAXH_LONGTEXT )
MODULE_CONFIG_STOP MODULE_CONFIG_STOP
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_display.c: Gtk+ tools for main interface * gtk_display.c: Gtk+ tools for main interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
void GtkDisplayDate( GtkAdjustment *p_adj ) void GtkDisplayDate( GtkAdjustment *p_adj )
{ {
intf_thread_t *p_intf; intf_thread_t *p_intf;
p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" ); p_intf = gtk_object_get_data( GTK_OBJECT( p_adj ), "p_intf" );
if( p_input_bank->pp_input[0] != NULL ) if( p_input_bank->pp_input[0] != NULL )
...@@ -167,7 +167,7 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -167,7 +167,7 @@ gint GtkModeManage( intf_thread_t * p_intf )
p_input_bank->pp_input[0]->psz_source ); p_input_bank->pp_input[0]->psz_source );
break; break;
} }
/* initialize and show slider for seekable streams */ /* initialize and show slider for seekable streams */
if( p_input_bank->pp_input[0]->stream.b_seekable ) if( p_input_bank->pp_input[0]->stream.b_seekable )
{ {
...@@ -176,7 +176,7 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -176,7 +176,7 @@ gint GtkModeManage( intf_thread_t * p_intf )
"value_changed" ); "value_changed" );
gtk_widget_show( GTK_WIDGET( p_slider ) ); gtk_widget_show( GTK_WIDGET( p_slider ) );
} }
/* control buttons for free pace streams */ /* control buttons for free pace streams */
b_control = p_input_bank->pp_input[0]->stream.b_pace_control; b_control = p_input_bank->pp_input[0]->stream.b_pace_control;
...@@ -187,7 +187,7 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -187,7 +187,7 @@ gint GtkModeManage( intf_thread_t * p_intf )
p_intf->p_sys->b_audio_update = 1; p_intf->p_sys->b_audio_update = 1;
p_intf->p_sys->b_spu_update = 1; p_intf->p_sys->b_spu_update = 1;
p_intf->p_sys->i_part = 0; p_intf->p_sys->i_part = 0;
p_input_bank->pp_input[0]->stream.b_changed = 0; p_input_bank->pp_input[0]->stream.b_changed = 0;
intf_WarnMsg( 3, "intf: stream has changed, refreshing interface" ); intf_WarnMsg( 3, "intf: stream has changed, refreshing interface" );
} }
...@@ -241,3 +241,39 @@ gint GtkModeManage( intf_thread_t * p_intf ) ...@@ -241,3 +241,39 @@ gint GtkModeManage( intf_thread_t * p_intf )
#undef GETWIDGET #undef GETWIDGET
return TRUE; 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
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_dsiplay.h: Gtk+ tools for main interface. * gtk_dsiplay.h: Gtk+ tools for main interface.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr> * Stéphane Borel <stef@via.ecp.fr>
...@@ -26,7 +26,8 @@ ...@@ -26,7 +26,8 @@
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
gint GtkModeManage ( intf_thread_t * p_intf ); gint GtkModeManage ( intf_thread_t * p_intf );
void GtkDisplayDate ( GtkAdjustment *p_adj ); void GtkDisplayDate ( GtkAdjustment *p_adj );
void GtkHideTooltips ( void );
void GtkHideToolbarText ( void );
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment