Commit 32ef13cf authored by Stéphane Borel's avatar Stéphane Borel

*Bugfixes, cleanings in gtk.

parent 9530fc9f
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* -dvd_udf to find files * -dvd_udf to find files
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.58 2001/05/15 01:01:44 stef Exp $ * $Id: input_dvd.c,v 1.59 2001/05/15 14:49:47 stef Exp $
* *
* Author: Stphane Borel <stef@via.ecp.fr> * Author: Stphane Borel <stef@via.ecp.fr>
* *
...@@ -1043,7 +1043,7 @@ static int DVDRead( input_thread_t * p_input, ...@@ -1043,7 +1043,7 @@ static int DVDRead( input_thread_t * p_input,
p_input->stream.p_selected_area->i_tell = i_off - p_input->stream.p_selected_area->i_tell = i_off -
p_input->stream.p_selected_area->i_start; p_input->stream.p_selected_area->i_start;
p_input->stream.p_selected_area->i_part = p_dvd->i_chapter; p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
intf_WarnMsg( 2, "chapter %d", p_dvd->i_chapter);
/* the synchro has to be reinitialized when we change cell */ /* the synchro has to be reinitialized when we change cell */
p_input->stream.pp_programs[0]->i_synchro_state = SYNCHRO_REINIT; p_input->stream.pp_programs[0]->i_synchro_state = SYNCHRO_REINIT;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin. * gtk_callbacks.c : Callbacks for the Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.17 2001/05/15 01:01:44 stef Exp $ * $Id: gtk_callbacks.c,v 1.18 2001/05/15 14:49:48 stef 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>
...@@ -66,10 +66,9 @@ ...@@ -66,10 +66,9 @@
* Main interface callbacks * Main interface callbacks
*/ */
gboolean gboolean GtkExit( GtkWidget *widget,
GtkExit (GtkWidget *widget, GdkEventButton *event,
GdkEventButton *event, gpointer user_data )
gpointer user_data)
{ {
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data ); intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
...@@ -80,10 +79,9 @@ GtkExit (GtkWidget *widget, ...@@ -80,10 +79,9 @@ GtkExit (GtkWidget *widget,
return TRUE; return TRUE;
} }
gboolean gboolean GtkWindowDelete( GtkWidget *widget,
GtkWindowDelete (GtkWidget *widget, GdkEvent *event,
GdkEvent *event, gpointer user_data )
gpointer user_data)
{ {
GtkExit( GTK_WIDGET( widget ), NULL, user_data ); GtkExit( GTK_WIDGET( widget ), NULL, user_data );
...@@ -91,10 +89,9 @@ GtkWindowDelete (GtkWidget *widget, ...@@ -91,10 +89,9 @@ GtkWindowDelete (GtkWidget *widget,
} }
gboolean gboolean GtkWindowToggle( GtkWidget *widget,
GtkWindowToggle (GtkWidget *widget, GdkEventButton *event,
GdkEventButton *event, gpointer user_data )
gpointer user_data)
{ {
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data ); intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
...@@ -111,36 +108,38 @@ GtkWindowToggle (GtkWidget *widget, ...@@ -111,36 +108,38 @@ GtkWindowToggle (GtkWidget *widget,
return TRUE; return TRUE;
} }
gboolean gboolean GtkFullscreen( GtkWidget *widget,
GtkFullscreen (GtkWidget *widget, GdkEventButton *event,
GdkEventButton *event, gpointer user_data)
gpointer user_data)
{ {
if( p_vout_bank->i_count ) if( p_vout_bank->i_count )
{ {
vlc_mutex_lock( &p_vout_bank->pp_vout[0]->change_lock ); vlc_mutex_lock( &p_vout_bank->pp_vout[0]->change_lock );
if( p_vout_bank->pp_vout[0]->b_fullscreen ==
!GTK_CHECK_MENU_ITEM( widget )->active ) p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;
p_vout_bank->pp_vout[0]->i_changes |= VOUT_FULLSCREEN_CHANGE;
vlc_mutex_unlock( &p_vout_bank->pp_vout[0]->change_lock ); vlc_mutex_unlock( &p_vout_bank->pp_vout[0]->change_lock );
}
return TRUE; return TRUE;
}
else
{
return FALSE;
}
} }
void void GtkWindowDrag( GtkWidget *widget,
GtkWindowDrag (GtkWidget *widget, GdkDragContext *drag_context,
GdkDragContext *drag_context, gint x,
gint x, gint y,
gint y, GtkSelectionData *data,
GtkSelectionData *data, guint info,
guint info, guint time,
guint time, gpointer user_data)
gpointer user_data)
{ {
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
int end = p_main->p_playlist->i_size; int end = p_main->p_playlist->i_size;
GtkDropDataReceived( p_intf, data, info, PLAYLIST_END); GtkDropDataReceived( p_intf, data, info, PLAYLIST_END );
if( p_intf->p_input != NULL ) if( p_intf->p_input != NULL )
{ {
...@@ -149,15 +148,16 @@ GtkWindowDrag (GtkWidget *widget, ...@@ -149,15 +148,16 @@ GtkWindowDrag (GtkWidget *widget,
} }
intf_PlaylistJumpto( p_main->p_playlist, end-1 ); intf_PlaylistJumpto( p_main->p_playlist, end-1 );
p_main->p_playlist->b_stopped = 0;
} }
/****************************************************************************
* Slider management
****************************************************************************/
gboolean gboolean GtkSliderRelease( GtkWidget *widget,
GtkSliderRelease (GtkWidget *widget, GdkEventButton *event,
GdkEventButton *event, gpointer user_data )
gpointer user_data)
{ {
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
...@@ -169,10 +169,9 @@ GtkSliderRelease (GtkWidget *widget, ...@@ -169,10 +169,9 @@ GtkSliderRelease (GtkWidget *widget,
} }
gboolean gboolean GtkSliderPress( GtkWidget *widget,
GtkSliderPress (GtkWidget *widget, GdkEventButton *event,
GdkEventButton *event, gpointer user_data)
gpointer user_data)
{ {
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
...@@ -184,9 +183,11 @@ GtkSliderPress (GtkWidget *widget, ...@@ -184,9 +183,11 @@ GtkSliderPress (GtkWidget *widget,
} }
void /****************************************************************************
GtkTitlePrev (GtkButton *button, * DVD specific items
gpointer user_data) ****************************************************************************/
void GtkTitlePrev( GtkButton * button, gpointer user_data )
{ {
intf_thread_t * p_intf; intf_thread_t * p_intf;
input_area_t * p_area; input_area_t * p_area;
...@@ -208,15 +209,13 @@ GtkTitlePrev (GtkButton *button, ...@@ -208,15 +209,13 @@ GtkTitlePrev (GtkButton *button,
} }
void void GtkTitleNext( GtkButton * button, gpointer user_data )
GtkTitleNext (GtkButton *button,
gpointer user_data)
{ {
intf_thread_t * p_intf; intf_thread_t * p_intf;
input_area_t * p_area; input_area_t * p_area;
int i_id; int i_id;
p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
i_id = p_intf->p_input->stream.p_selected_area->i_id + 1; i_id = p_intf->p_input->stream.p_selected_area->i_id + 1;
if( i_id < p_intf->p_input->stream.i_area_nb ) if( i_id < p_intf->p_input->stream.i_area_nb )
...@@ -232,9 +231,7 @@ GtkTitleNext (GtkButton *button, ...@@ -232,9 +231,7 @@ GtkTitleNext (GtkButton *button,
} }
void void GtkChapterPrev( GtkButton * button, gpointer user_data )
GtkChapterPrev (GtkButton *button,
gpointer user_data)
{ {
intf_thread_t * p_intf; intf_thread_t * p_intf;
input_area_t * p_area; input_area_t * p_area;
...@@ -254,9 +251,7 @@ GtkChapterPrev (GtkButton *button, ...@@ -254,9 +251,7 @@ GtkChapterPrev (GtkButton *button,
} }
void void GtkChapterNext( GtkButton * button, gpointer user_data )
GtkChapterNext (GtkButton *button,
gpointer user_data)
{ {
intf_thread_t * p_intf; intf_thread_t * p_intf;
input_area_t * p_area; input_area_t * p_area;
...@@ -378,94 +373,42 @@ GtkJumpCancel (GtkButton *button, ...@@ -378,94 +373,42 @@ GtkJumpCancel (GtkButton *button,
} }
void /****************************************************************************
GtkFileOpenActivate (GtkMenuItem *menuitem, * Callbacks for menuitems
gpointer user_data) ****************************************************************************/
{ void GtkExitActivate( GtkMenuItem * menuitem, gpointer user_data )
GtkFileOpenShow( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkDiscOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkDiscOpenShow( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkNetworkOpenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkNetworkOpenShow( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkExitActivate (GtkMenuItem *menuitem,
gpointer user_data)
{ {
GtkExit( GTK_WIDGET( menuitem ), NULL, user_data ); GtkExit( GTK_WIDGET( menuitem ), NULL, user_data );
} }
void void GtkFullscreenActivate( GtkMenuItem * menuitem, gpointer user_data )
GtkWindowToggleActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWindowToggle( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkFullscreenActivate (GtkMenuItem *menuitem,
gpointer user_data)
{ {
GtkFullscreen( GTK_WIDGET( menuitem ), NULL, user_data ); GtkFullscreen( GTK_WIDGET( menuitem ), NULL, user_data );
} }
void void GtkWindowToggleActivate( GtkMenuItem * menuitem, gpointer user_data )
GtkPlaylistActivate (GtkMenuItem *menuitem,
gpointer user_data)
{ {
GtkPlaylistShow( GTK_WIDGET( menuitem ), NULL, user_data ); GtkWindowToggle( GTK_WIDGET( menuitem ), NULL, user_data );
} }
void void GtkAboutActivate( GtkMenuItem * menuitem, gpointer user_data )
GtkModulesActivate (GtkMenuItem *menuitem,
gpointer user_data)
{ {
GtkAboutShow( GTK_WIDGET( menuitem ), NULL, user_data );
} }
void void GtkJumpActivate( GtkMenuItem * menuitem, gpointer user_data )
GtkPreferencesActivate (GtkMenuItem *menuitem,
gpointer user_data)
{ {
GtkPreferencesShow( GTK_WIDGET( menuitem ), NULL, user_data ); GtkJumpShow( GTK_WIDGET( menuitem ), NULL, user_data );
} }
void void
GtkAboutActivate (GtkMenuItem *menuitem, GtkPlaylistDestroy (GtkObject *object,
gpointer user_data) gpointer user_data)
{ {
GtkAboutShow( GTK_WIDGET( menuitem ), NULL, user_data );
}
void
GtkJumpActivate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkJumpShow( GTK_WIDGET( menuitem ), NULL, user_data );
} }
...@@ -8,294 +8,32 @@ ...@@ -8,294 +8,32 @@
/* General glade callbacks */ /* General glade callbacks */
gboolean /* main window callbacks: specific prototypes are in headers listed before */
GtkExit (GtkWidget *widget,
GdkEventButton *event, gboolean GtkExit ( GtkWidget *, GdkEventButton *, gpointer );
gpointer user_data); gboolean GtkWindowToggle ( GtkWidget *, GdkEventButton *, gpointer );
gboolean gboolean GtkFullscreen ( GtkWidget *, GdkEventButton *, gpointer );
GtkWindowToggle (GtkWidget *widget, gboolean GtkSliderRelease ( GtkWidget *, GdkEventButton *, gpointer );
GdkEventButton *event, gboolean GtkSliderPress ( GtkWidget *, GdkEventButton *, gpointer );
gpointer user_data); gboolean GtkWindowDelete ( GtkWidget * widget, GdkEvent *, gpointer );
gboolean GtkJumpShow ( GtkWidget *, GdkEventButton *, gpointer );
gboolean GtkAboutShow ( GtkWidget *, GdkEventButton *, gpointer );
gboolean void GtkTitlePrev ( GtkButton * button, gpointer );
GtkSliderRelease (GtkWidget *widget, void GtkTitleNext ( GtkButton * button, gpointer );
GdkEventButton *event, void GtkChapterPrev ( GtkButton *, gpointer );
gpointer user_data); void GtkChapterNext ( GtkButton * button, gpointer );
void GtkAboutOk ( GtkButton *, gpointer );
gboolean void GtkWindowDrag ( GtkWidget *, GdkDragContext *,
GtkSliderPress (GtkWidget *widget, gint, gint, GtkSelectionData *,
GdkEventButton *event, guint , guint, gpointer );
gpointer user_data); void GtkJumpOk ( GtkButton * button, gpointer );
void GtkJumpCancel ( GtkButton * button, gpointer user_data );
void void GtkExitActivate ( GtkMenuItem *, gpointer );
GtkTitlePrev (GtkButton *button, void GtkWindowToggleActivate( GtkMenuItem *, gpointer );
gpointer user_data); void GtkFullscreenActivate ( GtkMenuItem *, gpointer );
void GtkAboutActivate ( GtkMenuItem *, gpointer );
void void GtkJumpActivate ( GtkMenuItem *, gpointer );
GtkTitleNext (GtkButton *button,
gpointer user_data); void
GtkPlaylistDestroy (GtkObject *object,
void
GtkChapterPrev (GtkButton *button,
gpointer user_data);
void
GtkChapterNext (GtkButton *button,
gpointer user_data);
gboolean
GtkFullscreen (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
GtkAboutShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void GtkAboutOk( GtkButton * button, gpointer user_data);
void
GtkWindowDrag (GtkWidget *widget,
GdkDragContext *drag_context,
gint x,
gint y,
GtkSelectionData *data,
guint info,
guint time,
gpointer user_data);
gboolean
GtkWindowDelete (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
gboolean
GtkJumpShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void
GtkJumpOk (GtkButton *button,
gpointer user_data);
void
GtkJumpCancel (GtkButton *button,
gpointer user_data);
gboolean
GtkDiscOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
GtkFileOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
GtkNetworkOpenShow (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
void
on_menubar_open_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_open_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_disc_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_network_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_exit_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_interface_hide_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_fullscreen_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_playlist_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menubar_modules_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_popup_play_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_pause_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_stop_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_back_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_popup_interface_toggle_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_fullscreen_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_next_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_prev_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_jump_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_popup_file_activate (GtkMenuItem *menuitem,