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 Library 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 | * Library General Public License for more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU Library 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-1999. 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_PACKER_H__ |
---|
31 | #define __GTK_PACKER_H__ |
---|
32 | |
---|
33 | #include <gtk/gtkcontainer.h> |
---|
34 | |
---|
35 | #ifdef __cplusplus |
---|
36 | extern "C" { |
---|
37 | #endif /* __cplusplus */ |
---|
38 | |
---|
39 | |
---|
40 | #define GTK_TYPE_PACKER (gtk_packer_get_type ()) |
---|
41 | #define GTK_PACKER(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_PACKER, GtkPacker)) |
---|
42 | #define GTK_PACKER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_PACKER, GtkPackerClass)) |
---|
43 | #define GTK_IS_PACKER(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_PACKER)) |
---|
44 | #define GTK_IS_PACKER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PACKER)) |
---|
45 | |
---|
46 | |
---|
47 | |
---|
48 | typedef struct _GtkPacker GtkPacker; |
---|
49 | typedef struct _GtkPackerClass GtkPackerClass; |
---|
50 | typedef struct _GtkPackerChild GtkPackerChild; |
---|
51 | |
---|
52 | typedef enum |
---|
53 | { |
---|
54 | GTK_PACK_EXPAND = 1 << 0, /*< nick=expand >*/ |
---|
55 | GTK_FILL_X = 1 << 1, |
---|
56 | GTK_FILL_Y = 1 << 2 |
---|
57 | } GtkPackerOptions; |
---|
58 | |
---|
59 | typedef enum |
---|
60 | { |
---|
61 | GTK_SIDE_TOP, |
---|
62 | GTK_SIDE_BOTTOM, |
---|
63 | GTK_SIDE_LEFT, |
---|
64 | GTK_SIDE_RIGHT |
---|
65 | } GtkSideType; |
---|
66 | |
---|
67 | typedef enum |
---|
68 | { |
---|
69 | GTK_ANCHOR_CENTER, |
---|
70 | GTK_ANCHOR_NORTH, |
---|
71 | GTK_ANCHOR_NORTH_WEST, |
---|
72 | GTK_ANCHOR_NORTH_EAST, |
---|
73 | GTK_ANCHOR_SOUTH, |
---|
74 | GTK_ANCHOR_SOUTH_WEST, |
---|
75 | GTK_ANCHOR_SOUTH_EAST, |
---|
76 | GTK_ANCHOR_WEST, |
---|
77 | GTK_ANCHOR_EAST, |
---|
78 | GTK_ANCHOR_N = GTK_ANCHOR_NORTH, |
---|
79 | GTK_ANCHOR_NW = GTK_ANCHOR_NORTH_WEST, |
---|
80 | GTK_ANCHOR_NE = GTK_ANCHOR_NORTH_EAST, |
---|
81 | GTK_ANCHOR_S = GTK_ANCHOR_SOUTH, |
---|
82 | GTK_ANCHOR_SW = GTK_ANCHOR_SOUTH_WEST, |
---|
83 | GTK_ANCHOR_SE = GTK_ANCHOR_SOUTH_EAST, |
---|
84 | GTK_ANCHOR_W = GTK_ANCHOR_WEST, |
---|
85 | GTK_ANCHOR_E = GTK_ANCHOR_EAST |
---|
86 | } GtkAnchorType; |
---|
87 | |
---|
88 | struct _GtkPackerChild |
---|
89 | { |
---|
90 | GtkWidget *widget; |
---|
91 | |
---|
92 | GtkAnchorType anchor; |
---|
93 | GtkSideType side; |
---|
94 | GtkPackerOptions options; |
---|
95 | |
---|
96 | guint use_default : 1; |
---|
97 | |
---|
98 | guint border_width : 16; |
---|
99 | guint pad_x : 16; |
---|
100 | guint pad_y : 16; |
---|
101 | guint i_pad_x : 16; |
---|
102 | guint i_pad_y : 16; |
---|
103 | }; |
---|
104 | |
---|
105 | struct _GtkPacker |
---|
106 | { |
---|
107 | GtkContainer parent; |
---|
108 | |
---|
109 | GList *children; |
---|
110 | |
---|
111 | guint spacing; |
---|
112 | |
---|
113 | guint default_border_width : 16; |
---|
114 | guint default_pad_x : 16; |
---|
115 | guint default_pad_y : 16; |
---|
116 | guint default_i_pad_x : 16; |
---|
117 | guint default_i_pad_y : 16; |
---|
118 | }; |
---|
119 | |
---|
120 | struct _GtkPackerClass |
---|
121 | { |
---|
122 | GtkContainerClass parent_class; |
---|
123 | }; |
---|
124 | |
---|
125 | |
---|
126 | GtkType gtk_packer_get_type (void); |
---|
127 | GtkWidget* gtk_packer_new (void); |
---|
128 | void gtk_packer_add_defaults (GtkPacker *packer, |
---|
129 | GtkWidget *child, |
---|
130 | GtkSideType side, |
---|
131 | GtkAnchorType anchor, |
---|
132 | GtkPackerOptions options); |
---|
133 | void gtk_packer_add (GtkPacker *packer, |
---|
134 | GtkWidget *child, |
---|
135 | GtkSideType side, |
---|
136 | GtkAnchorType anchor, |
---|
137 | GtkPackerOptions options, |
---|
138 | guint border_width, |
---|
139 | guint pad_x, |
---|
140 | guint pad_y, |
---|
141 | guint i_pad_x, |
---|
142 | guint i_pad_y); |
---|
143 | void gtk_packer_set_child_packing (GtkPacker *packer, |
---|
144 | GtkWidget *child, |
---|
145 | GtkSideType side, |
---|
146 | GtkAnchorType anchor, |
---|
147 | GtkPackerOptions options, |
---|
148 | guint border_width, |
---|
149 | guint pad_x, |
---|
150 | guint pad_y, |
---|
151 | guint i_pad_x, |
---|
152 | guint i_pad_y); |
---|
153 | void gtk_packer_reorder_child (GtkPacker *packer, |
---|
154 | GtkWidget *child, |
---|
155 | gint position); |
---|
156 | void gtk_packer_set_spacing (GtkPacker *packer, |
---|
157 | guint spacing); |
---|
158 | void gtk_packer_set_default_border_width (GtkPacker *packer, |
---|
159 | guint border); |
---|
160 | void gtk_packer_set_default_pad (GtkPacker *packer, |
---|
161 | guint pad_x, |
---|
162 | guint pad_y); |
---|
163 | void gtk_packer_set_default_ipad (GtkPacker *packer, |
---|
164 | guint i_pad_x, |
---|
165 | guint i_pad_y); |
---|
166 | |
---|
167 | |
---|
168 | #ifdef __cplusplus |
---|
169 | } |
---|
170 | #endif /* __cplusplus */ |
---|
171 | |
---|
172 | |
---|
173 | #endif /* __GTK_PACKER_H__ */ |
---|