summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2021-12-02 12:50:13 +0100
committerBastien Nocera <hadess@hadess.net>2021-12-02 15:37:32 +0100
commit6d61029febe5d25e94a5ada846a3ee9f5303f629 (patch)
tree0280891739520140b513a770f5d17c2f1e5267d1
parente97ef6cefa246a59d8bb61a6b8391ad8e21e1720 (diff)
downloadgnome-bluetooth-6d61029febe5d25e94a5ada846a3ee9f5303f629.tar.gz
lib: Simplify enum types generation
-rw-r--r--lib/gnome-bluetooth-enum-types.c.template40
-rw-r--r--lib/gnome-bluetooth-enum-types.h.template17
-rw-r--r--lib/meson.build10
3 files changed, 3 insertions, 64 deletions
diff --git a/lib/gnome-bluetooth-enum-types.c.template b/lib/gnome-bluetooth-enum-types.c.template
deleted file mode 100644
index 32d5ceb2..00000000
--- a/lib/gnome-bluetooth-enum-types.c.template
+++ /dev/null
@@ -1,40 +0,0 @@
-/*** BEGIN file-header ***/
-#include "gnome-bluetooth-enum-types.h"
-#include <glib-object.h>
-
-/*** END file-header ***/
-
-/*** BEGIN file-production ***/
-/* enumerations from "@basename@" */
-#include "@basename@"
-
-/*** END file-production ***/
-
-/*** BEGIN value-header ***/
-GType
-@enum_name@_get_type (void)
-{
- static GType the_type = 0;
-
- if (the_type == 0)
- {
- static const G@Type@Value values[] = {
-/*** END value-header ***/
-
-/*** BEGIN value-production ***/
- { @VALUENAME@,
- "@VALUENAME@",
- "@valuenick@" },
-/*** END value-production ***/
-
-/*** BEGIN value-tail ***/
- { 0, NULL, NULL }
- };
- the_type = g_@type@_register_static (
- g_intern_static_string ("@EnumName@"),
- values);
- }
- return the_type;
-}
-
-/*** END value-tail ***/
diff --git a/lib/gnome-bluetooth-enum-types.h.template b/lib/gnome-bluetooth-enum-types.h.template
deleted file mode 100644
index a1f9fc6f..00000000
--- a/lib/gnome-bluetooth-enum-types.h.template
+++ /dev/null
@@ -1,17 +0,0 @@
-/*** BEGIN file-header ***/
-#pragma once
-
-#include <glib-object.h>
-
-/*** END file-header ***/
-
-/*** BEGIN file-production ***/
-/* Enumerations from "@basename@" */
-
-/*** END file-production ***/
-
-/*** BEGIN enumeration-production ***/
-#define BLUETOOTH_TYPE_@ENUMSHORT@ (@enum_name@_get_type())
-GType @enum_name@_get_type (void) G_GNUC_CONST;
-
-/*** END enumeration-production ***/
diff --git a/lib/meson.build b/lib/meson.build
index e27df61b..31d7d31b 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -42,13 +42,9 @@ built_sources += gnome.compile_resources(
export: true,
)
-enum_types = 'gnome-bluetooth-enum-types'
-
-built_sources += gnome.mkenums(
- enum_types,
- sources: headers,
- c_template: enum_types + '.c.template',
- h_template: enum_types + '.h.template',
+built_sources += gnome.mkenums_simple(
+ 'gnome-bluetooth-enum-types',
+ sources : headers,
)
client = 'bluetooth-client'