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




commit 169a57334a3473312c0a03785acebeb6fa9922ea
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

 demo/org.gnome.Adwaita1.Demo.json                 |  3 +-
 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                                    |  7 ++++
 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 +-
 12 files changed, 13 insertions(+), 83 deletions(-)
---
diff --git a/demo/org.gnome.Adwaita1.Demo.json b/demo/org.gnome.Adwaita1.Demo.json
index b2074e33..3534a804 100644
--- a/demo/org.gnome.Adwaita1.Demo.json
+++ b/demo/org.gnome.Adwaita1.Demo.json
@@ -8,8 +8,7 @@
     "--device=dri",
     "--share=ipc",
     "--socket=wayland",
-    "--socket=fallback-x11",
-    "--env=GTK_PATH=/app/lib/gtk-4.0"
+    "--socket=fallback-x11"
   ],
   "modules": [
     {
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..92ccace6 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,12 @@ adw_init (void)
 
   adw_style_manager_ensure ();
 
+  if (g_io_extension_point_lookup ("gtk-inspector-page"))
+    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]