Fixed wrong use of g_error()
[dia.git] / app / gtkwrapbox.h
blobde204449f23abad63290d56377efc088e72a916b
1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * GtkWrapBox: Wrapping box widget
5 * Copyright (C) 1999 Tim Janik
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.
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.
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.
23 #ifndef __GTK_WRAP_BOX_H__
24 #define __GTK_WRAP_BOX_H__
27 #include <gtk/gtkcontainer.h>
29 G_BEGIN_DECLS
32 /* --- type macros --- */
33 #define GTK_TYPE_WRAP_BOX (gtk_wrap_box_get_type ())
34 #define GTK_WRAP_BOX(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_WRAP_BOX, GtkWrapBox))
35 #define GTK_WRAP_BOX_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_WRAP_BOX, GtkWrapBoxClass))
36 #define GTK_IS_WRAP_BOX(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_WRAP_BOX))
37 #define GTK_IS_WRAP_BOX_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_WRAP_BOX))
38 #define GTK_WRAP_BOX_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_WRAP_BOX, GtkWrapBoxClass))
41 /* --- typedefs --- */
42 typedef struct _GtkWrapBox GtkWrapBox;
43 typedef struct _GtkWrapBoxClass GtkWrapBoxClass;
44 typedef struct _GtkWrapBoxChild GtkWrapBoxChild;
46 /* --- GtkWrapBox --- */
47 struct _GtkWrapBox
49 GtkContainer container;
51 guint homogeneous : 1;
52 guint justify : 4;
53 guint line_justify : 4;
54 guint8 hspacing;
55 guint8 vspacing;
56 guint16 n_children;
57 GtkWrapBoxChild *children;
58 gfloat aspect_ratio; /* 1/256..256 */
59 guint child_limit;
61 struct _GtkWrapBoxClass
63 GtkContainerClass parent_class;
65 GSList* (*rlist_line_children) (GtkWrapBox *wbox,
66 GtkWrapBoxChild **child_p,
67 GtkAllocation *area,
68 guint *max_child_size,
69 gboolean *expand_line);
71 struct _GtkWrapBoxChild
73 GtkWidget *widget;
74 guint hexpand : 1;
75 guint hfill : 1;
76 guint vexpand : 1;
77 guint vfill : 1;
78 guint wrapped : 1;
80 GtkWrapBoxChild *next;
82 #define GTK_JUSTIFY_TOP GTK_JUSTIFY_LEFT
83 #define GTK_JUSTIFY_BOTTOM GTK_JUSTIFY_RIGHT
86 /* --- prototypes --- */
87 GtkType gtk_wrap_box_get_type (void) G_GNUC_CONST;
88 void gtk_wrap_box_set_homogeneous (GtkWrapBox *wbox,
89 gboolean homogeneous);
90 void gtk_wrap_box_set_hspacing (GtkWrapBox *wbox,
91 guint hspacing);
92 void gtk_wrap_box_set_vspacing (GtkWrapBox *wbox,
93 guint vspacing);
94 void gtk_wrap_box_set_justify (GtkWrapBox *wbox,
95 GtkJustification justify);
96 void gtk_wrap_box_set_line_justify (GtkWrapBox *wbox,
97 GtkJustification line_justify);
98 void gtk_wrap_box_set_aspect_ratio (GtkWrapBox *wbox,
99 gfloat aspect_ratio);
100 void gtk_wrap_box_pack (GtkWrapBox *wbox,
101 GtkWidget *child,
102 gboolean hexpand,
103 gboolean hfill,
104 gboolean vexpand,
105 gboolean vfill);
106 void gtk_wrap_box_pack_wrapped (GtkWrapBox *wbox,
107 GtkWidget *child,
108 gboolean hexpand,
109 gboolean hfill,
110 gboolean vexpand,
111 gboolean vfill,
112 gboolean wrapped);
113 void gtk_wrap_box_reorder_child (GtkWrapBox *wbox,
114 GtkWidget *child,
115 gint position);
116 void gtk_wrap_box_query_child_packing (GtkWrapBox *wbox,
117 GtkWidget *child,
118 gboolean *hexpand,
119 gboolean *hfill,
120 gboolean *vexpand,
121 gboolean *vfill,
122 gboolean *wrapped);
123 void gtk_wrap_box_set_child_packing (GtkWrapBox *wbox,
124 GtkWidget *child,
125 gboolean hexpand,
126 gboolean hfill,
127 gboolean vexpand,
128 gboolean vfill,
129 gboolean wrapped);
130 guint* gtk_wrap_box_query_line_lengths (GtkWrapBox *wbox,
131 guint *n_lines);
134 G_END_DECLS
136 #endif /* __GTK_WRAP_BOX_H__ */