[gnome-db] Re: gnome_db_combo_get_model & gnome_db_combo_get_column



You can find the patch with this email.

On Thu, Dec 18, 2003 at 05:05:51PM +0100, Rodrigo Moya wrote:
>> On Thu, 2003-12-18 at 15:15, Stephane Wirtel wrote:
>> > Rodrigo, 
>> > 
>> > I want to know how can i name my new functions.
>> > 
>> > With this function, it's possible to get the GdaDataModel, included in the
>> > GnomeDbCombo.
>> > 
>> > GdaDataModel *gnome_db_combo_get_model(GnomeDbCombo *combo)
>> >     return GDA_DATA_MODEL(combo->priv->model);
>> > 
>> > and 
>> > 
>> > this function returns the column.
>> > gint gnome_db_combo_get_column (GnomeDbCombo *combo)
>> >     return combo->priv->col;
>> 
>> > What do you think about names of theses functions ?
>> > 
>> sound good
>> 
>> cheers
---end quoted text---
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libgnomedb/ChangeLog,v
retrieving revision 1.274
diff -u -r1.274 ChangeLog
--- ChangeLog	17 Dec 2003 22:43:46 -0000	1.274
+++ ChangeLog	18 Dec 2003 16:16:09 -0000
@@ -1,5 +1,10 @@
 2003-12-17  Stephane Wirtel <stephane wirtel brutele be>
 
+	* libgnomedb/gnome-db-combo.[ch] (gnome_db_combo_get_model, 
+	gnome_db_combo_get_column): new API functions.
+	
+2003-12-17  Stephane Wirtel <stephane wirtel brutele be>
+
 	* libgnomedb/gnome-db-grid.c (tree_view_row_activated_cb,
 	popup_button_pressed_cb): add a cast GTK_TREE_VIEW, G_CALLBACK,
 	and change g_return_if_fail to g_return_val_if_fail in
Index: libgnomedb/gnome-db-combo.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-combo.c,v
retrieving revision 1.5
diff -u -r1.5 gnome-db-combo.c
--- libgnomedb/gnome-db-combo.c	17 Dec 2003 22:16:00 -0000	1.5
+++ libgnomedb/gnome-db-combo.c	18 Dec 2003 16:16:10 -0000
@@ -280,3 +280,41 @@
 	}
 }
 
+/**
+ * gnome_db_combo_get_model
+ * @combo: a #GnomeDbCombo widget.
+ *
+ * This function returns the #GdaDataModel stored in the #GnomeDbCombo.
+ *
+ * Returns: a #GdaDataModel containing the data from the #GnomeDbCombo widget.
+ */
+GdaDataModel *
+gnome_db_combo_get_model (GnomeDbCombo *combo)
+{
+	g_return_val_if_fail (GNOME_DB_IS_COMBO (combo), NULL);
+
+	if (GDA_IS_DATA_MODEL (combo->priv->model)) {
+		return GDA_DATA_MODEL (combo->priv->model);
+	}
+	return NULL;
+}
+
+/**
+ * gnome_db_combo_get_column
+ * @combo: a #GnomeDbCombo widget.
+ *
+ * This function return the column.
+ * 
+ * Returns: the column of the #GdaDataModel stored by the #GnomeDbCombo.
+ */
+gint
+gnome_db_combo_get_column (GnomeDbCombo *combo)
+{
+	g_return_val_if_fail (GNOME_DB_IS_COMBO (combo), -1);
+	
+	if (GDA_IS_DATA_MODEL (combo->priv->model)) {
+		return combo->priv->col;
+	}
+	
+	return -1;
+}
Index: libgnomedb/gnome-db-combo.h
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-combo.h,v
retrieving revision 1.2
diff -u -r1.2 gnome-db-combo.h
--- libgnomedb/gnome-db-combo.h	17 Dec 2003 22:16:00 -0000	1.2
+++ libgnomedb/gnome-db-combo.h	18 Dec 2003 16:16:10 -0000
@@ -51,6 +51,8 @@
 GtkWidget *gnome_db_combo_new (void);
 GtkWidget *gnome_db_combo_new_with_model (GdaDataModel *model, gint pos);
 void       gnome_db_combo_set_model (GnomeDbCombo *combo, GdaDataModel *model, gint pos);
+GdaDataModel *gnome_db_combo_get_model (GnomeDbCombo *combo);
+gint       gnome_db_combo_get_column (GnomeDbCombo *combo);
 
 G_END_DECLS
 


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