]> git.sesse.net Git - vlc/blobdiff - modules/misc/gtk_main.c
Add m2ts and mts to the interface dialog selectors.
[vlc] / modules / misc / gtk_main.c
index 02739ba6a42c8bca1d75fd276c7986dbe530a1f4..c5b0d98069411954353fa0500ad4620ed59ffc70 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 
 
 #include <gtk/gtk.h>
@@ -56,7 +61,7 @@ static vlc_object_t * p_gtk_main = NULL;
  *****************************************************************************/
 vlc_module_begin();
     int i_cap;
-    set_description( _("Gtk+ GUI helper") );
+    set_description( N_("Gtk+ GUI helper") );
 #if defined(MODULE_NAME_IS_gtk_main)
     i_cap = 90;
     add_shortcut( "gtk" );
@@ -84,9 +89,7 @@ static int Open( vlc_object_t *p_this )
 {
     vlc_mutex_t *lock;
 
-    /* FIXME: put this in the module (de)initialization ASAP */
-    lock = var_GetGlobalCreate( "gtk" );
-    vlc_mutex_lock( lock );
+    lock = var_AcquireMutex( "gtk" );
 
     if( i_refcount > 0 )
     {
@@ -96,7 +99,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_SUCCESS;
     }
 
-    p_gtk_main = vlc_object_create( p_this, VLC_OBJECT_GENERIC );
+    p_gtk_main = vlc_object_create( p_this, sizeof( vlc_object_t ) );
 
     /* Only initialize gthreads if it's the first time we do it */
     if( !g_thread_supported() )
@@ -107,9 +110,9 @@ static int Open( vlc_object_t *p_this )
     /* Launch the gtk_main() thread. It will not return until it has
      * called gdk_threads_enter(), which ensures us thread safety. */
     if( vlc_thread_create( p_gtk_main, "gtk_main", GtkMain,
-                           VLC_THREAD_PRIORITY_LOW, VLC_TRUE ) )
+                           VLC_THREAD_PRIORITY_LOW, true ) )
     {
-        vlc_object_destroy( p_gtk_main );
+        vlc_object_release( p_gtk_main );
         i_refcount--;
         vlc_mutex_unlock( lock );
         return VLC_ETHREAD;
@@ -128,8 +131,7 @@ static void Close( vlc_object_t *p_this )
 {
     vlc_mutex_t *lock;
 
-    lock = var_GetGlobalMutex( "gtk" );
-    vlc_mutex_lock( lock );
+    lock = var_AcquireMutex( "gtk" );
 
     i_refcount--;
 
@@ -142,7 +144,7 @@ static void Close( vlc_object_t *p_this )
     gtk_main_quit();
     vlc_thread_join( p_gtk_main );
 
-    vlc_object_destroy( p_gtk_main );
+    vlc_object_release( p_gtk_main );
     p_gtk_main = NULL;
 
     vlc_mutex_unlock( lock );
@@ -196,4 +198,3 @@ static void GtkMain( vlc_object_t *p_this )
 
     gdk_threads_leave();
 }
-