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 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* 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>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -502,7 +502,8 @@ static inline uint64_t U64_AT( void * _p )
#ifndef HAVE_STRNDUP
# 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 */
# else
# define strndup vlc_strndup
......@@ -662,7 +663,8 @@ typedef __int64 off_t;
VLC_EXPORT( char *, vlc_dgettext, ( const char *package, const char *msgid ) );
#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 */
#elif defined( ENABLE_NLS ) && defined( HAVE_INCLUDED_GETTEXT )
# include "libintl.h"
......
......@@ -2,7 +2,7 @@
* familiar.c : familiar plugin for vlc
*****************************************************************************
* 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>
* Marc Ariberti <marcari@videolan.org>
......@@ -90,8 +90,8 @@ static int Open( vlc_object_t *p_this )
}
#ifdef NEED_GTK_MAIN
msg_Dbg( p_intf, "Using gtk_main" );
p_intf->p_sys->p_gtk_main = module_Need( p_this, "gtk_main", "gtk" );
msg_Dbg( p_intf, "Using gui-helper" );
p_intf->p_sys->p_gtk_main = module_Need( p_this, "gui-helper", "gtk" );
if( p_intf->p_sys->p_gtk_main == NULL )
{
free( p_intf->p_sys );
......@@ -124,7 +124,7 @@ static void Close( vlc_object_t *p_this )
}
#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 );
#endif
......@@ -143,7 +143,7 @@ static void Run( intf_thread_t *p_intf )
#ifndef NEED_GTK_MAIN
/* gtk_init needs to know the command line. We don't care, so we
* give it an empty one */
char *p_args[] = { "" };
char *p_args[] = { "", NULL };
char **pp_args = p_args;
int i_args = 1;
int i_dummy;
......@@ -156,24 +156,24 @@ static void Run( intf_thread_t *p_intf )
exit (1);
#else
gtk_set_locale ();
#ifndef NEED_GTK_MAIN
# ifndef NEED_GTK_MAIN
msg_Dbg( p_intf, "Starting familiar GTK+ interface" );
gtk_init( &i_args, &pp_args );
#else
# else
/* Initialize Gtk+ */
msg_Dbg( p_intf, "Starting familiar GTK+ interface thread" );
gdk_threads_enter();
#endif
# endif
#endif
/* Create some useful widgets that will certainly be used */
// FIXME: magic path
add_pixmap_directory("share");
add_pixmap_directory("/usr/share/vlc");
/* Path for pixmaps under linupy 1.4 */
add_pixmap_directory("/usr/local/share/pixmaps/vlc");
/* Path for pixmaps under linupy 2.0 */
add_pixmap_directory("/usr/share/pixmaps/vlc");
......
......@@ -7,7 +7,8 @@ COMMON_gtk = \
modules/gui/gtk/playlist.c \
modules/gui/gtk/modules.c \
modules/gui/gtk/preferences.c \
modules/gui/gtk/gtk_callbacks.c
modules/gui/gtk/gtk_callbacks.c \
$(NULL)
SOURCES_gtk = \
modules/gui/gtk/gtk.c \
......@@ -35,9 +36,11 @@ noinst_HEADERS += \
modules/gui/gtk/gtk_interface.h \
modules/gui/gtk/playlist.h \
modules/gui/gtk/preferences.h \
modules/gui/gtk/gtk_support.h
modules/gui/gtk/gtk_support.h \
$(NULL)
EXTRA_DIST += \
modules/gui/gtk/gtk.glade \
modules/gui/gtk/gnome.glade \
modules/gui/gtk/gnome_callbacks.c
modules/gui/gtk/gnome_callbacks.c \
$(NULL)
......@@ -2,7 +2,7 @@
* gnome.c : Gnome plugin for vlc
*****************************************************************************
* 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>
*
......@@ -98,7 +98,7 @@ static int Open( vlc_object_t *p_this )
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 )
{
free( p_intf->p_sys );
......
......@@ -2,7 +2,7 @@
* gtk.c : Gtk+ plugin for vlc
*****************************************************************************
* 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>
*
......@@ -97,7 +97,7 @@ static int Open( vlc_object_t *p_this )
}
#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 )
{
free( p_intf->p_sys );
......@@ -180,7 +180,7 @@ static void Run( intf_thread_t *p_intf )
#else
/* gtk_init needs to know the command line. We don't care, so we
* give it an empty one */
char *p_args[] = { "" };
char *p_args[] = { "", NULL };
char **pp_args = p_args;
int i_args = 1;
int i_dummy;
......
......@@ -2,7 +2,7 @@
* gtk_main.c : Gtk+ wrapper for gtk_main
*****************************************************************************
* 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>
*
......@@ -30,7 +30,11 @@
#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>
#endif
......@@ -52,14 +56,24 @@ static vlc_object_t * p_gtk_main = NULL;
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_description( _("Gtk+ helper module") );
#ifdef MODULE_NAME_IS_gtk_main
set_capability( "gtk_main", 90 );
#else
set_capability( "gtk_main", 100 );
int i_cap;
set_description( _("Gtk+ GUI helper module") );
#if defined(MODULE_NAME_IS_gtk_main)
i_cap = 90;
add_shortcut( "gtk" );
#elif defined(MODULE_NAME_IS_gnome_main)
i_cap = 100;
add_shortcut( "gtk" );
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
add_shortcut( "gtk" );
set_capability( "gui-helper", i_cap );
set_callbacks( Open, Close );
linked_with_a_crap_library_which_uses_atexit();
vlc_module_end();
......@@ -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
* give it an empty one */
static char *p_args[] = { "" };
#ifdef MODULE_NAME_IS_gtk_main
static char *p_args[] = { "", NULL };
#if defined(MODULE_NAME_IS_gtk_main) || defined(MODULE_NAME_IS_gtk2_main)
static char **pp_args = p_args;
#endif
static int i_args = 1;
......@@ -161,7 +175,7 @@ static void GtkMain( vlc_object_t *p_this )
/* FIXME: deprecated ? */
/* 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 );
#else
gtk_set_locale();
......
......@@ -2,7 +2,7 @@
* qte_main.c : QT Embedded wrapper for gte_main
*****************************************************************************
* 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>
*
......@@ -63,8 +63,8 @@ static qte_thread_t * p_qte_main = NULL;
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_description( _("Qt Embedded helper module") );
set_capability( "qte_main", 90 );
set_description( _("Qt Embedded GUI helper module") );
set_capability( "gui-helper", 90 );
add_shortcut( "qte" );
set_callbacks( Open, Close );
vlc_module_end();
......@@ -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) );
/* Launch the gtk_main() thread. It will not return until it has
* called gdk_threads_enter(), which ensures us thread safety. */
/* Launch the QApplication::exec() thread. It will not return until the
* application is properly initialized, which ensures us thread safety. */
if( vlc_thread_create( p_qte_main, "qte_main", QteMain,
VLC_THREAD_PRIORITY_LOW, VLC_TRUE ) )
{
......
......@@ -2,7 +2,7 @@
* qte.cpp : QT Embedded plugin for vlc
*****************************************************************************
* 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>
* Jean-Paul Saman <jpsaman@wxs.nl>
......@@ -151,7 +151,7 @@ static int Open( vlc_object_t *p_this )
p_vout->pf_display = Display;
#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 )
{
free( p_vout->p_sys );
......@@ -191,7 +191,7 @@ static void Close ( vlc_object_t *p_this )
}
#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 );
#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