Commit c33cab35 authored by Sam Hocevar's avatar Sam Hocevar

* ./plugins/gtk/*: new generic "Open Target" window. Please test and

    comment on usability.
parent 7fadd296
#! /bin/sh
## bootstrap.sh file for vlc, the VideoLAN Client
## $Id: bootstrap.sh,v 1.5 2002/06/08 14:08:46 sam Exp $
## $Id: bootstrap.sh,v 1.6 2002/07/11 19:28:13 sam Exp $
##
## Authors: Samuel Hocevar <sam@zoy.org>
......@@ -69,7 +69,6 @@ EOF
| sed 's#_("--")#"--"#' \
| sed 's#_("/dev/dvd")#"/dev/dvd"#' \
| sed 's#_(\("./."\))#\1#' \
| sed 's/_GLADE_SUX_\([^,]*\), NULL/, "\1"/' \
>> /tmp/$$.$file.bak
mv -f /tmp/$$.$file.bak plugins/gtk/$file
fi
......
......@@ -2,7 +2,7 @@
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: gnome.c,v 1.28 2002/07/02 19:16:47 sam Exp $
* $Id: gnome.c,v 1.29 2002/07/11 19:28:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -289,10 +289,7 @@ static void intf_Run( intf_thread_t *p_intf )
/* 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_sat = NULL;
p_intf->p_sys->p_open = NULL;
p_intf->p_sys->p_jump = NULL;
/* Hide tooltips if the option is set */
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*****************************************************************************
* gnome_callbacks.c : GNOME-specific callbacks.
*****************************************************************************
* Copyright (C) 2000, 2001, 2002 VideoLAN
* $Id: gnome_callbacks.c,v 1.12 2002/06/07 14:30:40 sam 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.
*****************************************************************************/
/*****************************************************************************
* This file is not needed: everything is in gtk_callbacks.c
*****************************************************************************/
/*****************************************************************************
* This file is not needed: everything is in gtk_callbacks.h
*****************************************************************************/
#include "gtk_callbacks.h"
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -5,12 +5,9 @@
GtkWidget* create_intf_window (void);
GtkWidget* create_intf_popup (void);
GtkWidget* create_intf_about (void);
GtkWidget* create_intf_fileopen (void);
GtkWidget* create_intf_open (void);
GtkWidget* create_intf_file (void);
GtkWidget* create_intf_modules (void);
GtkWidget* create_intf_disc (void);
GtkWidget* create_intf_network (void);
GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_jump (void);
GtkWidget* create_intf_open (void);
GtkWidget* create_intf_messages (void);
GtkWidget* create_intf_sat (void);
......@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: gtk.c,v 1.28 2002/07/02 19:16:47 sam Exp $
* $Id: gtk.c,v 1.29 2002/07/11 19:28:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -284,10 +284,7 @@ static void intf_Run( intf_thread_t *p_intf )
/* 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_sat = NULL;
p_intf->p_sys->p_network = NULL;
p_intf->p_sys->p_open = NULL;
p_intf->p_sys->p_jump = NULL;
/* Hide tooltips if the option is set */
......@@ -359,7 +356,7 @@ static gint GtkManage( gpointer p_data )
{
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 );
"p_intf", p_intf );
}
gtk_menu_popup( GTK_MENU( p_intf->p_sys->p_popup ),
NULL, NULL, NULL, NULL, 0, GDK_CURRENT_TIME );
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* gtk_callbacks.c : Callbacks for the Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.c,v 1.47 2002/07/01 17:39:08 sam Exp $
* $Id: gtk_callbacks.c,v 1.48 2002/07/11 19:28:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -46,6 +46,40 @@
#include "netutils.h"
/*****************************************************************************
* Useful function to retrieve p_intf
****************************************************************************/
void * __GtkGetIntf( GtkWidget * widget )
{
void *p_data;
if( GTK_IS_MENU_ITEM( widget ) )
{
/* Look for a GTK_MENU */
while( widget->parent && !GTK_IS_MENU( widget ) )
{
widget = widget->parent;
}
/* Maybe this one has the data */
p_data = gtk_object_get_data( GTK_OBJECT( widget ), "p_intf" );
if( p_data )
{
return p_data;
}
/* Otherwise, the parent widget has it */
widget = gtk_menu_get_attach_widget( GTK_MENU( widget ) );
}
/* We look for the top widget */
widget = gtk_widget_get_toplevel( GTK_WIDGET( widget ) );
p_data = gtk_object_get_data( GTK_OBJECT( widget ), "p_intf" );
return p_data;
}
/*****************************************************************************
* Callbacks
*****************************************************************************/
......@@ -57,7 +91,7 @@
gboolean GtkExit( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( widget );
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_vlc->b_die = 1;
......@@ -79,12 +113,11 @@ gboolean GtkWindowDelete( GtkWidget *widget,
gboolean GtkWindowToggle( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( widget );
if( GTK_WIDGET_VISIBLE(p_intf->p_sys->p_window) )
{
gtk_widget_hide( p_intf->p_sys->p_window);
}
else
{
......@@ -97,7 +130,7 @@ gboolean GtkWindowToggle( GtkWidget *widget,
gboolean GtkFullscreen( GtkWidget *widget,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( widget );
vout_thread_t *p_vout;
p_vout = vlc_object_find( p_intf->p_sys->p_input,
......@@ -121,7 +154,7 @@ void GtkWindowDrag( GtkWidget *widget,
guint time,
gpointer user_data)
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
intf_thread_t * p_intf = GtkGetIntf( widget );
GtkDropDataReceived( p_intf, data, info, PLAYLIST_END );
}
......@@ -134,7 +167,7 @@ gboolean GtkSliderRelease( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
intf_thread_t *p_intf = GtkGetIntf( widget );
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_sys->b_slider_free = 1;
......@@ -148,7 +181,7 @@ gboolean GtkSliderPress( GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
intf_thread_t *p_intf = GtkGetIntf( widget );
vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_sys->b_slider_free = 0;
......@@ -168,7 +201,7 @@ void GtkTitlePrev( GtkButton * button, gpointer user_data )
input_area_t * p_area;
int i_id;
p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
p_intf = GtkGetIntf( button );
i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id - 1;
......@@ -194,7 +227,7 @@ void GtkTitleNext( GtkButton * button, gpointer user_data )
input_area_t * p_area;
int i_id;
p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
p_intf = GtkGetIntf( button );
i_id = p_intf->p_sys->p_input->stream.p_selected_area->i_id + 1;
if( i_id < p_intf->p_sys->p_input->stream.i_area_nb )
......@@ -217,7 +250,7 @@ void GtkChapterPrev( GtkButton * button, gpointer user_data )
intf_thread_t * p_intf;
input_area_t * p_area;
p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
p_intf = GtkGetIntf( button );
p_area = p_intf->p_sys->p_input->stream.p_selected_area;
if( p_area->i_part > 0 )
......@@ -240,7 +273,7 @@ void GtkChapterNext( GtkButton * button, gpointer user_data )
intf_thread_t * p_intf;
input_area_t * p_area;
p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
p_intf = GtkGetIntf( button );
p_area = p_intf->p_sys->p_input->stream.p_selected_area;
if( p_area->i_part < p_area->i_part_nb )
......@@ -276,7 +309,7 @@ void GtkChannelGo( GtkButton * button, gpointer user_data )
GtkWidget * spin;
int i_channel;
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( button );
window = gtk_widget_get_toplevel( GTK_WIDGET (button) );
spin = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( window ),
......@@ -300,7 +333,7 @@ void GtkChannelGo( GtkButton * button, gpointer user_data )
gboolean GtkAboutShow( GtkWidget *widget,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( widget );
if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) )
{
......@@ -316,7 +349,7 @@ gboolean GtkAboutShow( GtkWidget *widget,
void GtkAboutOk( GtkButton * button, gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( button );
gtk_widget_hide( p_intf->p_sys->p_about );
}
......@@ -329,7 +362,7 @@ void GtkAboutOk( GtkButton * button, gpointer user_data)
gboolean GtkJumpShow( GtkWidget *widget,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( widget );
if( !GTK_IS_WIDGET( p_intf->p_sys->p_jump ) )
{
......@@ -348,7 +381,7 @@ gboolean GtkJumpShow( GtkWidget *widget,
void GtkJumpOk( GtkButton *button,
gpointer user_data)
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET( button ), (char*)user_data );
intf_thread_t * p_intf = GtkGetIntf( button );
int i_hours, i_minutes, i_seconds;
if( p_intf->p_sys->p_input == NULL )
......@@ -387,7 +420,7 @@ gboolean GtkDiscEject ( GtkWidget *widget, gpointer user_data )
char *psz_parser;
char *psz_current;
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( widget );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
......@@ -493,7 +526,7 @@ gboolean GtkMessagesShow( GtkWidget *widget,
{
static GdkColor black = { 0, 0x0000, 0x0000, 0x0000 };
static GdkColormap *colormap;
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( widget );
gtk_widget_show( p_intf->p_sys->p_messages );
colormap = gdk_colormap_get_system ();
......@@ -514,7 +547,7 @@ void
GtkMessagesOk (GtkButton *button,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( button );
gtk_widget_hide( p_intf->p_sys->p_messages );
}
......@@ -524,8 +557,17 @@ GtkMessagesDelete (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t *p_intf = GtkGetIntf( widget );
gtk_widget_hide( p_intf->p_sys->p_messages );
return TRUE;
}
void
GtkOpenNotebookChanged (GtkNotebook *notebook,
GtkNotebookPage *page,
gint page_num,
gpointer user_data)
{
GtkOpenChanged( GTK_WIDGET( notebook ), user_data );
}
......@@ -2,7 +2,7 @@
* gtk_callbacks.h : Callbacks for the gtk plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_callbacks.h,v 1.20 2002/06/07 14:30:40 sam Exp $
* $Id: gtk_callbacks.h,v 1.21 2002/07/11 19:28:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -39,7 +39,7 @@
/* 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 *, gpointer );
......@@ -113,5 +113,35 @@ GtkNetworkOpenChannel (GtkToggleButton *togglebutton,
gpointer user_data);
void
GtkNetworkOpenChannel (GtkToggleButton *togglebutton,
GtkOpenOk (GtkButton *button,
gpointer user_data);
void
GtkOpenCancel (GtkButton *button,
gpointer user_data);
void
GtkOpenChanged (GtkWidget *button,
gpointer user_data);
void
GtkOpenNotebookChanged (GtkNotebook *notebook,
GtkNotebookPage *page,
gint page_num,
gpointer user_data);
void
GtkSatOpenToggle (GtkToggleButton *togglebutton,
gpointer user_data);
void
GtkFileShow (GtkButton *button,
gpointer user_data);
void
GtkFileOk (GtkButton *button,
gpointer user_data);
void
GtkFileCancel (GtkButton *button,
gpointer user_data);
......@@ -2,7 +2,7 @@
* gtk_common.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: gtk_common.h,v 1.10 2002/06/07 14:30:41 sam Exp $
* $Id: gtk_common.h,v 1.11 2002/07/11 19:28:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -30,15 +30,6 @@
#define MAX_ATEXIT 10
/*****************************************************************************
* Useful inline function
****************************************************************************/
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 Gtk+ interface
*****************************************************************************/
......@@ -66,10 +57,7 @@ struct intf_sys_s
GtkWidget * p_playwin; /* 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_sat; /* sat selection window */
GtkWidget * p_network; /* network stream window */
GtkWidget * p_open; /* multiopen window */
GtkWidget * p_jump; /* jump window */
GtkTooltips * p_tooltips; /* tooltips */
......@@ -105,3 +93,9 @@ struct intf_sys_s
gint GtkModeManage ( intf_thread_t * p_intf );
void GtkDisplayDate ( GtkAdjustment *p_adj );
/*****************************************************************************
* Useful macro
****************************************************************************/
#define GtkGetIntf( widget ) __GtkGetIntf( GTK_WIDGET( widget ) )
void * __GtkGetIntf( GtkWidget * );
......@@ -2,7 +2,7 @@
* gtk_control.c : functions to handle stream control buttons.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_control.c,v 1.12 2002/06/07 14:30:41 sam Exp $
* $Id: gtk_control.c,v 1.13 2002/07/11 19:28:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -61,7 +61,7 @@ gboolean GtkControlBack( GtkWidget *widget,
gboolean GtkControlStop( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t * p_intf = GtkGetIntf( widget );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
......@@ -79,7 +79,7 @@ gboolean GtkControlStop( GtkWidget *widget,
gboolean GtkControlPlay( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t * p_intf = GtkGetIntf( widget );
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
......@@ -110,7 +110,7 @@ gboolean GtkControlPlay( GtkWidget *widget,
gboolean GtkControlPause( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t * p_intf = GtkGetIntf( widget );
if( p_intf->p_sys->p_input == NULL )
{
......@@ -126,7 +126,7 @@ gboolean GtkControlPause( GtkWidget *widget,
gboolean GtkControlSlow( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t * p_intf = GtkGetIntf( widget );
if( p_intf->p_sys->p_input == NULL )
{
......@@ -142,7 +142,7 @@ gboolean GtkControlSlow( GtkWidget *widget,
gboolean GtkControlFast( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), (char*)user_data );
intf_thread_t * p_intf = GtkGetIntf( widget );
if( p_intf->p_sys->p_input == NULL )
{
......
This diff is collapsed.
......@@ -5,10 +5,8 @@
GtkWidget* create_intf_window (void);
GtkWidget* create_intf_popup (void);
GtkWidget* create_intf_about (void);
GtkWidget* create_intf_fileopen (void);
GtkWidget* create_intf_disc (void);
GtkWidget* create_intf_network (void);
GtkWidget* create_intf_open (void);
GtkWidget* create_intf_file (void);
GtkWidget* create_intf_jump (void);
GtkWidget* create_intf_playlist (void);
GtkWidget* create_intf_messages (void);
GtkWidget* create_intf_sat (void);
......@@ -2,7 +2,7 @@
* gtk_menu.c : functions to handle menu items.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_menu.c,v 1.26 2002/06/01 12:31:59 sam Exp $
* $Id: gtk_menu.c,v 1.27 2002/07/11 19:28:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -71,12 +71,12 @@ gint GtkSetupMenus( intf_thread_t * p_intf );
* user_data to transmit intf_* and we need to refresh the other menu.
****************************************************************************/
#define GTKLANGTOGGLE( intf, window, menu, type, callback, b_update ) \
#define GTKLANGTOGGLE( window, menu, type, callback, b_update ) \
intf_thread_t * p_intf; \
GtkWidget * p_menu; \
es_descriptor_t * p_es; \
\
p_intf = GetIntf( GTK_WIDGET(menuitem), (intf) ); \
p_intf = GtkGetIntf( menuitem ); \
\
if( !p_intf->p_sys->b_update ) \
{ \
......@@ -103,13 +103,13 @@ gint GtkSetupMenus( intf_thread_t * p_intf );
void GtkMenubarAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GTKLANGTOGGLE( "intf_window", p_popup, "popup_audio", AUDIO_ES,
GTKLANGTOGGLE( p_popup, "popup_audio", AUDIO_ES,
GtkPopupAudioToggle, b_audio_update );
}
void GtkPopupAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GTKLANGTOGGLE( "intf_popup", p_window, "menubar_audio", AUDIO_ES,
GTKLANGTOGGLE( p_window, "menubar_audio", AUDIO_ES,
GtkMenubarAudioToggle, b_audio_update );
}
......@@ -119,13 +119,13 @@ void GtkPopupAudioToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
void GtkMenubarSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GTKLANGTOGGLE( "intf_window", p_popup, "popup_subpictures", SPU_ES,
GTKLANGTOGGLE( p_popup, "popup_subpictures", SPU_ES,
GtkPopupSubtitleToggle, b_spu_update );
}
void GtkPopupSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GTKLANGTOGGLE( "intf_popup", p_window, "menubar_subpictures", SPU_ES,
GTKLANGTOGGLE( p_window, "menubar_subpictures", SPU_ES,
GtkMenubarSubtitleToggle, b_spu_update );
}
......@@ -138,7 +138,7 @@ void GtkPopupSubtitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem,
gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
intf_thread_t * p_intf = GtkGetIntf( menuitem );
if( menuitem->active &&
!p_intf->p_sys->b_title_update &&
......@@ -173,8 +173,8 @@ void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem,
/*
* Program
*/
#define GTKPROGRAMTOGGLE( intf ) \
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), intf ); \
#define GTKPROGRAMTOGGLE( ) \
intf_thread_t * p_intf = GtkGetIntf( menuitem ); \
\
if( menuitem->active && !p_intf->p_sys->b_program_update ) \
{ \
......@@ -195,12 +195,12 @@ void GtkPopupNavigationToggle( GtkCheckMenuItem * menuitem,
void GtkMenubarProgramToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GTKPROGRAMTOGGLE( "intf_window" );
GTKPROGRAMTOGGLE( );
}
void GtkPopupProgramToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
GTKPROGRAMTOGGLE( "intf_popup" );
GTKPROGRAMTOGGLE( );
}
/*
......@@ -209,7 +209,7 @@ void GtkPopupProgramToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
void GtkMenubarTitleToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
{
intf_thread_t * p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
intf_thread_t * p_intf = GtkGetIntf( menuitem );
if( menuitem->active && !p_intf->p_sys->b_title_update )
{
......@@ -239,7 +239,7 @@ void GtkMenubarChapterToggle( GtkCheckMenuItem * menuitem, gpointer user_data )
gint i_chapter;
GtkWidget * p_popup_menu;
p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
p_intf = GtkGetIntf( menuitem );
p_area = p_intf->p_sys->p_input->stream.p_selected_area;
i_chapter = (gint)((long)user_data);
......@@ -304,6 +304,7 @@ static gint GtkRadioMenu( intf_thread_t * p_intf,
p_group = p_menu_group;
p_menu = gtk_menu_new();
gtk_object_set_data( GTK_OBJECT( p_menu ), "p_intf", p_intf );
for( i_item = 0 ; i_item < i_nb ; i_item++ )
{
......@@ -323,6 +324,7 @@ static gint GtkRadioMenu( intf_thread_t * p_intf,
p_item_group = gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_item_group );
p_submenu = gtk_menu_new();
gtk_object_set_data( GTK_OBJECT( p_submenu ), "p_intf", p_intf );
}
snprintf( psz_name, GTK_MENU_LABEL_SIZE, "%s %d",
......@@ -416,6 +418,7 @@ static gint GtkProgramMenu( gpointer p_data,
/* menu container */
p_menu = gtk_menu_new();
gtk_object_set_data( GTK_OBJECT( p_menu ), "p_intf", p_intf );
p_item_active = NULL;
......@@ -508,6 +511,7 @@ static gint GtkLanguageMenus( gpointer p_data,
/* menu container */
p_menu = gtk_menu_new();
gtk_object_set_data( GTK_OBJECT( p_menu ), "p_intf", p_intf );
/* special case for "off" item */
snprintf( psz_name, GTK_MENU_LABEL_SIZE, _("None") );
......@@ -648,6 +652,8 @@ static gint GtkTitleMenu( gpointer p_data,
p_item_active = NULL;
i_title_nb = p_intf->p_sys->p_input->stream.i_area_nb;
gtk_object_set_data( GTK_OBJECT( p_title_menu ), "p_intf", p_intf );
/* loop on titles */
for( i_title = 1 ; i_title < i_title_nb ; i_title++ )
{
......@@ -667,6 +673,8 @@ static gint GtkTitleMenu( gpointer p_data,
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();
gtk_object_set_data( GTK_OBJECT( p_title_submenu ),
"p_intf", p_intf );
}
snprintf( psz_name, GTK_MENU_LABEL_SIZE, _("Title %d (%d)"), i_title,
......@@ -705,6 +713,8 @@ static gint GtkTitleMenu( gpointer p_data,
#if 1
p_chapter_menu = gtk_menu_new();
gtk_object_set_data( GTK_OBJECT( p_chapter_menu ),
"p_intf", p_intf );
i_chapter_nb =
p_intf->p_sys->p_input->stream.pp_areas[i_title]->i_part_nb;
......@@ -729,6 +739,8 @@ static gint GtkTitleMenu( gpointer p_data,
gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_chapter_menu_item );
p_chapter_submenu = gtk_menu_new();
gtk_object_set_data( GTK_OBJECT( p_chapter_submenu ),
"p_intf", p_intf );
}
snprintf( psz_name, GTK_MENU_LABEL_SIZE,
......
......@@ -2,7 +2,7 @@
* gtk_modules.c : functions to build modules configuration boxes.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_modules.c,v 1.9 2002/06/07 14:30:41 sam Exp $
* $Id: gtk_modules.c,v 1.10 2002/07/11 19:28:13 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -48,7 +48,7 @@
gboolean GtkModulesShow( GtkWidget *widget,
gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
intf_thread_t *p_intf = GtkGetIntf( widget );
if( !GTK_IS_WIDGET( p_intf->p_sys->p_modules ) )
{
......@@ -64,7 +64,7 @@ gboolean GtkModulesShow( GtkWidget *widget,
void GtkModulesCancel( GtkButton * button, gpointer user_data )
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" );
intf_thread_t *p_intf = GtkGetIntf( button );
gtk_widget_hide( p_intf->p_sys->p_modules );
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
* gtk_preferences.c: functions to handle the preferences dialog box.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gtk_preferences.c,v 1.33 2002/06/11 09:44:21 gbazin Exp $
* $Id: gtk_preferences.c,v 1.34 2002/07/11 19:28:13 sam Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Loc Minier <lool@via.ecp.fr>
......@@ -80,7 +80,7 @@ void GtkPreferencesShow( GtkMenuItem * menuitem, gpointer user_data )
{
intf_thread_t * p_intf;
p_intf = GetIntf( GTK_WIDGET(menuitem), (char*)user_data );
p_intf = GtkGetIntf( menuitem );
GtkCreateConfigDialog( "main", p_intf );
}
......
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