Commit 8157ecc5 authored by Adrien Plazas's avatar Adrien Plazas Committed by Alexander Mikhaylenko

Separate public and private enums

This avoids leaking private enums in the public API, e.g.
StackableBoxTransitionType here.
parent 92646534
Pipeline #55160 passed with stages
in 15 minutes and 40 seconds
/*** BEGIN file-header ***/
#include "config.h"
#include "hdy-enums-private.h"
#include "hdy-stackable-box-private.h"
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GType
@enum_name@_get_type (void)
{
static GType etype = 0;
if (G_UNLIKELY(etype == 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 }
};
etype = g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
}
return etype;
}
/*** END value-tail ***/
/*** BEGIN file-tail ***/
/*** END file-tail ***/
/*** BEGIN file-header ***/
#pragma once
#if !defined(_HANDY_INSIDE) && !defined(HANDY_COMPILATION)
#error "Only <handy.h> can be included directly."
#endif
#include <glib-object.h>
#include "hdy-enums.h"
G_BEGIN_DECLS
/*** END file-header ***/
/*** BEGIN file-production ***/
/* enumerations from "@basename@" */
/*** END file-production ***/
/*** BEGIN value-header ***/
GType @enum_name@_get_type (void);
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
/*** END value-header ***/
/*** BEGIN file-tail ***/
G_END_DECLS
/*** END file-tail ***/
......@@ -7,7 +7,6 @@
#include "hdy-header-bar.h"
#include "hdy-leaflet.h"
#include "hdy-navigation-direction.h"
#include "hdy-stackable-box-private.h"
#include "hdy-squeezer.h"
#include "hdy-view-switcher.h"
......
......@@ -11,6 +11,7 @@
#include "gtkprogresstrackerprivate.h"
#include "hdy-animation-private.h"
#include "hdy-cairo-private.h"
#include "hdy-enums-private.h"
#include "hdy-stackable-box-private.h"
#include "hdy-shadow-helper-private.h"
#include "hdy-swipeable-private.h"
......
......@@ -7,15 +7,19 @@ libhandy_resources = gnome.compile_resources(
c_name: 'hdy',
)
hdy_enum_headers = ['hdy-carousel.h',
'hdy-deck.h',
'hdy-header-bar.h',
'hdy-leaflet.h',
'hdy-navigation-direction.h',
'hdy-stackable-box-private.h',
'hdy-squeezer.h',
'hdy-view-switcher.h',
]
hdy_public_enum_headers = [
'hdy-carousel.h',
'hdy-deck.h',
'hdy-header-bar.h',
'hdy-leaflet.h',
'hdy-navigation-direction.h',
'hdy-squeezer.h',
'hdy-view-switcher.h',
]
hdy_private_enum_headers = [
'hdy-stackable-box-private.h',
]
version_data = configuration_data()
version_data.set('HDY_MAJOR_VERSION', handy_version_major)
......@@ -41,16 +45,24 @@ libhandy_public_headers = []
libhandy_public_sources = []
libhandy_private_sources = []
hdy_enums = gnome.mkenums('hdy-enums',
hdy_public_enums = gnome.mkenums('hdy-enums',
h_template: 'hdy-enums.h.in',
c_template: 'hdy-enums.c.in',
sources: hdy_enum_headers,
sources: hdy_public_enum_headers,
install_header: true,
install_dir: libhandy_header_dir,
)
libhandy_public_sources += [hdy_enums[0]]
libhandy_generated_headers += [hdy_enums[1]]
hdy_private_enums = gnome.mkenums('hdy-enums-private',
h_template: 'hdy-enums-private.h.in',
c_template: 'hdy-enums-private.c.in',
sources: hdy_private_enum_headers,
install_header: false,
)
libhandy_public_sources += [hdy_public_enums[0]]
libhandy_private_sources += [hdy_private_enums[0]]
libhandy_generated_headers += [hdy_public_enums[1]]
src_headers = [
'hdy-action-row.h',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment