]> git.sesse.net Git - vlc/commitdiff
* ./modules/misc/gtk_main.c, ./modules/gui/gtk/gtk.c,
authorSam Hocevar <sam@videolan.org>
Mon, 17 Mar 2003 18:02:11 +0000 (18:02 +0000)
committerSam Hocevar <sam@videolan.org>
Mon, 17 Mar 2003 18:02:11 +0000 (18:02 +0000)
    ./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.

include/vlc_common.h
modules/gui/familiar/familiar.c
modules/gui/gtk/Modules.am
modules/gui/gtk/gnome.c
modules/gui/gtk/gtk.c
modules/misc/gtk_main.c
modules/misc/qte_main.cpp
modules/video_output/qte/qte.cpp

index 1297fc357a2450b7dc993f92473a0ed66dd3f2bb..457b7ffa874ac97a8d0b705a4345867a6ac8203a 100644 (file)
@@ -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"
index b767bab4cf9c7911337b3d0a20e166e153c93a7b..3ac9df9e641b00dfcb3c82a5fe8a1276b9d4ae75 100644 (file)
@@ -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");
 
index 5f0810cd9747c8270d64ee87c289d678fa160884..58e9b1dfb34ecfd2304af9a9b5f1b63a646ac24a 100644 (file)
@@ -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)
index cec52f6a8b5412ab93740f02f9aeeedfdcb1ca5f..bd7fcbef95b23b26b01fd8b2f4285e74c5c7fa9a 100644 (file)
@@ -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 );
index 436f4ecde468e48a3da1a04fd81558388ae3842c..b37a2ca09cdc05d07ce260d7d7537ac450c581a6 100644 (file)
@@ -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;
index 302f63c50ae69235f7eabd136cd8e9db04c258ec..c7626cb82a9afe65a0df48f369f7dab50f0012de 100644 (file)
@@ -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>
  *
 
 #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();
index b57c39cae1cf7e0571f068fdbf8ff9c8b87da6db..12e197eebe2a313a0618599e7e5b8c3b607390ad 100644 (file)
@@ -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>
  *
@@ -41,7 +41,7 @@ typedef struct qte_thread_t
     VLC_COMMON_MEMBERS
 
     QApplication*       p_qte_application;
-    QWidget*           p_qte_widget;
+    QWidget*            p_qte_widget;
 
 } qte_thread_t;
 
@@ -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 ) )
     {
index 145db2933d262f46777080ac90fa33c929c4154f..0a1d8a3bd545dc81900dc5c9d0803f96503cab89 100644 (file)
@@ -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