]> Pileus Git - ~andy/gtk/blob - gtk/gtklayout.h
3f60f0bc6a88303c75ca7dfda1758bc075128808
[~andy/gtk] / gtk / gtklayout.h
1 /* Copyright Owen Taylor, 1998
2  * 
3  * This file may be distributed under either the terms of the
4  * Netscape Public License, or the GNU Library General Public License
5  *
6  * Note: No GTK+ or Mozilla code should be added to this file.
7  * The coding style should be that of the the GTK core.
8  */
9
10 #ifndef __GTK_LAYOUT_H
11 #define __GTK_LAYOUT_H
12
13 #include <gdk/gdk.h>
14 #include <gtk/gtkcontainer.h>
15 #include <gtk/gtkadjustment.h>
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
20
21 #define GTK_LAYOUT(obj)          GTK_CHECK_CAST (obj, gtk_layout_get_type (), GtkLayout)
22 #define GTK_LAYOUT_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_layout_get_type (), GtkLayoutClass)
23 #define GTK_IS_LAYOUT(obj)       GTK_CHECK_TYPE (obj, gtk_layout_get_type ())
24
25 typedef struct _GtkLayout        GtkLayout;
26 typedef struct _GtkLayoutClass   GtkLayoutClass;
27 typedef struct _GtkLayoutChild   GtkLayoutChild;
28
29 struct _GtkLayoutChild {
30   GtkWidget *widget;
31   GdkWindow *window;    /* For NO_WINDOW widgets */
32   gint x;
33   gint y;
34 };
35
36 struct _GtkLayout {
37   GtkContainer container;
38
39   GList *children;
40
41   guint width;
42   guint height;
43
44   guint xoffset;
45   guint yoffset;
46
47   GtkAdjustment *hadjustment;
48   GtkAdjustment *vadjustment;
49   
50   GdkWindow *bin_window;
51
52   GdkVisibilityState visibility;
53   gulong configure_serial;
54   gint scroll_x;
55   gint scroll_y;
56
57   guint frozen : 1;
58 };
59
60 struct _GtkLayoutClass {
61   GtkContainerClass parent_class;
62
63   void  (*scroll_adjustments)   (GtkLayout      *text,
64                                  GtkAdjustment  *hadjustment,
65                                  GtkAdjustment  *vadjustment);
66 };
67
68 GtkWidget*     gtk_layout_new             (GtkAdjustment *hadjustment,
69                                            GtkAdjustment *vadjustment);
70
71 guint          gtk_layout_get_type        (void);
72 void           gtk_layout_put             (GtkLayout     *layout, 
73                                            GtkWidget     *widget, 
74                                            gint           x, 
75                                            gint           y);
76   
77 void           gtk_layout_move            (GtkLayout     *layout, 
78                                            GtkWidget     *widget, 
79                                            gint           x, 
80                                            gint           y);
81   
82 void           gtk_layout_set_size        (GtkLayout     *layout, 
83                                            guint          width,
84                                            guint          height);
85
86 /* These disable and enable moving and repainting the scrolling window of the GtkLayout,
87  * respectively.  If you want to update the layout's offsets but do not want it to
88  * repaint itself, you should use these functions.
89  */
90 void           gtk_layout_freeze          (GtkLayout     *layout);
91 void           gtk_layout_thaw            (GtkLayout     *layout);
92
93 GtkAdjustment* gtk_layout_get_hadjustment (GtkLayout     *layout);
94 GtkAdjustment* gtk_layout_get_vadjustment (GtkLayout     *layout);
95 void           gtk_layout_set_hadjustment (GtkLayout     *layout,
96                                            GtkAdjustment *adjustment);
97 void           gtk_layout_set_vadjustment (GtkLayout     *layout,
98                                            GtkAdjustment *adjustment);
99
100 #ifdef __cplusplus
101 }
102 #endif /* __cplusplus */
103
104 #endif /* __GTK_LAYOUT_H */