2 * Copyright 2008 Department of Mathematical Sciences, New Mexico State University
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * DEPARTMENT OF MATHEMATICAL SCIENCES OR NEW MEXICO STATE UNIVERSITY BE
18 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 #include <gtk/gtkcontainer.h>
26 #include "gtkcompat.h"
31 * The LabCon (Labeled Container) widget. Created to provide a container
32 * that contains a label and a single child, and can be part of a group
33 * of other LabCon widgets. All members of the group have the same label
34 * width. The labels will be on the left or the right side of the child
35 * widget and can be aligned to the right, left, or center.
39 (G_TYPE_CHECK_INSTANCE_CAST(obj, labcon_get_type(), LabCon))
40 #define LABCON_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_CAST(klass, labcon_get_type(), LabConClass))
43 #define IS_LABCON(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE(obj, labcon_get_type()))
45 #define IS_LABCON_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_TYPE(klass, labcon_get_type()))
48 #define LABCON_GET_CLASS(obj) \
49 (G_TYPE_INSTANCE_GET_CLASS(obj, labcon_get_type(), LabConClass))
51 typedef struct _LabCon LabCon;
52 typedef struct _LabConClass LabConClass;
61 GtkContainer container;
68 * The pixbuf that will be shown as the image instead of a label.
70 const GdkPixbuf *pixbuf;
73 * Spacing between the label and the child widget.
80 LabConAlignment align;
83 * Label positioning (GTK_POS_LEFT or GTK_POS_RIGHT).
88 * The current width all labels should be.
93 * All the widgets that should have the same width labels.
101 struct _LabConClass {
102 GtkContainerClass parent_class;
105 /**********************************************************************
109 **********************************************************************/
111 extern GType labcon_get_type(void);
113 extern GtkWidget *labcon_new_label(const gchar *label, LabConAlignment align,
114 GtkPositionType pos, guint spacing,
115 GtkWidget *child, GtkWidget *group);
117 extern GtkWidget *labcon_new_label_defaults(const gchar *label,
121 extern GtkWidget *labcon_new_pixbuf(const GdkPixbuf *pixbuf,
122 LabConAlignment align,
128 extern GtkWidget *labcon_new_pixbuf_defaults(const GdkPixbuf *pixbuf,
132 extern const GdkPixbuf *labcon_get_pixbuf(LabCon *l);
133 extern GtkWidget *labcon_get_image(LabCon *l);
134 extern GtkWidget *labcon_get_label(LabCon *l);
135 extern GtkWidget *labcon_get_child(LabCon *l);
139 #endif /* _h_labcon */