]> Pileus Git - ~andy/gtk/blob - gtk/gtklayout.h
68bb43cb3aae9dd06dd7d054bc8039ead1ba4803
[~andy/gtk] / gtk / gtklayout.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  *
19  * GtkLayout: Widget for scrolling of arbitrary-sized areas.
20  *
21  * Copyright Owen Taylor, 1998
22  */
23
24 /*
25  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
26  * file for a list of people on the GTK+ Team.  See the ChangeLog
27  * files for a list of changes.  These files are distributed with
28  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
29  */
30
31 #ifndef __GTK_LAYOUT_H
32 #define __GTK_LAYOUT_H
33
34 #include <gdk/gdk.h>
35 #include <gtk/gtkcontainer.h>
36 #include <gtk/gtkadjustment.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41
42
43 #define GTK_TYPE_LAYOUT            (gtk_layout_get_type ())
44 #define GTK_LAYOUT(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_LAYOUT, GtkLayout))
45 #define GTK_LAYOUT_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LAYOUT, GtkLayoutClass))
46 #define GTK_IS_LAYOUT(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_LAYOUT))
47 #define GTK_IS_LAYOUT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LAYOUT))
48 #define GTK_LAYOUT_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_LAYOUT, GtkLayoutClass))
49
50
51 typedef struct _GtkLayout        GtkLayout;
52 typedef struct _GtkLayoutClass   GtkLayoutClass;
53
54 struct _GtkLayout {
55   GtkContainer container;
56
57   GList *children;
58
59   guint width;
60   guint height;
61
62   guint xoffset;
63   guint yoffset;
64
65   GtkAdjustment *hadjustment;
66   GtkAdjustment *vadjustment;
67
68   /*< public >*/
69   GdkWindow *bin_window;
70
71   /*< private >*/
72   GdkVisibilityState visibility;
73   gint scroll_x;
74   gint scroll_y;
75
76   guint freeze_count;
77 };
78
79 struct _GtkLayoutClass {
80   GtkContainerClass parent_class;
81
82   void  (*set_scroll_adjustments)   (GtkLayout      *layout,
83                                      GtkAdjustment  *hadjustment,
84                                      GtkAdjustment  *vadjustment);
85 };
86
87 GtkType        gtk_layout_get_type        (void) G_GNUC_CONST;
88 GtkWidget*     gtk_layout_new             (GtkAdjustment *hadjustment,
89                                            GtkAdjustment *vadjustment);
90 void           gtk_layout_put             (GtkLayout     *layout, 
91                                            GtkWidget     *child_widget, 
92                                            gint           x, 
93                                            gint           y);
94   
95 void           gtk_layout_move            (GtkLayout     *layout, 
96                                            GtkWidget     *child_widget, 
97                                            gint           x, 
98                                            gint           y);
99   
100 void           gtk_layout_set_size        (GtkLayout     *layout, 
101                                            guint          width,
102                                            guint          height);
103 void           gtk_layout_get_size        (GtkLayout     *layout,
104                                            guint         *width,
105                                            guint         *height);
106
107 GtkAdjustment* gtk_layout_get_hadjustment (GtkLayout     *layout);
108 GtkAdjustment* gtk_layout_get_vadjustment (GtkLayout     *layout);
109 void           gtk_layout_set_hadjustment (GtkLayout     *layout,
110                                            GtkAdjustment *adjustment);
111 void           gtk_layout_set_vadjustment (GtkLayout     *layout,
112                                            GtkAdjustment *adjustment);
113
114
115 #ifndef GTK_DISABLE_DEPRECATED
116 /* These disable and enable moving and repainting the scrolling window
117  * of the GtkLayout, respectively.  If you want to update the layout's
118  * offsets but do not want it to repaint itself, you should use these
119  * functions.
120  *
121  * - I don't understand these are supposed to work, so I suspect
122  * - they don't now.                    OWT 1/20/98
123  */
124 void           gtk_layout_freeze          (GtkLayout     *layout);
125 void           gtk_layout_thaw            (GtkLayout     *layout);
126 #endif /* GTK_DISABLE_DEPRECATED */
127
128 #ifdef __cplusplus
129 }
130 #endif /* __cplusplus */
131
132 #endif /* __GTK_LAYOUT_H */