[gnome-builder] meson: stub out meson options for build preferences



commit 0bc365087346a3fd122753cb8d87d5a374cfa2e2
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jan 17 17:38:30 2019 -0800

    meson: stub out meson options for build preferences

 .../buildui/gbp-buildui-config-view-addin.c        |  2 +-
 src/plugins/meson/gbp-meson-config-view-addin.c    | 78 ++++++++++++++++++++++
 src/plugins/meson/gbp-meson-config-view-addin.h    | 31 +++++++++
 src/plugins/meson/meson-plugin.c                   |  4 ++
 src/plugins/meson/meson.build                      | 15 +++--
 5 files changed, 122 insertions(+), 8 deletions(-)
---
diff --git a/src/plugins/buildui/gbp-buildui-config-view-addin.c 
b/src/plugins/buildui/gbp-buildui-config-view-addin.c
index df39474d8..622aefe58 100644
--- a/src/plugins/buildui/gbp-buildui-config-view-addin.c
+++ b/src/plugins/buildui/gbp-buildui-config-view-addin.c
@@ -422,7 +422,7 @@ gbp_buildui_config_view_addin_load (IdeConfigViewAddin *addin,
 
   /* Add our pages */
   dzl_preferences_add_page (preferences, "general", _("General"), 0);
-  dzl_preferences_add_page (preferences, "environ", _("Environment"), 20);
+  dzl_preferences_add_page (preferences, "environ", _("Environment"), 10);
 
   /* Add groups to pages */
   dzl_preferences_add_list_group (preferences, "general", "general", _("Overview"), GTK_SELECTION_NONE, 0);
diff --git a/src/plugins/meson/gbp-meson-config-view-addin.c b/src/plugins/meson/gbp-meson-config-view-addin.c
new file mode 100644
index 000000000..f89149fcb
--- /dev/null
+++ b/src/plugins/meson/gbp-meson-config-view-addin.c
@@ -0,0 +1,78 @@
+/* gbp-meson-config-view-addin.c
+ *
+ * Copyright 2019 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#define G_LOG_DOMAIN "gbp-meson-config-view-addin"
+
+#include "config.h"
+
+#include <dazzle.h>
+#include <glib/gi18n.h>
+#include <libide-foundry.h>
+#include <libide-gui.h>
+
+#include "gbp-meson-build-system.h"
+#include "gbp-meson-config-view-addin.h"
+
+struct _GbpMesonConfigViewAddin
+{
+  GObject parent_instance;
+};
+
+static void
+gbp_meson_config_view_addin_load (IdeConfigViewAddin *addin,
+                                  DzlPreferences     *preferences,
+                                  IdeConfig          *config)
+{
+  IdeBuildSystem *build_system;
+  IdeContext *context;
+
+  g_assert (IDE_IS_MAIN_THREAD ());
+  g_assert (IDE_IS_CONFIG_VIEW_ADDIN (addin));
+  g_assert (DZL_IS_PREFERENCES (preferences));
+  g_assert (IDE_IS_CONFIG (config));
+
+  context = ide_object_get_context (IDE_OBJECT (config));
+  build_system = ide_build_system_from_context (context);
+
+  if (!GBP_IS_MESON_BUILD_SYSTEM (build_system))
+    return;
+
+  dzl_preferences_add_page (preferences, "meson", _("Meson"), 20);
+  dzl_preferences_add_list_group (preferences, "meson", "options", _("Meson Options"), GTK_SELECTION_NONE, 
0);
+}
+
+static void
+config_view_addin_iface_init (IdeConfigViewAddinInterface *iface)
+{
+  iface->load = gbp_meson_config_view_addin_load;
+}
+
+G_DEFINE_TYPE_WITH_CODE (GbpMesonConfigViewAddin, gbp_meson_config_view_addin, G_TYPE_OBJECT,
+                         G_IMPLEMENT_INTERFACE (IDE_TYPE_CONFIG_VIEW_ADDIN, config_view_addin_iface_init))
+
+static void
+gbp_meson_config_view_addin_class_init (GbpMesonConfigViewAddinClass *klass)
+{
+}
+
+static void
+gbp_meson_config_view_addin_init (GbpMesonConfigViewAddin *self)
+{
+}
diff --git a/src/plugins/meson/gbp-meson-config-view-addin.h b/src/plugins/meson/gbp-meson-config-view-addin.h
new file mode 100644
index 000000000..589217a30
--- /dev/null
+++ b/src/plugins/meson/gbp-meson-config-view-addin.h
@@ -0,0 +1,31 @@
+/* gbp-meson-config-view-addin.h
+ *
+ * Copyright 2019 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+#pragma once
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define GBP_TYPE_MESON_CONFIG_VIEW_ADDIN (gbp_meson_config_view_addin_get_type())
+
+G_DECLARE_FINAL_TYPE (GbpMesonConfigViewAddin, gbp_meson_config_view_addin, GBP, MESON_CONFIG_VIEW_ADDIN, 
GObject)
+
+G_END_DECLS
diff --git a/src/plugins/meson/meson-plugin.c b/src/plugins/meson/meson-plugin.c
index b58e8d0d3..1663a12ed 100644
--- a/src/plugins/meson/meson-plugin.c
+++ b/src/plugins/meson/meson-plugin.c
@@ -25,6 +25,7 @@
 #include "gbp-meson-build-system.h"
 #include "gbp-meson-build-system-discovery.h"
 #include "gbp-meson-build-target-provider.h"
+#include "gbp-meson-config-view-addin.h"
 #include "gbp-meson-pipeline-addin.h"
 #include "gbp-meson-test-provider.h"
 #include "gbp-meson-toolchain-provider.h"
@@ -36,6 +37,9 @@ _gbp_meson_register_types (PeasObjectModule *module)
   /* For in-tree builds of meson projects */
   ide_g_file_add_ignored_pattern ("_build");
 
+  peas_object_module_register_extension_type (module,
+                                              IDE_TYPE_CONFIG_VIEW_ADDIN,
+                                              GBP_TYPE_MESON_CONFIG_VIEW_ADDIN);
   peas_object_module_register_extension_type (module,
                                               IDE_TYPE_PIPELINE_ADDIN,
                                               GBP_TYPE_MESON_PIPELINE_ADDIN);
diff --git a/src/plugins/meson/meson.build b/src/plugins/meson/meson.build
index a08a119b3..f161fb0c8 100644
--- a/src/plugins/meson/meson.build
+++ b/src/plugins/meson/meson.build
@@ -1,21 +1,22 @@
 if get_option('plugin_meson')
 
 plugins_sources += files([
-  'meson-plugin.c',
-  'gbp-meson-toolchain-edition-preferences-addin.c',
-  'gbp-meson-toolchain-edition-preferences-row.c',
   'gbp-meson-build-stage-cross-file.c',
-  'gbp-meson-build-system.c',
   'gbp-meson-build-system-discovery.c',
-  'gbp-meson-build-target.c',
+  'gbp-meson-build-system.c',
   'gbp-meson-build-target-provider.c',
+  'gbp-meson-build-target.c',
+  'gbp-meson-config-view-addin.c',
   'gbp-meson-pipeline-addin.c',
   'gbp-meson-test-provider.c',
   'gbp-meson-test.c',
-  'gbp-meson-toolchain.c',
-  'gbp-meson-toolchain-provider.c',
   'gbp-meson-tool-row.c',
+  'gbp-meson-toolchain-edition-preferences-addin.c',
+  'gbp-meson-toolchain-edition-preferences-row.c',
+  'gbp-meson-toolchain-provider.c',
+  'gbp-meson-toolchain.c',
   'gbp-meson-utils.c',
+  'meson-plugin.c',
 ])
 
 plugin_meson_resources = gnome.compile_resources(


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