[lasem/introspection] Add support for gobject introspection.



commit a613223c752d05cd6bccbe928a203f9fda4202d3
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Mon Feb 15 17:06:11 2010 +0100

    Add support for gobject introspection.

 Makefile.am         |    4 +++-
 configure.ac        |    9 ++++++---
 src/.gitignore      |    2 ++
 src/Makefile.am     |   31 ++++++++++++++++++++++++++++++-
 src/lsmattributes.h |    2 +-
 5 files changed, 42 insertions(+), 6 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index c64f03d..970f5e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,7 @@
 ACLOCAL_AMFLAGS = -I m4
 
+DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
+
 SUBDIRS = itex2mml src po
 
 lasemdocdir = ${prefix}/doc/lasem
@@ -11,7 +13,7 @@ lasemdoc_DATA = 	\
 	INSTALL		\
 	NEWS
 
-EXTRA_DIST = $(lasemdoc_DATA)
+EXTRA_DIST = $(lasemdoc_DATA) m4/introspection.m4
 
 # Copy all the spec files. Of cource, only one is actually used.
 dist-hook:
diff --git a/configure.ac b/configure.ac
index 98cea3d..9da22d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,9 +7,10 @@ m4_define([lasem_version], [lasem_version_major.lasem_version_minor.lasem_versio
 
 AC_INIT([lasem],[lasem_version],[http://bugzilla.gnome.org/enter_bug.cgi?product=lasem],[lasem])
 
-AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
-AC_CONFIG_HEADERS([config.h])
+AM_INIT_AUTOMAKE([-Wno-portability])
 AM_MAINTAINER_MODE
+
+AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 
 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
@@ -28,7 +29,7 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
 AM_GLIB_GNU_GETTEXT
 IT_PROG_INTLTOOL([0.35.0])
 
-LT_INIT
+LT_INIT()
 
 PKG_CHECK_MODULES(LASEM, [gobject-2.0 glib-2.0 gio-2.0 gdk-pixbuf-2.0 >= 2.16 gdk-2.0 >= 2.16 cairo >= 1.2 pangocairo >= 1.16.0 libxml-2.0])
 AC_SUBST(LASEM_CFLAGS)
@@ -36,6 +37,8 @@ AC_SUBST(LASEM_LIBS)
 
 AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
 
+GOBJECT_INTROSPECTION_CHECK([0.6.7])
+
 AC_CONFIG_FILES([
 Makefile
 itex2mml/Makefile
diff --git a/src/.gitignore b/src/.gitignore
index 5b8f7ce..bfd443f 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -8,3 +8,5 @@ lasemtest
 *.swp
 lsmenumtypes.c
 lsmenumtypes.h
+*.gir
+*.typelib
diff --git a/src/Makefile.am b/src/Makefile.am
index d96be22..2a445a9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,8 @@
+-include $(INTROSPECTION_MAKEFILE)
+  INTROSPECTION_GIRS =
+  INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
+  INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+
 INCLUDES = \
 	-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
 	-DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
@@ -217,4 +222,28 @@ lasemtest_LDFLAGS =
 
 lasemtest_LDADD = $(LASEM_LIBS) liblasem.la ../itex2mml/libitex2mml.la
 
-CLEAN_FILES = $(BUILT_SOURCES)
+CLEANFILES = $(BUILT_SOURCES)
+
+if HAVE_INTROSPECTION
+
+introspection_files = $(liblasem_la_SOURCES) \
+		      $(liblasem_la_HEADERS)
+
+Lasem-1.0.gir: $(INTROSPECTION_SCANNER) liblasem.la Makefile
+Lasem_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango-1.0 GdkPixbuf-2.0
+Lasem_1_0_gir_SCANNERFLAGS = --strip-prefix=Lsm
+Lasem_1_0_gir_CFLAGS = $(INCLUDES)
+Lasem_1_0_gir_LIBS = liblasem.la
+Lasem_1_0_gir_FILES = $(addprefix $(srcdir)/,$(introspection_files))
+
+INTROSPECTION_GIRS += Lasem-1.0.gir
+
+girdir = $(datadir)/gir-1.0
+dist_gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepositry-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(dist_gir_DATA) $(typelib_DATA)
+
+endif
diff --git a/src/lsmattributes.h b/src/lsmattributes.h
index c00f60c..d720c3d 100644
--- a/src/lsmattributes.h
+++ b/src/lsmattributes.h
@@ -35,7 +35,7 @@ gboolean	lsm_attribute_is_defined			(const LsmAttribute *attribute);
 
 typedef struct {
 	char const *		name;
-	ptrdiff_t 		attribute_offset;
+	int 			attribute_offset;
 	const LsmTraitClass *	trait_class;
 	const void *		trait_default;
 } LsmAttributeInfos;



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