Пример #1
0
/**
 * gdl_dock_object_reduce:
 * @object: A #GdlDockObject
 *
 * Remove a compound object if it is not longer useful to hold the child. The
 * object has to be removed and the child reattached to the parent.
 */
void
gdl_dock_object_reduce (GdlDockObject *object)
{
    g_return_if_fail (object != NULL);

    if (gdl_dock_object_is_frozen (object)) {
        object->priv->reduce_pending = TRUE;
        return;
    }

    if (GDL_DOCK_OBJECT_GET_CLASS (object)->reduce)
        GDL_DOCK_OBJECT_GET_CLASS (object)->reduce (object);
}
Пример #2
0
/**
 * gdl_dock_object_dock_request:
 * @object: A #GdlDockObject
 * @x: X coordinate
 * @y: Y coordinate
 * @request: A #GdlDockRequest with information about the docking position
 *
 * Dock a dock widget in @object at the defined position.
 *
 * Returns: %TRUE if @object has been docked.
 */
gboolean
gdl_dock_object_dock_request (GdlDockObject  *object,
                              gint            x,
                              gint            y,
                              GdlDockRequest *request)
{
    g_return_val_if_fail (object != NULL && request != NULL, FALSE);

    if (GDL_DOCK_OBJECT_GET_CLASS (object)->dock_request)
        return GDL_DOCK_OBJECT_GET_CLASS (object)->dock_request (object, x, y, request);
    else
        return FALSE;
}
Пример #3
0
/**
 * gdl_dock_object_reorder:
 * @object: A #GdlDockObject
 * @child: The child widget to reorder
 * @new_position: New position for the child
 * @other_data: (allow-none): Optional data giving additional information
 * depending on the dock object.
 *
 * Move the @child widget at another place.
 *
 * Returns: %TRUE if @child has been moved
 */
gboolean
gdl_dock_object_reorder (GdlDockObject    *object,
                         GdlDockObject    *child,
                         GdlDockPlacement  new_position,
                         GValue           *other_data)
{
    g_return_val_if_fail (object != NULL && child != NULL, FALSE);

    if (GDL_DOCK_OBJECT_GET_CLASS (object)->reorder)
            return GDL_DOCK_OBJECT_GET_CLASS (object)->reorder (object, child, new_position, other_data);
    else
        return FALSE;
}
Пример #4
0
/**
 * gdl_dock_object_child_placement:
 * @object: the dock object we are asking for child placement
 * @child: the child of the @object we want the placement for
 * @placement: (allow-none): where to return the placement information
 *
 * This function returns information about placement of a child dock
 * object inside another dock object.  The function returns %TRUE if
 * @child is effectively a child of @object.  @placement should
 * normally be initially setup to %GDL_DOCK_NONE.  If it's set to some
 * other value, this function will not touch the stored value if the
 * specified placement is "compatible" with the actual placement of
 * the child.
 *
 * @placement can be %NULL, in which case the function simply tells if
 * @child is attached to @object.
 *
 * Returns: %TRUE if @child is a child of @object.
 */
gboolean
gdl_dock_object_child_placement (GdlDockObject    *object,
                                 GdlDockObject    *child,
                                 GdlDockPlacement *placement)
{
    g_return_val_if_fail (object != NULL && child != NULL, FALSE);

    /* simple case */
    if (!gdl_dock_object_is_compound (object))
        return FALSE;

    if (GDL_DOCK_OBJECT_GET_CLASS (object)->child_placement)
        return GDL_DOCK_OBJECT_GET_CLASS (object)->child_placement (object, child, placement);
    else
        return FALSE;
}
Пример #5
0
/**
 * gdl_dock_object_present:
 * @object: A #GdlDockObject
 * @child: (allow-none): The child widget to present or %NULL
 *
 * Presents the GDL object to the user. By example, this will select the
 * corresponding page if the object is in a notebook. If @child is missing,
 * only the @object will be show.
 */
void
gdl_dock_object_present (GdlDockObject *object,
                         GdlDockObject *child)
{
    GdlDockObject *parent;

    g_return_if_fail (object != NULL && GDL_IS_DOCK_OBJECT (object));

    parent = gdl_dock_object_get_parent_object (object);
    if (parent)
        /* chain the call to our parent */
        gdl_dock_object_present (parent, object);

   if (GDL_DOCK_OBJECT_GET_CLASS (object)->present)
        GDL_DOCK_OBJECT_GET_CLASS (object)->present (object, child);
}
Пример #6
0
/**
 * gdl_dock_object_is_compound:
 * @object: A #GdlDockObject
 *
 * Check if an object is a compound object, accepting children widget or not.
 *
 * Returns: %TRUE if @object is a compound object.
 */
gboolean
gdl_dock_object_is_compound (GdlDockObject *object)
{
    g_return_val_if_fail (object != NULL, FALSE);
    g_return_val_if_fail (GDL_IS_DOCK_OBJECT (object), FALSE);

    return GDL_DOCK_OBJECT_GET_CLASS (object)->priv->is_compound;
}
Пример #7
0
gboolean
gdl_dock_object_is_compound (GdlDockObject *object)
{
    GdlDockObjectClass *klass;

    g_return_val_if_fail (object != NULL, FALSE);
    g_return_val_if_fail (GDL_IS_DOCK_OBJECT (object), FALSE);

    klass = GDL_DOCK_OBJECT_GET_CLASS (object);
    return klass->is_compound;
}