@ -26,18 +26,18 @@
*/
*/
/**
/**
* SECTION : clutter - model- default
* SECTION : clutter - list- model
* @ short_description : Defaul t model implementation
* @ short_description : Lis t model implementation
*
*
* # Clutter ModelDefault is a # ClutterModel implementation provided by
* # Clutter List Model is a # ClutterModel implementation provided by
* Clutter . # Clutter ModelDefault uses a # GSequence for storing the
* Clutter . # Clutter List Model uses a # GSequence for storing the
* values for each row , so it ' s optimized for insertion and look up
* values for each row , so it ' s optimized for insertion and look up
* in sorted lists .
* in sorted lists .
*
*
* # Clutter ModelDefault is a terminal class : it cannot be subclassed ,
* # Clutter List Model is a terminal class : it cannot be subclassed ,
* only instantiated .
* only instantiated .
*
*
* # Clutter ModelDefault is available since Clutter 0.6
* # Clutter List Model is available since Clutter 0.6
*/
*/
# ifdef HAVE_CONFIG_H
# ifdef HAVE_CONFIG_H
@ -55,52 +55,52 @@
# include "clutter-private.h"
# include "clutter-private.h"
# include "clutter-debug.h"
# include "clutter-debug.h"
# define CLUTTER_TYPE_ MODEL_DEFAULT _ITER \
# define CLUTTER_TYPE_ LIST_ MODEL_ITER \
( clutter_ model_default _iter_get_type( ) )
( clutter_ list_ model_iter_get_type( ) )
# define CLUTTER_ MODEL_DEFAULT _ITER(obj) \
# define CLUTTER_ LIST_ MODEL_ITER(obj) \
( G_TYPE_CHECK_INSTANCE_CAST ( ( obj ) , \
( G_TYPE_CHECK_INSTANCE_CAST ( ( obj ) , \
CLUTTER_TYPE_ MODEL_DEFAULT _ITER, \
CLUTTER_TYPE_ LIST_ MODEL_ITER, \
Clutter ModelDefault Iter) )
Clutter List ModelIter) )
# define CLUTTER_IS_ MODEL_DEFAULT _ITER(obj) \
# define CLUTTER_IS_ LIST_ MODEL_ITER(obj) \
( G_TYPE_CHECK_INSTANCE_TYPE ( ( obj ) , \
( G_TYPE_CHECK_INSTANCE_TYPE ( ( obj ) , \
CLUTTER_TYPE_ MODEL_DEFAULT _ITER) )
CLUTTER_TYPE_ LIST_ MODEL_ITER) )
# define CLUTTER_ MODEL_DEFAULT _ITER_CLASS(klass) \
# define CLUTTER_ LIST_ MODEL_ITER_CLASS(klass) \
( G_TYPE_CHECK_CLASS_CAST ( ( klass ) , \
( G_TYPE_CHECK_CLASS_CAST ( ( klass ) , \
CLUTTER_TYPE_ MODEL_DEFAULT _ITER, \
CLUTTER_TYPE_ LIST_ MODEL_ITER, \
Clutter ModelDefault IterClass) )
Clutter List ModelIterClass) )
# define CLUTTER_IS_ MODEL_DEFAULT _ITER_CLASS(klass) \
# define CLUTTER_IS_ LIST_ MODEL_ITER_CLASS(klass) \
( G_TYPE_CHECK_CLASS_TYPE ( ( klass ) , \
( G_TYPE_CHECK_CLASS_TYPE ( ( klass ) , \
CLUTTER_TYPE_ MODEL_DEFAULT _ITER) )
CLUTTER_TYPE_ LIST_ MODEL_ITER) )
# define CLUTTER_ MODEL_DEFAULT _ITER_GET_CLASS(obj) \
# define CLUTTER_ LIST_ MODEL_ITER_GET_CLASS(obj) \
( G_TYPE_INSTANCE_GET_CLASS ( ( obj ) , \
( G_TYPE_INSTANCE_GET_CLASS ( ( obj ) , \
CLUTTER_TYPE_ MODEL_DEFAULT _ITER, \
CLUTTER_TYPE_ LIST_ MODEL_ITER, \
Clutter ModelDefault IterClass) )
Clutter List ModelIterClass) )
# define CLUTTER_ MODEL_DEFAULT _CLASS(klass) \
# define CLUTTER_ LIST_ MODEL_CLASS(klass) \
( G_TYPE_CHECK_CLASS_CAST ( ( klass ) , \
( G_TYPE_CHECK_CLASS_CAST ( ( klass ) , \
CLUTTER_TYPE_ MODEL_DEFAULT , \
CLUTTER_TYPE_ LIST_ MODEL, \
Clutter ModelDefault Class) )
Clutter List ModelClass) )
# define CLUTTER_IS_ MODEL_DEFAULT _CLASS(klass) \
# define CLUTTER_IS_ LIST_ MODEL_CLASS(klass) \
( G_TYPE_CHECK_CLASS_TYPE ( ( klass ) , \
( G_TYPE_CHECK_CLASS_TYPE ( ( klass ) , \
CLUTTER_TYPE_ MODEL_DEFAULT ) )
CLUTTER_TYPE_ LIST_ MODEL) )
# define CLUTTER_ MODEL_DEFAULT _GET_CLASS(obj) \
# define CLUTTER_ LIST_ MODEL_GET_CLASS(obj) \
( G_TYPE_INSTANCE_GET_CLASS ( ( obj ) , \
( G_TYPE_INSTANCE_GET_CLASS ( ( obj ) , \
CLUTTER_TYPE_ MODEL_DEFAULT , \
CLUTTER_TYPE_ LIST_ MODEL, \
Clutter ModelDefault Class) )
Clutter List ModelClass) )
typedef struct _Clutter ModelDefault Iter Clutter ModelDefault Iter;
typedef struct _Clutter List ModelIter Clutter List ModelIter;
typedef struct _ClutterModelIterClass Clutter ModelDefault IterClass;
typedef struct _ClutterModelIterClass Clutter List ModelIterClass;
typedef struct _ClutterModelClass Clutter ModelDefault Class;
typedef struct _ClutterModelClass Clutter List ModelClass;
struct _Clutter ModelDefault
struct _Clutter List Model
{
{
ClutterModel parent_instance ;
ClutterModel parent_instance ;
GSequence * sequence ;
GSequence * sequence ;
} ;
} ;
struct _Clutter ModelDefault Iter
struct _Clutter List ModelIter
{
{
ClutterModelIter parent_instance ;
ClutterModelIter parent_instance ;
@ -110,25 +110,25 @@ struct _ClutterModelDefaultIter
/*
/*
* Clutter ModelDefault
* Clutter List Model
*/
*/
G_DEFINE_TYPE ( Clutter ModelDefault Iter,
G_DEFINE_TYPE ( Clutter List ModelIter,
clutter_ model_default _iter,
clutter_ list_ model_iter,
CLUTTER_TYPE_MODEL_ITER ) ;
CLUTTER_TYPE_MODEL_ITER ) ;
static void
static void
clutter_ model_default _iter_get_value ( ClutterModelIter * iter ,
clutter_ list_ model_iter_get_value ( ClutterModelIter * iter ,
guint column ,
guint column ,
GValue * value )
GValue * value )
{
{
Clutter ModelDefault Iter * iter_default ;
Clutter List ModelIter * iter_default ;
GValueArray * value_array ;
GValueArray * value_array ;
GValue * iter_value ;
GValue * iter_value ;
GValue real_value = { 0 , } ;
GValue real_value = { 0 , } ;
gboolean converted = FALSE ;
gboolean converted = FALSE ;
iter_default = CLUTTER_ MODEL_DEFAULT _ITER ( iter ) ;
iter_default = CLUTTER_ LIST_ MODEL_ITER ( iter ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
value_array = g_sequence_get ( iter_default - > seq_iter ) ;
value_array = g_sequence_get ( iter_default - > seq_iter ) ;
@ -171,17 +171,17 @@ clutter_model_default_iter_get_value (ClutterModelIter *iter,
}
}
static void
static void
clutter_ model_default _iter_set_value ( ClutterModelIter * iter ,
clutter_ list_ model_iter_set_value ( ClutterModelIter * iter ,
guint column ,
guint column ,
const GValue * value )
const GValue * value )
{
{
Clutter ModelDefault Iter * iter_default ;
Clutter List ModelIter * iter_default ;
GValueArray * value_array ;
GValueArray * value_array ;
GValue * iter_value ;
GValue * iter_value ;
GValue real_value = { 0 , } ;
GValue real_value = { 0 , } ;
gboolean converted = FALSE ;
gboolean converted = FALSE ;
iter_default = CLUTTER_ MODEL_DEFAULT _ITER ( iter ) ;
iter_default = CLUTTER_ LIST_ MODEL_ITER ( iter ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
value_array = g_sequence_get ( iter_default - > seq_iter ) ;
value_array = g_sequence_get ( iter_default - > seq_iter ) ;
@ -224,30 +224,30 @@ clutter_model_default_iter_set_value (ClutterModelIter *iter,
}
}
static gboolean
static gboolean
clutter_ model_default _iter_is_first ( ClutterModelIter * iter )
clutter_ list_ model_iter_is_first ( ClutterModelIter * iter )
{
{
Clutter ModelDefault Iter * iter_default ;
Clutter List ModelIter * iter_default ;
ClutterModel * model ;
ClutterModel * model ;
ClutterModelIter * temp_iter ;
ClutterModelIter * temp_iter ;
GSequenceIter * begin , * end ;
GSequenceIter * begin , * end ;
guint row ;
guint row ;
iter_default = CLUTTER_ MODEL_DEFAULT _ITER ( iter ) ;
iter_default = CLUTTER_ LIST_ MODEL_ITER ( iter ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
model = clutter_model_iter_get_model ( iter ) ;
model = clutter_model_iter_get_model ( iter ) ;
row = clutter_model_iter_get_row ( iter ) ;
row = clutter_model_iter_get_row ( iter ) ;
begin = g_sequence_get_begin_iter ( CLUTTER_ MODEL_DEFAULT ( model ) - > sequence ) ;
begin = g_sequence_get_begin_iter ( CLUTTER_ LIST_ MODEL ( model ) - > sequence ) ;
end = iter_default - > seq_iter ;
end = iter_default - > seq_iter ;
temp_iter = g_object_new ( CLUTTER_TYPE_ MODEL_DEFAULT _ITER,
temp_iter = g_object_new ( CLUTTER_TYPE_ LIST_ MODEL_ITER,
" model " , model ,
" model " , model ,
NULL ) ;
NULL ) ;
while ( ! g_sequence_iter_is_begin ( begin ) )
while ( ! g_sequence_iter_is_begin ( begin ) )
{
{
CLUTTER_ MODEL_DEFAULT _ITER ( temp_iter ) - > seq_iter = begin ;
CLUTTER_ LIST_ MODEL_ITER ( temp_iter ) - > seq_iter = begin ;
g_object_set ( G_OBJECT ( temp_iter ) , " row " , row , NULL ) ;
g_object_set ( G_OBJECT ( temp_iter ) , " row " , row , NULL ) ;
if ( clutter_model_filter_iter ( model , temp_iter ) )
if ( clutter_model_filter_iter ( model , temp_iter ) )
@ -271,15 +271,15 @@ clutter_model_default_iter_is_first (ClutterModelIter *iter)
}
}
static gboolean
static gboolean
clutter_ model_default _iter_is_last ( ClutterModelIter * iter )
clutter_ list_ model_iter_is_last ( ClutterModelIter * iter )
{
{
Clutter ModelDefault Iter * iter_default ;
Clutter List ModelIter * iter_default ;
ClutterModelIter * temp_iter ;
ClutterModelIter * temp_iter ;
ClutterModel * model ;
ClutterModel * model ;
GSequenceIter * begin , * end ;
GSequenceIter * begin , * end ;
guint row ;
guint row ;
iter_default = CLUTTER_ MODEL_DEFAULT _ITER ( iter ) ;
iter_default = CLUTTER_ LIST_ MODEL_ITER ( iter ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
if ( g_sequence_iter_is_end ( iter_default - > seq_iter ) )
if ( g_sequence_iter_is_end ( iter_default - > seq_iter ) )
@ -288,17 +288,17 @@ clutter_model_default_iter_is_last (ClutterModelIter *iter)
model = clutter_model_iter_get_model ( iter ) ;
model = clutter_model_iter_get_model ( iter ) ;
row = clutter_model_iter_get_row ( iter ) ;
row = clutter_model_iter_get_row ( iter ) ;
begin = g_sequence_get_end_iter ( CLUTTER_ MODEL_DEFAULT ( model ) - > sequence ) ;
begin = g_sequence_get_end_iter ( CLUTTER_ LIST_ MODEL ( model ) - > sequence ) ;
begin = g_sequence_iter_prev ( begin ) ;
begin = g_sequence_iter_prev ( begin ) ;
end = iter_default - > seq_iter ;
end = iter_default - > seq_iter ;
temp_iter = g_object_new ( CLUTTER_TYPE_ MODEL_DEFAULT _ITER,
temp_iter = g_object_new ( CLUTTER_TYPE_ LIST_ MODEL_ITER,
" model " , model ,
" model " , model ,
NULL ) ;
NULL ) ;
while ( ! g_sequence_iter_is_begin ( begin ) )
while ( ! g_sequence_iter_is_begin ( begin ) )
{
{
CLUTTER_ MODEL_DEFAULT _ITER ( temp_iter ) - > seq_iter = begin ;
CLUTTER_ LIST_ MODEL_ITER ( temp_iter ) - > seq_iter = begin ;
g_object_set ( G_OBJECT ( temp_iter ) , " row " , row , NULL ) ;
g_object_set ( G_OBJECT ( temp_iter ) , " row " , row , NULL ) ;
if ( clutter_model_filter_iter ( model , temp_iter ) )
if ( clutter_model_filter_iter ( model , temp_iter ) )
@ -322,15 +322,15 @@ clutter_model_default_iter_is_last (ClutterModelIter *iter)
}
}
static ClutterModelIter *
static ClutterModelIter *
clutter_ model_default _iter_next ( ClutterModelIter * iter )
clutter_ list_ model_iter_next ( ClutterModelIter * iter )
{
{
Clutter ModelDefault Iter * iter_default ;
Clutter List ModelIter * iter_default ;
ClutterModelIter * temp_iter ;
ClutterModelIter * temp_iter ;
ClutterModel * model = NULL ;
ClutterModel * model = NULL ;
GSequenceIter * filter_next ;
GSequenceIter * filter_next ;
guint row ;
guint row ;
iter_default = CLUTTER_ MODEL_DEFAULT _ITER ( iter ) ;
iter_default = CLUTTER_ LIST_ MODEL_ITER ( iter ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
model = clutter_model_iter_get_model ( iter ) ;
model = clutter_model_iter_get_model ( iter ) ;
@ -339,13 +339,13 @@ clutter_model_default_iter_next (ClutterModelIter *iter)
filter_next = g_sequence_iter_next ( iter_default - > seq_iter ) ;
filter_next = g_sequence_iter_next ( iter_default - > seq_iter ) ;
g_assert ( filter_next ! = NULL ) ;
g_assert ( filter_next ! = NULL ) ;
temp_iter = g_object_new ( CLUTTER_TYPE_ MODEL_DEFAULT _ITER,
temp_iter = g_object_new ( CLUTTER_TYPE_ LIST_ MODEL_ITER,
" model " , model ,
" model " , model ,
NULL ) ;
NULL ) ;
while ( ! g_sequence_iter_is_end ( filter_next ) )
while ( ! g_sequence_iter_is_end ( filter_next ) )
{
{
CLUTTER_ MODEL_DEFAULT _ITER ( temp_iter ) - > seq_iter = filter_next ;
CLUTTER_ LIST_ MODEL_ITER ( temp_iter ) - > seq_iter = filter_next ;
g_object_set ( G_OBJECT ( temp_iter ) , " row " , row , NULL ) ;
g_object_set ( G_OBJECT ( temp_iter ) , " row " , row , NULL ) ;
if ( clutter_model_filter_iter ( model , temp_iter ) )
if ( clutter_model_filter_iter ( model , temp_iter ) )
@ -371,15 +371,15 @@ clutter_model_default_iter_next (ClutterModelIter *iter)
}
}
static ClutterModelIter *
static ClutterModelIter *
clutter_ model_default _iter_prev ( ClutterModelIter * iter )
clutter_ list_ model_iter_prev ( ClutterModelIter * iter )
{
{
Clutter ModelDefault Iter * iter_default ;
Clutter List ModelIter * iter_default ;
ClutterModelIter * temp_iter ;
ClutterModelIter * temp_iter ;
ClutterModel * model ;
ClutterModel * model ;
GSequenceIter * filter_prev ;
GSequenceIter * filter_prev ;
guint row ;
guint row ;
iter_default = CLUTTER_ MODEL_DEFAULT _ITER ( iter ) ;
iter_default = CLUTTER_ LIST_ MODEL_ITER ( iter ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
g_assert ( iter_default - > seq_iter ! = NULL ) ;
model = clutter_model_iter_get_model ( iter ) ;
model = clutter_model_iter_get_model ( iter ) ;
@ -388,13 +388,13 @@ clutter_model_default_iter_prev (ClutterModelIter *iter)
filter_prev = g_sequence_iter_prev ( iter_default - > seq_iter ) ;
filter_prev = g_sequence_iter_prev ( iter_default - > seq_iter ) ;
g_assert ( filter_prev ! = NULL ) ;
g_assert ( filter_prev ! = NULL ) ;
temp_iter = g_object_new ( CLUTTER_TYPE_ MODEL_DEFAULT _ITER,
temp_iter = g_object_new ( CLUTTER_TYPE_ LIST_ MODEL_ITER,
" model " , model ,
" model " , model ,
NULL ) ;
NULL ) ;
while ( ! g_sequence_iter_is_begin ( filter_prev ) )
while ( ! g_sequence_iter_is_begin ( filter_prev ) )
{
{
CLUTTER_ MODEL_DEFAULT _ITER ( temp_iter ) - > seq_iter = filter_prev ;
CLUTTER_ LIST_ MODEL_ITER ( temp_iter ) - > seq_iter = filter_prev ;
g_object_set ( G_OBJECT ( temp_iter ) , " row " , row , NULL ) ;
g_object_set ( G_OBJECT ( temp_iter ) , " row " , row , NULL ) ;
if ( clutter_model_filter_iter ( model , temp_iter ) )
if ( clutter_model_filter_iter ( model , temp_iter ) )
@ -419,41 +419,41 @@ clutter_model_default_iter_prev (ClutterModelIter *iter)
return CLUTTER_MODEL_ITER ( iter_default ) ;
return CLUTTER_MODEL_ITER ( iter_default ) ;
}
}
static void
static void
clutter_ model_default _iter_class_init ( Clutter ModelDefault IterClass * klass )
clutter_ list_ model_iter_class_init ( Clutter List ModelIterClass * klass )
{
{
ClutterModelIterClass * iter_class = CLUTTER_MODEL_ITER_CLASS ( klass ) ;
ClutterModelIterClass * iter_class = CLUTTER_MODEL_ITER_CLASS ( klass ) ;
iter_class - > get_value = clutter_ model_default _iter_get_value;
iter_class - > get_value = clutter_ list_ model_iter_get_value;
iter_class - > set_value = clutter_ model_default _iter_set_value;
iter_class - > set_value = clutter_ list_ model_iter_set_value;
iter_class - > is_first = clutter_ model_default _iter_is_first;
iter_class - > is_first = clutter_ list_ model_iter_is_first;
iter_class - > is_last = clutter_ model_default _iter_is_last;
iter_class - > is_last = clutter_ list_ model_iter_is_last;
iter_class - > next = clutter_ model_default _iter_next;
iter_class - > next = clutter_ list_ model_iter_next;
iter_class - > prev = clutter_ model_default _iter_prev;
iter_class - > prev = clutter_ list_ model_iter_prev;
}
}
static void
static void
clutter_ model_default_ iter_init ( Clutter ModelDefault Iter * iter )
clutter_ list_ model_iter_init ( Clutter List ModelIter * iter )
{
{
iter - > seq_iter = NULL ;
iter - > seq_iter = NULL ;
}
}
/*
/*
* Clutter ModelDefault
* Clutter List Model
*/
*/
G_DEFINE_TYPE ( Clutter ModelDefault , clutter_ mode l_defau lt , CLUTTER_TYPE_MODEL ) ;
G_DEFINE_TYPE ( Clutter List Model, clutter_ list _mo del, CLUTTER_TYPE_MODEL ) ;
static ClutterModelIter *
static ClutterModelIter *
clutter_ model_default _get_iter_at_row ( ClutterModel * model ,
clutter_ list_ model_get_iter_at_row ( ClutterModel * model ,
guint row )
guint row )
{
{
Clutter ModelDefault * model_default = CLUTTER_ MODEL_DEFAULT ( model ) ;
Clutter List Model * model_default = CLUTTER_ LIST_ MODEL ( model ) ;
Clutter ModelDefault Iter * retval ;
Clutter List ModelIter * retval ;
if ( row > = g_sequence_get_length ( model_default - > sequence ) )
if ( row > = g_sequence_get_length ( model_default - > sequence ) )
return NULL ;
return NULL ;
retval = g_object_new ( CLUTTER_TYPE_ MODEL_DEFAULT _ITER,
retval = g_object_new ( CLUTTER_TYPE_ LIST_ MODEL_ITER,
" model " , model ,
" model " , model ,
" row " , row ,
" row " , row ,
NULL ) ;
NULL ) ;
@ -463,11 +463,11 @@ clutter_model_default_get_iter_at_row (ClutterModel *model,
}
}
static ClutterModelIter *
static ClutterModelIter *
clutter_ model_default _insert_row ( ClutterModel * model ,
clutter_ list_ model_insert_row ( ClutterModel * model ,
gint index_ )
gint index_ )
{
{
Clutter ModelDefault * model_default = CLUTTER_ MODEL_DEFAULT ( model ) ;
Clutter List Model * model_default = CLUTTER_ LIST_ MODEL ( model ) ;
Clutter ModelDefault Iter * retval ;
Clutter List ModelIter * retval ;
guint n_columns , i , pos ;
guint n_columns , i , pos ;
GValueArray * array ;
GValueArray * array ;
GSequenceIter * seq_iter ;
GSequenceIter * seq_iter ;
@ -502,7 +502,7 @@ clutter_model_default_insert_row (ClutterModel *model,
pos = index_ ;
pos = index_ ;
}
}
retval = g_object_new ( CLUTTER_TYPE_ MODEL_DEFAULT _ITER,
retval = g_object_new ( CLUTTER_TYPE_ LIST_ MODEL_ITER,
" model " , model ,
" model " , model ,
" row " , pos ,
" row " , pos ,
NULL ) ;
NULL ) ;
@ -512,10 +512,10 @@ clutter_model_default_insert_row (ClutterModel *model,
}
}
static void
static void
clutter_ model_default _remove_row ( ClutterModel * model ,
clutter_ list_ model_remove_row ( ClutterModel * model ,
guint row )
guint row )
{
{
Clutter ModelDefault * model_default = CLUTTER_ MODEL_DEFAULT ( model ) ;
Clutter List Model * model_default = CLUTTER_ LIST_ MODEL ( model ) ;
GSequenceIter * seq_iter ;
GSequenceIter * seq_iter ;
guint pos = 0 ;
guint pos = 0 ;
@ -528,11 +528,11 @@ clutter_model_default_remove_row (ClutterModel *model,
{
{
ClutterModelIter * iter ;
ClutterModelIter * iter ;
iter = g_object_new ( CLUTTER_TYPE_ MODEL_DEFAULT _ITER,
iter = g_object_new ( CLUTTER_TYPE_ LIST_ MODEL_ITER,
" model " , model ,
" model " , model ,
" row " , pos ,
" row " , pos ,
NULL ) ;
NULL ) ;
CLUTTER_ MODEL_DEFAULT _ITER ( iter ) - > seq_iter = seq_iter ;
CLUTTER_ LIST_ MODEL_ITER ( iter ) - > seq_iter = seq_iter ;
/* the actual row is removed from the sequence inside
/* the actual row is removed from the sequence inside
* the : : row - removed signal class handler , so that every
* the : : row - removed signal class handler , so that every
@ -555,9 +555,9 @@ clutter_model_default_remove_row (ClutterModel *model,
}
}
static guint
static guint
clutter_ model_default _get_n_rows ( ClutterModel * model )
clutter_ list_ model_get_n_rows ( ClutterModel * model )
{
{
Clutter ModelDefault * model_default = CLUTTER_ MODEL_DEFAULT ( model ) ;
Clutter List Model * model_default = CLUTTER_ LIST_ MODEL ( model ) ;
return g_sequence_get_length ( model_default - > sequence ) ;
return g_sequence_get_length ( model_default - > sequence ) ;
}
}
@ -586,7 +586,7 @@ sort_model_default (gconstpointer a,
}
}
static void
static void
clutter_ model_default _resort ( ClutterModel * model ,
clutter_ list_ model_resort ( ClutterModel * model ,
ClutterModelSortFunc func ,
ClutterModelSortFunc func ,
gpointer data )
gpointer data )
{
{
@ -597,19 +597,19 @@ clutter_model_default_resort (ClutterModel *model,
sort_closure . func = func ;
sort_closure . func = func ;
sort_closure . data = data ;
sort_closure . data = data ;
g_sequence_sort ( CLUTTER_ MODEL_DEFAULT ( model ) - > sequence ,
g_sequence_sort ( CLUTTER_ LIST_ MODEL ( model ) - > sequence ,
sort_model_default ,
sort_model_default ,
& sort_closure ) ;
& sort_closure ) ;
}
}
static void
static void
clutter_ model_default _row_removed ( ClutterModel * model ,
clutter_ list_ model_row_removed ( ClutterModel * model ,
ClutterModelIter * iter )
ClutterModelIter * iter )
{
{
Clutter ModelDefault Iter * iter_default ;
Clutter List ModelIter * iter_default ;
GValueArray * array ;
GValueArray * array ;
iter_default = CLUTTER_ MODEL_DEFAULT _ITER ( iter ) ;
iter_default = CLUTTER_ LIST_ MODEL_ITER ( iter ) ;
array = g_sequence_get ( iter_default - > seq_iter ) ;
array = g_sequence_get ( iter_default - > seq_iter ) ;
g_value_array_free ( array ) ;
g_value_array_free ( array ) ;
@ -619,9 +619,9 @@ clutter_model_default_row_removed (ClutterModel *model,
}
}
static void
static void
clutter_ model_default _finalize ( GObject * gobject )
clutter_ list_ model_finalize ( GObject * gobject )
{
{
Clutter ModelDefault * model = CLUTTER_ MODEL_DEFAULT ( gobject ) ;
Clutter List Model * model = CLUTTER_ LIST_ MODEL ( gobject ) ;
GSequenceIter * iter ;
GSequenceIter * iter ;
iter = g_sequence_get_begin_iter ( model - > sequence ) ;
iter = g_sequence_get_begin_iter ( model - > sequence ) ;
@ -634,34 +634,34 @@ clutter_model_default_finalize (GObject *gobject)
}
}
g_sequence_free ( model - > sequence ) ;
g_sequence_free ( model - > sequence ) ;
G_OBJECT_CLASS ( clutter_ model_default _parent_class) - > finalize ( gobject ) ;
G_OBJECT_CLASS ( clutter_ list_ model_parent_class) - > finalize ( gobject ) ;
}
}
static void
static void
clutter_ model_default_ class_init ( Clutter ModelDefault Class * klass )
clutter_ list_ model_class_init ( Clutter List ModelClass * klass )
{
{
GObjectClass * gobject_class = G_OBJECT_CLASS ( klass ) ;
GObjectClass * gobject_class = G_OBJECT_CLASS ( klass ) ;
ClutterModelClass * model_class = CLUTTER_MODEL_CLASS ( klass ) ;
ClutterModelClass * model_class = CLUTTER_MODEL_CLASS ( klass ) ;
gobject_class - > finalize = clutter_ model_default _finalize;
gobject_class - > finalize = clutter_ list_ model_finalize;
model_class - > get_n_rows = clutter_ model_default _get_n_rows;
model_class - > get_n_rows = clutter_ list_ model_get_n_rows;
model_class - > get_iter_at_row = clutter_ model_default _get_iter_at_row;
model_class - > get_iter_at_row = clutter_ list_ model_get_iter_at_row;
model_class - > insert_row = clutter_ model_default _insert_row;
model_class - > insert_row = clutter_ list_ model_insert_row;
model_class - > remove_row = clutter_ model_default _remove_row;
model_class - > remove_row = clutter_ list_ model_remove_row;
model_class - > resort = clutter_ model_default _resort;
model_class - > resort = clutter_ list_ model_resort;
model_class - > row_removed = clutter_ model_default _row_removed;
model_class - > row_removed = clutter_ list_ model_row_removed;
}
}
static void
static void
clutter_ model_default_ init ( Clutter ModelDefault * model )
clutter_ list_ model_init ( Clutter List Model * model )
{
{
model - > sequence = g_sequence_new ( NULL ) ;
model - > sequence = g_sequence_new ( NULL ) ;
}
}
/**
/**
* clutter_ model_default _new:
* clutter_ list_ model_new:
* @ n_columns : number of columns in the model
* @ n_columns : number of columns in the model
* @ Varargs : @ n_columns number of # GType and string pairs
* @ Varargs : @ n_columns number of # GType and string pairs
*
*
@ -671,7 +671,7 @@ clutter_model_default_init (ClutterModelDefault *model)
* For example :
* For example :
*
*
* < informalexample > < programlisting >
* < informalexample > < programlisting >
* model = clutter_ model_default _new ( 3 ,
* model = clutter_ list_ model_new ( 3 ,
* G_TYPE_INT , " Score " ,
* G_TYPE_INT , " Score " ,
* G_TYPE_STRING , " Team " ,
* G_TYPE_STRING , " Team " ,
* GDK_TYPE_PIXBUF , " Logo " ) ;
* GDK_TYPE_PIXBUF , " Logo " ) ;
@ -684,12 +684,12 @@ clutter_model_default_init (ClutterModelDefault *model)
* the canonical name of the type held by the column will be used as
* the canonical name of the type held by the column will be used as
* the title .
* the title .
*
*
* Return value : a new default # Clutter Model
* Return value : a new # Clutter List Model
*
*
* Since : 0.6
* Since : 0.6
*/
*/
ClutterModel *
ClutterModel *
clutter_ model_default _new ( guint n_columns ,
clutter_ list_ model_new ( guint n_columns ,
. . . )
. . . )
{
{
ClutterModel * model ;
ClutterModel * model ;
@ -698,7 +698,7 @@ clutter_model_default_new (guint n_columns,
g_return_val_if_fail ( n_columns > 0 , NULL ) ;
g_return_val_if_fail ( n_columns > 0 , NULL ) ;
model = g_object_new ( CLUTTER_TYPE_ MODEL_DEFAULT , NULL ) ;
model = g_object_new ( CLUTTER_TYPE_ LIST_ MODEL, NULL ) ;
clutter_model_set_n_columns ( model , n_columns , TRUE , TRUE ) ;
clutter_model_set_n_columns ( model , n_columns , TRUE , TRUE ) ;
va_start ( args , n_columns ) ;
va_start ( args , n_columns ) ;
@ -725,12 +725,12 @@ clutter_model_default_new (guint n_columns,
}
}
/**
/**
* clutter_ model_default _newv:
* clutter_ list_ model_newv:
* @ n_columns : number of columns in the model
* @ n_columns : number of columns in the model
* @ types : an array of # GType types for the columns , from first to last
* @ types : an array of # GType types for the columns , from first to last
* @ names : an array of names for the columns , from first to last
* @ names : an array of names for the columns , from first to last
*
*
* Non - vararg version of clutter_ model_default _new( ) . This function is
* Non - vararg version of clutter_ list_ model_new( ) . This function is
* useful for language bindings .
* useful for language bindings .
*
*
* Return value : a new default # ClutterModel
* Return value : a new default # ClutterModel
@ -738,7 +738,7 @@ clutter_model_default_new (guint n_columns,
* Since : 0.6
* Since : 0.6
*/
*/
ClutterModel *
ClutterModel *
clutter_ model_default _newv ( guint n_columns ,
clutter_ list_ model_newv ( guint n_columns ,
GType * types ,
GType * types ,
const gchar * const names [ ] )
const gchar * const names [ ] )
{
{
@ -747,7 +747,7 @@ clutter_model_default_newv (guint n_columns,
g_return_val_if_fail ( n_columns > 0 , NULL ) ;
g_return_val_if_fail ( n_columns > 0 , NULL ) ;
model = g_object_new ( CLUTTER_TYPE_ MODEL_DEFAULT , NULL ) ;
model = g_object_new ( CLUTTER_TYPE_ LIST_ MODEL, NULL ) ;
clutter_model_set_n_columns ( model , n_columns , TRUE , TRUE ) ;
clutter_model_set_n_columns ( model , n_columns , TRUE , TRUE ) ;
for ( i = 0 ; i < n_columns ; i + + )
for ( i = 0 ; i < n_columns ; i + + )