[gnome-builder/wip/gtk4-port: 27/67] code: use IdeSignalGroup and others




commit d5a8a79e25618cc4ff0e51b06bb7b397362f55df
Author: Christian Hergert <chergert redhat com>
Date:   Thu Sep 23 16:36:41 2021 -0700

    code: use IdeSignalGroup and others
    
    Removes libdazzle usage

 src/libide/code/ide-highlight-engine.c | 39 +++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 20 deletions(-)
---
diff --git a/src/libide/code/ide-highlight-engine.c b/src/libide/code/ide-highlight-engine.c
index 10ac92c22..da7623e06 100644
--- a/src/libide/code/ide-highlight-engine.c
+++ b/src/libide/code/ide-highlight-engine.c
@@ -22,7 +22,6 @@
 
 #include "config.h"
 
-#include <dazzle.h>
 #include <glib/gi18n.h>
 #include <gtksourceview/gtksource.h>
 #include <libide-plugins.h>
@@ -43,7 +42,7 @@ struct _IdeHighlightEngine
 
   GWeakRef             buffer_wref;
 
-  DzlSignalGroup      *signal_group;
+  IdeSignalGroup      *signal_group;
   IdeHighlighter      *highlighter;
   GSettings           *settings;
 
@@ -414,10 +413,10 @@ ide_highlight_engine_queue_work (IdeHighlightEngine *self)
    *       called and we potentially cause a frame to drop.
    */
 
-  self->work_timeout = gdk_threads_add_idle_full (G_PRIORITY_LOW + 1,
-                                                  ide_highlight_engine_work_timeout_handler,
-                                                  self,
-                                                  NULL);
+  self->work_timeout = g_idle_add_full (G_PRIORITY_LOW + 1,
+                                        ide_highlight_engine_work_timeout_handler,
+                                        self,
+                                        NULL);
 }
 
 /**
@@ -497,7 +496,7 @@ ide_highlight_engine_reload (IdeHighlightEngine *self)
 
   g_assert (IDE_IS_HIGHLIGHT_ENGINE (self));
 
-  dzl_clear_source (&self->work_timeout);
+  g_clear_handle_id (&self->work_timeout, g_source_remove);
 
   buffer = g_weak_ref_get (&self->buffer_wref);
   if (buffer == NULL)
@@ -680,7 +679,7 @@ ide_highlight_engine_clear (IdeHighlightEngine *self)
 static void
 ide_highlight_engine__bind_buffer_cb (IdeHighlightEngine *self,
                                       IdeBuffer          *buffer,
-                                      DzlSignalGroup     *group)
+                                      IdeSignalGroup     *group)
 {
   GtkTextBuffer *text_buffer = (GtkTextBuffer *)buffer;
   GtkTextIter begin;
@@ -690,7 +689,7 @@ ide_highlight_engine__bind_buffer_cb (IdeHighlightEngine *self,
 
   g_assert (IDE_IS_HIGHLIGHT_ENGINE (self));
   g_assert (IDE_IS_BUFFER (buffer));
-  g_assert (DZL_IS_SIGNAL_GROUP (group));
+  g_assert (IDE_IS_SIGNAL_GROUP (group));
   g_assert (self->invalid_begin == NULL);
   g_assert (self->invalid_end == NULL);
 
@@ -718,18 +717,18 @@ ide_highlight_engine__bind_buffer_cb (IdeHighlightEngine *self,
 
 static void
 ide_highlight_engine__unbind_buffer_cb (IdeHighlightEngine  *self,
-                                        DzlSignalGroup      *group)
+                                        IdeSignalGroup      *group)
 {
   g_autoptr(GtkTextBuffer) text_buffer = NULL;
 
   IDE_ENTRY;
 
   g_assert (IDE_IS_HIGHLIGHT_ENGINE (self));
-  g_assert (DZL_IS_SIGNAL_GROUP (group));
+  g_assert (IDE_IS_SIGNAL_GROUP (group));
 
   text_buffer = g_weak_ref_get (&self->buffer_wref);
 
-  dzl_clear_source (&self->work_timeout);
+  g_clear_handle_id (&self->work_timeout, g_source_remove);
 
   if (text_buffer != NULL)
     {
@@ -781,7 +780,7 @@ ide_highlight_engine_set_buffer (IdeHighlightEngine *self,
   /* We can get GtkSourceBuffer intermittently here. */
   if (!buffer || IDE_IS_BUFFER (buffer))
     {
-      dzl_signal_group_set_target (self->signal_group, buffer);
+      ide_signal_group_set_target (self->signal_group, buffer);
       g_object_notify_by_pspec (G_OBJECT (self), properties [PROP_BUFFER]);
     }
 }
@@ -952,27 +951,27 @@ ide_highlight_engine_init (IdeHighlightEngine *self)
 
   self->settings = g_settings_new ("org.gnome.builder.code-insight");
   self->enabled = g_settings_get_boolean (self->settings, "semantic-highlighting");
-  self->signal_group = dzl_signal_group_new (IDE_TYPE_BUFFER);
+  self->signal_group = ide_signal_group_new (IDE_TYPE_BUFFER);
 
-  dzl_signal_group_connect_object (self->signal_group,
+  ide_signal_group_connect_object (self->signal_group,
                                    "insert-text",
                                    G_CALLBACK (ide_highlight_engine__buffer_insert_text_cb),
                                    self,
                                    G_CONNECT_SWAPPED | G_CONNECT_AFTER);
 
-  dzl_signal_group_connect_object (self->signal_group,
+  ide_signal_group_connect_object (self->signal_group,
                                    "delete-range",
                                    G_CALLBACK (ide_highlight_engine__buffer_delete_range_cb),
                                    self,
                                    G_CONNECT_SWAPPED | G_CONNECT_AFTER);
 
-  dzl_signal_group_connect_object (self->signal_group,
+  ide_signal_group_connect_object (self->signal_group,
                                    "notify::language",
                                    G_CALLBACK (ide_highlight_engine__notify_language_cb),
                                    self,
                                    G_CONNECT_SWAPPED);
 
-  dzl_signal_group_connect_object (self->signal_group,
+  ide_signal_group_connect_object (self->signal_group,
                                    "notify::style-scheme",
                                    G_CALLBACK (ide_highlight_engine__notify_style_scheme_cb),
                                    self,
@@ -1163,7 +1162,7 @@ ide_highlight_engine_pause (IdeHighlightEngine *self)
 {
   g_return_if_fail (IDE_IS_HIGHLIGHT_ENGINE (self));
 
-  dzl_signal_group_block (self->signal_group);
+  ide_signal_group_block (self->signal_group);
 }
 
 void
@@ -1174,7 +1173,7 @@ ide_highlight_engine_unpause (IdeHighlightEngine *self)
   g_return_if_fail (IDE_IS_HIGHLIGHT_ENGINE (self));
   g_return_if_fail (self->signal_group != NULL);
 
-  dzl_signal_group_unblock (self->signal_group);
+  ide_signal_group_unblock (self->signal_group);
 
   buffer = g_weak_ref_get (&self->buffer_wref);
 


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