]> git.sesse.net Git - vlc/blobdiff - modules/misc/gtk_main.c
CORBA module update:
[vlc] / modules / misc / gtk_main.c
index 967eec3ca211b0139fa6c0cc172653eeb2fb2dce..962de10bd2c9050e2f4c088db0d889c507c7254f 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_main.c : Gtk+ wrapper for gtk_main
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: gtk_main.c,v 1.10 2002/10/15 08:35:24 sam Exp $
+ * $Id: gtk_main.c,v 1.15 2003/03/30 18:14:38 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -10,7 +10,7 @@
  * 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
 
 #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") );
+#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,17 +166,24 @@ 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;
 
     /* FIXME: deprecated ? */
-    /* gdk_threads_init(); */
+#if defined(MODULE_NAME_IS_gtk2_main) || defined(MODULE_NAME_IS_gnome2_main)
+    gdk_threads_init();
+#endif
 
-#ifdef MODULE_NAME_IS_gnome_main
+#if defined(MODULE_NAME_IS_gnome_main)
     gnome_init( p_this->p_vlc->psz_object_name, VERSION, i_args, p_args );
+#elif defined(MODULE_NAME_IS_gnome2_main)
+    gnome_program_init( PACKAGE, VERSION, LIBGNOMEUI_MODULE,
+                        i_args, p_args,
+                        GNOME_PARAM_APP_DATADIR, "",//PACKAGE_DATA_DIR,
+                        NULL );
 #else
     gtk_set_locale();
     gtk_init( &i_args, &pp_args );