[ekiga] Got rid of the gnomemeeting_thread_* api



commit 76e338f5621def5c5c70e4c6f1a5de36bf019151
Author: Julien Puydt <jpuydt gnome org>
Date:   Tue Oct 20 22:11:43 2009 +0200

    Got rid of the gnomemeeting_thread_* api
    
    That made no sense any more : the gui is supposed to
    be purely single-threaded.

 lib/gui/gmdialog.c      |  142 ++---------------------------------------------
 lib/gui/gmdialog.h      |   49 ----------------
 lib/gui/gmwindow.c      |    7 +-
 src/gui/main_window.cpp |    2 +-
 4 files changed, 9 insertions(+), 191 deletions(-)
---
diff --git a/lib/gui/gmdialog.c b/lib/gui/gmdialog.c
index f586394..41c07eb 100644
--- a/lib/gui/gmdialog.c
+++ b/lib/gui/gmdialog.c
@@ -41,7 +41,6 @@
  *                          to create dialogs for GnomeMeeting.
  */
 
-
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
@@ -51,6 +50,8 @@
 
 #include "gmdialog.h"
 
+#include "gmwindow.h"
+
 #ifdef WIN32
 #define vsnprintf _vsnprintf
 #endif
@@ -75,40 +76,6 @@ static GtkWidget *gnomemeeting_dialog (GtkWindow *,
 
 /* Callbacks */
 
-#ifdef WIN32
-/* DESCRIPTION  :  /
- * BEHAVIOR     :  Displays the window given as a pointer in the
- *  		   idle loop.
- * PRE          :  data = GtkWindow to show.
- */
-static gboolean thread_safe_window_show (gpointer);
-
-
-/* DESCRIPTION  :  /
- * BEHAVIOR     :  Displays the window given as a pointer in the
- *  		   idle loop (using gtk_widget_show_all).
- * PRE          :  data = GtkWindow to show.
- */
-static gboolean thread_safe_window_show_all (gpointer);
-
-
-/* DESCRIPTION  :  /
- * BEHAVIOR     :  Hides the window given as a pointer in the
- *  		   idle loop.
- * PRE          :  data = GtkWindow to hide.
- */
-static gboolean thread_safe_window_hide (gpointer);
-
-
-/* DESCRIPTION  :  /
- * BEHAVIOR     :  Destroys the widget given as a pointer in the
- *  		   idle loop.
- * PRE          :  data = GtkWidget to destroy.
- */
-static gboolean thread_safe_widget_destroy (gpointer);
-#endif
-
-
 /* DESCRIPTION  :  Callback called when the progress dialog receives
  * 	           a delete_event.
  * BEHAVIOR     :  Prevents the dialog to be destroyed through user 
@@ -145,55 +112,7 @@ static void warning_dialog_destroyed_cb (GtkWidget *,
 					 gint,
 					 gpointer);
 
-
-/* Workaround for windows and threads problems */
-#ifdef WIN32
-static gboolean
-thread_safe_window_show (gpointer data)
-{
-  g_return_val_if_fail (data != NULL, FALSE);
-
-  gtk_window_present (GTK_WINDOW (data));
-  gtk_widget_show (GTK_WIDGET (data));
-
-  return FALSE;
-}
-
-
-static gboolean
-thread_safe_window_show_all (gpointer data)
-{
-  g_return_val_if_fail (data != NULL, FALSE);
-
-  gtk_window_present (GTK_WINDOW (data));
-  gtk_widget_show_all (GTK_WIDGET (data));
-
-  return FALSE;
-}
-
-
-static gboolean
-thread_safe_window_hide (gpointer data)
-{
-  g_return_val_if_fail (data != NULL, FALSE);
-
-  gtk_widget_hide (GTK_WIDGET (data));
-
-  return FALSE;
-}
-
-
-static gboolean
-thread_safe_widget_destroy (gpointer data)
-{
-  g_return_val_if_fail (data != NULL, FALSE);
-
-  gtk_widget_destroy (GTK_WIDGET (data));
-
-  return FALSE;
-}
-#endif
-
+/* implementation of the internal callbacks */
 
 static void
 progress_dialog_destroyed_cb (G_GNUC_UNUSED GtkWidget *w, 
@@ -249,57 +168,6 @@ warning_dialog_destroyed_cb (GtkWidget *w,
 
 
 /* Implementation of public functions */
-void
-gnomemeeting_threads_dialog_show (GtkWidget *dialog)
-{
-  g_return_if_fail (dialog != NULL);
-
-#ifndef WIN32
-  gtk_window_present (GTK_WINDOW (dialog));
-  gtk_widget_show (dialog);
-#else
-  g_idle_add (thread_safe_window_show, dialog);
-#endif
-}
-
-
-void
-gnomemeeting_threads_dialog_show_all (GtkWidget *dialog)
-{
-  g_return_if_fail (dialog != NULL);
-
-#ifndef WIN32
-  gtk_window_present (GTK_WINDOW (dialog));
-  gtk_widget_show_all (dialog);
-#else
-  g_idle_add (thread_safe_window_show_all, dialog);
-#endif
-}
-
-void
-gnomemeeting_threads_dialog_hide (GtkWidget *dialog)
-{
-  g_return_if_fail (dialog != NULL);
-
-#ifndef WIN32
-  gtk_widget_hide (dialog);
-#else
-  g_idle_add (thread_safe_window_hide, dialog);
-#endif
-}
-
-void
-gnomemeeting_threads_widget_destroy (GtkWidget *widget)
-{
-  g_return_if_fail (widget != NULL);
-
-#ifndef WIN32
-  gtk_widget_destroy (widget);
-#else
-  g_idle_add (thread_safe_widget_destroy, widget);
-#endif
-}
-
 
 GtkWidget *
 gnomemeeting_error_dialog (GtkWindow *parent,
@@ -490,7 +358,7 @@ gnomemeeting_warning_dialog_on_widget (GtkWindow *parent,
                      button);
   
   /* Can be called from threads */
-  gnomemeeting_threads_dialog_show_all (dialog);
+  gm_window_show (dialog);
 
   g_signal_connect_data (GTK_OBJECT (dialog), "response",
 			 G_CALLBACK (warning_dialog_destroyed_cb),
@@ -556,7 +424,7 @@ gnomemeeting_dialog (GtkWindow *parent,
                             GTK_OBJECT (dialog));
   
   /* Can be called from threads */
-  gnomemeeting_threads_dialog_show_all (dialog);
+  gm_window_show (dialog);
 
   g_free (dialog_text);
   g_free (primary_text);
diff --git a/lib/gui/gmdialog.h b/lib/gui/gmdialog.h
index bf8d963..26d48db 100644
--- a/lib/gui/gmdialog.h
+++ b/lib/gui/gmdialog.h
@@ -50,55 +50,6 @@
 
 G_BEGIN_DECLS
 
-
-/**
- * gnomemeeting_threads_dialog_show:
- *
- * @widget: the dialog to show
- *
- * Shows the dialog from a thread. Using that function instead of 
- * gtk_widget_show is required for Win32 to work around GTK+ problems when
- * a widget has to be shown from a thread.
- **/
-void gnomemeeting_threads_dialog_show (GtkWidget *);
-
-
-/**
- * gnomemeeting_threads_dialog_show_all:
- *
- * @widget: the dialog to show
- *
- * Shows the dialog from a thread. Using that function instead of 
- * gtk_widget_show is required for Win32 to work around GTK+ problems when
- * a widget has to be shown from a thread.
- **/
-void gnomemeeting_threads_dialog_show_all (GtkWidget *);
-
-
-/**
- * gnomemeeting_threads_dialog_hide:
- *
- * @widget: the dialog to hide
- *
- * Hides the dialog from a thread. Using that function instead of 
- * gtk_widget_hide is required for Win32 to work around GTK+ problems when
- * a widget has to be hidden from a thread.
- **/
-void gnomemeeting_threads_dialog_hide (GtkWidget *);
-
-
-/**
- * gnomemeeting_threads_widget_destroy:
- *
- * @widget: the widget to destroy
- *
- * Destroys the widget from a thread. Using that function instead of 
- * gtk_widget_destroy is required for Win32 to work around GTK+ problems when
- * a widget has to be destroyed from a thread.
- **/
-void gnomemeeting_threads_widget_destroy (GtkWidget *);
-
-
 /**
  * gnomemeeting_warning_dialog_on_widget:
  *
diff --git a/lib/gui/gmwindow.c b/lib/gui/gmwindow.c
index a802506..a18bd79 100644
--- a/lib/gui/gmwindow.c
+++ b/lib/gui/gmwindow.c
@@ -40,8 +40,6 @@
 
 #include "gmwindow.h"
 
-#include "gmdialog.h"
-
 #include "gmconf.h"
 
 #include <gdk/gdkkeysyms.h>
@@ -598,7 +596,8 @@ gm_window_show (GtkWidget* w)
       g_free (size);
     }
 
-    gnomemeeting_threads_dialog_show (w);
+    gtk_window_present (GTK_WINDOW (w));
+    gtk_widget_show_all (w);
   }
 
   g_free (conf_key_position);
@@ -646,7 +645,7 @@ gm_window_hide (GtkWidget* w)
       g_free (size);
     }
 
-    gnomemeeting_threads_dialog_hide (w);
+    gtk_widget_hide (w);
   }
 
   g_free (conf_key_position);
diff --git a/src/gui/main_window.cpp b/src/gui/main_window.cpp
index 7ebf6f7..dacdc33 100644
--- a/src/gui/main_window.cpp
+++ b/src/gui/main_window.cpp
@@ -2974,7 +2974,7 @@ ekiga_main_window_transfer_dialog_run (EkigaMainWindow *mw,
   else
     gm_entry_dialog_set_text (GM_ENTRY_DIALOG (mw->priv->transfer_call_popup), "sip:");
 
-  gnomemeeting_threads_dialog_show (mw->priv->transfer_call_popup);
+  gm_window_show (mw->priv->transfer_call_popup);
 
   answer = gtk_dialog_run (GTK_DIALOG (mw->priv->transfer_call_popup));
   switch (answer) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]