]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - unix/gtkcols.h
first pass
[PuTTY.git] / unix / gtkcols.h
1 /*
2  * gtkcols.h - header file for a columns-based widget container
3  * capable of supporting the PuTTY portable dialog box layout
4  * mechanism.
5  */
6
7 #ifndef COLUMNS_H
8 #define COLUMNS_H
9
10 #include <gdk/gdk.h>
11 #include <gtk/gtk.h>
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif /* __cplusplus */
16
17 #define TYPE_COLUMNS (columns_get_type())
18 #define COLUMNS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), TYPE_COLUMNS, Columns))
19 #define COLUMNS_CLASS(klass)                                            \
20     (G_TYPE_CHECK_CLASS_CAST((klass), TYPE_COLUMNS, ColumnsClass))
21 #define IS_COLUMNS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), TYPE_COLUMNS))
22 #define IS_COLUMNS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), TYPE_COLUMNS))
23
24 typedef struct Columns_tag Columns;
25 typedef struct ColumnsClass_tag ColumnsClass;
26 typedef struct ColumnsChild_tag ColumnsChild;
27
28 struct Columns_tag {
29     GtkContainer container;
30     /* private after here */
31     GList *children;                   /* this holds ColumnsChild structures */
32     GList *taborder;                   /* this just holds GtkWidgets */
33     gint spacing;
34 };
35
36 struct ColumnsClass_tag {
37     GtkContainerClass parent_class;
38 };
39
40 struct ColumnsChild_tag {
41     /* If `widget' is non-NULL, this entry represents an actual widget. */
42     GtkWidget *widget;
43     gint colstart, colspan;
44     gboolean force_left;               /* for recalcitrant GtkLabels */
45     ColumnsChild *same_height_as;
46     /* Otherwise, this entry represents a change in the column setup. */
47     gint ncols;
48     gint *percentages;
49     gint x, y, w, h;           /* used during an individual size computation */
50 };
51
52 GType columns_get_type(void);
53 GtkWidget *columns_new(gint spacing);
54 void columns_set_cols(Columns *cols, gint ncols, const gint *percentages);
55 void columns_add(Columns *cols, GtkWidget *child,
56                  gint colstart, gint colspan);
57 void columns_taborder_last(Columns *cols, GtkWidget *child);
58 void columns_force_left_align(Columns *cols, GtkWidget *child);
59 void columns_force_same_height(Columns *cols, GtkWidget *ch1, GtkWidget *ch2);
60
61 #ifdef __cplusplus
62 }
63 #endif /* __cplusplus */
64
65 #endif /* COLUMNS_H */