/** * clutter_layout_manager_get_child_meta: * @manager: a #ClutterLayoutManager * @container: a #ClutterContainer using @manager * @actor: a #ClutterActor child of @container * * Retrieves the #ClutterLayoutMeta that the layout @manager associated * to the @actor child of @container, eventually by creating one if the * #ClutterLayoutManager supports layout properties * * Return value: (transfer none): a #ClutterLayoutMeta, or %NULL if the * #ClutterLayoutManager does not have layout properties. The returned * layout meta instance is owned by the #ClutterLayoutManager and it * should not be unreferenced * * Since: 1.0 */ ClutterLayoutMeta * clutter_layout_manager_get_child_meta (ClutterLayoutManager *manager, ClutterContainer *container, ClutterActor *actor) { g_return_val_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager), NULL); g_return_val_if_fail (CLUTTER_IS_CONTAINER (container), NULL); g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL); return get_child_meta (manager, container, actor); }
/** * st_table_child_get_y_align: * @table: A #StTable * @child: A #ClutterActor * * Get the y-align value of the child * * Returns: An #StAlign value */ StAlign st_table_child_get_y_align (StTable *table, ClutterActor *child) { StTableChild *meta; g_return_val_if_fail (ST_IS_TABLE (table), 0); g_return_val_if_fail (CLUTTER_IS_ACTOR (child), 0); meta = get_child_meta (table, child); return meta->y_align; }
/** * st_table_child_get_allocate_hidden: * @table: A #StTable * @child: A #ClutterActor * * Determine if the child is allocated even if it is hidden * * Returns: %TRUE if the actor is allocated when hidden */ gboolean st_table_child_get_allocate_hidden (StTable *table, ClutterActor *child) { StTableChild *meta; g_return_val_if_fail (ST_IS_TABLE (table), TRUE); g_return_val_if_fail (CLUTTER_IS_ACTOR (child), TRUE); meta = get_child_meta (table, child); return meta->allocate_hidden; }
/** * st_table_child_get_x_expand: * @table: A #StTable * @child: A #ClutterActor * * Get the x-expand property of the child * * Returns: %TRUE if the child is set to x-expand */ gboolean st_table_child_get_x_expand (StTable *table, ClutterActor *child) { StTableChild *meta; g_return_val_if_fail (ST_IS_TABLE (table), 0); g_return_val_if_fail (CLUTTER_IS_ACTOR (child), 0); meta = get_child_meta (table, child); return meta->x_expand; }
/** * st_table_child_set_y_align: * @table: A #StTable * @child: A #ClutterActor * @align: A #StAlign value * * Set the value of the y-align property. This will only have an effect if * y-fill value is set to FALSE. * */ void st_table_child_set_y_align (StTable *table, ClutterActor *child, StAlign align) { StTableChild *meta; g_return_if_fail (ST_IS_TABLE (table)); g_return_if_fail (CLUTTER_IS_ACTOR (child)); meta = get_child_meta (table, child); meta->y_align = align; clutter_actor_queue_relayout (child); }
/** * st_table_child_set_y_expand: * @table: A #StTable * @child: A #ClutterActor * @expand: the new value of the y-expand child property * * Set y-expand on the child. This causes the row which the child * resides in to be allocated any extra space if the allocation of the table is * larger than the preferred size. * */ void st_table_child_set_y_expand (StTable *table, ClutterActor *child, gboolean expand) { StTableChild *meta; g_return_if_fail (ST_IS_TABLE (table)); g_return_if_fail (CLUTTER_IS_ACTOR (child)); meta = get_child_meta (table, child); meta->y_expand = expand; clutter_actor_queue_relayout (child); }
/** * st_table_child_set_row_span: * @table: A #StTable * @child: A #ClutterActor * @span: the number of rows to span * * Set the row span of the child. * */ void st_table_child_set_row_span (StTable *table, ClutterActor *child, gint span) { StTableChild *meta; g_return_if_fail (ST_IS_TABLE (table)); g_return_if_fail (CLUTTER_IS_ACTOR (child)); g_return_if_fail (span > 1); meta = get_child_meta (table, child); meta->row_span = span; clutter_actor_queue_relayout (child); }
/** * st_table_child_set_allocate_hidden: * @table: A #StTable * @child: A #ClutterActor * @value: %TRUE if the actor should be allocated when hidden * * Set whether the child should be allocate even if it is hidden */ void st_table_child_set_allocate_hidden (StTable *table, ClutterActor *child, gboolean value) { StTableChild *meta; g_return_if_fail (ST_IS_TABLE (table)); g_return_if_fail (CLUTTER_IS_ACTOR (child)); meta = get_child_meta (table, child); if (meta->allocate_hidden != value) { meta->allocate_hidden = value; clutter_actor_queue_relayout (child); g_object_notify (G_OBJECT (meta), "allocate-hidden"); } }
/** * clutter_layout_manager_child_set_property: * @manager: a #ClutterLayoutManager * @container: a #ClutterContainer using @manager * @actor: a #ClutterActor child of @container * @property_name: the name of the property to set * @value: a #GValue with the value of the property to set * * Sets a property on the #ClutterLayoutMeta created by @manager and * attached to a child of @container * * Since: 1.2 */ void clutter_layout_manager_child_set_property (ClutterLayoutManager *manager, ClutterContainer *container, ClutterActor *actor, const gchar *property_name, const GValue *value) { ClutterLayoutMeta *meta; GObjectClass *klass; GParamSpec *pspec; g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (actor)); g_return_if_fail (property_name != NULL); g_return_if_fail (value != NULL); meta = get_child_meta (manager, container, actor); if (meta == NULL) { g_warning ("Layout managers of type '%s' do not support " "layout metadata", g_type_name (G_OBJECT_TYPE (manager))); return; } klass = G_OBJECT_GET_CLASS (meta); pspec = g_object_class_find_property (klass, property_name); if (pspec == NULL) { g_warning ("%s: Layout managers of type '%s' have no layout " "property named '%s'", G_STRLOC, G_OBJECT_TYPE_NAME (manager), property_name); return; } layout_set_property_internal (manager, G_OBJECT (meta), pspec, value); }
/** * clutter_layout_manager_child_set: * @manager: a #ClutterLayoutManager * @container: a #ClutterContainer using @manager * @actor: a #ClutterActor child of @container * @first_property: the first property name * @Varargs: a list of property name and value pairs * * Sets a list of properties and their values on the #ClutterLayoutMeta * associated by @manager to a child of @container * * Languages bindings should use clutter_layout_manager_child_set_property() * instead * * Since: 1.2 */ void clutter_layout_manager_child_set (ClutterLayoutManager *manager, ClutterContainer *container, ClutterActor *actor, const gchar *first_property, ...) { ClutterLayoutMeta *meta; GObjectClass *klass; const gchar *pname; va_list var_args; g_return_if_fail (CLUTTER_IS_LAYOUT_MANAGER (manager)); g_return_if_fail (CLUTTER_IS_CONTAINER (container)); g_return_if_fail (CLUTTER_IS_ACTOR (actor)); g_return_if_fail (first_property != NULL); meta = get_child_meta (manager, container, actor); if (meta == NULL) { g_warning ("Layout managers of type '%s' do not support " "layout metadata", g_type_name (G_OBJECT_TYPE (manager))); return; } klass = G_OBJECT_GET_CLASS (meta); va_start (var_args, first_property); pname = first_property; while (pname) { GValue value = { 0, }; GParamSpec *pspec; gchar *error; gboolean res; pspec = g_object_class_find_property (klass, pname); if (pspec == NULL) { g_warning ("%s: Layout managers of type '%s' have no layout " "property named '%s'", G_STRLOC, G_OBJECT_TYPE_NAME (manager), pname); break; } G_VALUE_COLLECT_INIT (&value, G_PARAM_SPEC_VALUE_TYPE (pspec), var_args, 0, &error); if (error) { g_warning ("%s: %s", G_STRLOC, error); g_free (error); break; } res = layout_set_property_internal (manager, G_OBJECT (meta), pspec, &value); g_value_unset (&value); if (!res) break; pname = va_arg (var_args, gchar*); } va_end (var_args); }