gdk: Use gnome.mkenums_simple

This lets us avoid template files, and works just as well.
This commit is contained in:
Matthias Clasen 2022-09-24 20:41:09 -04:00
parent 0f4f90d722
commit 455eefa854
3 changed files with 4 additions and 73 deletions

View File

@ -1,41 +0,0 @@
/*** BEGIN file-header ***/
#include "config.h"
#include "gdk.h"
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GType
@enum_name@_get_type (void)
{
static gsize g_define_type_id__volatile = 0;
if (g_once_init_enter (&g_define_type_id__volatile))
{
static const G@Type@Value values[] = {
/*** END value-header ***/
/*** BEGIN value-production ***/
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
/*** END value-production ***/
/*** BEGIN value-tail ***/
{ 0, NULL, NULL }
};
GType g_define_type_id =
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
return g_define_type_id__volatile;
}
/*** END value-tail ***/
/*** BEGIN file-tail ***/
/**/
/*** END file-tail ***/

View File

@ -1,29 +0,0 @@
/*** BEGIN file-header ***/
#ifndef __GDK_ENUM_TYPES_H__
#define __GDK_ENUM_TYPES_H__
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gdk/gdk.h> can be included directly."
#endif
#include <glib-object.h>
#include <gdk/gdkversionmacros.h>
G_BEGIN_DECLS
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GDK_AVAILABLE_IN_ALL GType @enum_name@_get_type (void) G_GNUC_CONST;
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
/*** END value-header ***/
/*** BEGIN file-tail ***/
G_END_DECLS
#endif /* __GDK_ENUM_TYPES_H__ */
/*** END file-tail ***/

View File

@ -136,10 +136,11 @@ gdkresources = gnome.compile_resources('gdkresources',
gdk_headers = gdk_public_headers
gdk_enums = gnome.mkenums('gdkenumtypes',
gdk_enums = gnome.mkenums_simple('gdkenumtypes',
sources: gdk_public_headers,
c_template: 'gdkenumtypes.c.template',
h_template: 'gdkenumtypes.h.template',
decorator: 'GDK_AVAILABLE_IN_ALL',
body_prefix: '#include "config.h"',
header_prefix: '#include "gdkversionmacros.h"',
install_dir: gtk_includedir / 'gtk-4.0/gdk',
install_header: true,
)