]> Pileus Git - ~andy/gtk/blob - gtk/gtkcontainer.h
bcb43aec18be1d01a3c27c8f527bbea943822aee
[~andy/gtk] / gtk / gtkcontainer.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18 #ifndef __GTK_CONTAINER_H__
19 #define __GTK_CONTAINER_H__
20
21
22 #include <gdk/gdk.h>
23 #include <gtk/gtkenums.h>
24 #include <gtk/gtkwidget.h>
25
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30
31
32 #define GTK_CONTAINER(obj)          GTK_CHECK_CAST (obj, gtk_container_get_type (), GtkContainer)
33 #define GTK_CONTAINER_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_container_get_type, GtkContainerClass)
34 #define GTK_IS_CONTAINER(obj)       GTK_CHECK_TYPE (obj, gtk_container_get_type ())
35
36 #define GTK_TYPE_CONTAINER          (gtk_container_get_type ())
37
38 typedef struct _GtkContainer       GtkContainer;
39 typedef struct _GtkContainerClass  GtkContainerClass;
40
41 struct _GtkContainer
42 {
43   GtkWidget widget;
44
45   GtkWidget *focus_child;
46   gint16 border_width;
47   guint auto_resize : 1;
48   guint need_resize : 1;
49   guint block_resize : 1;
50
51
52   /* The list of children that requested a resize
53    */
54   GSList *resize_widgets;
55 };
56
57 struct _GtkContainerClass
58 {
59   GtkWidgetClass parent_class;
60
61   void (* add)         (GtkContainer     *container,
62                         GtkWidget        *widget);
63   void (* remove)      (GtkContainer     *container,
64                         GtkWidget        *widget);
65   gint (* need_resize) (GtkContainer     *container);
66   void (* foreach)     (GtkContainer     *container,
67                         GtkCallback       callback,
68                         gpointer          callbabck_data);
69   gint (* focus)       (GtkContainer     *container,
70                         GtkDirectionType  direction);
71 };
72
73
74
75 guint  gtk_container_get_type       (void);
76 void   gtk_container_border_width   (GtkContainer     *container,
77                                      gint              border_width);
78 void   gtk_container_add            (GtkContainer     *container,
79                                      GtkWidget        *widget);
80 void   gtk_container_remove         (GtkContainer     *container,
81                                      GtkWidget        *widget);
82 void   gtk_container_disable_resize (GtkContainer     *container);
83 void   gtk_container_enable_resize  (GtkContainer     *container);
84 void   gtk_container_block_resize   (GtkContainer     *container);
85 void   gtk_container_unblock_resize (GtkContainer     *container);
86 gint   gtk_container_need_resize    (GtkContainer     *container);
87 void   gtk_container_foreach        (GtkContainer     *container,
88                                      GtkCallback       callback,
89                                      gpointer          callback_data);
90 void   gtk_container_foreach_interp (GtkContainer     *container,
91                                      GtkCallbackMarshal callback,
92                                      gpointer          callback_data,
93                                      GtkDestroyNotify  notify);
94 gint   gtk_container_focus          (GtkContainer     *container,
95                                      GtkDirectionType  direction);
96 GList* gtk_container_children       (GtkContainer     *container);
97
98
99 #ifdef __cplusplus
100 }
101 #endif /* __cplusplus */
102
103
104 #endif /* __GTK_CONTAINER_H__ */