Filter:   InfoImg
download bonobo-dock-item.h
Language: C
Copyright: (C) 1998 Elliot Lee (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald (C) 1998 Ettore Perazzoli
LOC: 92
Project Info
libbonoboui
Server: Gnome
Type: cvs
...onoboui\libbonoboui\bonobo\
   .cvsignore
   bonobo-a11y.c
   bonobo-a11y.h
   bonobo-canvas-component.c
   bonobo-canvas-component.h
   bonobo-canvas-item.c
   bonobo-canvas-item.h
   bonobo-control-frame.c
   bonobo-control-frame.h
   bonobo-control-internal.h
   bonobo-control.c
   bonobo-control.h
   bonobo-dock-band.c
   bonobo-dock-band.h
   bonobo-dock-item-grip.c
   bonobo-dock-item-grip.h
   bonobo-dock-item.c
   bonobo-dock-item.h
   bonobo-dock-layout.c
   bonobo-dock-layout.h
   bonobo-dock.c
   bonobo-dock.h
   ...bo-embeddable-factory.h
   ...bo-file-selector-util.c
   ...bo-file-selector-util.h
   ...bo-insert-component.xpm
   bonobo-plug.c
   bonobo-plug.h
   bonobo-property-control.c
   bonobo-property-control.h
   bonobo-selector-widget.c
   bonobo-selector-widget.h
   bonobo-selector.c
   bonobo-selector.h
   bonobo-socket.c
   bonobo-socket.h
   bonobo-ui-component.c
   bonobo-ui-component.h
   bonobo-ui-config-widget.c
   bonobo-ui-config-widget.h
   bonobo-ui-container.c
   bonobo-ui-container.h
   bonobo-ui-engine-config.c
   bonobo-ui-engine-config.h
   bonobo-ui-engine-private.h
   bonobo-ui-engine.c
   bonobo-ui-engine.h
   bonobo-ui-init-gtk.c
   ...o-ui-internal-toolbar.c
   bonobo-ui-main.c
   bonobo-ui-main.h
   bonobo-ui-marshal-main.c
   bonobo-ui-marshal.list
   bonobo-ui-node-private.h
   bonobo-ui-node.c
   bonobo-ui-node.h
   bonobo-ui-preferences.c
   bonobo-ui-preferences.h
   bonobo-ui-private.h
   bonobo-ui-sync-keys.c
   bonobo-ui-sync-keys.h
   bonobo-ui-sync-menu.c
   bonobo-ui-sync-menu.h
   bonobo-ui-sync-status.c
   bonobo-ui-sync-status.h
   bonobo-ui-sync-toolbar.c
   bonobo-ui-sync-toolbar.h
   bonobo-ui-sync.c
   bonobo-ui-sync.h
   ...i-toolbar-button-item.c
   ...i-toolbar-button-item.h
   ...-toolbar-control-item.c
   ...-toolbar-control-item.h
   bonobo-ui-toolbar-item.c
   bonobo-ui-toolbar-item.h
   ...ui-toolbar-popup-item.c
   ...ui-toolbar-popup-item.h
   ...ar-toggle-button-item.c
   ...ar-toggle-button-item.h
   bonobo-ui-toolbar.c
   bonobo-ui-toolbar.h
   bonobo-ui-util.c
   bonobo-ui-util.h
   bonobo-ui-win32.c
   bonobo-ui-xml.c
   bonobo-ui-xml.h
   bonobo-widget.c
   bonobo-widget.h
   bonobo-window.c
   bonobo-window.h
   bonobo-wrapper.h
   bonobo-zoomable-frame.c
   bonobo-zoomable-frame.h
   bonobo-zoomable.c
   bonobo-zoomable.h
   ...i-2.0-uninstalled.pc.in
   libbonoboui-2.0.pc.in
   Makefile.am

/* WARNING ____ IMMATURE API ____ liable to change */

/* bonobo-dock-item.h
 *
 * Copyright (C) 1998 Ettore Perazzoli
 * Copyright (C) 1998 Elliot Lee
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 * All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */
/*
  @NOTATION@
*/

#ifndef _BONOBO_DOCK_ITEM_H
#define _BONOBO_DOCK_ITEM_H

#include <gtk/gtk.h>

G_BEGIN_DECLS

#define BONOBO_TYPE_DOCK_ITEM            (bonobo_dock_item_get_type())
#define BONOBO_DOCK_ITEM(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), BONOBO_TYPE_DOCK_ITEM, BonoboDockItem))
#define BONOBO_DOCK_ITEM_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), BONOBO_TYPE_DOCK_ITEM, BonoboDockItemClass))
#define BONOBO_IS_DOCK_ITEM(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BONOBO_TYPE_DOCK_ITEM))
#define BONOBO_IS_DOCK_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BONOBO_TYPE_DOCK_ITEM))
#define BONOBO_DOCK_ITEM_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), BONOBO_TYPE_DOCK_ITEM, BonoboDockItemClass))

typedef enum
{
  BONOBO_DOCK_ITEM_BEH_NORMAL = 0,
  BONOBO_DOCK_ITEM_BEH_EXCLUSIVE = 1 << 0,
  BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING = 1 << 1,
  BONOBO_DOCK_ITEM_BEH_NEVER_VERTICAL = 1 << 2,
  BONOBO_DOCK_ITEM_BEH_NEVER_HORIZONTAL = 1 << 3,
  BONOBO_DOCK_ITEM_BEH_LOCKED = 1 << 4
  /* MAINT: Update the size of the bit field in the BonoboDockItem structure if you add items to this */
} BonoboDockItemBehavior;

/* obsolete, for compatibility; don't use */
#define BONOBO_DOCK_ITEM_BEH_NEVER_DETACH BONOBO_DOCK_ITEM_BEH_NEVER_FLOATING

#define BONOBO_DOCK_ITEM_NOT_LOCKED(x) (! (BONOBO_DOCK_ITEM(x)->behavior \
                                          & BONOBO_DOCK_ITEM_BEH_LOCKED))

typedef struct _BonoboDockItem        BonoboDockItem;
typedef struct _BonoboDockItemPrivate BonoboDockItemPrivate;
typedef struct _BonoboDockItemClass   BonoboDockItemClass;

struct _BonoboDockItem
{
  GtkBin bin;

  gchar                *name;

  /* <private> */
  GdkWindow            *bin_window; /* parent window for children */
  GdkWindow            *float_window; /* always NULL */
  GtkShadowType         shadow_type;

  /* Start drag position (wrt widget->window).  */
  gint16                  dragoff_x, dragoff_y;

  /* Position of the floating window.  */
  gint16                  float_x, float_y;

  guint                 behavior : 5;
  guint                 orientation : 1;

  guint                 float_window_mapped : 1;
  guint                 is_floating : 1;
  guint                 in_drag : 1;
  /* If TRUE, the pointer must be grabbed on "map_event".  */
  guint                 grab_on_map_event : 1;

  /*< private >*/
  BonoboDockItemPrivate *_priv;
};

struct _BonoboDockItemClass
{
  GtkBinClass parent_class;

  void (* dock_drag_begin) (BonoboDockItem *item);
  void (* dock_drag_motion) (BonoboDockItem *item, gint x, gint y);
  void (* dock_drag_end) (BonoboDockItem *item);
  void (* dock_detach) (BonoboDockItem *item);
  void (* orientation_changed) (BonoboDockItem *item, GtkOrientation new_orientation);

  gpointer dummy[4];
};

/* Public methods.  */
GtkType        bonobo_dock_item_get_type        (void) G_GNUC_CONST;
GtkWidget     *bonobo_dock_item_new             (const gchar *name,
                                                BonoboDockItemBehavior behavior);
void           bonobo_dock_item_construct       (BonoboDockItem *new_dock_item,
						const gchar *name,
						BonoboDockItemBehavior behavior);

GtkWidget     *bonobo_dock_item_get_child       (BonoboDockItem *dock_item);

char          *bonobo_dock_item_get_name        (BonoboDockItem *dock_item);

void           bonobo_dock_item_set_shadow_type (BonoboDockItem *dock_item,
                                                GtkShadowType type);

GtkShadowType  bonobo_dock_item_get_shadow_type (BonoboDockItem *dock_item);
 
gboolean       bonobo_dock_item_set_orientation (BonoboDockItem *dock_item,
                                                GtkOrientation orientation);

GtkOrientation bonobo_dock_item_get_orientation (BonoboDockItem *dock_item);

BonoboDockItemBehavior
               bonobo_dock_item_get_behavior    (BonoboDockItem *dock_item);

void	       bonobo_dock_item_set_behavior    (BonoboDockItem         *dock_item,
                                                 BonoboDockItemBehavior  behavior);

/* Private methods.  */
#ifdef BONOBO_UI_INTERNAL
void           bonobo_dock_item_set_locked      (BonoboDockItem *dock_item,
						 gboolean        locked);
gboolean       bonobo_dock_item_detach          (BonoboDockItem *item,
						 gint x, gint y);
                                               
void           bonobo_dock_item_attach          (BonoboDockItem *item,
						 GtkWidget *parent,
						 gint x, gint y);
void           bonobo_dock_item_unfloat         (BonoboDockItem *item);

void           bonobo_dock_item_grab_pointer    (BonoboDockItem *item);
                                               
void           bonobo_dock_item_drag_floating   (BonoboDockItem *item,
						 gint x, gint y);

void           bonobo_dock_item_handle_size_request
                                               (BonoboDockItem *item,
                                                GtkRequisition *requisition);

void           bonobo_dock_item_get_floating_position
                                               (BonoboDockItem *item,
                                                gint *x, gint *y);
GtkWidget     *bonobo_dock_item_get_grip       (BonoboDockItem *item);

#endif /* BONOBO_UI_INTERNAL */

G_END_DECLS

#endif /* _BONOBO_DOCK_ITEM_H */