1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
21 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
22 * file for a list of people on the GTK+ Team. See the ChangeLog
23 * files for a list of changes. These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
27 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
28 #error "Only <gtk/gtk.h> can be included directly."
31 #ifndef __GTK_RANGE_H__
32 #define __GTK_RANGE_H__
36 #include <gtk/gtkadjustment.h>
37 #include <gtk/gtkwidget.h>
43 #define GTK_TYPE_RANGE (gtk_range_get_type ())
44 #define GTK_RANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RANGE, GtkRange))
45 #define GTK_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RANGE, GtkRangeClass))
46 #define GTK_IS_RANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RANGE))
47 #define GTK_IS_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RANGE))
48 #define GTK_RANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RANGE, GtkRangeClass))
50 /* These two are private/opaque types, ignore */
51 typedef struct _GtkRangeLayout GtkRangeLayout;
52 typedef struct _GtkRangeStepTimer GtkRangeStepTimer;
54 typedef struct _GtkRange GtkRange;
55 typedef struct _GtkRangeClass GtkRangeClass;
61 GtkAdjustment *GSEAL (adjustment);
62 GtkUpdateType GSEAL (update_policy);
63 guint GSEAL (inverted) : 1;
67 guint GSEAL (flippable) : 1;
69 /* Steppers are: < > ---- < >
73 guint GSEAL (has_stepper_a) : 1;
74 guint GSEAL (has_stepper_b) : 1;
75 guint GSEAL (has_stepper_c) : 1;
76 guint GSEAL (has_stepper_d) : 1;
78 guint GSEAL (need_recalc) : 1;
80 guint GSEAL (slider_size_fixed) : 1;
82 gint GSEAL (min_slider_size);
84 GtkOrientation GSEAL (orientation);
86 /* Area of entire stepper + trough assembly in widget->window coords */
87 GdkRectangle GSEAL (range_rect);
88 /* Slider range along the long dimension, in widget->window coords */
89 gint GSEAL (slider_start);
90 gint GSEAL (slider_end);
92 /* Round off value to this many digits, -1 for no rounding */
93 gint GSEAL (round_digits);
96 guint GSEAL (trough_click_forward) : 1; /* trough click was on the forward side of slider */
97 guint GSEAL (update_pending) : 1; /* need to emit value_changed */
98 GtkRangeLayout *GSEAL (layout);
99 GtkRangeStepTimer *GSEAL (timer);
100 gint GSEAL (slide_initial_slider_position);
101 gint GSEAL (slide_initial_coordinate);
102 guint GSEAL (update_timeout_id);
103 GdkWindow *GSEAL (event_window);
106 struct _GtkRangeClass
108 GtkWidgetClass parent_class;
110 /* what detail to pass to GTK drawing functions */
111 gchar *slider_detail;
112 gchar *stepper_detail;
114 void (* value_changed) (GtkRange *range);
115 void (* adjust_bounds) (GtkRange *range,
118 /* action signals for keybindings */
119 void (* move_slider) (GtkRange *range,
120 GtkScrollType scroll);
122 /* Virtual functions */
123 void (* get_range_border) (GtkRange *range,
126 gboolean (* change_value) (GtkRange *range,
127 GtkScrollType scroll,
130 /* Padding for future expansion */
131 void (*_gtk_reserved1) (void);
132 void (*_gtk_reserved2) (void);
133 void (*_gtk_reserved3) (void);
137 GType gtk_range_get_type (void) G_GNUC_CONST;
139 void gtk_range_set_update_policy (GtkRange *range,
140 GtkUpdateType policy);
141 GtkUpdateType gtk_range_get_update_policy (GtkRange *range);
143 void gtk_range_set_adjustment (GtkRange *range,
144 GtkAdjustment *adjustment);
145 GtkAdjustment* gtk_range_get_adjustment (GtkRange *range);
147 void gtk_range_set_inverted (GtkRange *range,
149 gboolean gtk_range_get_inverted (GtkRange *range);
151 void gtk_range_set_lower_stepper_sensitivity (GtkRange *range,
152 GtkSensitivityType sensitivity);
153 GtkSensitivityType gtk_range_get_lower_stepper_sensitivity (GtkRange *range);
154 void gtk_range_set_upper_stepper_sensitivity (GtkRange *range,
155 GtkSensitivityType sensitivity);
156 GtkSensitivityType gtk_range_get_upper_stepper_sensitivity (GtkRange *range);
158 void gtk_range_set_increments (GtkRange *range,
161 void gtk_range_set_range (GtkRange *range,
164 void gtk_range_set_value (GtkRange *range,
166 gdouble gtk_range_get_value (GtkRange *range);
168 void gtk_range_set_show_fill_level (GtkRange *range,
169 gboolean show_fill_level);
170 gboolean gtk_range_get_show_fill_level (GtkRange *range);
171 void gtk_range_set_restrict_to_fill_level (GtkRange *range,
172 gboolean restrict_to_fill_level);
173 gboolean gtk_range_get_restrict_to_fill_level (GtkRange *range);
174 void gtk_range_set_fill_level (GtkRange *range,
176 gdouble gtk_range_get_fill_level (GtkRange *range);
178 gdouble _gtk_range_get_wheel_delta (GtkRange *range,
179 GdkScrollDirection direction);
185 #endif /* __GTK_RANGE_H__ */