[gtk/wip/chergert/gtk3-speedup-char_is_invisible: 2/3] texttag: avoid use of g_signal_emit_by_name()
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/gtk3-speedup-char_is_invisible: 2/3] texttag: avoid use of g_signal_emit_by_name()
- Date: Wed, 18 Mar 2020 20:02:46 +0000 (UTC)
commit 2aba6f0ba45083f64708d36f595b7fe1f5000eee
Author: Christian Hergert <chergert redhat com>
Date: Wed Sep 4 19:39:24 2019 -0700
texttag: avoid use of g_signal_emit_by_name()
This avoids looking up the signal by name and instead uses the saved
signal identifier from gtktexttagtable.c
gtk/gtktexttag.c | 6 ++----
gtk/gtktexttagtable.c | 8 ++++++++
gtk/gtktexttagtableprivate.h | 3 +++
3 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c
index cbc1a2f3f4..85831be54c 100644
--- a/gtk/gtktexttag.c
+++ b/gtk/gtktexttag.c
@@ -78,6 +78,7 @@
#include "gtktexttag.h"
#include "gtktexttypes.h"
#include "gtktexttagtable.h"
+#include "gtktexttagtableprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
@@ -2317,10 +2318,7 @@ gtk_text_tag_changed (GtkTextTag *tag,
* added, this would increase significantly the number of signal connections.
*/
if (priv->table != NULL)
- g_signal_emit_by_name (priv->table,
- "tag-changed",
- tag,
- size_changed);
+ _gtk_text_tag_table_tag_changed (priv->table, tag, size_changed);
}
static int
diff --git a/gtk/gtktexttagtable.c b/gtk/gtktexttagtable.c
index 11e4c7d809..d2c4b5154d 100644
--- a/gtk/gtktexttagtable.c
+++ b/gtk/gtktexttagtable.c
@@ -464,3 +464,11 @@ _gtk_text_tag_table_remove_buffer (GtkTextTagTable *table,
priv->buffers = g_slist_remove (priv->buffers, buffer);
}
+
+void
+_gtk_text_tag_table_tag_changed (GtkTextTagTable *table,
+ GtkTextTag *tag,
+ gboolean size_changed)
+{
+ g_signal_emit (table, signals[TAG_CHANGED], 0, tag, size_changed);
+}
diff --git a/gtk/gtktexttagtableprivate.h b/gtk/gtktexttagtableprivate.h
index 969cc4e2c8..0a8401e695 100644
--- a/gtk/gtktexttagtableprivate.h
+++ b/gtk/gtktexttagtableprivate.h
@@ -33,6 +33,9 @@ void _gtk_text_tag_table_add_buffer (GtkTextTagTable *table,
gpointer buffer);
void _gtk_text_tag_table_remove_buffer (GtkTextTagTable *table,
gpointer buffer);
+void _gtk_text_tag_table_tag_changed (GtkTextTagTable *table,
+ GtkTextTag *tag,
+ gboolean size_changed);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]