[libadwaita/zbrown/enums] enums: let mkenums use the standard template




commit 29e8c84bb86defd69dcc3122aac92fad5759c45b
Author: Zander Brown <zbrown gnome org>
Date:   Fri Nov 12 10:15:01 2021 +0000

    enums: let mkenums use the standard template
    
    We don't need to do anything fancy and the manually written file-header
    section was causing confusion when adding new enums

 src/adw-enums-private.c.in | 39 ---------------------------------------
 src/adw-enums-private.h.in | 27 ---------------------------
 src/adw-enums.c.in         | 46 ----------------------------------------------
 src/adw-enums.h.in         | 28 ----------------------------
 src/meson.build            | 21 +++++++++++++++------
 5 files changed, 15 insertions(+), 146 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index 35f3d905..efd81e5e 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -50,18 +50,27 @@ libadwaita_public_headers = []
 libadwaita_public_sources = []
 libadwaita_private_sources = []
 
-adw_public_enums = gnome.mkenums('adw-enums',
-      h_template: 'adw-enums.h.in',
-      c_template: 'adw-enums.c.in',
+adw_public_enums = gnome.mkenums_simple('adw-enums',
          sources: adw_public_enum_headers,
+     body_prefix: '#include "config.h"',
+   header_prefix: '#if !defined(_ADWAITA_INSIDE) && !defined(ADWAITA_COMPILATION)\n' +
+                  '#error "Only <adwaita.h> can be included directly."\n' +
+                  '#endif\n' +
+                  '\n' +
+                  '#include "adw-version.h"\n',
+       decorator: 'ADW_AVAILABLE_IN_ALL',
   install_header: true,
      install_dir: libadwaita_header_dir,
 )
 
-adw_private_enums = gnome.mkenums('adw-enums-private',
-      h_template: 'adw-enums-private.h.in',
-      c_template: 'adw-enums-private.c.in',
+adw_private_enums = gnome.mkenums_simple('adw-enums-private',
          sources: adw_private_enum_headers,
+     body_prefix: '#include "config.h"',
+   header_prefix: '#if !defined(_ADWAITA_INSIDE) && !defined(ADWAITA_COMPILATION)\n' +
+                  '#error "Only <adwaita.h> can be included directly."\n' +
+                  '#endif\n' +
+                  '\n' +
+                  '#include "adw-enums.h"\n',
   install_header: false,
 )
 


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