Commit 2b013d35 authored by Sam Hocevar's avatar Sam Hocevar

* ./modules/misc/gtk_main.c, ./modules/gui/gtk/gtk.c,

    ./modules/gui/gtk/gnome.c, ./modules/gui/familiar/familiar.c: added a
    terminating NULL pointer in the fake argv values we pass to gtk_init().
  * ./modules/misc/qte_main.cpp, ./modules/misc/gtk_main.c: these plugins now
    have the "gui-helper" capability.
  * ./modules/misc/gtk_main.c: paved the way for Gtk2.
parent 8965c3f4
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.58 2003/03/11 19:02:30 fenrir Exp $ * $Id: vlc_common.h,v 1.59 2003/03/17 18:02:11 sam Exp $
* *
* Authors: Samuel Hocevar <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -502,7 +502,8 @@ static inline uint64_t U64_AT( void * _p ) ...@@ -502,7 +502,8 @@ static inline uint64_t U64_AT( void * _p )
#ifndef HAVE_STRNDUP #ifndef HAVE_STRNDUP
# if defined(STRNDUP_IN_GNOME_H) && \ # if defined(STRNDUP_IN_GNOME_H) && \
(defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gnome_main)) (defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gnome_main)||\
defined(MODULE_NAME_IS_gnome2)||defined(MODULE_NAME_IS_gnome2_main))
/* Do nothing: gnome.h defines strndup for us */ /* Do nothing: gnome.h defines strndup for us */
# else # else
# define strndup vlc_strndup # define strndup vlc_strndup
...@@ -662,7 +663,8 @@ typedef __int64 off_t; ...@@ -662,7 +663,8 @@ typedef __int64 off_t;
VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) ); VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) );
#if defined( ENABLE_NLS ) && \ #if defined( ENABLE_NLS ) && \
(defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gnome_main)) (defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gnome_main)||\
defined(MODULE_NAME_IS_gnome2)||defined(MODULE_NAME_IS_gnome2_main))
/* Declare nothing: gnome.h will do it for us */ /* Declare nothing: gnome.h will do it for us */
#elif defined( ENABLE_NLS ) && defined( HAVE_INCLUDED_GETTEXT ) #elif defined( ENABLE_NLS ) && defined( HAVE_INCLUDED_GETTEXT )
# include "libintl.h" # include "libintl.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.c : familiar plugin for vlc * familiar.c : familiar plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: familiar.c,v 1.32 2003/03/17 13:49:14 marcari Exp $ * $Id: familiar.c,v 1.33 2003/03/17 18:02:10 sam Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* Marc Ariberti <marcari@videolan.org> * Marc Ariberti <marcari@videolan.org>
...@@ -90,8 +90,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -90,8 +90,8 @@ static int Open( vlc_object_t *p_this )
} }
#ifdef NEED_GTK_MAIN #ifdef NEED_GTK_MAIN
msg_Dbg( p_intf, "Using gtk_main" ); msg_Dbg( p_intf, "Using gui-helper" );
p_intf->p_sys->p_gtk_main = module_Need( p_this, "gtk_main", "gtk" ); p_intf->p_sys->p_gtk_main = module_Need( p_this, "gui-helper", "gtk" );
if( p_intf->p_sys->p_gtk_main == NULL ) if( p_intf->p_sys->p_gtk_main == NULL )
{ {
free( p_intf->p_sys ); free( p_intf->p_sys );
...@@ -124,7 +124,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -124,7 +124,7 @@ static void Close( vlc_object_t *p_this )
} }
#ifdef NEED_GTK_MAIN #ifdef NEED_GTK_MAIN
msg_Dbg( p_intf, "Releasing gtk_main" ); msg_Dbg( p_intf, "Releasing gui-helper" );
module_Unneed( p_intf, p_intf->p_sys->p_gtk_main ); module_Unneed( p_intf, p_intf->p_sys->p_gtk_main );
#endif #endif
...@@ -143,7 +143,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -143,7 +143,7 @@ static void Run( intf_thread_t *p_intf )
#ifndef NEED_GTK_MAIN #ifndef NEED_GTK_MAIN
/* gtk_init needs to know the command line. We don't care, so we /* gtk_init needs to know the command line. We don't care, so we
* give it an empty one */ * give it an empty one */
char *p_args[] = { "" }; char *p_args[] = { "", NULL };
char **pp_args = p_args; char **pp_args = p_args;
int i_args = 1; int i_args = 1;
int i_dummy; int i_dummy;
...@@ -156,24 +156,24 @@ static void Run( intf_thread_t *p_intf ) ...@@ -156,24 +156,24 @@ static void Run( intf_thread_t *p_intf )
exit (1); exit (1);
#else #else
gtk_set_locale (); gtk_set_locale ();
#ifndef NEED_GTK_MAIN # ifndef NEED_GTK_MAIN
msg_Dbg( p_intf, "Starting familiar GTK+ interface" ); msg_Dbg( p_intf, "Starting familiar GTK+ interface" );
gtk_init( &i_args, &pp_args ); gtk_init( &i_args, &pp_args );
#else # else
/* Initialize Gtk+ */ /* Initialize Gtk+ */
msg_Dbg( p_intf, "Starting familiar GTK+ interface thread" ); msg_Dbg( p_intf, "Starting familiar GTK+ interface thread" );
gdk_threads_enter(); gdk_threads_enter();
#endif # endif
#endif #endif
/* Create some useful widgets that will certainly be used */ /* Create some useful widgets that will certainly be used */
// FIXME: magic path // FIXME: magic path
add_pixmap_directory("share"); add_pixmap_directory("share");
add_pixmap_directory("/usr/share/vlc"); add_pixmap_directory("/usr/share/vlc");
/* Path for pixmaps under linupy 1.4 */ /* Path for pixmaps under linupy 1.4 */
add_pixmap_directory("/usr/local/share/pixmaps/vlc"); add_pixmap_directory("/usr/local/share/pixmaps/vlc");
/* Path for pixmaps under linupy 2.0 */ /* Path for pixmaps under linupy 2.0 */
add_pixmap_directory("/usr/share/pixmaps/vlc"); add_pixmap_directory("/usr/share/pixmaps/vlc");
......
...@@ -7,7 +7,8 @@ COMMON_gtk = \ ...@@ -7,7 +7,8 @@ COMMON_gtk = \
modules/gui/gtk/playlist.c \ modules/gui/gtk/playlist.c \
modules/gui/gtk/modules.c \ modules/gui/gtk/modules.c \
modules/gui/gtk/preferences.c \ modules/gui/gtk/preferences.c \
modules/gui/gtk/gtk_callbacks.c modules/gui/gtk/gtk_callbacks.c \
$(NULL)
SOURCES_gtk = \ SOURCES_gtk = \
modules/gui/gtk/gtk.c \ modules/gui/gtk/gtk.c \
...@@ -35,9 +36,11 @@ noinst_HEADERS += \ ...@@ -35,9 +36,11 @@ noinst_HEADERS += \
modules/gui/gtk/gtk_interface.h \ modules/gui/gtk/gtk_interface.h \
modules/gui/gtk/playlist.h \ modules/gui/gtk/playlist.h \
modules/gui/gtk/preferences.h \ modules/gui/gtk/preferences.h \
modules/gui/gtk/gtk_support.h modules/gui/gtk/gtk_support.h \
$(NULL)
EXTRA_DIST += \ EXTRA_DIST += \
modules/gui/gtk/gtk.glade \ modules/gui/gtk/gtk.glade \
modules/gui/gtk/gnome.glade \ modules/gui/gtk/gnome.glade \
modules/gui/gtk/gnome_callbacks.c modules/gui/gtk/gnome_callbacks.c \
$(NULL)
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* 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.13 2003/03/10 18:17:19 gbazin Exp $ * $Id: gnome.c,v 1.14 2003/03/17 18:02:10 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -98,7 +98,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -98,7 +98,7 @@ static int Open( vlc_object_t *p_this )
return VLC_ENOMEM; return VLC_ENOMEM;
} }
p_intf->p_sys->p_gtk_main = module_Need( p_this, "gtk_main", "gnome" ); p_intf->p_sys->p_gtk_main = module_Need( p_this, "gui-helper", "gnome" );
if( p_intf->p_sys->p_gtk_main == NULL ) if( p_intf->p_sys->p_gtk_main == NULL )
{ {
free( p_intf->p_sys ); free( p_intf->p_sys );
......
...@@ -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.18 2003/03/10 18:17:19 gbazin Exp $ * $Id: gtk.c,v 1.19 2003/03/17 18:02:10 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -97,7 +97,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -97,7 +97,7 @@ static int Open( vlc_object_t *p_this )
} }
#ifdef NEED_GTK_MAIN #ifdef NEED_GTK_MAIN
p_intf->p_sys->p_gtk_main = module_Need( p_this, "gtk_main", "gtk" ); p_intf->p_sys->p_gtk_main = module_Need( p_this, "gui-helper", "gtk" );
if( p_intf->p_sys->p_gtk_main == NULL ) if( p_intf->p_sys->p_gtk_main == NULL )
{ {
free( p_intf->p_sys ); free( p_intf->p_sys );
...@@ -180,7 +180,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -180,7 +180,7 @@ static void Run( intf_thread_t *p_intf )
#else #else
/* gtk_init needs to know the command line. We don't care, so we /* gtk_init needs to know the command line. We don't care, so we
* give it an empty one */ * give it an empty one */
char *p_args[] = { "" }; char *p_args[] = { "", NULL };
char **pp_args = p_args; char **pp_args = p_args;
int i_args = 1; int i_args = 1;
int i_dummy; int i_dummy;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_main.c : Gtk+ wrapper for gtk_main * gtk_main.c : Gtk+ wrapper for gtk_main
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: gtk_main.c,v 1.11 2003/01/15 13:16:39 sam Exp $ * $Id: gtk_main.c,v 1.12 2003/03/17 18:02:10 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -30,7 +30,11 @@ ...@@ -30,7 +30,11 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#ifdef MODULE_NAME_IS_gnome_main #if defined(MODULE_NAME_IS_gtk2_main)
# include <glib.h>
#endif
#if defined(MODULE_NAME_IS_gnome_main) || defined(MODULE_NAME_IS_gnome2_main)
# include <gnome.h> # include <gnome.h>
#endif #endif
...@@ -52,14 +56,24 @@ static vlc_object_t * p_gtk_main = NULL; ...@@ -52,14 +56,24 @@ static vlc_object_t * p_gtk_main = NULL;
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
vlc_module_begin(); vlc_module_begin();
set_description( _("Gtk+ helper module") ); int i_cap;
#ifdef MODULE_NAME_IS_gtk_main set_description( _("Gtk+ GUI helper module") );
set_capability( "gtk_main", 90 ); #if defined(MODULE_NAME_IS_gtk_main)
#else i_cap = 90;
set_capability( "gtk_main", 100 ); add_shortcut( "gtk" );
#elif defined(MODULE_NAME_IS_gnome_main)
i_cap = 100;
add_shortcut( "gtk" );
add_shortcut( "gnome" ); add_shortcut( "gnome" );
#elif defined(MODULE_NAME_IS_gtk2_main)
i_cap = 95;
add_shortcut( "gtk2" );
#elif defined(MODULE_NAME_IS_gnome2_main)
i_cap = 105;
add_shortcut( "gtk2" );
add_shortcut( "gnome2" );
#endif #endif
add_shortcut( "gtk" ); set_capability( "gui-helper", i_cap );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
linked_with_a_crap_library_which_uses_atexit(); linked_with_a_crap_library_which_uses_atexit();
vlc_module_end(); vlc_module_end();
...@@ -152,8 +166,8 @@ static void GtkMain( vlc_object_t *p_this ) ...@@ -152,8 +166,8 @@ static void GtkMain( vlc_object_t *p_this )
{ {
/* gtk_init needs to know the command line. We don't care, so we /* gtk_init needs to know the command line. We don't care, so we
* give it an empty one */ * give it an empty one */
static char *p_args[] = { "" }; static char *p_args[] = { "", NULL };
#ifdef MODULE_NAME_IS_gtk_main #if defined(MODULE_NAME_IS_gtk_main) || defined(MODULE_NAME_IS_gtk2_main)
static char **pp_args = p_args; static char **pp_args = p_args;
#endif #endif
static int i_args = 1; static int i_args = 1;
...@@ -161,7 +175,7 @@ static void GtkMain( vlc_object_t *p_this ) ...@@ -161,7 +175,7 @@ static void GtkMain( vlc_object_t *p_this )
/* FIXME: deprecated ? */ /* FIXME: deprecated ? */
/* gdk_threads_init(); */ /* gdk_threads_init(); */
#ifdef MODULE_NAME_IS_gnome_main #if defined(MODULE_NAME_IS_gnome_main) || defined(MODULE_NAME_IS_gnome2_main)
gnome_init( p_this->p_vlc->psz_object_name, VERSION, i_args, p_args ); gnome_init( p_this->p_vlc->psz_object_name, VERSION, i_args, p_args );
#else #else
gtk_set_locale(); gtk_set_locale();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* qte_main.c : QT Embedded wrapper for gte_main * qte_main.c : QT Embedded wrapper for gte_main
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003 VideoLAN
* $Id: qte_main.cpp,v 1.4 2003/03/06 10:11:33 jpsaman Exp $ * $Id: qte_main.cpp,v 1.5 2003/03/17 18:02:10 sam Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -41,7 +41,7 @@ typedef struct qte_thread_t ...@@ -41,7 +41,7 @@ typedef struct qte_thread_t
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
QApplication* p_qte_application; QApplication* p_qte_application;
QWidget* p_qte_widget; QWidget* p_qte_widget;
} qte_thread_t; } qte_thread_t;
...@@ -63,8 +63,8 @@ static qte_thread_t * p_qte_main = NULL; ...@@ -63,8 +63,8 @@ static qte_thread_t * p_qte_main = NULL;
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
vlc_module_begin(); vlc_module_begin();
set_description( _("Qt Embedded helper module") ); set_description( _("Qt Embedded GUI helper module") );
set_capability( "qte_main", 90 ); set_capability( "gui-helper", 90 );
add_shortcut( "qte" ); add_shortcut( "qte" );
set_callbacks( Open, Close ); set_callbacks( Open, Close );
vlc_module_end(); vlc_module_end();
...@@ -94,8 +94,8 @@ static int Open( vlc_object_t *p_this ) ...@@ -94,8 +94,8 @@ static int Open( vlc_object_t *p_this )
p_qte_main = (qte_thread_t *) vlc_object_create( p_this, sizeof(qte_thread_t) ); p_qte_main = (qte_thread_t *) vlc_object_create( p_this, sizeof(qte_thread_t) );
/* Launch the gtk_main() thread. It will not return until it has /* Launch the QApplication::exec() thread. It will not return until the
* called gdk_threads_enter(), which ensures us thread safety. */ * application is properly initialized, which ensures us thread safety. */
if( vlc_thread_create( p_qte_main, "qte_main", QteMain, if( vlc_thread_create( p_qte_main, "qte_main", QteMain,
VLC_THREAD_PRIORITY_LOW, VLC_TRUE ) ) VLC_THREAD_PRIORITY_LOW, VLC_TRUE ) )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* qte.cpp : QT Embedded plugin for vlc * qte.cpp : QT Embedded plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2003 VideoLAN * Copyright (C) 1998-2003 VideoLAN
* $Id: qte.cpp,v 1.15 2003/03/06 10:11:33 jpsaman Exp $ * $Id: qte.cpp,v 1.16 2003/03/17 18:02:10 sam Exp $
* *
* Authors: Gerald Hansink <gerald.hansink@ordain.nl> * Authors: Gerald Hansink <gerald.hansink@ordain.nl>
* Jean-Paul Saman <jpsaman@wxs.nl> * Jean-Paul Saman <jpsaman@wxs.nl>
...@@ -151,7 +151,7 @@ static int Open( vlc_object_t *p_this ) ...@@ -151,7 +151,7 @@ static int Open( vlc_object_t *p_this )
p_vout->pf_display = Display; p_vout->pf_display = Display;
#ifdef NEED_QTE_MAIN #ifdef NEED_QTE_MAIN
p_vout->p_sys->p_qte_main = module_Need( p_this, "qte_main", "qte" ); p_vout->p_sys->p_qte_main = module_Need( p_this, "gui-helper", "qte" );
if( p_vout->p_sys->p_qte_main == NULL ) if( p_vout->p_sys->p_qte_main == NULL )
{ {
free( p_vout->p_sys ); free( p_vout->p_sys );
...@@ -191,7 +191,7 @@ static void Close ( vlc_object_t *p_this ) ...@@ -191,7 +191,7 @@ static void Close ( vlc_object_t *p_this )
} }
#ifdef NEED_QTE_MAIN #ifdef NEED_QTE_MAIN
msg_Dbg( p_vout, "Releasing qte_main" ); msg_Dbg( p_vout, "Releasing gui-helper" );
module_Unneed( p_vout, p_vout->p_sys->p_qte_main ); module_Unneed( p_vout, p_vout->p_sys->p_qte_main );
#endif #endif
......
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