vte r2068 - in trunk: . doc/reference src



Author: chpe
Date: Thu Jun 26 18:32:49 2008
New Revision: 2068
URL: http://svn.gnome.org/viewvc/vte?rev=2068&view=rev

Log:
Use glib-mkenums to generate the enum types.

Added:
   trunk/src/vtetypebuiltins.c.template
   trunk/src/vtetypebuiltins.h.template
Modified:
   trunk/ChangeLog
   trunk/configure.in
   trunk/doc/reference/Makefile.am
   trunk/src/Makefile.am
   trunk/src/vte.c
   trunk/src/vte.h

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Thu Jun 26 18:32:49 2008
@@ -33,6 +33,7 @@
 AC_STDC_HEADERS
 AM_PROG_CC_STDC
 AM_MAINTAINER_MODE
+AM_PROG_CC_C_O
 
 AM_PROG_LIBTOOL
 IT_PROG_INTLTOOL([0.35.0])
@@ -614,6 +615,12 @@
 fi
 AM_CONDITIONAL(BUILD_GNOME_PTY_HELPER,[test "$enable_gnome_pty_helper" != no])
 
+AC_PATH_PROG([GLIB_GENMARSHAL],[glib-genmarshal])
+AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
+
+PKG_CHECK_EXISTS([glib-2.0 >= 2.14],[GLIB_GENMARSHAL_INTERNAL="--internal"],[GLIB_GENMARSHAL_INTERNAL=""])
+AC_SUBST([GLIB_GENMARSHAL_INTERNAL])
+
 ################################################################################
 
 GTK_DOC_CHECK([1.0])

Modified: trunk/doc/reference/Makefile.am
==============================================================================
--- trunk/doc/reference/Makefile.am	(original)
+++ trunk/doc/reference/Makefile.am	Thu Jun 26 18:32:49 2008
@@ -49,7 +49,7 @@
 
 # CFLAGS and LDFLAGS for compiling scan program. Only needed
 # if $(DOC_MODULE).types is non-empty.
-GTKDOC_CFLAGS = $(VTE_CFLAGS) -I$(top_srcdir)/src
+GTKDOC_CFLAGS = $(VTE_CFLAGS) -I$(top_srcdir)/src -DVTE_COMPILATION
 GTKDOC_LIBS = $(top_builddir)/src/libvte.la
 
 # Extra options to supply to gtkdoc-mkdb

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Thu Jun 26 18:32:49 2008
@@ -1,5 +1,5 @@
 bin_PROGRAMS = vte
-pkginclude_HEADERS = pty.h reaper.h vte.h vteaccess.h vteversion.h
+pkginclude_HEADERS = pty.h reaper.h vte.h vteaccess.h vtetypebuiltins.h vteversion.h
 lib_LTLIBRARIES = libvte.la
 pkglib_PROGRAMS = interpret utf8echo nativeecho utf8mode iso8859mode slowcat vterdb
 pkglib_SCRIPTS = decset osc window
@@ -11,6 +11,8 @@
 	vteseq-n.gperf \
 	vteseq-2.c \
 	vteseq-n.c \
+	vtetypebuiltins.c.template \
+	vtetypebuiltins.h.template \
 	genkeysyms.py \
 	iso2022.txt \
 	marshal.list \
@@ -36,7 +38,8 @@
 	    -DG_DISABLE_ASSERT -DG_LOG_DOMAIN=\"Vte\"
 AM_CPPFLAGS = -DDATADIR='"$(datadir)"' \
 	      -DLIBEXECDIR='"$(libexecdir)"' \
-	      -DLOCALEDIR='"$(localedir)"'
+	      -DLOCALEDIR='"$(localedir)"' \
+	      -DVTE_COMPILATION
 AM_LDFLAGS = $(LDFLAGS)
 
 EXTRA_libvte_la_SOURCES = keysyms.c
@@ -104,6 +107,8 @@
 	vtetc.h \
 	vtetree.c \
 	vtetree.h \
+	vtetypebuiltins.c \
+	vtetypebuiltins.h \
 	vteversion.h
 
 if BUILD_XFT
@@ -123,11 +128,25 @@
 	@LIBTOOL_EXPORT_OPTIONS@ @LIBTOOL_FLAGS@
 libvte_la_LIBADD = $(LIBS) $(VTE_LIBS) $(X_LIBS) $(PCRE_LIBS) $(FT2_LIBS)
 
-CLEANFILES = marshal.c marshal.h
+BUILT_SOURCES = marshal.c marshal.h vtetypebuiltins.c vtetypebuiltins.h
+CLEANFILES = marshal.c marshal.h vtetypebuiltins.c vtetypebuiltins.h stamp-vtetypebuiltins.h
 
 marshal.c marshal.h: marshal.list
-	glib-genmarshal --prefix=_vte_marshal --body $^ > marshal.c
-	glib-genmarshal --prefix=_vte_marshal --header $^ > marshal.h
+	$(GLIB_GENMARSHAL) --prefix=_vte_marshal --body $(GLIB_GENMARSHAL_INTERNAL) $^ > marshal.c
+	$(GLIB_GENMARSHAL) --prefix=_vte_marshal --header $(GLIB_GENMARSHAL_INTERNAL) $^ > marshal.h
+
+vtetypebuiltins.h: stamp-vtetypebuiltins.h
+	@true
+stamp-vtetypebuiltins.h: vtetypebuiltins.h.template vte.h
+	$(GLIB_MKENUMS) --template $< $(filter-out $<,$^) > xgen-vtbh \
+	&& (cmp -s xgen-vtbh vtetypebuiltins.h || cp xgen-vtbh vtetypebuiltins.h ) \
+	&& rm -f xgen-vtbh \
+	&& echo timestamp > $(@F)
+
+vtetypebuiltins.c: vtetypebuiltins.c.template vte.h
+	$(GLIB_MKENUMS) --template $< $(filter-out $<,$^) > xgen-vtbc \
+	&& (cmp -s xgen-vtbc vtetypebuiltins.c || cp xgen-vtbc vtetypebuiltins.c ) \
+	&& rm -f xgen-vtbc
 
 vte_SOURCES = \
 	vteapp.c

Modified: trunk/src/vte.c
==============================================================================
--- trunk/src/vte.c	(original)
+++ trunk/src/vte.c	Thu Jun 26 18:32:49 2008
@@ -11170,44 +11170,6 @@
 	process_timer = g_timer_new ();
 }
 
-GType
-vte_terminal_erase_binding_get_type(void)
-{
-	static GType terminal_erase_binding_type = 0;
-	static GEnumValue values[] = {
-		{VTE_ERASE_AUTO, "VTE_ERASE_AUTO", "auto"},
-		{VTE_ERASE_ASCII_BACKSPACE, "VTE_ERASE_ASCII_BACKSPACE",
-		 "ascii-backspace"},
-		{VTE_ERASE_ASCII_DELETE, "VTE_ERASE_ASCII_DELETE",
-		 "ascii-delete"},
-		{VTE_ERASE_DELETE_SEQUENCE, "VTE_ERASE_DELETE_SEQUENCE",
-		 "delete-sequence"},
-	};
-	if (terminal_erase_binding_type == 0) {
-		terminal_erase_binding_type =
-			g_enum_register_static("VteTerminalEraseBinding",
-					       values);
-	}
-	return terminal_erase_binding_type;
-}
-
-GType
-vte_terminal_anti_alias_get_type(void)
-{
-	static GType terminal_anti_alias_type = 0;
-	static GEnumValue values[] = {
-		{VTE_ANTI_ALIAS_USE_DEFAULT, "VTE_ANTI_ALIAS_USE_DEFAULT", "use-default"},
-		{VTE_ANTI_ALIAS_FORCE_ENABLE, "VTE_ANTI_ALIAS_FORCE_ENABLE", "force-enable"},
-		{VTE_ANTI_ALIAS_FORCE_DISABLE, "VTE_ANTI_ALIAS_FORCE_DISABLE", "force-disable"},
-	};
-	if (terminal_anti_alias_type == 0) {
-		terminal_anti_alias_type =
-			g_enum_register_static("VteTerminalAntiAlias",
-					       values);
-	}
-	return terminal_anti_alias_type;
-}
-
 /**
  * vte_terminal_set_audible_bell:
  * @terminal: a #VteTerminal

Modified: trunk/src/vte.h
==============================================================================
--- trunk/src/vte.h	(original)
+++ trunk/src/vte.h	Thu Jun 26 18:32:49 2008
@@ -25,8 +25,13 @@
 
 #include <sys/types.h> /* for pid_t */
 
+#define __VTE_VTE_H_INSIDE__ 1
+
+#include "vtetypebuiltins.h"
 #include "vteversion.h"
 
+#undef __VTE_VTE_H_INSIDE__
+
 G_BEGIN_DECLS
 
 /* Private implementation details. */
@@ -195,10 +200,8 @@
 							     VTE_TYPE_TERMINAL)
 #define VTE_TERMINAL_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj), VTE_TYPE_TERMINAL, VteTerminalClass))
 
-#define VTE_TYPE_TERMINAL_ERASE_BINDING	(vte_terminal_erase_binding_get_type())
 #define VTE_IS_TERMINAL_ERASE_BINDING(obj)	G_TYPE_CHECK_INSTANCE_TYPE((obj),\
 						VTE_TYPE_TERMINAL_ERASE_BINDING)
-#define VTE_TYPE_TERMINAL_ANTI_ALIAS	(vte_terminal_anti_alias_get_type())
 #define VTE_IS_TERMINAL_ANTI_ALIAS(obj)		G_TYPE_CHECK_INSTANCE_TYPE((obj),\
 						VTE_TYPE_TERMINAL_ANTI_ALIAS)
 

Added: trunk/src/vtetypebuiltins.c.template
==============================================================================
--- (empty file)
+++ trunk/src/vtetypebuiltins.c.template	Thu Jun 26 18:32:49 2008
@@ -0,0 +1,40 @@
+/*** BEGIN file-header ***/
+#include "vte.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/src/vtetypebuiltins.h.template
==============================================================================
--- (empty file)
+++ trunk/src/vtetypebuiltins.h.template	Thu Jun 26 18:32:49 2008
@@ -0,0 +1,28 @@
+/*** BEGIN file-header ***/
+#if !defined (__VTE_VTE_H_INSIDE__) && !defined (VTE_COMPILATION)
+#error "Only <vte/vte.h> can be included directly."
+#endif
+
+#ifndef VTE_TYPE_BUILTINS_H
+#define VTE_TYPE_BUILTINS_H
+
+#include <glib-object.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 VTE_TYPE_ ENUMSHORT@ (@enum_name _get_type ())
+/*** END value-header ***/
+
+/*** BEGIN file-tail ***/
+G_END_DECLS
+
+#endif /* !VTE_TYPE_BUILTINS_H */
+/*** END file-tail ***/



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