[gnome-db] GObject Introspection annotations patch for 4.2.x series



This patch back port some modifications from 4.99.x branch. I've been able to generate Vala bindings update and sent a patch to Vala project.

My plan is to generate VAPI at build time for 5.0 and install in Vala vapi directory. Now a days, GIR support is better and better, at the point that if the generated gir file is good enough, valac can parse directly without a vapi file, I think this is the point to reach.

We need to add more annotations and avoid API with problems to be bindingable. Even I found that we can review our API using the generated vapi, because you can find GList* with no defined contained type, some functions that can be included in other objects and not as a "free" function not associated to anyone.

I'll step this way and propose some API changes to upcoming Gda 5.0.

Waiting for your comments.
From 325122f3fd032104b12a2e4d15261cb06248fd1a Mon Sep 17 00:00:00 2001
From: Daniel Espinosa <esodan gmail com>
Date: Thu, 8 Sep 2011 19:15:27 -0500
Subject: [PATCH] Improvements to GObject Introspection in SqlParser and
 SqlBuilder

---
 libgda/Makefile.am                            |    3 ++-
 libgda/gda-sql-builder.c                      |   18 +++++++++---------
 libgda/gda-types.h                            |    8 ++++++++
 libgda/sql-parser/gda-statement-struct-decl.h |   17 ++++++++++++++++-
 4 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/libgda/Makefile.am b/libgda/Makefile.am
index a8a8012..a904e1d 100644
--- a/libgda/Makefile.am
+++ b/libgda/Makefile.am
@@ -313,7 +313,8 @@ threadwrapper = \
 
 sqlparser = \
 	sql-parser/gda-sql-parser.h \
-	sql-parser/gda-sql-parser.c
+	sql-parser/gda-sql-parser.c \
+	sql-parser/gda-statement-struct-decl.h
 
 handlers = \
 	handlers/gda-handler-bin.h \
diff --git a/libgda/gda-sql-builder.c b/libgda/gda-sql-builder.c
index 32cc592..9593379 100644
--- a/libgda/gda-sql-builder.c
+++ b/libgda/gda-sql-builder.c
@@ -352,7 +352,7 @@ gda_sql_builder_get_statement (GdaSqlBuilder *builder, GError **error)
 }
 
 /**
- * gda_sql_builder_get_sql_statement:
+ * gda_sql_builder_get_sql_statement: (skip)
  * @builder: a #GdaSqlBuilder object
  *
  * Creates a new #GdaSqlStatement structure from @builder's contents.
@@ -1039,7 +1039,7 @@ gda_sql_builder_add_param (GdaSqlBuilder *builder, const gchar *param_name, GTyp
 }
 
 /**
- * gda_sql_builder_add_cond:
+ * gda_sql_builder_add_cond: (skip)
  * @builder: a #GdaSqlBuilder object
  * @op: type of condition
  * @op1: the ID of the 1st argument (not 0)
@@ -1083,7 +1083,7 @@ gda_sql_builder_add_cond (GdaSqlBuilder *builder, GdaSqlOperatorType op, GdaSqlB
 }
 
 /**
- * gda_sql_builder_add_cond_v:
+ * gda_sql_builder_add_cond_v: (skip)
  * @builder: a #GdaSqlBuilder object
  * @op: type of condition
  * @op_ids: (array length=op_ids_size): an array of ID for the arguments (not %0)
@@ -1725,7 +1725,7 @@ gda_sql_builder_add_function_v (GdaSqlBuilder *builder, const gchar *func_name,
 }
 
 /**
- * gda_sql_builder_add_sub_select:
+ * gda_sql_builder_add_sub_select: (skip)
  * @builder: a #GdaSqlBuilder object
  * @sqlst: a pointer to a #GdaSqlStatement, which has to be a SELECT or compound SELECT. This will be copied.
  *
@@ -1764,7 +1764,7 @@ gda_sql_builder_add_sub_select (GdaSqlBuilder *builder, GdaSqlStatement *sqlst)
 }
 
 /**
- * gda_sql_builder_compound_set_type:
+ * gda_sql_builder_compound_set_type: (skip)
  * @builder: a #GdaSqlBuilder object
  * @compound_type: a type of compound
  *
@@ -1788,7 +1788,7 @@ gda_sql_builder_compound_set_type (GdaSqlBuilder *builder, GdaSqlStatementCompou
 }
 
 /**
- * gda_sql_builder_compound_add_sub_select:
+ * gda_sql_builder_compound_add_sub_select: (skip)
  * @builder: a #GdaSqlBuilder object
  * @sqlst: a pointer to a #GdaSqlStatement, which has to be a SELECT or compound SELECT. This will be copied.
  *
@@ -1946,7 +1946,7 @@ gda_sql_builder_add_case_v (GdaSqlBuilder *builder,
 }
 
 /**
- * gda_sql_builder_export_expression:
+ * gda_sql_builder_export_expression: (skip)
  * @builder: a #GdaSqlBuilder object
  * @id: the ID of the expression to be exported, (must be a valid ID in @builder, not %0)
  *
@@ -1973,8 +1973,8 @@ gda_sql_builder_export_expression (GdaSqlBuilder *builder, GdaSqlBuilderId id)
 }
 
 /**
- * gda_sql_builder_import_expression:
- * @builder: a #GdaSqlBuilder object
+ * gda_sql_builder_import_expression: (skip)
+ * @builder: a #GdaSqlBuilder object 
  * @expr: a #GdaSqlExpr obtained using gda_sql_builder_export_expression()
  *
  * Imports the @expr into @builder.
diff --git a/libgda/gda-types.h b/libgda/gda-types.h
index b546a05..e677f8b 100644
--- a/libgda/gda-types.h
+++ b/libgda/gda-types.h
@@ -29,11 +29,19 @@ G_BEGIN_DECLS
 
 /* Boxed type for GError will not be done in GLib see bug #300610 */
 #define GDA_TYPE_ERROR (_gda_error_get_type())
+/**
+ * GdaError: (skip)
+ *
+ */
 typedef GError GdaError;
 GType   _gda_error_get_type (void) G_GNUC_CONST;
 
 /* Pointer type for GSList (not a boxed type!) */
 #define GDA_TYPE_SLIST (_gda_slist_get_type())
+/**
+ * GdaSList: (skip)
+ *
+ */
 typedef GSList GdaSList;
 GType   _gda_slist_get_type (void) G_GNUC_CONST;
 
diff --git a/libgda/sql-parser/gda-statement-struct-decl.h b/libgda/sql-parser/gda-statement-struct-decl.h
index 6f5f54f..99a419c 100644
--- a/libgda/sql-parser/gda-statement-struct-decl.h
+++ b/libgda/sql-parser/gda-statement-struct-decl.h
@@ -80,6 +80,10 @@ typedef enum {
 /*
  * Structures identification
  */
+/**
+ * GdaSqlAnyPartType: (skip)
+ *
+ */
 typedef enum {
 	/* complete statements */
 	GDA_SQL_ANY_STMT_SELECT = GDA_SQL_STATEMENT_SELECT,
@@ -109,6 +113,10 @@ typedef enum {
 	GDA_SQL_ANY_SQL_SELECT_ORDER
 } GdaSqlAnyPartType;
 
+/**
+ * GdaSqlAnyPart: (skip)
+ *
+ */
 struct _GdaSqlAnyPart {
 	GdaSqlAnyPartType  type;
 	GdaSqlAnyPart     *parent;
@@ -135,6 +143,10 @@ gboolean gda_sql_any_part_check_structure (GdaSqlAnyPart *node, GError **error);
 /*
  * Contents' infos
  */
+/**
+ * GdaSqlStatementContentsInfo: (skip)
+ *
+ */
 typedef struct {
 	GdaSqlStatementType  type;
 	gchar               *name;
@@ -157,7 +169,10 @@ typedef struct {
 /*
  * Validation against a dictionary
  */
-
+/**
+ * GdaSqlStatementCheckValidityData: (skip)
+ *
+ */
 typedef struct {
 	GdaConnection *cnc;
 	GdaMetaStore  *store;
-- 
1.7.6



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