[gnome-db] GObject Introspection to GDA UI extension - Initial support



I had to delete some macros from gda-debug-macros.h because it creates
some constants in the GIR file witch make the GDA GOI support to fail.
I suppose this could be implemented in a different way, I hope so!!!

I'll re-open the bug 585351 for GOI for GDA, because I found the
actual GIR generation doesn't take the *.c files (exists a typo on the
Makefile.am - Reported by Alan Knowles). If I correct the typo and
include the *.c to the GOi scanner, it fails because exist some
undefined types GError, (some are typo too), but the Bug 612022 on GOI
blocks to fix this bug.

This is an initial support for GObject Introspection, both on GDA and
its UI extension. Now and on, we need to modify the *.c files
documentation to add GOI annotations and wait to fix some bugs on GOI.

-- 
Trabajar, la mejor arma para tu superación
"de grano en grano, se hace la arena" (R) (en trámite, pero para los
cuates: LIBRE)
diff --git a/libgda-ui/Makefile.am b/libgda-ui/Makefile.am
index db2e2db..cb95d8a 100644
--- a/libgda-ui/Makefile.am
+++ b/libgda-ui/Makefile.am
@@ -1,3 +1,5 @@
+QUIET_GEN = $(Q:@= echo ' GEN '$@;)
+
 lib_LTLIBRARIES = libgda-ui-4.0.la
 
 SUBDIRS = marshallers data-entries internal data . data-entries/plugins demos
@@ -37,9 +39,8 @@ ui_headers = \
 	gdaui-tree-store.h \
 	gdaui-plugin.h
 
-libgda_ui_4_0_la_SOURCES = \
+ui_sources = \
 	$(ui_headers) \
-	$(libgda_ui_built_cfiles) \
 	gdaui-basic-form.c \
 	gdaui-combo.c \
 	gdaui-data-entry.c \
@@ -61,6 +62,10 @@ libgda_ui_4_0_la_SOURCES = \
 	gdaui-tree-store.c \
 	gdaui-init.c
 
+libgda_ui_4_0_la_SOURCES = \
+	$(libgda_ui_built_cfiles) \
+	$(ui_sources)
+
 gdaui-enum-types.h: s-enum-types-h
 	@true
 
@@ -148,3 +153,117 @@ dtddir=$(datadir)/libgda-$(GDA_ABI_MAJOR_VERSION).$(GDA_ABI_MINOR_VERSION)/dtd
 dtd_DATA=$(DTD_FILES)
 
 EXTRA_DIST = $(DTD_FILES) libgda-ui.symbols
+
+if HAVE_INTROSPECTION
+BUILT_GIRSOURCES =
+ui_data_entries_sources = \
+	data-entries/gdaui-data-cell-renderer-bin.h \
+	data-entries/gdaui-data-cell-renderer-boolean.h \
+	data-entries/gdaui-data-cell-renderer-combo.h \
+	data-entries/gdaui-data-cell-renderer-info.h \
+	data-entries/gdaui-data-cell-renderer-textual.h \
+	data-entries/gdaui-entry-bin.h \
+	data-entries/gdaui-entry-boolean.h \
+	data-entries/gdaui-entry-combo.h \
+	data-entries/gdaui-entry-none.h \
+	data-entries/gdaui-entry-shell.h \
+	data-entries/gdaui-entry-string.h \
+	data-entries/gdaui-entry-number.h \
+	data-entries/gdaui-entry-common-time.h \
+	data-entries/gdaui-entry-time.h \
+	data-entries/gdaui-entry-timestamp.h \
+	data-entries/gdaui-entry-date.h \
+	data-entries/gdaui-entry-wrapper.h \
+	data-entries/gdaui-entry.h \
+	data-entries/gdaui-formatted-entry.h \
+	data-entries/gdaui-numeric-entry.h \
+	data-entries/gdaui-data-cell-renderer-bin.c \
+	data-entries/gdaui-data-cell-renderer-boolean.c \
+	data-entries/gdaui-data-cell-renderer-combo.c \
+	data-entries/gdaui-data-cell-renderer-info.c \
+	data-entries/gdaui-data-cell-renderer-textual.c \
+	data-entries/gdaui-entry-bin.c \
+	data-entries/gdaui-entry-boolean.c \
+	data-entries/gdaui-entry-combo.c \
+	data-entries/gdaui-entry-none.c \
+	data-entries/gdaui-entry-shell.c \
+	data-entries/gdaui-entry-string.c \
+	data-entries/gdaui-entry-number.c \
+	data-entries/gdaui-entry-common-time.c \
+	data-entries/gdaui-entry-time.c \
+	data-entries/gdaui-entry-timestamp.c \
+	data-entries/gdaui-entry-date.c \
+	data-entries/gdaui-entry-wrapper.c \
+	data-entries/gdaui-entry.c \
+	data-entries/gdaui-formatted-entry.c \
+	data-entries/gdaui-numeric-entry.c
+
+plugin_sources = \
+        data-entries/plugins/common-pict.c \
+        data-entries/plugins/common-pict.h \
+        data-entries/plugins/custom-marshal.c \
+        data-entries/plugins/custom-marshal.h \
+        data-entries/plugins/gdaui-data-cell-renderer-cgrid.c \
+        data-entries/plugins/gdaui-data-cell-renderer-cgrid.h \
+        data-entries/plugins/gdaui-data-cell-renderer-password.c \
+        data-entries/plugins/gdaui-data-cell-renderer-password.h \
+        data-entries/plugins/gdaui-data-cell-renderer-pict.c \
+        data-entries/plugins/gdaui-data-cell-renderer-pict.h \
+        data-entries/plugins/gdaui-entry-cgrid.c \
+        data-entries/plugins/gdaui-entry-cgrid.h \
+        data-entries/plugins/gdaui-entry-cidr.c \
+        data-entries/plugins/gdaui-entry-cidr.h \
+        data-entries/plugins/gdaui-entry-filesel.c \
+        data-entries/plugins/gdaui-entry-filesel.h \
+        data-entries/plugins/gdaui-entry-password.c \
+        data-entries/plugins/gdaui-entry-password.h \
+        data-entries/plugins/gdaui-entry-pict.c \
+        data-entries/plugins/gdaui-entry-pict.h \
+        data-entries/plugins/gdaui-entry-text.c \
+        data-entries/plugins/gdaui-entry-text.h
+
+gir_sources = \
+	$(ui_headers) \
+	$(ui_sources) \
+	$(plugin_sources) \
+	$(ui_data_entries_sources)
+
+Gdaui- GDA_ABI_VERSION@.gir: $(INTROSPECTION_SCANNER) libgda-ui-4.0.la
+	$(INTROSPECTION_SCANNER) -v \
+		--namespace Gdaui --nsversion= GDA_ABI_VERSION@ \
+		-I$(top_srcdir) -I$(top_srcdir)/libgda -I$(top_srcdir)/libgda-ui \
+		$(LIBGDA_CFLAGS) \
+		$(GTK_CFLAGS) \
+		$(GIO_CFLAGS) \
+		--add-include-path=data-entries \
+		--add-include-path=$(top_srcdir)/libgda \
+		--include=GL-1.0 \
+		--include=GObject-2.0 \
+		--include=libxml2-2.0 \
+		--include=Gtk-2.0 \
+		--include=Gda-4.0 \
+		--library=gda-ui- GDA_ABI_VERSION@ \
+	    $(INCLUDE_CFLAGS) \
+	    --output $@ \
+		$(addprefix $(srcdir)/, $(ui_sources)) \
+		$(addprefix $(srcdir)/, $(ui_data_entries_sources)) 
+
+BUILT_GIRSOURCES += Gdaui- GDA_ABI_VERSION@.gir
+
+endif
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(BUILT_GIRSOURCES)
+
+typelibsdir = $(libdir)/girepository-1.0/
+
+typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib)
+
+Gdaui- GDA_ABI_VERSION@.typelib: Gdaui- GDA_ABI_VERSION@.gir $(INTROSPECTION_COMPILER)
+	$(QUIET_GEN)$(DEBUG) $(INTROSPECTION_COMPILER) \
+	--includedir=$(srcdir) --includedir=. \
+	--includedir=$(srcdir)/data-entries\
+	$(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+CLEANFILES += $(BUILT_GIRSOURCES) $(typelibs_DATA)
+
diff --git a/libgda/gda-debug-macros.h b/libgda/gda-debug-macros.h
index 3a576a2..2a38728 100644
--- a/libgda/gda-debug-macros.h
+++ b/libgda/gda-debug-macros.h
@@ -23,21 +23,6 @@
 #include <glib.h>
 #include <glib-object.h>
 
-#ifdef GDA_DEBUG
-#define D_COL_NOR "\033[0m"
-#define D_COL_H0 "\033[;34;7m"
-#define D_COL_H1 "\033[;36;7m"
-#define D_COL_H2 "\033[;36;4m"
-#define D_COL_OK "\033[;32m"
-#define D_COL_ERR "\033[;31;1m"
-#endif
-
-#ifndef TO_IMPLEMENT
-  #ifdef GDA_DEBUG
-    #define TO_IMPLEMENT g_print (D_COL_ERR "Implementation missing:" D_COL_NOR " %s() in %s line %d\n", __FUNCTION__, __FILE__,__LINE__)
-  #else
-    #define TO_IMPLEMENT g_print ("Implementation missing: %s() in %s line %d\n", __FUNCTION__, __FILE__,__LINE__)
-  #endif
-#endif
+#define TO_IMPLEMENT g_print ("Implementation missing: %s() in %s line %d\n", __FUNCTION__, __FILE__,__LINE__)
 
 #endif


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