gucharmap r1713 - in trunk: . gucharmap



Author: chpe
Date: Fri Mar 21 11:00:45 2008
New Revision: 1713
URL: http://svn.gnome.org/viewvc/gucharmap?rev=1713&view=rev

Log:
Add type builtins.


Added:
   trunk/gucharmap/gucharmap-type-builtins.c.template
   trunk/gucharmap/gucharmap-type-builtins.h.template
Modified:
   trunk/configure.ac
   trunk/gucharmap/Makefile.am

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Fri Mar 21 11:00:45 2008
@@ -83,6 +83,11 @@
 
 PKG_CHECK_MODULES([GTK],[gtk+-2.0 >= $GTK_REQUIRED])
 
+GLIB_GENMARSHAL="$($PKG_CONFIG --variable=glib_genmarshal glib-2.0)"
+AC_SUBST([GLIB_GENMARSHAL])
+GLIB_MKENUMS="$($PKG_CONFIG --variable=glib_mkenums glib-2.0)"
+AC_SUBST([GLIB_MKENUMS])
+
 AC_ARG_ENABLE([gconf],
               [AS_HELP_STRING([--disable-gconf],
 	                      [don't build with gconf support])])
@@ -116,9 +121,6 @@
     AC_DEFINE([HAVE_GCONF], [1], [Define if have gconf])
 fi
 
-GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
-AC_SUBST(GLIB_GENMARSHAL)
-
 AH_TEMPLATE([ENABLE_UNIHAN], [Define if you want CJK ideograph information])
 AC_ARG_ENABLE(unihan, 
               AC_HELP_STRING([--disable-unihan], 

Modified: trunk/gucharmap/Makefile.am
==============================================================================
--- trunk/gucharmap/Makefile.am	(original)
+++ trunk/gucharmap/Makefile.am	Fri Mar 21 11:00:45 2008
@@ -20,8 +20,6 @@
 
 localedir = $(datadir)/locale
 
-BUILT_SOURCES = gucharmap-marshal.c gucharmap-marshal.h
-
 lib_LTLIBRARIES = libgucharmap.la
 
 libgucharmap_la_SOURCES = \
@@ -49,6 +47,8 @@
 	gucharmap-script-chapters-model.h \
 	gucharmap-script-codepoint-list.c \
 	gucharmap-script-codepoint-list.h \
+	gucharmap-type-builtins.c \
+	gucharmap-type-builtins.h \
 	gucharmap-unicode-info.c \
 	gucharmap-unicode-info.h \
 	unicode-blocks.h \
@@ -144,6 +144,13 @@
 	windres -i $< -o $@
 endif
 
+BUILT_SOURCES = \
+	gucharmap-marshal.c \
+	gucharmap-marshal.h \
+	gucharmap-type-builtins.c \
+	gucharmap-type-builtins.h \
+	$(NULL)
+
 gucharmap-marshal.h: $(srcdir)/gucharmap-marshal.list
 	( $(GLIB_GENMARSHAL) --prefix=_gucharmap_marshal $(srcdir)/gucharmap-marshal.list \
                             --header \
@@ -159,6 +166,21 @@
           && mv gucharmap-marshal.c.tmp gucharmap-marshal.c ) \
         || ( rm -f gucharmap-marshal.c.tmp && exit 1 )
 
+
+gucharmap-type-builtins.h: stamp-gucharmap-type-builtins.h
+	@true
+
+stamp-gucharmap-type-builtins.h: gucharmap-type-builtins.h.template $(libgucharmapinclude_HEADERS)
+	$(GLIB_MKENUMS) --template $< $(filter-out $<,$^) > xgen-gtbh \
+	&& (cmp -s xgen-gtbh gucharmap-type-builtins.h || cp xgen-gtbh gucharmap-type-builtins.h ) \
+	&& rm -f xgen-gtbh \
+	&& echo timestamp > $(@F)
+
+gucharmap-type-builtins.c: gucharmap-type-builtins.c.template $(libgucharmapinclude_HEADERS)
+	$(GLIB_MKENUMS) --template $< $(filter-out $<,$^) > xgen-gtbc \
+	&& (cmp -s xgen-gtbc gucharmap-type-builtins.c || cp xgen-gtbc gucharmap-type-builtins.c ) \
+	&& rm -f xgen-gtbc
+
 # printoptions.h: print.glade
 # 	$(GTK_BUILDER_CONVERT) --root custom_tab_container $< - | \
 # 		$(XMLLINT) --noblanks - | \
@@ -167,14 +189,17 @@
 # 	&& rm -f xgen-$(@F)
 
 # don't do the symlink stuff if this is windows
-if OS_WIN32
 
-install-exec-hook:
-        
-uninstall-local:
+EXTRA_DIST = \
+	gucharmap-marshal.list \
+	gucharmaprc.rc \
+	$(NULL)
 
-else
+CLEANFILES = \
+	$(BUILT_SOURCES) \
+	$(NULL)
 
+if !OS_WIN32
 # install a symlink to the binary called "charmap"
 install-exec-hook:
 	test -e "$(DESTDIR)$(bindir)/charmap" \
@@ -190,8 +215,4 @@
 	test -h "$(DESTDIR)$(bindir)/gnome-character-map" \
 	&& rm -f "$(DESTDIR)$(bindir)/gnome-character-map"
 
-endif
-
-CLEANFILES = gucharmap-marshal.c gucharmap-marshal.h
-
-EXTRA_DIST = gucharmap-marshal.list gucharmaprc.rc 
+endif # !OS_WIN32

Added: trunk/gucharmap/gucharmap-type-builtins.c.template
==============================================================================
--- (empty file)
+++ trunk/gucharmap/gucharmap-type-builtins.c.template	Fri Mar 21 11:00:45 2008
@@ -0,0 +1,40 @@
+/*** BEGIN file-header ***/
+#include "gucharmap-type-builtins.h"
+
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+/* enumerations from "@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 ***/

Added: trunk/gucharmap/gucharmap-type-builtins.h.template
==============================================================================
--- (empty file)
+++ trunk/gucharmap/gucharmap-type-builtins.h.template	Fri Mar 21 11:00:45 2008
@@ -0,0 +1,29 @@
+/*** BEGIN file-header ***/
+#if !defined (__GUCHARMAP_GUCHARMAP_H_INSIDE__) && !defined (GUCHARMAP_COMPILATION)
+#error "Only <gucharmap/gucharmap.h> can be included directly."
+#endif
+
+#ifndef GUCHARMAP_TYPE_BUILTINS_H
+#define GUCHARMAP_TYPE_BUILTINS_H
+
+#include <glib-object.h>
+#include <gucharmap/gucharmap.h>
+
+G_BEGIN_DECLS
+/*** END file-header ***/
+
+/*** BEGIN file-production ***/
+
+/* enumerations from "@filename@" */
+/*** END file-production ***/
+
+/*** BEGIN value-header ***/
+GType @enum_name _get_type (void);
+#define GTK_TYPE_ ENUMSHORT@ (@enum_name _get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif /* !GUCHARMAP_TYPE_BUILTINS_H */
+/*** END file-tail ***/



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