2008-01-14 Emmanuele Bassi <ebassi@openedhand.com>

* clutter.symbols: Add clutter_model_insertv()

	* clutter/clutter-model.[ch] (clutter_model_insertv): Add a vector
	based insertion API, for language bindings
This commit is contained in:
Emmanuele Bassi 2008-01-14 10:13:35 +00:00
parent 3b0c46dd28
commit ccc4ad400b
6 changed files with 69 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2008-01-14 Emmanuele Bassi <ebassi@openedhand.com>
* clutter.symbols: Add clutter_model_insertv()
* clutter/clutter-model.[ch] (clutter_model_insertv): Add a vector
based insertion API, for language bindings
2008-01-12 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-effect.c (clutter_effect_rotate): Make the

View File

@ -387,6 +387,7 @@ clutter_model_get_n_rows
clutter_model_get_sorting_column
clutter_model_get_type
clutter_model_insert
clutter_model_insertv
clutter_model_insert_value
clutter_model_iter_get
clutter_model_iter_get_model

View File

@ -917,6 +917,57 @@ clutter_model_insert (ClutterModel *model,
g_object_unref (iter);
}
/**
* clutter_model_insertv:
* @model: a #ClutterModel
* @row: row index
* @n_columns: the number of columns and values to set
* @columns: a vector containing the columns to set
* @values: a vector containing the values for the cells
*
* Inserts data at @row into the #ClutterModel, setting the row
* values for the given @columns upon creation.
*
* Since: 0.6
*/
void
clutter_model_insertv (ClutterModel *model,
guint row,
guint n_columns,
guint *columns,
GValue *values)
{
ClutterModelPrivate *priv;
ClutterModelIter *iter;
gint i;
gboolean resort = FALSE;
g_return_if_fail (CLUTTER_IS_MODEL (model));
g_return_if_fail (n_columns <= clutter_model_get_n_columns (model));
g_return_if_fail (columns != NULL);
g_return_if_fail (values != NULL);
priv = model->priv;
iter = CLUTTER_MODEL_GET_CLASS (model)->insert_row (model, row);
g_assert (CLUTTER_IS_MODEL_ITER (iter));
for (i = 0; i < n_columns; i++)
{
if (priv->sort_column == columns[i])
resort = TRUE;
clutter_model_iter_set_value (iter, columns[i], &values[i]);
}
g_signal_emit (model, model_signals[ROW_ADDED], 0, iter);
if (resort)
clutter_model_resort (model);
g_object_unref (iter);
}
/**
* clutter_model_insert_value:
* @model: a #ClutterModel

View File

@ -207,6 +207,11 @@ void clutter_model_prependv (ClutterModel *model,
void clutter_model_insert (ClutterModel *model,
guint row,
...);
void clutter_model_insertv (ClutterModel *model,
guint row,
guint n_columns,
guint *columns,
GValue *values);
void clutter_model_insert_value (ClutterModel *model,
guint row,
guint column,

View File

@ -1,3 +1,7 @@
2008-01-14 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-sections.txt: Add clutter_model_insertv()
2008-01-09 Emmanuele Bassi <ebassi@openedhand.com>
* Makefile.am: Add clutter-model-private.h

View File

@ -1164,6 +1164,7 @@ clutter_model_appendv
clutter_model_prepend
clutter_model_prependv
clutter_model_insert
clutter_model_insertv
clutter_model_insert_value
clutter_model_remove