]> Pileus Git - ~andy/gtk/blob - gtk/gtkcontainer.h
made the object/class cast checks much more descriptive, based on
[~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
47   gint16 border_width;
48   guint auto_resize : 1;
49   guint need_resize : 1;
50   guint block_resize : 1;
51
52
53   /* The list of children that requested a resize
54    */
55   GSList *resize_widgets;
56 };
57
58 struct _GtkContainerClass
59 {
60   GtkWidgetClass parent_class;
61
62   void (* add)         (GtkContainer     *container,
63                         GtkWidget        *widget);
64   void (* remove)      (GtkContainer     *container,
65                         GtkWidget        *widget);
66   gint (* need_resize) (GtkContainer     *container);
67   void (* foreach)     (GtkContainer     *container,
68                         GtkCallback       callback,
69                         gpointer          callbabck_data);
70   gint (* focus)       (GtkContainer     *container,
71                         GtkDirectionType  direction);
72 };
73
74
75
76 guint  gtk_container_get_type            (void);
77 void   gtk_container_border_width        (GtkContainer     *container,
78                                           gint              border_width);
79 void   gtk_container_add                 (GtkContainer     *container,
80                                           GtkWidget        *widget);
81 void   gtk_container_remove              (GtkContainer     *container,
82                                           GtkWidget        *widget);
83 void   gtk_container_disable_resize      (GtkContainer     *container);
84 void   gtk_container_enable_resize       (GtkContainer     *container);
85 void   gtk_container_block_resize        (GtkContainer     *container);
86 void   gtk_container_unblock_resize      (GtkContainer     *container);
87 gint   gtk_container_need_resize         (GtkContainer     *container);
88 void   gtk_container_foreach             (GtkContainer     *container,
89                                           GtkCallback       callback,
90                                           gpointer          callback_data);
91 void   gtk_container_foreach_interp      (GtkContainer     *container,
92                                           GtkCallbackMarshal marshal,
93                                           gpointer          callback_data,
94                                           GtkDestroyNotify  notify);
95 void   gtk_container_foreach_full        (GtkContainer     *container,
96                                           GtkCallback       callback,
97                                           GtkCallbackMarshal marshal,
98                                           gpointer          callback_data,
99                                           GtkDestroyNotify  notify);
100 gint   gtk_container_focus               (GtkContainer     *container,
101                                           GtkDirectionType  direction);
102 GList* gtk_container_children            (GtkContainer     *container);
103
104 void   gtk_container_register_toplevel   (GtkContainer     *container);
105 void   gtk_container_unregister_toplevel (GtkContainer     *container);
106      
107
108 #ifdef __cplusplus
109 }
110 #endif /* __cplusplus */
111
112
113 #endif /* __GTK_CONTAINER_H__ */