[gnome-builder/wip/gtk4-port] plugins/make: make template subclass IdeProjectTemplate



commit b9e73161fe12eda8bb59aabb9f57f7c87b1cb43d
Author: Christian Hergert <chergert redhat com>
Date:   Thu May 26 17:05:16 2022 -0700

    plugins/make: make template subclass IdeProjectTemplate
    
    This still needs to be implemented as part of the port, but it makes it
    so we can start compiling the object to test.

 src/plugins/make/gbp-make-template.c | 86 ++++++++++++++++++++++++++++++++++++
 src/plugins/make/gbp-make-template.h |  9 +---
 src/plugins/make/meson.build         |  1 +
 3 files changed, 89 insertions(+), 7 deletions(-)
---
diff --git a/src/plugins/make/gbp-make-template.c b/src/plugins/make/gbp-make-template.c
new file mode 100644
index 000000000..8267587ec
--- /dev/null
+++ b/src/plugins/make/gbp-make-template.c
@@ -0,0 +1,86 @@
+/* gbp-make-template.c
+ *
+ * Copyright 2022 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-make-template"
+
+#include "config.h"
+
+#include "gbp-make-template.h"
+
+struct _GbpMakeTemplate
+{
+  IdeProjectTemplate parent_instance;
+};
+
+G_DEFINE_FINAL_TYPE (GbpMakeTemplate, gbp_make_template, IDE_TYPE_PROJECT_TEMPLATE)
+
+enum {
+  PROP_0,
+  N_PROPS
+};
+
+static GParamSpec *properties [N_PROPS];
+
+static void
+gbp_make_template_finalize (GObject *object)
+{
+  G_OBJECT_CLASS (gbp_make_template_parent_class)->finalize (object);
+}
+
+static void
+gbp_make_template_get_property (GObject    *object,
+                                guint       prop_id,
+                                GValue     *value,
+                                GParamSpec *pspec)
+{
+  switch (prop_id)
+    {
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+gbp_make_template_set_property (GObject      *object,
+                                guint         prop_id,
+                                const GValue *value,
+                                GParamSpec   *pspec)
+{
+  switch (prop_id)
+    {
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+    }
+}
+
+static void
+gbp_make_template_class_init (GbpMakeTemplateClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->finalize = gbp_make_template_finalize;
+  object_class->get_property = gbp_make_template_get_property;
+  object_class->set_property = gbp_make_template_set_property;
+}
+
+static void
+gbp_make_template_init (GbpMakeTemplate *self)
+{
+}
diff --git a/src/plugins/make/gbp-make-template.h b/src/plugins/make/gbp-make-template.h
index 64ec3ff80..35fb1585f 100644
--- a/src/plugins/make/gbp-make-template.h
+++ b/src/plugins/make/gbp-make-template.h
@@ -20,17 +20,12 @@
 
 #pragma once
 
-#include <glib-object.h>
+#include <libide-projects.h>
 
 G_BEGIN_DECLS
 
 #define GBP_TYPE_MAKE_TEMPLATE (gbp_make_template_get_type())
 
-G_DECLARE_DERIVABLE_TYPE (GbpMakeTemplate, gbp_make_template, GBP, MAKE_TEMPLATE, GObject)
-
-struct _GbpMakeTemplateClass
-{
-  GObjectClass parent_class;
-};
+G_DECLARE_FINAL_TYPE (GbpMakeTemplate, gbp_make_template, GBP, MAKE_TEMPLATE, IdeProjectTemplate)
 
 G_END_DECLS
diff --git a/src/plugins/make/meson.build b/src/plugins/make/meson.build
index 352bbb2c9..d66862117 100644
--- a/src/plugins/make/meson.build
+++ b/src/plugins/make/meson.build
@@ -8,6 +8,7 @@ plugins_sources += files([
   'gbp-make-build-target-provider.c',
   'gbp-make-pipeline-addin.c',
   'gbp-make-run-command-provider.c',
+  'gbp-make-template.c',
   'gbp-make-template-provider.c',
 ])
 


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