![]() |
![]() |
![]() |
![]() |
This class is a container for AsComponent objects which usually share the same AsContext and are manipulated together. It also provides binding-safe accessor functions to manipulate an array of components.
See also: AsComponent
AsComponentBox *
as_component_box_new (AsComponentBoxFlags flags
);
Creates a new AsComponentBox.
Since: 1.0
AsComponentBox *
as_component_box_new_simple (void
);
Creates a new AsComponentBox with the simplest parameters, so it is basically an array storage without overhead.
Only the most basic checks on inserted components will be performed, and it is assumed that the inserted components have been checked already prior to insertion.
#define as_component_box_index(cbox, index_)
Returns the AsComponent at the given index of the array.
This does not perform bounds checking on the given index_
,
so you are responsible for checking it against the array length.
Use as_component_box_len
to determine the amount of components
present in the AsComponentBox.
#define as_component_box_len(cbox) (cbox)->cpts->len
Get the amount of components in its box array.
GPtrArray *
as_component_box_array (AsComponentBox *cbox
);
Get the contents of this component box as GPtrArray.
AsComponentBoxFlags
as_component_box_get_flags (AsComponentBox *cbox
);
Get the flags this component box was constructed with.
guint
as_component_box_get_size (AsComponentBox *cbox
);
Get the amount of components in this box.
AsComponent * as_component_box_index_safe (AsComponentBox *cbox
,guint index
);
Retrieve a component at the expective index from the internal component array.
gboolean
as_component_box_is_empty (AsComponentBox *cbox
);
Check if there are any components present.
gboolean as_component_box_add (AsComponentBox *cbox
,AsComponent *cpt
,GError **error
);
Add a component to the box. Returns an error if we could not add it (most likely due to component box constraints).
void
as_component_box_sort (AsComponentBox *cbox
);
Sort components to bring them into a deterministic order.
void
as_component_box_sort_by_score (AsComponentBox *cbox
);
Sort components by their (search) match score.