[libgda] Replaced DATA_STORE_COL_* by GDAUI_DATA_STORE_COL_*
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Replaced DATA_STORE_COL_* by GDAUI_DATA_STORE_COL_*
- Date: Tue, 7 Jun 2011 16:48:15 +0000 (UTC)
commit 00e73a5af2c0b891465b6499da62691b641499c0
Author: Vivien Malerba <malerba gnome-db org>
Date: Tue Jun 7 18:43:17 2011 +0200
Replaced DATA_STORE_COL_* by GDAUI_DATA_STORE_COL_*
to respect GDAUI namespace; keep the current declarations as #define
and deprecation guards
libgda-ui/gdaui-data-store.c | 35 +++++++++++++++++------------------
libgda-ui/gdaui-data-store.h | 18 +++++++++++++-----
libgda-ui/gdaui-raw-grid.c | 12 ++++++------
libgda-ui/internal/utility.c | 2 +-
4 files changed, 37 insertions(+), 30 deletions(-)
---
diff --git a/libgda-ui/gdaui-data-store.c b/libgda-ui/gdaui-data-store.c
index 6af472c..85ecde9 100644
--- a/libgda-ui/gdaui-data-store.c
+++ b/libgda-ui/gdaui-data-store.c
@@ -1,6 +1,5 @@
-/* gdaui-data-store.c
- *
- * Copyright (C) 2005 - 2010 Vivien Malerba <malerba gnome-db org>
+/*
+ * Copyright (C) 2005 - 2011 Vivien Malerba <malerba gnome-db org>
*
* This Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as
@@ -382,13 +381,13 @@ gdaui_data_store_set_value (GdauiDataStore *store, GtkTreeIter *iter,
/* Global attributes */
if (col < 0) {
switch (col) {
- case DATA_STORE_COL_MODEL_N_COLUMNS:
- case DATA_STORE_COL_MODEL_POINTER:
- case DATA_STORE_COL_MODEL_ROW:
- case DATA_STORE_COL_MODIFIED:
+ case GDAUI_DATA_STORE_COL_MODEL_N_COLUMNS:
+ case GDAUI_DATA_STORE_COL_MODEL_POINTER:
+ case GDAUI_DATA_STORE_COL_MODEL_ROW:
+ case GDAUI_DATA_STORE_COL_MODIFIED:
g_warning (_("Trying to modify a read-only row"));
break;
- case DATA_STORE_COL_TO_DELETE:
+ case GDAUI_DATA_STORE_COL_TO_DELETE:
if (g_value_get_boolean (value))
gda_data_proxy_delete (store->priv->proxy, row);
else
@@ -622,15 +621,15 @@ data_store_get_column_type (GtkTreeModel *tree_model, gint index)
if (index < 0) {
switch (index) {
- case DATA_STORE_COL_MODEL_N_COLUMNS:
- case DATA_STORE_COL_MODEL_ROW:
+ case GDAUI_DATA_STORE_COL_MODEL_N_COLUMNS:
+ case GDAUI_DATA_STORE_COL_MODEL_ROW:
retval = G_TYPE_INT;
break;
- case DATA_STORE_COL_MODEL_POINTER:
+ case GDAUI_DATA_STORE_COL_MODEL_POINTER:
retval = G_TYPE_POINTER;
break;
- case DATA_STORE_COL_MODIFIED:
- case DATA_STORE_COL_TO_DELETE:
+ case GDAUI_DATA_STORE_COL_MODIFIED:
+ case GDAUI_DATA_STORE_COL_TO_DELETE:
retval = G_TYPE_BOOLEAN;
break;
}
@@ -720,22 +719,22 @@ data_store_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint column,
/* Global attributes */
if (column < 0) {
switch (column) {
- case DATA_STORE_COL_MODEL_N_COLUMNS:
+ case GDAUI_DATA_STORE_COL_MODEL_N_COLUMNS:
model_nb_cols = gda_data_proxy_get_proxied_model_n_cols (store->priv->proxy);
g_value_set_int (value, model_nb_cols);
break;
- case DATA_STORE_COL_MODEL_POINTER:
+ case GDAUI_DATA_STORE_COL_MODEL_POINTER:
g_value_set_pointer (value, gda_data_proxy_get_proxied_model (store->priv->proxy));
break;
- case DATA_STORE_COL_MODEL_ROW:
+ case GDAUI_DATA_STORE_COL_MODEL_ROW:
g_value_set_int (value, gda_data_proxy_get_proxied_model_row (store->priv->proxy,
GPOINTER_TO_INT (iter->user_data)));
break;
- case DATA_STORE_COL_MODIFIED:
+ case GDAUI_DATA_STORE_COL_MODIFIED:
g_value_set_boolean (value, gda_data_proxy_row_has_changed (store->priv->proxy,
GPOINTER_TO_INT (iter->user_data)));
break;
- case DATA_STORE_COL_TO_DELETE:
+ case GDAUI_DATA_STORE_COL_TO_DELETE:
g_value_set_boolean (value, gda_data_proxy_row_is_deleted (store->priv->proxy,
GPOINTER_TO_INT (iter->user_data)));
break;
diff --git a/libgda-ui/gdaui-data-store.h b/libgda-ui/gdaui-data-store.h
index af98431..1cdec33 100644
--- a/libgda-ui/gdaui-data-store.h
+++ b/libgda-ui/gdaui-data-store.h
@@ -36,13 +36,21 @@ typedef struct _GdauiDataStoreClass GdauiDataStoreClass;
typedef struct _GdauiDataStorePriv GdauiDataStorePriv;
enum {
- DATA_STORE_COL_MODEL_N_COLUMNS = -2, /* number of columns in the GdaDataModel */
- DATA_STORE_COL_MODEL_POINTER = -3, /* pointer to the GdaDataModel */
- DATA_STORE_COL_MODEL_ROW = -4, /* row number in the GdaDataModel, or -1 for new rows */
- DATA_STORE_COL_MODIFIED = -5, /* TRUE if row has been modified */
- DATA_STORE_COL_TO_DELETE = -6 /* TRUE if row is marked to be deleted */
+ GDAUI_DATA_STORE_COL_MODEL_N_COLUMNS = -2, /* number of columns in the GdaDataModel */
+ GDAUI_DATA_STORE_COL_MODEL_POINTER = -3, /* pointer to the GdaDataModel */
+ GDAUI_DATA_STORE_COL_MODEL_ROW = -4, /* row number in the GdaDataModel, or -1 for new rows */
+ GDAUI_DATA_STORE_COL_MODIFIED = -5, /* TRUE if row has been modified */
+ GDAUI_DATA_STORE_COL_TO_DELETE = -6 /* TRUE if row is marked to be deleted */
};
+#ifndef GDA_DISABLE_DEPRECATED
+#define DATA_STORE_COL_MODEL_N_COLUMNS GDAUI_DATA_STORE_COL_MODEL_N_COLUMNS
+#define DATA_STORE_COL_MODEL_POINTER GDAUI_DATA_STORE_COL_MODEL_POINTER
+#define DATA_STORE_COL_MODEL_ROW GDAUI_DATA_STORE_COL_MODEL_ROW
+#define DATA_STORE_COL_MODIFIED GDAUI_DATA_STORE_COL_MODIFIED
+#define DATA_STORE_COL_TO_DELETE GDAUI_DATA_STORE_COL_TO_DELETE
+#endif
+
/* struct for the object's data */
struct _GdauiDataStore
{
diff --git a/libgda-ui/gdaui-raw-grid.c b/libgda-ui/gdaui-raw-grid.c
index f61267d..a0ce3f1 100644
--- a/libgda-ui/gdaui-raw-grid.c
+++ b/libgda-ui/gdaui-raw-grid.c
@@ -650,7 +650,7 @@ _gdaui_raw_grid_get_selection (GdauiRawGrid *grid)
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (grid->priv->store), &iter,
(GtkTreePath *)(list->data))) {
gtk_tree_model_get (GTK_TREE_MODEL (grid->priv->store), &iter,
- DATA_STORE_COL_MODEL_ROW, &row, -1);
+ GDAUI_DATA_STORE_COL_MODEL_ROW, &row, -1);
retlist = g_list_prepend (retlist, GINT_TO_POINTER (row));
}
}
@@ -1074,8 +1074,8 @@ cell_value_set_attributes (G_GNUC_UNUSED GtkTreeViewColumn *tree_column,
col = g_slist_index (((GdaSet *)grid->priv->iter)->holders,
GDA_SET_NODE (group->group->nodes->data)->holder);
gtk_tree_model_get (GTK_TREE_MODEL (grid->priv->store), iter,
- DATA_STORE_COL_TO_DELETE, &to_be_deleted,
- DATA_STORE_COL_MODEL_ROW, &row,
+ GDAUI_DATA_STORE_COL_TO_DELETE, &to_be_deleted,
+ GDAUI_DATA_STORE_COL_MODEL_ROW, &row,
col, &value,
offset + col, &attributes, -1);
g_object_set (G_OBJECT (cell),
@@ -1144,8 +1144,8 @@ cell_info_set_attributes (GtkTreeViewColumn *tree_column,
col = g_slist_index (((GdaSet *)grid->priv->iter)->holders,
GDA_SET_NODE (group->group->nodes->data)->holder);
gtk_tree_model_get (GTK_TREE_MODEL (grid->priv->store), iter,
- DATA_STORE_COL_TO_DELETE, &to_be_deleted,
- DATA_STORE_COL_MODEL_ROW, &row,
+ GDAUI_DATA_STORE_COL_TO_DELETE, &to_be_deleted,
+ GDAUI_DATA_STORE_COL_MODEL_ROW, &row,
offset + col, &attributes, -1);
g_object_set (G_OBJECT (cell),
"editable", !cdata->data_locked && !(attributes & GDA_VALUE_ATTR_NO_MODIF),
@@ -3030,7 +3030,7 @@ gdaui_raw_grid_selector_get_selected_rows (GdauiDataSelector *iface)
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (grid->priv->store), &iter,
(GtkTreePath *)(list->data))) {
gtk_tree_model_get (GTK_TREE_MODEL (grid->priv->store), &iter,
- DATA_STORE_COL_MODEL_ROW, &row, -1);
+ GDAUI_DATA_STORE_COL_MODEL_ROW, &row, -1);
if (!selarray)
selarray = g_array_new (FALSE, FALSE, sizeof (gint));
g_array_append_val (selarray, row);
diff --git a/libgda-ui/internal/utility.c b/libgda-ui/internal/utility.c
index 7a5712a..41a772f 100644
--- a/libgda-ui/internal/utility.c
+++ b/libgda-ui/internal/utility.c
@@ -213,7 +213,7 @@ _gdaui_utility_proxy_compute_attributes_for_group (GdauiSetGroup *group, GdauiDa
for (list = group->group->nodes; list; list = list->next) {
col = g_slist_index (((GdaSet*)model_iter)->holders, GDA_SET_NODE (list->data)->holder);
gtk_tree_model_get (GTK_TREE_MODEL (store), tree_iter,
- DATA_STORE_COL_TO_DELETE, &local_to_del,
+ GDAUI_DATA_STORE_COL_TO_DELETE, &local_to_del,
offset + col, &localattr, -1);
if (list == group->group->nodes)
attributes = localattr;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]