Re: [gnome-db] New release soon



Sorry it is attached... :-)

2007/2/9, Murray Cumming <murrayc murrayc com>:
On Fri, 2007-02-09 at 00:06 -0600, Daniel Espinosa wrote:
> Attached you'll find a patch for libgda library.

You forgot that part.

> Just to comment, I have a plan to make API changes in libgnomedb in
> GnomeDbSelector: in the function gnome_db_selector_set_mode_columns
> use 'gulong' types for mode and columns why does it not use
> GnomeDbSelectorMode and GnomeDbSelectorColumn types? is this affect
> the code (I hadn't time to check it my self)

Yes, that seems to be the convention in GTK+ too: They use the enum type
when various values of the enum should be ORed together, as flags.

I've made the change in svn trunk, and I will make similar changes to
other OR'ed function parameters.

> After your realise, I'll complete the migration of GnomeDb# to the new
> libraries, in order to get DLL for each library created
>
> 2007/2/8, Vivien Malerba <vmalerba gmail com>:
> > On 2/8/07, Daniel Espinosa <esodan gmail com> wrote:
> > > I have some changes in libgda, I'll prepare a patch and send to the list ASAP.
> >
> > By tomorrow morning would be fine.
> >
> > Thanks,
> >
> > Vivien

--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




--
Trabajar, la mejor arma para tu superación
"de grano en grano, se hace la arena" (R) (entrámite, pero para los
cuates: LIBRE)
Index: gtk-doc.make
===================================================================
--- gtk-doc.make	(revisión: 2816)
+++ gtk-doc.make	(copia de trabajo)
@@ -53,8 +53,6 @@
 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
 	@echo 'gtk-doc: Scanning header files'
 	@-chmod -R u+w $(srcdir)
-	cd $(srcdir) && \
-	  gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
 	if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
 	    CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
 	else \
@@ -63,6 +61,8 @@
                test -f $$i || touch $$i ; \
 	    done \
 	fi
+	cd $(srcdir) && \
+	  gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
 	touch scan-build.stamp
 
 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
@@ -147,7 +147,7 @@
 	mkdir $(distdir)/html
 	-cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
 	-cp $(srcdir)/xml/*.xml $(distdir)/xml
-	cp $(srcdir)/html/* $(distdir)/html
+	-cp $(srcdir)/html/* $(distdir)/html
 	if test -f $(srcdir)/$(DOC_MODULE).types; then \
 	  cp $(srcdir)/$(DOC_MODULE).types $(distdir)/$(DOC_MODULE).types; \
 	fi
Index: gda-sharp/gda-sharp.dll.config.in
===================================================================
--- gda-sharp/gda-sharp.dll.config.in	(revisión: 2816)
+++ gda-sharp/gda-sharp.dll.config.in	(copia de trabajo)
@@ -1,3 +1,3 @@
 <configuration>
-  <dllmap dll="gda-3" target="libgda-3 LIB_PREFIX@ 3 LIB_SUFFIX@"/>
+  <dllmap dll="gda-3" target="libgda-3 LIB_PREFIX@"/>
 </configuration>
Index: gda-sharp/Gda.metadata
===================================================================
--- gda-sharp/Gda.metadata	(revisión: 2816)
+++ gda-sharp/Gda.metadata	(copia de trabajo)
@@ -3,10 +3,13 @@
   <attr path="/api/namespace/class[ name='Main']" name="hidden">1</attr>
   <attr path="/api/namespace/class[ cname='GType_']" name="hidden">1</attr>
   <attr path="/api/namespace/class[ name='Value']" name="hidden">1</attr>
-  <attr path="/api/namespace/interface[ cname='GdaDataModel']/method[ name='Foreach']/*/*[ name='func']" name="scope">call</attr>
-  <attr path="/api/namespace/interface[ cname='GdaDataModel']/signal[ name='BeginUpdate']" name="name">BeganUpdate</attr>
-  <attr path="/api/namespace/interface[ cname='GdaDataModel']/signal[ name='CancelUpdate']" name="name">CanceledUpdate</attr>
-  <attr path="/api/namespace/interface[ cname='GdaDataModel']/signal[ name='CommitUpdate']" name="name">CommittedUpdate</attr>
+  <attr path="/api/namespace/interface[ cname='GdaDataModel']" name="name">IGdaDataModel</attr>
+  <attr path="/api/namespace/interface[ cname='GdaEntity']" name="name">IEntity</attr>
+  <attr path="/api/namespace/interface[ cname='GdaXmlStorage']" name="name">IXmlStorage</attr>
+  <attr path="/api/namespace/interface[ cname='GdaDataHandler']" name="name">IDataHandler</attr>
+  <attr path="/api/namespace/interface[ cname='GdaEntityField']" name="name">IEntityField</attr>
+  <attr path="/api/namespace/interface[ cname='GdaReferer']" name="name">IReferer</attr>
+  <attr path="/api/namespace/interface[ cname='GdaRenderer']" name="name">IRenderer</attr>
   <attr path="/api/namespace/object[ cname='GdaDataModelArray']/method[ name='SetNColumns']" name="new_flag">1</attr>
   <attr path="/api/namespace/object[ cname='GdaDataModelHash']/method[ name='SetNColumns']" name="new_flag">1</attr>
   <attr path="/api/namespace/object[ cname='GdaQueryFieldValue']/method[ name='IsParameter']" name="name">GetIsParameter</attr>
@@ -18,5 +21,24 @@
   <attr path="/api/namespace/object[ cname='GdaDictType']/method[ name='SetGType']" name="name">SetValueType</attr>
   <attr path="/api/namespace/object[ cname='GdaDictType']/method[ name='GetGType']" name="name">GetValueType</attr>
   <attr path="/api/namespace/struct[ cname='GdaServerProviderHandlerInfo']/field[ name='GType']" name="name">ValueType</attr>
+  <attr path="/api/namespace/object[ cname='GdaDictTable']/method[ name='IsView']" name="name">GetIsView</attr>
+  <add-node path="/api/namespace/object[ cname='GdaDictTable']/implements"><interface cname="GdaEntity" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQuery']/implements"><interface cname="GdaXmlStorage" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQuery']/implements"><interface cname="GdaRenderer" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryCondition']/implements"><interface cname="GdaRenderer" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryTarget']/implements"><interface cname="GdaReferer" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryJoin']/implements"><interface cname="GdaReferer" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryFieldValue']/implements"><interface cname="GdaEntityField" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryFieldValue']/implements"><interface cname="GdaReferer" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryFieldFunc']/implements"><interface cname="GdaEntityField" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryFieldFunc']/implements"><interface cname="GdaReferer" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryFieldField']/implements"><interface cname="GdaEntityField" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryFieldField']/implements"><interface cname="GdaReferer" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryFieldAll']/implements"><interface cname="GdaEntityField" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryFieldAll']/implements"><interface cname="GdaReferer" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryFieldAgg']/implements"><interface cname="GdaEntityField" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaQueryFieldAgg']/implements"><interface cname="GdaReferer" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaDictField']/implements"><interface cname="GdaEntityField" /></add-node>
+  <add-node path="/api/namespace/object[ cname='GdaDictReferer']/implements"><interface cname="GdaReferer" /></add-node>
 </metadata>
 
Index: gda-sharp/gda-sources.xml
===================================================================
--- gda-sharp/gda-sources.xml	(revisión: 2816)
+++ gda-sharp/gda-sources.xml	(copia de trabajo)
@@ -3,11 +3,21 @@
     <library name="gda-3">
       <namespace name="Gda">
         <directory path="../libgda">
-	    <exclude>gda-export.h</exclude>
-	    <exclude>gda-intl.h</exclude>
-	    <exclude>gda-log.h</exclude>
-	</directory>
+	        <exclude>gda-export.h</exclude>
+	        <exclude>gda-intl.h</exclude>
+	        <exclude>gda-log.h</exclude>
+	    </directory>
       </namespace>
     </library>
+    <library name="gda_handlers-3.0">
+    	<namespace name="Gda">
+    		<directory path="../libgda/handlers" />
+    	</namespace>
+    </library>
+    <library name="gda_graph-3.0">
+    	<namespace name="Gda">
+    		<directory path="../libgda/graph" />
+    	</namespace>
+    </library>
   </api>
 </gapi-parser-input>
Index: libgda/gda-query-field-agg.c
===================================================================
--- libgda/gda-query-field-agg.c	(revisión: 2816)
+++ libgda/gda-query-field-agg.c	(copia de trabajo)
@@ -58,7 +58,7 @@
 /* Field interface */
 static void         gda_query_field_agg_field_init      (GdaEntityFieldIface *iface);
 static GdaEntity   *gda_query_field_agg_get_entity      (GdaEntityField *iface);
-static GdaDictType *gda_query_field_agg_get_data_type   (GdaEntityField *iface);
+static GdaDictType *gda_query_field_agg_get_dict_type   (GdaEntityField *iface);
 
 /* Renderer interface */
 static void         gda_query_field_agg_renderer_init   (GdaRendererIface *iface);
@@ -183,7 +183,7 @@
 gda_query_field_agg_field_init (GdaEntityFieldIface *iface)
 {
 	iface->get_entity = gda_query_field_agg_get_entity;
-	iface->get_data_type = gda_query_field_agg_get_data_type;
+	iface->get_dict_type = gda_query_field_agg_get_dict_type;
 }
 
 static void
@@ -653,7 +653,7 @@
 }
 
 static GdaDictType *
-gda_query_field_agg_get_data_type (GdaEntityField *iface)
+gda_query_field_agg_get_dict_type (GdaEntityField *iface)
 {
 	g_return_val_if_fail (iface && GDA_IS_QUERY_FIELD_AGG (iface), NULL);
 	g_return_val_if_fail (GDA_QUERY_FIELD_AGG (iface)->priv, NULL);
Index: libgda/gda-query-field-all.c
===================================================================
--- libgda/gda-query-field-all.c	(revisión: 2816)
+++ libgda/gda-query-field-all.c	(copia de trabajo)
@@ -55,7 +55,7 @@
 /* Field interface */
 static void              gda_query_field_all_field_init      (GdaEntityFieldIface *iface);
 static GdaEntity         *gda_query_field_all_get_entity      (GdaEntityField *iface);
-static GdaDictType *gda_query_field_all_get_data_type   (GdaEntityField *iface);
+static GdaDictType *gda_query_field_all_get_dict_type   (GdaEntityField *iface);
 
 /* Renderer interface */
 static void            gda_query_field_all_renderer_init      (GdaRendererIface *iface);
@@ -180,7 +180,7 @@
 gda_query_field_all_field_init (GdaEntityFieldIface *iface)
 {
 	iface->get_entity = gda_query_field_all_get_entity;
-	iface->get_data_type = gda_query_field_all_get_data_type;
+	iface->get_dict_type = gda_query_field_all_get_dict_type;
 }
 
 static void
@@ -546,7 +546,7 @@
 }
 
 static GdaDictType *
-gda_query_field_all_get_data_type (GdaEntityField *iface)
+gda_query_field_all_get_dict_type (GdaEntityField *iface)
 {
 	g_return_val_if_fail (iface && GDA_IS_QUERY_FIELD_ALL (iface), NULL);
 	g_return_val_if_fail (GDA_QUERY_FIELD_ALL (iface)->priv, NULL);
Index: libgda/gda-dict-field.c
===================================================================
--- libgda/gda-dict-field.c	(revisión: 2816)
+++ libgda/gda-dict-field.c	(copia de trabajo)
@@ -58,7 +58,8 @@
 /* GdaEntityField interface */
 static void           gda_dict_field_field_init       (GdaEntityFieldIface *iface);
 static GdaEntity      *gda_dict_field_get_entity      (GdaEntityField *iface);
-static GdaDictType    *gda_dict_field_get_data_type   (GdaEntityField *iface);
+static GdaDictType    *gda_dict_field_get_dict_type   (GdaEntityField *iface);
+static void           gda_dict_field_set_dict_type   (GdaEntityField *iface, GdaDictType *type);
 
 /* Renderer interface */
 static void            gda_dict_field_renderer_init   (GdaRendererIface *iface);
@@ -81,14 +82,15 @@
 {
 	PROP_0,
 	PROP_DB_TABLE,
-	PROP_PLUGIN
+	PROP_PLUGIN,
+	PROP_DICT_TYPE
 };
 
 
 /* private structure */
 struct _GdaDictFieldPrivate
 {
-	GdaDictType     *data_type;
+	GdaDictType     *dict_type;
 	GdaDictTable    *table;
 	gint             length;     /* -1 if not applicable */
 	gint             scale;      /* 0 if not applicable */
@@ -164,7 +166,8 @@
 gda_dict_field_field_init (GdaEntityFieldIface *iface)
 {
 	iface->get_entity = gda_dict_field_get_entity;
-	iface->get_data_type = gda_dict_field_get_data_type;
+	iface->get_dict_type = gda_dict_field_get_dict_type;
+	iface->set_dict_type = gda_dict_field_set_dict_type;
 }
 
 static void
@@ -207,7 +210,7 @@
 {
 	gda_dict_field->priv = g_new0 (GdaDictFieldPrivate, 1);
 	gda_dict_field->priv->table = NULL;
-	gda_dict_field->priv->data_type = NULL;
+	gda_dict_field->priv->dict_type = NULL;
 	gda_dict_field->priv->length = -1;
 	gda_dict_field->priv->scale = 0;
 	gda_dict_field->priv->extra_attrs = 0;
@@ -238,7 +241,7 @@
 	gda_dict_field = GDA_DICT_FIELD (obj);
 
 	if (type)
-		gda_dict_field_set_dict_type (gda_dict_field, type);
+		gda_dict_field_set_dict_type (GDA_ENTITY_FIELD(gda_dict_field), type);
 	
 	return obj;
 }
@@ -266,11 +269,11 @@
 							      G_CALLBACK (destroyed_object_cb), gda_dict_field);
 			gda_dict_field->priv->table = NULL;
 		}
-		if (gda_dict_field->priv->data_type) {
-			g_signal_handlers_disconnect_by_func (G_OBJECT (gda_dict_field->priv->data_type),
+		if (gda_dict_field->priv->dict_type) {
+			g_signal_handlers_disconnect_by_func (G_OBJECT (gda_dict_field->priv->dict_type),
 							      G_CALLBACK (destroyed_object_cb), gda_dict_field);
-			g_object_unref (gda_dict_field->priv->data_type);
-			gda_dict_field->priv->data_type = NULL;
+			g_object_unref (gda_dict_field->priv->dict_type);
+			gda_dict_field->priv->dict_type = NULL;
 		}
 	}
 
@@ -480,34 +483,8 @@
 	return retval;
 }
 
-/**
-* gda_dict_field_set_dict_type
-* @field: a #GdaDictField  object
-* @type: a #GdaDictType object
-*
-* Sets the data type of the field
-*/
-void
-gda_dict_field_set_dict_type (GdaDictField *field, GdaDictType *type)
-{
-	g_return_if_fail (field && GDA_IS_DICT_FIELD (field));
-	g_return_if_fail (field->priv);
-	g_return_if_fail (type && GDA_IS_DICT_TYPE (type));
 
-	if (field->priv->data_type != type) {
-		if (field->priv->data_type)
-			g_signal_handlers_disconnect_by_func (G_OBJECT (field->priv->data_type),
-							      G_CALLBACK (destroyed_object_cb), field);
-		field->priv->data_type = type;
-		g_object_ref (type);
-		gda_object_connect_destroy (type, G_CALLBACK (destroyed_object_cb), field);
-		
-		/* signal the modification */
-		gda_object_signal_emit_changed (GDA_OBJECT (field));
-	}
-}
 
-
 /**
  * gda_dict_field_set_default_value
  * @field: a #GdaDictField object
@@ -796,14 +773,38 @@
 }
 
 static GdaDictType *
-gda_dict_field_get_data_type (GdaEntityField *iface)
+gda_dict_field_get_dict_type (GdaEntityField *iface)
 {
 	g_return_val_if_fail (iface && GDA_IS_DICT_FIELD (iface), NULL);
 	g_return_val_if_fail (GDA_DICT_FIELD (iface)->priv, NULL);
 
-	return GDA_DICT_FIELD (iface)->priv->data_type;
+	return GDA_DICT_FIELD (iface)->priv->dict_type;
 }
 
+static void
+gda_dict_field_set_dict_type (GdaEntityField *iface, GdaDictType *type)
+{
+	GdaDictField *field;
+	
+	field = GDA_DICT_FIELD (iface);
+	
+	g_return_if_fail (field && GDA_IS_DICT_FIELD (field));
+	g_return_if_fail (field->priv);
+	g_return_if_fail (type && GDA_IS_DICT_TYPE (type));
+
+	if (field->priv->dict_type != type) {
+		if (field->priv->dict_type)
+			g_signal_handlers_disconnect_by_func (G_OBJECT (field->priv->dict_type),
+							      G_CALLBACK (destroyed_object_cb), field);
+		field->priv->dict_type = type;
+		g_object_ref (type);
+		gda_object_connect_destroy (type, G_CALLBACK (destroyed_object_cb), field);
+		
+		/* signal the modification */
+		gda_object_signal_emit_changed (GDA_OBJECT (field));
+	}
+}
+
 /* 
  * GdaXmlStorage interface implementation
  */
@@ -845,7 +846,7 @@
 	if (gda_object_get_owner (GDA_OBJECT (field)))
 		xmlSetProp(node, (xmlChar*)"owner", (xmlChar*)gda_object_get_owner (GDA_OBJECT (field)));
 	xmlSetProp(node, (xmlChar*)"descr", (xmlChar*)gda_object_get_description (GDA_OBJECT (field)));
-	str = gda_xml_storage_get_xml_id (GDA_XML_STORAGE (field->priv->data_type));
+	str = gda_xml_storage_get_xml_id (GDA_XML_STORAGE (field->priv->dict_type));
 	xmlSetProp(node, (xmlChar*)"type", (xmlChar*)str);
 	g_free (str);
 	str = g_strdup_printf ("%d", field->priv->length);
@@ -926,7 +927,7 @@
 		if ((*prop == 'D') && prop+1 && (*(prop+1) == 'T')) {
 			GdaDictType *dt = gda_dict_get_dict_type_by_xml_id (dict, prop);
 			if (dt) 
-				gda_dict_field_set_dict_type (field, dt);
+				gda_dict_field_set_dict_type (GDA_ENTITY_FIELD(field), dt);
 			else {
 				/* create a new custom data type */
 				gchar *tmp, *tmp2;
@@ -948,7 +949,7 @@
 				gda_object_set_description (GDA_OBJECT (dt), tmp2);
 				g_free (tmp2);
 				gda_dict_declare_object (dict, GDA_OBJECT(dt));
-				gda_dict_field_set_dict_type (field, dt);
+				gda_dict_field_set_dict_type (GDA_ENTITY_FIELD (field), dt);
 				g_object_unref (dt);
 			}
 			type = TRUE;
Index: libgda/gda-query-parsing.c
===================================================================
--- libgda/gda-query-parsing.c	(revisión: 2816)
+++ libgda/gda-query-parsing.c	(copia de trabajo)
@@ -1664,7 +1664,7 @@
 	 */
 	qfield = (GdaEntityField *) gda_query_field_value_new (query, gdatype);
 	if (real_type)
-		gda_query_field_value_set_dict_type (GDA_QUERY_FIELD_VALUE (qfield), real_type);
+		gda_entity_field_set_dict_type (GDA_ENTITY_FIELD (qfield), real_type);
 	if (unspecvalue) 
 		/* value MUST BE a parameter */
 		gda_query_field_value_set_is_parameter (GDA_QUERY_FIELD_VALUE (qfield), TRUE);
Index: libgda/gda-dict-field.h
===================================================================
--- libgda/gda-dict-field.h	(revisión: 2816)
+++ libgda/gda-dict-field.h	(copia de trabajo)
@@ -69,7 +69,6 @@
 void            gda_dict_field_set_scale         (GdaDictField *field, gint length);
 gint            gda_dict_field_get_scale         (GdaDictField *field);
 GSList         *gda_dict_field_get_constraints   (GdaDictField *field);
-void            gda_dict_field_set_dict_type     (GdaDictField *field, GdaDictType *type);
 
 void            gda_dict_field_set_default_value (GdaDictField *field, const GValue *value);
 const GValue   *gda_dict_field_get_default_value (GdaDictField *field);
Index: libgda/gda-query-field-field.c
===================================================================
--- libgda/gda-query-field-field.c	(revisión: 2816)
+++ libgda/gda-query-field-field.c	(copia de trabajo)
@@ -58,7 +58,7 @@
 /* Field interface */
 static void         gda_query_field_field_field_init      (GdaEntityFieldIface *iface);
 static GdaEntity   *gda_query_field_field_get_entity      (GdaEntityField *iface);
-static GdaDictType *gda_query_field_field_get_data_type   (GdaEntityField *iface);
+static GdaDictType *gda_query_field_field_get_dict_type   (GdaEntityField *iface);
 
 /* Renderer interface */
 static void         gda_query_field_field_renderer_init   (GdaRendererIface *iface);
@@ -193,7 +193,7 @@
 gda_query_field_field_field_init (GdaEntityFieldIface *iface)
 {
 	iface->get_entity = gda_query_field_field_get_entity;
-	iface->get_data_type = gda_query_field_field_get_data_type;
+	iface->get_dict_type = gda_query_field_field_get_dict_type;
 }
 
 static void
@@ -826,7 +826,7 @@
 }
 
 static GdaDictType *
-gda_query_field_field_get_data_type (GdaEntityField *iface)
+gda_query_field_field_get_dict_type (GdaEntityField *iface)
 {
 	g_return_val_if_fail (iface && GDA_IS_QUERY_FIELD_FIELD (iface), NULL);
 	g_return_val_if_fail (GDA_QUERY_FIELD_FIELD (iface)->priv, NULL);
Index: libgda/gda-dict-table.c
===================================================================
--- libgda/gda-dict-table.c	(revisión: 2816)
+++ libgda/gda-dict-table.c	(copia de trabajo)
@@ -652,7 +652,7 @@
 			str = gda_value_stringify ((GValue *) value);
 			type = gda_dict_get_dict_type_by_name (dict, str);
 			if (type)
-				gda_dict_field_set_dict_type (field, type);
+				gda_entity_field_set_dict_type (GDA_ENTITY_FIELD (field), type);
 			else {
 				/* declare a custom data type */
 				gchar *descr;
@@ -665,7 +665,7 @@
 				gda_object_set_description (GDA_OBJECT (type), descr);
 				g_free (descr);
 				gda_dict_declare_object (dict, (GdaObject *) type);
-				gda_dict_field_set_dict_type (field, type);
+				gda_entity_field_set_dict_type (GDA_ENTITY_FIELD (field), type);
 				g_object_unref (type);
 			}
 			g_free (str);
Index: libgda/gda-query-field-func.c
===================================================================
--- libgda/gda-query-field-func.c	(revisión: 2816)
+++ libgda/gda-query-field-func.c	(copia de trabajo)
@@ -58,7 +58,7 @@
 /* Field interface */
 static void              gda_query_field_func_field_init      (GdaEntityFieldIface *iface);
 static GdaEntity         *gda_query_field_func_get_entity      (GdaEntityField *iface);
-static GdaDictType *gda_query_field_func_get_data_type   (GdaEntityField *iface);
+static GdaDictType *gda_query_field_func_get_dict_type   (GdaEntityField *iface);
 
 /* Renderer interface */
 static void            gda_query_field_func_renderer_init   (GdaRendererIface *iface);
@@ -184,7 +184,7 @@
 gda_query_field_func_field_init (GdaEntityFieldIface *iface)
 {
 	iface->get_entity = gda_query_field_func_get_entity;
-	iface->get_data_type = gda_query_field_func_get_data_type;
+	iface->get_dict_type = gda_query_field_func_get_dict_type;
 }
 
 static void
@@ -713,7 +713,7 @@
 }
 
 static GdaDictType *
-gda_query_field_func_get_data_type (GdaEntityField *iface)
+gda_query_field_func_get_dict_type (GdaEntityField *iface)
 {
 	g_return_val_if_fail (iface && GDA_IS_QUERY_FIELD_FUNC (iface), NULL);
 	g_return_val_if_fail (GDA_QUERY_FIELD_FUNC (iface)->priv, NULL);
Index: libgda/gda-query-field-value.c
===================================================================
--- libgda/gda-query-field-value.c	(revisión: 2816)
+++ libgda/gda-query-field-value.c	(copia de trabajo)
@@ -61,8 +61,9 @@
 /* Field interface */
 static void               gda_query_field_value_field_init      (GdaEntityFieldIface *iface);
 static GdaEntity         *gda_query_field_value_get_entity      (GdaEntityField *iface);
-static GType              gda_query_field_value_get_ig_type    (GdaEntityField *iface);
-static GdaDictType       *gda_query_field_value_get_data_type   (GdaEntityField *iface);
+static GType              gda_query_field_value_get_g_type      (GdaEntityField *iface);
+static GdaDictType       *gda_query_field_value_get_dict_type   (GdaEntityField *iface);
+static void               gda_query_field_value_set_dict_type   (GdaEntityField *iface, GdaDictType *type);
 
 /* Renderer interface */
 static void            gda_query_field_value_renderer_init      (GdaRendererIface *iface);
@@ -104,7 +105,8 @@
 	PROP_GDA_TYPE,
 	PROP_RESTRICT_MODEL,
         PROP_RESTRICT_COLUMN,
-	PROP_ENTRY_PLUGIN
+	PROP_ENTRY_PLUGIN,
+	PROP_IS_PARAMETER
 };
 
 
@@ -201,8 +203,8 @@
 gda_query_field_value_field_init (GdaEntityFieldIface *iface)
 {
 	iface->get_entity = gda_query_field_value_get_entity;
-	iface->get_g_type = gda_query_field_value_get_ig_type;
-	iface->get_data_type = gda_query_field_value_get_data_type;
+	iface->get_g_type = gda_query_field_value_get_g_type;
+	iface->get_dict_type = gda_query_field_value_get_dict_type;
 }
 
 static void
@@ -256,6 +258,9 @@
 	g_object_class_install_property (object_class, PROP_ENTRY_PLUGIN,
                                          g_param_spec_string ("entry_plugin", NULL, NULL, NULL,
                                                               (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+    g_object_class_install_property (object_class, PROP_IS_PARAMETER,
+                                         g_param_spec_boolean ("is_parameter", NULL, NULL, FALSE,
+                                                              (G_PARAM_READABLE | G_PARAM_WRITABLE)));
 	/* virtual functions */
 #ifdef GDA_DEBUG
         GDA_OBJECT_CLASS (class)->dump = (void (*)(GdaObject *, guint)) gda_query_field_value_dump;
@@ -480,7 +485,7 @@
 	obj = (GObject *) nqf;
 
 	if (qf->priv->dict_type)
-		gda_query_field_value_set_dict_type (nqf, qf->priv->dict_type);
+		gda_query_field_value_set_dict_type (GDA_ENTITY_FIELD(nqf), qf->priv->dict_type);
 
 	if (qf->priv->value)
 		nqf->priv->value = gda_value_copy (qf->priv->value);
@@ -624,23 +629,7 @@
 	return field->priv->default_value;
 }
 
-/**
- * gda_query_field_value_get_g_type
- * @field: a #GdaQueryFieldValue object
- *
- * Get the GDA type of value stored within @field
- *
- * Returns: the type
- */
-GType
-gda_query_field_value_get_g_type (GdaQueryFieldValue *field)
-{
-	g_return_val_if_fail (GDA_IS_QUERY_FIELD_VALUE (field), G_TYPE_INVALID);
-	g_return_val_if_fail (field->priv, G_TYPE_INVALID);
 
-	return field->priv->g_type;
-}
-
 /**
  * gda_query_field_value_set_is_parameter
  * @field: a #GdaQueryFieldValue object
@@ -844,65 +833,10 @@
 }
 
 
-/**
- * gda_query_field_value_set_dict_type
- * @field: a #GdaQueryFieldValue object
- * @type: a #GdaDictType object, or %NULL
- *
- * Set the #GdaDictType type of @field
- */
-void
-gda_query_field_value_set_dict_type (GdaQueryFieldValue *field, GdaDictType *type)
-{
-	g_return_if_fail (GDA_IS_QUERY_FIELD_VALUE (field));
-	g_return_if_fail (field->priv);
-	if (type)
-		g_return_if_fail (GDA_IS_DICT_TYPE (type));
 
-	if (type == field->priv->dict_type)
-		return;
 
-	/* get rid of the old data type */
-	if (field->priv->dict_type) {
-		g_signal_handlers_disconnect_by_func (field->priv->dict_type,
-						      G_CALLBACK (destroyed_type_cb), field);
-		field->priv->dict_type = NULL;
-	}
-	
-	if (type) {
-		/* setting the new data type */
-		field->priv->dict_type = type;
-		gda_object_connect_destroy (type,
-					    G_CALLBACK (destroyed_type_cb), field);
-		
-		if (field->priv->g_type != gda_dict_type_get_g_type (type)) {
-			g_warning ("GdaQueryFieldValue: setting to GDA type incompatible dict type");
-			field->priv->g_type = gda_dict_type_get_g_type (type);
-		}
-	}
 
-	/* signal a change */
-	gda_object_signal_emit_changed (GDA_OBJECT (field));
-}
-
 /**
- * gda_query_field_value_get_dict_type
- * @field: a #GdaQueryFieldValue object
- *
- * Get the #GdaDictType type of @field
- *
- * Returns: the #GdaDictType type
- */
-GdaDictType *
-gda_query_field_value_get_dict_type (GdaQueryFieldValue *field)
-{
-	g_return_val_if_fail (GDA_IS_QUERY_FIELD_VALUE (field), NULL);
-	g_return_val_if_fail (field->priv, NULL);
-
-	return field->priv->dict_type;
-}
-
-/**
  * gda_query_field_value_get_parameter_index
  * @field: a #GdaQueryFieldValue object
  *
@@ -1009,7 +943,7 @@
 }
 
 static GType
-gda_query_field_value_get_ig_type (GdaEntityField *iface)
+gda_query_field_value_get_g_type (GdaEntityField *iface)
 {
 	g_return_val_if_fail (iface && GDA_IS_QUERY_FIELD_VALUE (iface), G_TYPE_INVALID);
 	g_return_val_if_fail (GDA_QUERY_FIELD_VALUE (iface)->priv, G_TYPE_INVALID);
@@ -1018,7 +952,7 @@
 }
 
 static GdaDictType *
-gda_query_field_value_get_data_type (GdaEntityField *iface)
+gda_query_field_value_get_dict_type (GdaEntityField *iface)
 {
 	g_return_val_if_fail (iface && GDA_IS_QUERY_FIELD_VALUE (iface), NULL);
 	g_return_val_if_fail (GDA_QUERY_FIELD_VALUE (iface)->priv, NULL);
@@ -1026,6 +960,45 @@
 	return GDA_QUERY_FIELD_VALUE (iface)->priv->dict_type;
 }
 
+static void
+gda_query_field_value_set_dict_type (GdaEntityField *iface, GdaDictType *type)
+{
+	GdaQueryFieldValue *field;
+	
+	field = GDA_QUERY_FIELD_VALUE (iface);
+	
+	g_return_if_fail (GDA_IS_QUERY_FIELD_VALUE (field));
+	g_return_if_fail (field->priv);
+	if (type)
+		g_return_if_fail (GDA_IS_DICT_TYPE (type));
+
+	if (type == field->priv->dict_type)
+		return;
+
+	/* get rid of the old data type */
+	if (field->priv->dict_type) {
+		g_signal_handlers_disconnect_by_func (field->priv->dict_type,
+						      G_CALLBACK (destroyed_type_cb), field);
+		field->priv->dict_type = NULL;
+	}
+	
+	if (type) {
+		/* setting the new data type */
+		field->priv->dict_type = type;
+		gda_object_connect_destroy (type,
+					    G_CALLBACK (destroyed_type_cb), field);
+		
+		if (field->priv->g_type != gda_dict_type_get_g_type (type)) {
+			g_warning ("GdaQueryFieldValue: setting to GDA type incompatible dict type");
+			field->priv->g_type = gda_dict_type_get_g_type (type);
+		}
+	}
+
+	/* signal a change */
+	gda_object_signal_emit_changed (GDA_OBJECT (field));
+}
+
+
 /* 
  * GdaXmlStorage interface implementation
  */
Index: libgda/gda-query-field-value.h
===================================================================
--- libgda/gda-query-field-value.h	(revisión: 2816)
+++ libgda/gda-query-field-value.h	(copia de trabajo)
@@ -66,13 +66,9 @@
 const GValue     *gda_query_field_value_get_value           (GdaQueryFieldValue *field);
 void              gda_query_field_value_set_default_value   (GdaQueryFieldValue *field, const GValue *default_val);
 const GValue     *gda_query_field_value_get_default_value   (GdaQueryFieldValue *field);
-GType             gda_query_field_value_get_g_type          (GdaQueryFieldValue *field);
 
-void              gda_query_field_value_set_dict_type       (GdaQueryFieldValue *field, GdaDictType *type);
-GdaDictType      *gda_query_field_value_get_dict_type       (GdaQueryFieldValue *field);
-
 void              gda_query_field_value_set_is_parameter    (GdaQueryFieldValue *field, gboolean is_param);
-gboolean          gda_query_field_value_is_parameter        (GdaQueryFieldValue *field);
+gboolean          gda_query_field_value_get_is_parameter        (GdaQueryFieldValue *field);
 gint              gda_query_field_value_get_parameter_index (GdaQueryFieldValue *field);
 void              gda_query_field_value_set_not_null        (GdaQueryFieldValue *field, gboolean not_null);
 gboolean          gda_query_field_value_get_not_null        (GdaQueryFieldValue *field);
Index: libgda/gda-entity-field.c
===================================================================
--- libgda/gda-entity-field.c	(revisión: 2816)
+++ libgda/gda-entity-field.c	(copia de trabajo)
@@ -84,7 +84,7 @@
  * gda_entity_field_get_dict_type
  * @iface: an object which implements the #GdaEntityField interface
  *
- * Get the data type of the object implementing the #GdaEntityField interface
+ * Get the dict type of the object implementing the #GdaEntityField interface
  *
  * Returns: the corresponding #GdaDictType
  */
@@ -93,13 +93,31 @@
 {
 	g_return_val_if_fail (iface && GDA_IS_ENTITY_FIELD (iface), NULL);
 
-	if (GDA_ENTITY_FIELD_GET_IFACE (iface)->get_data_type)
-		return (GDA_ENTITY_FIELD_GET_IFACE (iface)->get_data_type) (iface);
+	if (GDA_ENTITY_FIELD_GET_IFACE (iface)->get_dict_type)
+		return (GDA_ENTITY_FIELD_GET_IFACE (iface)->get_dict_type) (iface);
 	
 	return NULL;
 }
 
 /**
+ * gda_entity_field_set_dict_type
+ * @iface: an object which implements the #GdaEntityField interface
+ * @type: a GdaDictType to set to.
+ *
+ * Set the dict type of the object implementing the #GdaEntityField interface
+ */
+void
+gda_entity_field_set_dict_type (GdaEntityField *iface, GdaDictType *type)
+{
+	g_return_val_if_fail (iface && GDA_IS_ENTITY_FIELD (iface), NULL);
+
+	if (GDA_ENTITY_FIELD_GET_IFACE (iface)->set_dict_type)
+		return (GDA_ENTITY_FIELD_GET_IFACE (iface)->set_dict_type) (iface, type);
+	
+	return NULL;
+}
+
+/**
  * gda_entity_field_get_g_type
  * @iface: an object which implements the #GdaEntityField interface
  *
@@ -112,9 +130,9 @@
 {
 	g_return_val_if_fail (iface && GDA_IS_ENTITY_FIELD (iface), G_TYPE_INVALID);
 
-	if (GDA_ENTITY_FIELD_GET_IFACE (iface)->get_data_type) {
+	if (GDA_ENTITY_FIELD_GET_IFACE (iface)->get_dict_type) {
 		GdaDictType *type;	
-		type = (GDA_ENTITY_FIELD_GET_IFACE (iface)->get_data_type) (iface);
+		type = (GDA_ENTITY_FIELD_GET_IFACE (iface)->get_dict_type) (iface);
 
 		if (type)
 			return gda_dict_type_get_g_type (type);
Index: libgda/gda-entity-field.h
===================================================================
--- libgda/gda-entity-field.h	(revisión: 2816)
+++ libgda/gda-entity-field.h	(copia de trabajo)
@@ -42,7 +42,8 @@
 	/* virtual table */
 	GdaEntity         *(* get_entity)      (GdaEntityField *iface);
 	GType              (* get_g_type)      (GdaEntityField *iface);
-	GdaDictType       *(* get_data_type)   (GdaEntityField *iface);
+    void               (* set_dict_type)   (GdaEntityField *iface, GdaDictType *type);
+	GdaDictType       *(* get_dict_type)   (GdaEntityField *iface);
 	const gchar       *(* get_alias)       (GdaEntityField *iface);
 };
 
@@ -50,6 +51,7 @@
 
 GdaEntity       *gda_entity_field_get_entity      (GdaEntityField *iface);
 GType            gda_entity_field_get_g_type      (GdaEntityField *iface);
+void             gda_entity_field_set_dict_type   (GdaEntityField *iface, GdaDictType *type);
 GdaDictType     *gda_entity_field_get_dict_type   (GdaEntityField *iface);
 const gchar     *gda_entity_field_get_name        (GdaEntityField *iface);
 const gchar     *gda_entity_field_get_description (GdaEntityField *iface);
Index: libgda/gda-query.c
===================================================================
--- libgda/gda-query.c	(revisión: 2816)
+++ libgda/gda-query.c	(copia de trabajo)
@@ -1444,7 +1444,7 @@
 					/* create the #GdaQueryFieldValue fields */
 					field = GDA_QUERY_FIELD (gda_query_field_value_new (query, gtype));
 					if (dtype)
-						gda_query_field_value_set_dict_type (GDA_QUERY_FIELD_VALUE (field), dtype);
+						gda_entity_field_set_dict_type (GDA_ENTITY_FIELD (field), dtype);
 					gda_query_field_set_internal (field, TRUE);
 					gda_query_field_set_visible (field, FALSE);
 					gda_entity_add_field (GDA_ENTITY (query), GDA_ENTITY_FIELD (field));
Index: libgda/gda-server-provider-extra.c
===================================================================
--- libgda/gda-server-provider-extra.c	(revisión: 2816)
+++ libgda/gda-server-provider-extra.c	(copia de trabajo)
@@ -742,7 +742,7 @@
 		
 		g_object_get (G_OBJECT (list->data), "value_provider", &fvalue, NULL);
 		if (GDA_IS_QUERY_FIELD_VALUE (fvalue)) {
-			if (gda_query_field_value_get_g_type (fvalue) == GDA_TYPE_BLOB)
+			if (gda_entity_field_get_g_type (GDA_ENTITY_FIELD (fvalue)) == GDA_TYPE_BLOB)
 				blob_value_prov_fields = g_slist_append (blob_value_prov_fields, list->data);
 		}
 		g_object_unref (fvalue);
Index: ChangeLog
===================================================================
--- ChangeLog	(revisión: 2816)
+++ ChangeLog	(copia de trabajo)
@@ -1,3 +1,14 @@
+2007-02-08 Daniel Espinosa <esodan gmail com>
+
+    	* libgda/gda-query-field-value.c: Added the is_parameter property to GdaQueryFieldValue Object,
+    	API change: gda_query_field_is_parameter to gda_query_field_get_is_parameter
+    	* libgda/gda-entity-field.c: 
+    	* libgda/gda-query-field-*:
+    	Changed virtual reference from (*get_data_type) to (*get_dict_type)
+    	* libgda/gda-query-field-value: Deleted a duplicated method gda_query_field_value_get_data_type and
+    	gda_query_field_value_get_g_type, becouse this object implements GdaEntityField interface
+    	* gda-sharp: API updates, added missing reference to libraries
+    
 2007-02-03  Armin Burgmeier  <armin openismus com>
 
 	* libgda/gda-object-ref.c: Changed handled_object_type to also accept
@@ -289,6 +300,7 @@
 	* libgda/gda-graphviz.c: (gda_graphviz_class_init): Remove nonsense unused PROP ("prop") properties 
 	with #if 0. I would prefer to delete the code, but I guess someone found these placeholders useful once.
 
+>>>>>>> .r2809
 2007-01-11  Murray Cumming  <murrayc murryac com>
 
 	* libgda/gda-blob-op.c: Add a FIXME comment to documentation that advises use of 


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