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
34G_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
42typedef 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 */
60typedef 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 */
84typedef enum
85{
86 GTK_POLICY_ALWAYS,
87 GTK_POLICY_AUTOMATIC,
88 GTK_POLICY_NEVER,
89 GTK_POLICY_EXTERNAL
90} GtkPolicyType;
91
92
93GDK_AVAILABLE_IN_ALL
94GType gtk_scrolled_window_get_type (void) G_GNUC_CONST;
95GDK_AVAILABLE_IN_ALL
96GtkWidget* gtk_scrolled_window_new (void);
97GDK_AVAILABLE_IN_ALL
98void gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
99 GtkAdjustment *hadjustment);
100GDK_AVAILABLE_IN_ALL
101void gtk_scrolled_window_set_vadjustment (GtkScrolledWindow *scrolled_window,
102 GtkAdjustment *vadjustment);
103GDK_AVAILABLE_IN_ALL
104GtkAdjustment* gtk_scrolled_window_get_hadjustment (GtkScrolledWindow *scrolled_window);
105GDK_AVAILABLE_IN_ALL
106GtkAdjustment* gtk_scrolled_window_get_vadjustment (GtkScrolledWindow *scrolled_window);
107GDK_AVAILABLE_IN_ALL
108GtkWidget* gtk_scrolled_window_get_hscrollbar (GtkScrolledWindow *scrolled_window);
109GDK_AVAILABLE_IN_ALL
110GtkWidget* gtk_scrolled_window_get_vscrollbar (GtkScrolledWindow *scrolled_window);
111GDK_AVAILABLE_IN_ALL
112void gtk_scrolled_window_set_policy (GtkScrolledWindow *scrolled_window,
113 GtkPolicyType hscrollbar_policy,
114 GtkPolicyType vscrollbar_policy);
115GDK_AVAILABLE_IN_ALL
116void gtk_scrolled_window_get_policy (GtkScrolledWindow *scrolled_window,
117 GtkPolicyType *hscrollbar_policy,
118 GtkPolicyType *vscrollbar_policy);
119GDK_AVAILABLE_IN_ALL
120void gtk_scrolled_window_set_placement (GtkScrolledWindow *scrolled_window,
121 GtkCornerType window_placement);
122GDK_AVAILABLE_IN_ALL
123void gtk_scrolled_window_unset_placement (GtkScrolledWindow *scrolled_window);
124
125GDK_AVAILABLE_IN_ALL
126GtkCornerType gtk_scrolled_window_get_placement (GtkScrolledWindow *scrolled_window);
127GDK_AVAILABLE_IN_ALL
128void gtk_scrolled_window_set_has_frame (GtkScrolledWindow *scrolled_window,
129 gboolean has_frame);
130GDK_AVAILABLE_IN_ALL
131gboolean gtk_scrolled_window_get_has_frame (GtkScrolledWindow *scrolled_window);
132
133GDK_AVAILABLE_IN_ALL
134int gtk_scrolled_window_get_min_content_width (GtkScrolledWindow *scrolled_window);
135GDK_AVAILABLE_IN_ALL
136void gtk_scrolled_window_set_min_content_width (GtkScrolledWindow *scrolled_window,
137 int width);
138GDK_AVAILABLE_IN_ALL
139int gtk_scrolled_window_get_min_content_height (GtkScrolledWindow *scrolled_window);
140GDK_AVAILABLE_IN_ALL
141void gtk_scrolled_window_set_min_content_height (GtkScrolledWindow *scrolled_window,
142 int height);
143GDK_AVAILABLE_IN_ALL
144void gtk_scrolled_window_set_kinetic_scrolling (GtkScrolledWindow *scrolled_window,
145 gboolean kinetic_scrolling);
146GDK_AVAILABLE_IN_ALL
147gboolean gtk_scrolled_window_get_kinetic_scrolling (GtkScrolledWindow *scrolled_window);
148
149GDK_AVAILABLE_IN_ALL
150void gtk_scrolled_window_set_overlay_scrolling (GtkScrolledWindow *scrolled_window,
151 gboolean overlay_scrolling);
152GDK_AVAILABLE_IN_ALL
153gboolean gtk_scrolled_window_get_overlay_scrolling (GtkScrolledWindow *scrolled_window);
154
155GDK_AVAILABLE_IN_ALL
156void gtk_scrolled_window_set_max_content_width (GtkScrolledWindow *scrolled_window,
157 int width);
158GDK_AVAILABLE_IN_ALL
159int gtk_scrolled_window_get_max_content_width (GtkScrolledWindow *scrolled_window);
160
161GDK_AVAILABLE_IN_ALL
162void gtk_scrolled_window_set_max_content_height (GtkScrolledWindow *scrolled_window,
163 int height);
164GDK_AVAILABLE_IN_ALL
165int gtk_scrolled_window_get_max_content_height (GtkScrolledWindow *scrolled_window);
166
167GDK_AVAILABLE_IN_ALL
168void gtk_scrolled_window_set_propagate_natural_width (GtkScrolledWindow *scrolled_window,
169 gboolean propagate);
170GDK_AVAILABLE_IN_ALL
171gboolean gtk_scrolled_window_get_propagate_natural_width (GtkScrolledWindow *scrolled_window);
172
173GDK_AVAILABLE_IN_ALL
174void gtk_scrolled_window_set_propagate_natural_height (GtkScrolledWindow *scrolled_window,
175 gboolean propagate);
176GDK_AVAILABLE_IN_ALL
177gboolean gtk_scrolled_window_get_propagate_natural_height (GtkScrolledWindow *scrolled_window);
178
179GDK_AVAILABLE_IN_ALL
180void gtk_scrolled_window_set_child (GtkScrolledWindow *scrolled_window,
181 GtkWidget *child);
182GDK_AVAILABLE_IN_ALL
183GtkWidget *gtk_scrolled_window_get_child (GtkScrolledWindow *scrolled_window);
184
185G_END_DECLS
186
187
188#endif /* __GTK_SCROLLED_WINDOW_H__ */
189

source code of gtk/gtk/gtkscrolledwindow.h