[gtk/mainloop-cleanup: 19/21] Drop gtk_main and gtk_main_quit
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/mainloop-cleanup: 19/21] Drop gtk_main and gtk_main_quit
- Date: Mon, 10 Feb 2020 04:17:33 +0000 (UTC)
commit 4dd780a96b1d37903ab88a4ae4536329cd9e164e
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Feb 9 22:33:02 2020 -0500
Drop gtk_main and gtk_main_quit
The alternatives are to use GtkApplication,
or use GMainContext.
docs/reference/gtk/gtk4-sections.txt | 2 --
gtk/gtkmain.c | 48 ------------------------------------
gtk/gtkmain.h | 5 ----
3 files changed, 55 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 19632c6b1f..76b0248402 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4418,8 +4418,6 @@ gtk_get_default_language
gtk_get_locale_direction
gtk_init
gtk_init_check
-gtk_main
-gtk_main_quit
<SUBSECTION>
gtk_grab_add
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 2869db4846..33fccd8a80 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -139,14 +139,11 @@
static GtkWindowGroup *gtk_main_get_window_group (GtkWidget *widget);
-static guint gtk_main_loop_level = 0;
static gint pre_initialized = FALSE;
static gint gtk_initialized = FALSE;
static GList *current_events = NULL;
static GThread *initialized_thread = NULL;
-static GSList *main_loops = NULL; /* stack of currently executing main loops */
-
typedef struct {
GdkDisplay *display;
guint flags;
@@ -1011,37 +1008,6 @@ gtk_get_default_language (void)
return pango_language_get_default ();
}
-/**
- * gtk_main:
- *
- * Runs the main loop until gtk_main_quit() is called.
- *
- * You can nest calls to gtk_main(). In that case gtk_main_quit()
- * will make the innermost invocation of the main loop return.
- */
-void
-gtk_main (void)
-{
- GMainLoop *loop;
-
- gtk_main_loop_level++;
-
- loop = g_main_loop_new (NULL, TRUE);
- main_loops = g_slist_prepend (main_loops, loop);
-
- if (g_main_loop_is_running (main_loops->data))
- g_main_loop_run (loop);
-
- main_loops = g_slist_remove (main_loops, loop);
-
- g_main_loop_unref (loop);
-
- gtk_main_loop_level--;
-
- if (gtk_main_loop_level == 0)
- gtk_main_sync ();
-}
-
typedef struct {
GMainLoop *store_loop;
guint n_clipboards;
@@ -1125,20 +1091,6 @@ gtk_main_sync (void)
_gtk_recent_manager_sync ();
}
-/**
- * gtk_main_quit:
- *
- * Makes the innermost invocation of the main loop return
- * when it regains control.
- */
-void
-gtk_main_quit (void)
-{
- g_return_if_fail (main_loops != NULL);
-
- g_main_loop_quit (main_loops->data);
-}
-
static void
rewrite_events_translate (GdkSurface *old_surface,
GdkSurface *new_surface,
diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h
index 9b4016b568..dd5e547953 100644
--- a/gtk/gtkmain.h
+++ b/gtk/gtkmain.h
@@ -110,11 +110,6 @@ PangoLanguage *gtk_get_default_language (void);
GDK_AVAILABLE_IN_ALL
GtkTextDirection gtk_get_locale_direction (void);
-GDK_AVAILABLE_IN_ALL
-void gtk_main (void);
-GDK_AVAILABLE_IN_ALL
-void gtk_main_quit (void);
-
GDK_AVAILABLE_IN_ALL
void gtk_grab_add (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]