Gnome User Interface Library Reference Manual
<<< Previous Page | Home | Up | Next Page >>>

# GnomeDockItem

## Name

GnomeDockItem -- A dockable widget.

## Synopsis

    #include <gnome.h>

    struct      GnomeDockItem;
    enum        GnomeDockItemBehavior;
    #define     GNOME_DOCK_ITEM_NOT_LOCKED      (x)
    GtkWidget*  gnome_dock_item_new             (const gchar *name,
                                                 GnomeDockItemBehavior behavior);
    GtkWidget*  gnome_dock_item_get_child       (GnomeDockItem *dock_item);
    char*       gnome_dock_item_get_name        (GnomeDockItem *dock_item);
    void        gnome_dock_item_set_shadow_type (GnomeDockItem *dock_item,
                                                 GtkShadowType type);
    GtkShadowType gnome_dock_item_get_shadow_type
                                                (GnomeDockItem *dock_item);
    gboolean    gnome_dock_item_set_orientation (GnomeDockItem *dock_item,
                                                 GtkOrientation orientation);
    GtkOrientation gnome_dock_item_get_orientation
                                                (GnomeDockItem *dock_item);
    GnomeDockItemBehavior gnome_dock_item_get_behavior
                                                (GnomeDockItem *dock_item);
    gboolean    gnome_dock_item_detach          (GnomeDockItem *item,
                                                 gint x,
                                                 gint y);
    void        gnome_dock_item_attach          (GnomeDockItem *item,
                                                 GtkWidget *parent,
                                                 gint x,
                                                 gint y);
    void        gnome_dock_item_grab_pointer    (GnomeDockItem *item);
    void        gnome_dock_item_drag_floating   (GnomeDockItem *item,
                                                 gint x,
                                                 gint y);
    void        gnome_dock_item_handle_size_request
                                                (GnomeDockItem *item,
                                                 GtkRequisition *requisition);
    void        gnome_dock_item_get_floating_position
                                                (GnomeDockItem *item,
                                                 gint *x,
                                                 gint *y);

## Object Hierarchy

      GtkObject
       +----GtkWidget
             +----GtkContainer
                   +----GtkBin
                         +----GnomeDockItem

## Description

GnomeDockItem is a container widget that can be used to make widgets dockable. "Making a widget dockable" means that the widget gets a handle through which users can drag it around the dock widget or detach it so that it gets displayed into its own window (thus becoming a "floating" item).

## Details

### struct GnomeDockItem

    struct GnomeDockItem;

### enum GnomeDockItemBehavior

    typedef enum
    {
      GNOME_DOCK_ITEM_BEH_NORMAL = 0,
      GNOME_DOCK_ITEM_BEH_EXCLUSIVE = 1 << 0,
      GNOME_DOCK_ITEM_BEH_NEVER_FLOATING = 1 << 1,
      GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL = 1 << 2,
      GNOME_DOCK_ITEM_BEH_NEVER_HORIZONTAL = 1 << 3,
      GNOME_DOCK_ITEM_BEH_LOCKED = 1 << 4
    } GnomeDockItemBehavior;

This enumeration can be used to customize the behavior of a dock item. Every value represents a property bit, so that the properties can be combined together by using the OR (`|') operator.

The special value GNOME_DOCK_ITEM_BEH_NORMAL specifies the ``normal'' (default) behavior, and means to have all the properties disabled (and thus the corresponding bits set to zero).

- GNOME_DOCK_ITEM_BEH_EXCLUSIVE specifies that the dock item is always the only one in its band.

- GNOME_DOCK_ITEM_BEH_NEVER_FLOATING specifies that users cannot detach the dock item from the dock.

- GNOME_DOCK_ITEM_BEH_NEVER_VERTICAL specifies that the dock item must be kept horizontal, and users cannot move it to a vertical band.

- GNOME_DOCK_ITEM_BEH_NEVER_HORIZONTAL specifies that the dock item must be kept horizontal, and users cannot move it to a vertical band.

- GNOME_DOCK_ITEM_BEH_LOCKED specifies that users cannot drag the item around.

### GNOME_DOCK_ITEM_NOT_LOCKED()

    #define     GNOME_DOCK_ITEM_NOT_LOCKED(x)

`x` : |

### gnome_dock_item_new ()

    GtkWidget*  gnome_dock_item_new             (const gchar *name,
                                                 GnomeDockItemBehavior behavior);

Create a new GnomeDockItem named `name`, with the specified `behavior`.

`name` : | Name for the new item
`behavior` : | Behavior for the new item
Returns : | A new GnomeDockItem widget.

### gnome_dock_item_get_child ()

    GtkWidget*  gnome_dock_item_get_child       (GnomeDockItem *dock_item);

Retrieve the child of `item`.

`dock_item` : |
Returns : | The child of `item`.

### gnome_dock_item_get_name ()

    char*       gnome_dock_item_get_name        (GnomeDockItem *dock_item);

Retrieve the name of `item`.

`dock_item` : |
Returns : | The name of `item` as a malloc()ed zero-terminated string.

### gnome_dock_item_set_shadow_type ()

    void        gnome_dock_item_set_shadow_type (GnomeDockItem *dock_item,
                                                 GtkShadowType type);

Set the shadow type for `dock_item`.

`dock_item` : | A GnomeDockItem widget
`type` : | The shadow type for `dock_item`

### gnome_dock_item_get_shadow_type ()

    GtkShadowType gnome_dock_item_get_shadow_type
                                                (GnomeDockItem *dock_item);

Retrieve the shadow type of `dock_item`.

`dock_item` : | A GnomeDockItem widget.
Returns : | `dock_item`'s shadow type.

### gnome_dock_item_set_orientation ()

    gboolean    gnome_dock_item_set_orientation (GnomeDockItem *dock_item,
                                                 GtkOrientation orientation);

Set the orientation for `dock_item`.

`dock_item` : | A GnomeDockItem widget
`orientation` : | New orientation for `dock_item`
Returns : | `TRUE` if the operation succeeds, `FALSE` if it fails.

### gnome_dock_item_get_orientation ()

    GtkOrientation gnome_dock_item_get_orientation
                                                (GnomeDockItem *dock_item);

Retrieve the orientation of `dock_item`.

`dock_item` : | A GnomeDockItem widget.
Returns : | The current orientation of `dock_item`.

### gnome_dock_item_get_behavior ()

    GnomeDockItemBehavior gnome_dock_item_get_behavior
                                                (GnomeDockItem *dock_item);

Retrieve the behavior of `dock_item`.

`dock_item` : | A GnomeDockItem widget.
Returns : | The behavior of `dock_item`.

### gnome_dock_item_detach ()

    gboolean    gnome_dock_item_detach          (GnomeDockItem *item,
                                                 gint x,
                                                 gint y);

`item` : |
`x` : |
`y` : |
Returns : |

### gnome_dock_item_attach ()

    void        gnome_dock_item_attach          (GnomeDockItem *item,
                                                 GtkWidget *parent,
                                                 gint x,
                                                 gint y);

`item` : |
`parent` : |
`x` : |
`y` : |

### gnome_dock_item_grab_pointer ()

    void        gnome_dock_item_grab_pointer    (GnomeDockItem *item);

`item` : |

### gnome_dock_item_drag_floating ()

    void        gnome_dock_item_drag_floating   (GnomeDockItem *item,
                                                 gint x,
                                                 gint y);

`item` : |
`x` : |
`y` : |

### gnome_dock_item_handle_size_request ()

    void        gnome_dock_item_handle_size_request
                                                (GnomeDockItem *item,
                                                 GtkRequisition *requisition);

`item` : |
`requisition` : |

### gnome_dock_item_get_floating_position ()

    void        gnome_dock_item_get_floating_position
                                                (GnomeDockItem *item,
                                                 gint *x,
                                                 gint *y);

`item` : |
`x` : |
`y` : |

## See Also

GnomeDock GnomeDockBand GnomeDockLayout

<<< Previous Page | Home | Up | Next Page >>>
GnomeDockBand | GnomeDock