1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * This file is part of the GNOME Devtools Libraries.
4 *
5 * Copyright (C) 2002 Gustavo Giráldez <gustavo.giraldez@gmx.net>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
22 #ifndef __GDL_DOCK_H__
23 #define __GDL_DOCK_H__
25 #include <gtk/gtk.h>
26 #include "libgdl/gdl-dock-object.h"
27 #include "libgdl/gdl-dock-item.h"
28 #include "libgdl/gdl-dock-placeholder.h"
30 G_BEGIN_DECLS
32 /* standard macros */
33 #define GDL_TYPE_DOCK (gdl_dock_get_type ())
34 #define GDL_DOCK(obj) (GTK_CHECK_CAST ((obj), GDL_TYPE_DOCK, GdlDock))
35 #define GDL_DOCK_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GDL_TYPE_DOCK, GdlDockClass))
36 #define GDL_IS_DOCK(obj) (GTK_CHECK_TYPE ((obj), GDL_TYPE_DOCK))
37 #define GDL_IS_DOCK_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GDL_TYPE_DOCK))
38 #define GDL_DOCK_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_DOCK, GdlDockClass))
40 /* data types & structures */
41 typedef struct _GdlDock GdlDock;
42 typedef struct _GdlDockClass GdlDockClass;
43 typedef struct _GdlDockPrivate GdlDockPrivate;
45 struct _GdlDock {
46 GdlDockObject object;
48 GdlDockObject *root;
50 GdlDockPrivate *_priv;
51 };
53 struct _GdlDockClass {
54 GdlDockObjectClass parent_class;
56 void (* layout_changed) (GdlDock *dock); /* proxy signal for the master */
57 };
59 /* additional macros */
60 #define GDL_DOCK_IS_CONTROLLER(dock) \
61 (gdl_dock_master_get_controller (GDL_DOCK_OBJECT_GET_MASTER (dock)) == \
62 GDL_DOCK_OBJECT (dock))
64 /* public interface */
66 GtkWidget *gdl_dock_new (void);
68 GtkWidget *gdl_dock_new_from (GdlDock *original,
69 gboolean floating);
71 GType gdl_dock_get_type (void);
73 void gdl_dock_add_item (GdlDock *dock,
74 GdlDockItem *item,
75 GdlDockPlacement place);
77 void gdl_dock_add_floating_item (GdlDock *dock,
78 GdlDockItem *item,
79 gint x,
80 gint y,
81 gint width,
82 gint height);
84 GdlDockItem *gdl_dock_get_item_by_name (GdlDock *dock,
85 const gchar *name);
87 GdlDockPlaceholder *gdl_dock_get_placeholder_by_name (GdlDock *dock,
88 const gchar *name);
90 GList *gdl_dock_get_named_items (GdlDock *dock);
92 GdlDock *gdl_dock_object_get_toplevel (GdlDockObject *object);
94 void gdl_dock_xor_rect (GdlDock *dock,
95 GdkRectangle *rect);
97 G_END_DECLS
99 #endif