[libadwaita/wip/exalm/inspector-v2: 468/468] Rework inspector page




commit c90e1e0f99be3361206fac77d97aa7fc4b6725a3
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Dec 29 04:23:02 2021 +0500

    Rework inspector page
    
    Remove the module, implement the extension from adw_init().
    
    Requires https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4296

 meson_options.txt                                 |  4 ---
 po/POTFILES.in                                    |  4 +--
 src/{inspector => }/adw-inspector-page-private.h  |  0
 src/{inspector => }/adw-inspector-page.c          |  2 +-
 src/{inspector => }/adw-inspector-page.ui         |  0
 src/adw-main.c                                    |  6 ++++
 src/adwaita.gresources.xml                        |  1 +
 src/inspector/adw-inspector-module.c              | 43 -----------------------
 src/inspector/adw-inspector-module.gresources.xml |  6 ----
 src/inspector/meson.build                         | 23 ------------
 src/meson.build                                   |  3 +-
 11 files changed, 11 insertions(+), 81 deletions(-)
---
diff --git a/meson_options.txt b/meson_options.txt
index 78a8c6a6..a136a963 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -20,7 +20,3 @@ option('tests',
 option('examples',
        type: 'boolean', value: true,
        description: 'Build and install the examples and demo applications')
-
-option('inspector',
-       type: 'boolean', value: true,
-       description: 'Build and install the libadwaita GtkInspector module')
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8e25c405..4910cfb8 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,6 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
+src/adw-inspector-page.c
+src/adw-inspector-page.ui
 src/adw-preferences-window.c
 src/adw-preferences-window.ui
-src/inspector/adw-inspector-page.c
-src/inspector/adw-inspector-page.ui
diff --git a/src/inspector/adw-inspector-page-private.h b/src/adw-inspector-page-private.h
similarity index 100%
rename from src/inspector/adw-inspector-page-private.h
rename to src/adw-inspector-page-private.h
diff --git a/src/inspector/adw-inspector-page.c b/src/adw-inspector-page.c
similarity index 99%
rename from src/inspector/adw-inspector-page.c
rename to src/adw-inspector-page.c
index cf2491da..f0c03c9c 100644
--- a/src/inspector/adw-inspector-page.c
+++ b/src/adw-inspector-page.c
@@ -164,7 +164,7 @@ adw_inspector_page_class_init (AdwInspectorPageClass *klass)
   g_object_class_install_properties (object_class, LAST_PROP, props);
 
   gtk_widget_class_set_template_from_resource (widget_class,
-                                               "/org/gnome/Adwaita/inspector/ui/adw-inspector-page.ui");
+                                               "/org/gnome/Adwaita/ui/adw-inspector-page.ui");
 
   gtk_widget_class_bind_template_child (widget_class, AdwInspectorPage, support_color_schemes_switch);
   gtk_widget_class_bind_template_child (widget_class, AdwInspectorPage, color_scheme_row);
diff --git a/src/inspector/adw-inspector-page.ui b/src/adw-inspector-page.ui
similarity index 100%
rename from src/inspector/adw-inspector-page.ui
rename to src/adw-inspector-page.ui
diff --git a/src/adw-main.c b/src/adw-main.c
index bef5575c..02eee872 100644
--- a/src/adw-main.c
+++ b/src/adw-main.c
@@ -7,6 +7,7 @@
 
 #include "adw-main-private.h"
 
+#include "adw-inspector-page-private.h"
 #include "adw-style-manager-private.h"
 #include <glib/gi18n-lib.h>
 #include <gtk/gtk.h>
@@ -47,6 +48,11 @@ adw_init (void)
 
   adw_style_manager_ensure ();
 
+  g_io_extension_point_implement ("gtk-inspector-page",
+                                  ADW_TYPE_INSPECTOR_PAGE,
+                                  "libadwaita",
+                                  10);
+
   adw_initialized = TRUE;
 }
 
diff --git a/src/adwaita.gresources.xml b/src/adwaita.gresources.xml
index ea354366..21524a9e 100644
--- a/src/adwaita.gresources.xml
+++ b/src/adwaita.gresources.xml
@@ -11,6 +11,7 @@
     <file preprocess="xml-stripblanks">adw-action-row.ui</file>
     <file preprocess="xml-stripblanks">adw-combo-row.ui</file>
     <file preprocess="xml-stripblanks">adw-expander-row.ui</file>
+    <file preprocess="xml-stripblanks">adw-inspector-page.ui</file>
     <file preprocess="xml-stripblanks">adw-preferences-group.ui</file>
     <file preprocess="xml-stripblanks">adw-preferences-page.ui</file>
     <file preprocess="xml-stripblanks">adw-preferences-window.ui</file>
diff --git a/src/meson.build b/src/meson.build
index e35c3cff..1ed528a0 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -168,6 +168,7 @@ src_sources = [
   'adw-gizmo.c',
   'adw-header-bar.c',
   'adw-indicator-bin.c',
+  'adw-inspector-page.c',
   'adw-leaflet.c',
   'adw-main.c',
   'adw-navigation-direction.c',
@@ -348,5 +349,3 @@ pkgg.generate(
      requires: 'gtk4',
   install_dir: libdir / 'pkgconfig',
 )
-
-subdir('inspector')


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