[gnome-builder/wip/gtk4-port: 736/1774] plugins/omni-gutter: port editor page addin




commit 72226e21c3c452933cebf2c605667c9610b60b39
Author: Christian Hergert <chergert redhat com>
Date:   Tue Apr 26 16:09:27 2022 -0700

    plugins/omni-gutter: port editor page addin
    
    This can use the API on the editor page now instead of the API on the
    IdeSourceView as it was before.

 .../gbp-omni-gutter-editor-page-addin.c            | 24 ++++++++++++----------
 1 file changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/src/plugins/omni-gutter/gbp-omni-gutter-editor-page-addin.c 
b/src/plugins/omni-gutter/gbp-omni-gutter-editor-page-addin.c
index d73137fa1..fc7537f21 100644
--- a/src/plugins/omni-gutter/gbp-omni-gutter-editor-page-addin.c
+++ b/src/plugins/omni-gutter/gbp-omni-gutter-editor-page-addin.c
@@ -20,6 +20,8 @@
 
 #define G_LOG_DOMAIN "gbp-omni-gutter-editor-page-addin"
 
+#include "config.h"
+
 #include <libide-editor.h>
 
 #include "gbp-omni-gutter-editor-page-addin.h"
@@ -34,28 +36,28 @@ static void
 gbp_omni_gutter_editor_page_addin_load (IdeEditorPageAddin *addin,
                                         IdeEditorPage      *page)
 {
-  GbpOmniGutterRenderer *gutter;
-  IdeSourceView *view;
+  IDE_ENTRY;
 
-  g_assert (IDE_IS_EDITOR_PAGE_ADDIN (addin));
+  g_assert (GBP_IS_OMNI_GUTTER_EDITOR_PAGE_ADDIN (addin));
   g_assert (IDE_IS_EDITOR_PAGE (page));
 
-  view = ide_editor_page_get_view (page);
-  gutter = gbp_omni_gutter_renderer_new ();
-  ide_source_view_set_gutter (view, IDE_GUTTER (gutter));
+  ide_editor_page_set_gutter (page, IDE_GUTTER (gbp_omni_gutter_renderer_new ()));
+
+  IDE_EXIT;
 }
 
 static void
 gbp_omni_gutter_editor_page_addin_unload (IdeEditorPageAddin *addin,
                                           IdeEditorPage      *page)
 {
-  IdeSourceView *view;
+  IDE_ENTRY;
 
-  g_assert (IDE_IS_EDITOR_PAGE_ADDIN (addin));
+  g_assert (GBP_IS_OMNI_GUTTER_EDITOR_PAGE_ADDIN (addin));
   g_assert (IDE_IS_EDITOR_PAGE (page));
 
-  view = ide_editor_page_get_view (page);
-  ide_source_view_set_gutter (view, NULL);
+  ide_editor_page_set_gutter (page, NULL);
+
+  IDE_EXIT;
 }
 
 static void
@@ -66,7 +68,7 @@ editor_page_addin_iface_init (IdeEditorPageAddinInterface *iface)
 }
 
 G_DEFINE_FINAL_TYPE_WITH_CODE (GbpOmniGutterEditorPageAddin, gbp_omni_gutter_editor_page_addin, 
G_TYPE_OBJECT,
-                         G_IMPLEMENT_INTERFACE (IDE_TYPE_EDITOR_PAGE_ADDIN, editor_page_addin_iface_init))
+                               G_IMPLEMENT_INTERFACE (IDE_TYPE_EDITOR_PAGE_ADDIN, 
editor_page_addin_iface_init))
 
 static void
 gbp_omni_gutter_editor_page_addin_class_init (GbpOmniGutterEditorPageAddinClass *klass)


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