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, see <http://www.gnu.org/licenses/>. |
16 | */ |
17 | |
18 | /* |
19 | * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS |
20 | * file for a list of people on the GTK+ Team. See the ChangeLog |
21 | * files for a list of changes. These files are distributed with |
22 | * GTK+ at ftp://ftp.gtk.org/pub/gtk/. |
23 | */ |
24 | |
25 | #ifndef __GTK_SCROLLED_WINDOW_H__ |
26 | #define __GTK_SCROLLED_WINDOW_H__ |
27 | |
28 | #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) |
29 | #error "Only <gtk/gtk.h> can be included directly." |
30 | #endif |
31 | |
32 | #include <gtk/gtkwidget.h> |
33 | |
34 | G_BEGIN_DECLS |
35 | |
36 | |
37 | #define GTK_TYPE_SCROLLED_WINDOW (gtk_scrolled_window_get_type ()) |
38 | #define GTK_SCROLLED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_SCROLLED_WINDOW, GtkScrolledWindow)) |
39 | #define GTK_IS_SCROLLED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_SCROLLED_WINDOW)) |
40 | |
41 | |
42 | typedef struct _GtkScrolledWindow GtkScrolledWindow; |
43 | |
44 | /** |
45 | * GtkCornerType: |
46 | * @GTK_CORNER_TOP_LEFT: Place the scrollbars on the right and bottom of the |
47 | * widget (default behaviour). |
48 | * @GTK_CORNER_BOTTOM_LEFT: Place the scrollbars on the top and right of the |
49 | * widget. |
50 | * @GTK_CORNER_TOP_RIGHT: Place the scrollbars on the left and bottom of the |
51 | * widget. |
52 | * @GTK_CORNER_BOTTOM_RIGHT: Place the scrollbars on the top and left of the |
53 | * widget. |
54 | * |
55 | * Specifies which corner a child widget should be placed in when packed into |
56 | * a `GtkScrolledWindow.` |
57 | * |
58 | * This is effectively the opposite of where the scroll bars are placed. |
59 | */ |
60 | typedef enum |
61 | { |
62 | GTK_CORNER_TOP_LEFT, |
63 | GTK_CORNER_BOTTOM_LEFT, |
64 | GTK_CORNER_TOP_RIGHT, |
65 | GTK_CORNER_BOTTOM_RIGHT |
66 | } GtkCornerType; |
67 | |
68 | |
69 | /** |
70 | * GtkPolicyType: |
71 | * @GTK_POLICY_ALWAYS: The scrollbar is always visible. The view size is |
72 | * independent of the content. |
73 | * @GTK_POLICY_AUTOMATIC: The scrollbar will appear and disappear as necessary. |
74 | * For example, when all of a `GtkTreeView` can not be seen. |
75 | * @GTK_POLICY_NEVER: The scrollbar should never appear. In this mode the |
76 | * content determines the size. |
77 | * @GTK_POLICY_EXTERNAL: Don't show a scrollbar, but don't force the |
78 | * size to follow the content. This can be used e.g. to make multiple |
79 | * scrolled windows share a scrollbar. |
80 | * |
81 | * Determines how the size should be computed to achieve the one of the |
82 | * visibility mode for the scrollbars. |
83 | */ |
84 | typedef enum |
85 | { |
86 | GTK_POLICY_ALWAYS, |
87 | GTK_POLICY_AUTOMATIC, |
88 | GTK_POLICY_NEVER, |
89 | GTK_POLICY_EXTERNAL |
90 | } GtkPolicyType; |
91 | |
92 | |
93 | GDK_AVAILABLE_IN_ALL |
94 | GType gtk_scrolled_window_get_type (void) G_GNUC_CONST; |
95 | GDK_AVAILABLE_IN_ALL |
96 | GtkWidget* gtk_scrolled_window_new (void); |
97 | GDK_AVAILABLE_IN_ALL |
98 | void gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window, |
99 | GtkAdjustment *hadjustment); |
100 | GDK_AVAILABLE_IN_ALL |
101 | void gtk_scrolled_window_set_vadjustment (GtkScrolledWindow *scrolled_window, |
102 | GtkAdjustment *vadjustment); |
103 | GDK_AVAILABLE_IN_ALL |
104 | GtkAdjustment* gtk_scrolled_window_get_hadjustment (GtkScrolledWindow *scrolled_window); |
105 | GDK_AVAILABLE_IN_ALL |
106 | GtkAdjustment* gtk_scrolled_window_get_vadjustment (GtkScrolledWindow *scrolled_window); |
107 | GDK_AVAILABLE_IN_ALL |
108 | GtkWidget* gtk_scrolled_window_get_hscrollbar (GtkScrolledWindow *scrolled_window); |
109 | GDK_AVAILABLE_IN_ALL |
110 | GtkWidget* gtk_scrolled_window_get_vscrollbar (GtkScrolledWindow *scrolled_window); |
111 | GDK_AVAILABLE_IN_ALL |
112 | void gtk_scrolled_window_set_policy (GtkScrolledWindow *scrolled_window, |
113 | GtkPolicyType hscrollbar_policy, |
114 | GtkPolicyType vscrollbar_policy); |
115 | GDK_AVAILABLE_IN_ALL |
116 | void gtk_scrolled_window_get_policy (GtkScrolledWindow *scrolled_window, |
117 | GtkPolicyType *hscrollbar_policy, |
118 | GtkPolicyType *vscrollbar_policy); |
119 | GDK_AVAILABLE_IN_ALL |
120 | void gtk_scrolled_window_set_placement (GtkScrolledWindow *scrolled_window, |
121 | GtkCornerType window_placement); |
122 | GDK_AVAILABLE_IN_ALL |
123 | void gtk_scrolled_window_unset_placement (GtkScrolledWindow *scrolled_window); |
124 | |
125 | GDK_AVAILABLE_IN_ALL |
126 | GtkCornerType gtk_scrolled_window_get_placement (GtkScrolledWindow *scrolled_window); |
127 | GDK_AVAILABLE_IN_ALL |
128 | void gtk_scrolled_window_set_has_frame (GtkScrolledWindow *scrolled_window, |
129 | gboolean has_frame); |
130 | GDK_AVAILABLE_IN_ALL |
131 | gboolean gtk_scrolled_window_get_has_frame (GtkScrolledWindow *scrolled_window); |
132 | |
133 | GDK_AVAILABLE_IN_ALL |
134 | int gtk_scrolled_window_get_min_content_width (GtkScrolledWindow *scrolled_window); |
135 | GDK_AVAILABLE_IN_ALL |
136 | void gtk_scrolled_window_set_min_content_width (GtkScrolledWindow *scrolled_window, |
137 | int width); |
138 | GDK_AVAILABLE_IN_ALL |
139 | int gtk_scrolled_window_get_min_content_height (GtkScrolledWindow *scrolled_window); |
140 | GDK_AVAILABLE_IN_ALL |
141 | void gtk_scrolled_window_set_min_content_height (GtkScrolledWindow *scrolled_window, |
142 | int height); |
143 | GDK_AVAILABLE_IN_ALL |
144 | void gtk_scrolled_window_set_kinetic_scrolling (GtkScrolledWindow *scrolled_window, |
145 | gboolean kinetic_scrolling); |
146 | GDK_AVAILABLE_IN_ALL |
147 | gboolean gtk_scrolled_window_get_kinetic_scrolling (GtkScrolledWindow *scrolled_window); |
148 | |
149 | GDK_AVAILABLE_IN_ALL |
150 | void gtk_scrolled_window_set_overlay_scrolling (GtkScrolledWindow *scrolled_window, |
151 | gboolean overlay_scrolling); |
152 | GDK_AVAILABLE_IN_ALL |
153 | gboolean gtk_scrolled_window_get_overlay_scrolling (GtkScrolledWindow *scrolled_window); |
154 | |
155 | GDK_AVAILABLE_IN_ALL |
156 | void gtk_scrolled_window_set_max_content_width (GtkScrolledWindow *scrolled_window, |
157 | int width); |
158 | GDK_AVAILABLE_IN_ALL |
159 | int gtk_scrolled_window_get_max_content_width (GtkScrolledWindow *scrolled_window); |
160 | |
161 | GDK_AVAILABLE_IN_ALL |
162 | void gtk_scrolled_window_set_max_content_height (GtkScrolledWindow *scrolled_window, |
163 | int height); |
164 | GDK_AVAILABLE_IN_ALL |
165 | int gtk_scrolled_window_get_max_content_height (GtkScrolledWindow *scrolled_window); |
166 | |
167 | GDK_AVAILABLE_IN_ALL |
168 | void gtk_scrolled_window_set_propagate_natural_width (GtkScrolledWindow *scrolled_window, |
169 | gboolean propagate); |
170 | GDK_AVAILABLE_IN_ALL |
171 | gboolean gtk_scrolled_window_get_propagate_natural_width (GtkScrolledWindow *scrolled_window); |
172 | |
173 | GDK_AVAILABLE_IN_ALL |
174 | void gtk_scrolled_window_set_propagate_natural_height (GtkScrolledWindow *scrolled_window, |
175 | gboolean propagate); |
176 | GDK_AVAILABLE_IN_ALL |
177 | gboolean gtk_scrolled_window_get_propagate_natural_height (GtkScrolledWindow *scrolled_window); |
178 | |
179 | GDK_AVAILABLE_IN_ALL |
180 | void gtk_scrolled_window_set_child (GtkScrolledWindow *scrolled_window, |
181 | GtkWidget *child); |
182 | GDK_AVAILABLE_IN_ALL |
183 | GtkWidget *gtk_scrolled_window_get_child (GtkScrolledWindow *scrolled_window); |
184 | |
185 | G_END_DECLS |
186 | |
187 | |
188 | #endif /* __GTK_SCROLLED_WINDOW_H__ */ |
189 | |