]> Pileus Git - ~andy/gtk/blob - gtk/gtkpacker.h
use more elaborate variable names.
[~andy/gtk] / gtk / gtkpacker.h
1 /* GTK - The GIMP Toolkit 
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 
3  * 
4  * GtkPacker Widget 
5  * Copyright (C) 1998 Shawn T. Amundson, James S. Mitchell, Michael L. Staiger
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 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
19  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
22
23 /*
24  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
25  * file for a list of people on the GTK+ Team.  See the ChangeLog
26  * files for a list of changes.  These files are distributed with
27  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
28  */
29
30 #ifndef GTK_DISABLE_DEPRECATED
31
32 #ifndef __GTK_PACKER_H__
33 #define __GTK_PACKER_H__
34
35 #include <gtk/gtkcontainer.h>
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40
41
42 #define GTK_TYPE_PACKER            (gtk_packer_get_type ())
43 #define GTK_PACKER(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_PACKER, GtkPacker))
44 #define GTK_PACKER_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PACKER, GtkPackerClass))
45 #define GTK_IS_PACKER(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_PACKER))
46 #define GTK_IS_PACKER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PACKER))
47 #define GTK_PACKER_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_PACKER, GtkPackerClass))
48
49
50 typedef struct _GtkPacker           GtkPacker;
51 typedef struct _GtkPackerClass      GtkPackerClass;
52 typedef struct _GtkPackerChild      GtkPackerChild;
53
54 typedef enum
55 {
56     GTK_PACK_EXPAND   = 1 << 0, /*< nick=expand >*/
57     GTK_FILL_X        = 1 << 1,
58     GTK_FILL_Y        = 1 << 2
59 } GtkPackerOptions;
60
61 typedef enum
62 {
63     GTK_SIDE_TOP,
64     GTK_SIDE_BOTTOM,
65     GTK_SIDE_LEFT,
66     GTK_SIDE_RIGHT
67 } GtkSideType;
68
69 typedef enum
70 {
71   GTK_ANCHOR_CENTER,
72   GTK_ANCHOR_NORTH,
73   GTK_ANCHOR_NORTH_WEST,
74   GTK_ANCHOR_NORTH_EAST,
75   GTK_ANCHOR_SOUTH,
76   GTK_ANCHOR_SOUTH_WEST,
77   GTK_ANCHOR_SOUTH_EAST,
78   GTK_ANCHOR_WEST,
79   GTK_ANCHOR_EAST,
80   GTK_ANCHOR_N  =       GTK_ANCHOR_NORTH,
81   GTK_ANCHOR_NW =       GTK_ANCHOR_NORTH_WEST,
82   GTK_ANCHOR_NE =       GTK_ANCHOR_NORTH_EAST,
83   GTK_ANCHOR_S  =       GTK_ANCHOR_SOUTH,
84   GTK_ANCHOR_SW =       GTK_ANCHOR_SOUTH_WEST,
85   GTK_ANCHOR_SE =       GTK_ANCHOR_SOUTH_EAST,
86   GTK_ANCHOR_W  =       GTK_ANCHOR_WEST,
87   GTK_ANCHOR_E  =       GTK_ANCHOR_EAST
88 } GtkAnchorType;
89
90 struct _GtkPackerChild
91 {
92   GtkWidget *widget;
93   
94   GtkAnchorType anchor;
95   GtkSideType side;
96   GtkPackerOptions options;
97   
98   guint use_default : 1;
99   
100   guint border_width : 16;
101   guint pad_x : 16;
102   guint pad_y : 16;
103   guint i_pad_x : 16;
104   guint i_pad_y : 16;
105 };
106
107 struct _GtkPacker
108 {
109   GtkContainer parent;
110   
111   GList *children;
112   
113   guint spacing;
114   
115   guint default_border_width : 16;
116   guint default_pad_x : 16;
117   guint default_pad_y : 16;
118   guint default_i_pad_x : 16;
119   guint default_i_pad_y : 16;
120 };
121
122 struct _GtkPackerClass
123 {
124   GtkContainerClass parent_class;
125 };
126
127
128 GtkType    gtk_packer_get_type                 (void) G_GNUC_CONST;
129 GtkWidget* gtk_packer_new                      (void);
130 void       gtk_packer_add_defaults             (GtkPacker       *packer, 
131                                                 GtkWidget       *child,
132                                                 GtkSideType      side,
133                                                 GtkAnchorType    anchor,
134                                                 GtkPackerOptions options);
135 void       gtk_packer_add                      (GtkPacker       *packer, 
136                                                 GtkWidget       *child,
137                                                 GtkSideType      side,
138                                                 GtkAnchorType    anchor,
139                                                 GtkPackerOptions options,
140                                                 guint            border_width, 
141                                                 guint            pad_x, 
142                                                 guint            pad_y,
143                                                 guint            i_pad_x,
144                                                 guint            i_pad_y);
145 void       gtk_packer_set_child_packing        (GtkPacker       *packer, 
146                                                 GtkWidget       *child,
147                                                 GtkSideType      side,
148                                                 GtkAnchorType    anchor,
149                                                 GtkPackerOptions options,
150                                                 guint            border_width, 
151                                                 guint            pad_x, 
152                                                 guint            pad_y,
153                                                 guint            i_pad_x,
154                                                 guint            i_pad_y);
155 void       gtk_packer_reorder_child            (GtkPacker       *packer,
156                                                 GtkWidget       *child,
157                                                 gint             position);
158 void       gtk_packer_set_spacing              (GtkPacker       *packer,
159                                                 guint            spacing);
160 void       gtk_packer_set_default_border_width (GtkPacker       *packer,
161                                                 guint            border);
162 void       gtk_packer_set_default_pad          (GtkPacker       *packer,
163                                                 guint             pad_x,
164                                                 guint             pad_y);
165 void       gtk_packer_set_default_ipad         (GtkPacker       *packer,
166                                                 guint            i_pad_x,
167                                                 guint            i_pad_y);
168
169
170 #ifdef __cplusplus
171 }
172 #endif /* __cplusplus */
173
174
175 #endif /* __GTK_PACKER_H__ */
176
177 #endif /* GTK_DISABLE_DEPRECATED */