From f8f243a0620938f655f7fdf45d73f3a387436462 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sun, 18 Jan 2009 15:59:21 +0000 Subject: [PATCH] Make EvJobPriority a proper GType. Fixes bug #567788. 2009-01-18 Tomeu Vizoso * libview/Makefile.am: * libview/ev-view-type-builtins.c.template: * libview/ev-view-type-builtins.h.template: Make EvJobPriority a proper GType. Fixes bug #567788. svn path=/trunk/; revision=3353 --- ChangeLog | 8 +++++ libview/Makefile.am | 23 +++++++++++-- libview/ev-view-type-builtins.c.template | 42 ++++++++++++++++++++++++ libview/ev-view-type-builtins.h.template | 25 ++++++++++++++ 4 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 libview/ev-view-type-builtins.c.template create mode 100644 libview/ev-view-type-builtins.h.template diff --git a/ChangeLog b/ChangeLog index 4c17c4e0..3766f157 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-18 Tomeu Vizoso + + * libview/Makefile.am: + * libview/ev-view-type-builtins.c.template: + * libview/ev-view-type-builtins.h.template: + + Make EvJobPriority a proper GType. Fixes bug #567788. + 2009-01-18 Carlos Garcia Campos * configure.ac: diff --git a/libview/Makefile.am b/libview/Makefile.am index dfdb20e8..e41b3a80 100644 --- a/libview/Makefile.am +++ b/libview/Makefile.am @@ -22,7 +22,8 @@ NOINST_H_FILES = \ INST_H_FILES = \ ev-jobs.h \ ev-page-cache.h \ - ev-view.h + ev-view.h \ + ev-view-type-builtins.h headerdir = $(prefix)/include/evince/@EV_API_VERSION@/ev-view header_DATA = $(INST_H_FILES) @@ -37,12 +38,15 @@ libevview_la_SOURCES = \ ev-view.c \ ev-view-accessible.c \ ev-view-marshal.c \ + ev-view-type-builtins.c \ $(NOINST_H_FILES) \ $(INST_H_FILES) BUILT_SOURCES = \ ev-view-marshal.h \ - ev-view-marshal.c + ev-view-marshal.c \ + ev-view-type-builtins.c \ + ev-view-type-builtins.h CLEANFILES = $(BUILT_SOURCES) @@ -54,3 +58,18 @@ ev-view-marshal.c: $(srcdir)/ev-view-marshal.list $(GLIB_GENMARSHAL) --prefix=ev_view_marshal $(srcdir)/ev-view-marshal.list --body >> $@ EXTRA_DIST = ev-view-marshal.list + +ev-view-type-builtins.h: stamp-ev-view-type-builtins.h + @true + +stamp-ev-view-type-builtins.h: ev-view-type-builtins.h.template ev-job-scheduler.h + $(GLIB_MKENUMS) --template $< $(filter-out $<,$^) > xgen-etbh \ + && (cmp -s xgen-etbh ev-view-type-builtins.h || cp xgen-etbh ev-view-type-builtins.h ) \ + && rm -f xgen-etbh \ + && echo timestamp > $(@F) + +ev-view-type-builtins.c: ev-view-type-builtins.c.template ev-job-scheduler.h + $(GLIB_MKENUMS) --template $< $(filter-out $<,$^) > xgen-etbc \ + && (cmp -s xgen-etbc ev-view-type-builtins.c || cp xgen-etbc ev-view-type-builtins.c ) \ + && rm -f xgen-etbc + diff --git a/libview/ev-view-type-builtins.c.template b/libview/ev-view-type-builtins.c.template new file mode 100644 index 00000000..2365a44d --- /dev/null +++ b/libview/ev-view-type-builtins.c.template @@ -0,0 +1,42 @@ +/*** BEGIN file-header ***/ +#include "ev-view-type-builtins.h" + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ +#include "@filename@" +/*** END file-production ***/ + + +/*** BEGIN value-header ***/ +GType +@enum_name@_get_type (void) +{ + static volatile 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 ***/ diff --git a/libview/ev-view-type-builtins.h.template b/libview/ev-view-type-builtins.h.template new file mode 100644 index 00000000..a6ac309a --- /dev/null +++ b/libview/ev-view-type-builtins.h.template @@ -0,0 +1,25 @@ +/*** BEGIN file-header ***/ + +#ifndef EV_VIEW_TYPE_BUILTINS_H +#define EV_VIEW_TYPE_BUILTINS_H + +#include + +G_BEGIN_DECLS +/*** END file-header ***/ + +/*** BEGIN file-production ***/ + +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GType @enum_name@_get_type (void) G_GNUC_CONST; +#define EV_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) +/*** END value-header ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +#endif /* !EV_VIEW_TYPE_BUILTINS_H */ +/*** END file-tail ***/ -- 2.43.5