[gtk/mainloop-cleanup: 9/11] Drop gtk_main and gtk_main_quit
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/mainloop-cleanup: 9/11] Drop gtk_main and gtk_main_quit
- Date: Mon, 10 Feb 2020 03:49:27 +0000 (UTC)
commit 857f4da55aa8685697c2fac7527d8defc2cf3911
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 | 4 ---
3 files changed, 54 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index f56602c51a..33a38b4613 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
gtk_main_do_event
<SUBSECTION>
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index aff478bb43..90f18a4133 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 cbef7b11fb..132d642823 100644
--- a/gtk/gtkmain.h
+++ b/gtk/gtkmain.h
@@ -112,10 +112,6 @@ GtkTextDirection gtk_get_locale_direction (void);
GDK_AVAILABLE_IN_ALL
void gtk_main_do_event (GdkEvent *event);
-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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]