![]() |
![]() |
![]() |
Mex Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#define MEX_MODEL_IFACE (iface) #define MEX_IS_MODEL_IFACE (iface) gint (*MexModelSortFunc) (MexContent *a
,MexContent *b
,gpointer userdata
); struct MexModelIface; GController * mex_model_get_controller (MexModel *model
); MexContent * mex_model_get_content (MexModel *model
,guint index_
); void mex_model_add_content (MexModel *model
,MexContent *content
); void mex_model_remove_content (MexModel *model
,MexContent *content
); void mex_model_clear (MexModel *model
); void mex_model_set_sort_func (MexModel *model
,MexModelSortFunc sort_func
,gpointer user_data
); guint mex_model_get_length (MexModel *model
); gint mex_model_index (MexModel *model
,MexContent *content
); MexModel * mex_model_get_model (MexModel *model
);
A class can implement MexModel to provide generic access to a collection of MexContent objects, with optional sorting and filtering.
The interface also provides access to the GController for a model, which advertises changes to the model via signals.
#define MEX_MODEL_IFACE(iface) (G_TYPE_CHECK_CLASS_CAST ((iface), MEX_TYPE_MODEL, MexModelIface))
#define MEX_IS_MODEL_IFACE(iface) (G_TYPE_CHECK_CLASS_TYPE ((iface), MEX_TYPE_MODEL))
struct MexModelIface { GTypeInterface g_iface; /* virtual functions */ GController * (*get_controller) (MexModel *model); MexContent * (*get_content) (MexModel *model, guint index_); void (*add_content) (MexModel *model, MexContent *content); void (*remove_content) (MexModel *model, MexContent *content); void (*clear) (MexModel *model); void (*set_sort_func) (MexModel *model, MexModelSortFunc sort_func, gpointer user_data); guint (*get_length) (MexModel *model); gint (*index) (MexModel *model, MexContent *content); MexModel *(*get_model) (MexModel *model); };
GController * mex_model_get_controller (MexModel *model
);
Retrieves the GController object for this model
.
|
a MexModel |
Returns : |
A GController. Call g_object_unref() on the
controller once finished with it. [transfer full]
|
Since 0.2
MexContent * mex_model_get_content (MexModel *model
,guint index_
);
Retrieves the MexContent object at position index_
for this model
.
|
a MexModel |
|
a position |
Returns : |
A GController. Call g_object_unref() on the controller once
finished with it. [transfer full]
|
Since 0.2
void mex_model_set_sort_func (MexModel *model
,MexModelSortFunc sort_func
,gpointer user_data
);
|
the model to sort |
|
the function to sort the model with. [scope call] |
|
data given to sort_func when called |
Since 0.2