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__
35 #include <gtk/gtkadjustment.h>
36 #include <gtk/gtkwidget.h>
42 #define GTK_TYPE_RANGE (gtk_range_get_type ())
43 #define GTK_RANGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RANGE, GtkRange))
44 #define GTK_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RANGE, GtkRangeClass))
45 #define GTK_IS_RANGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RANGE))
46 #define GTK_IS_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RANGE))
47 #define GTK_RANGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RANGE, GtkRangeClass))
49 /* These two are private/opaque types, ignore */
50 typedef struct _GtkRangeLayout GtkRangeLayout;
51 typedef struct _GtkRangeStepTimer GtkRangeStepTimer;
53 typedef struct _GtkRange GtkRange;
54 typedef struct _GtkRangeClass GtkRangeClass;
60 GtkAdjustment *GSEAL (adjustment);
61 GtkUpdateType GSEAL (update_policy);
62 guint GSEAL (inverted) : 1;
66 guint GSEAL (flippable) : 1;
68 /* Steppers are: < > ---- < >
72 guint GSEAL (has_stepper_a) : 1;
73 guint GSEAL (has_stepper_b) : 1;
74 guint GSEAL (has_stepper_c) : 1;
75 guint GSEAL (has_stepper_d) : 1;
77 guint GSEAL (need_recalc) : 1;
79 guint GSEAL (slider_size_fixed) : 1;
81 gint GSEAL (min_slider_size);
83 GtkOrientation GSEAL (orientation);
85 /* Area of entire stepper + trough assembly in widget->window coords */
86 GdkRectangle GSEAL (range_rect);
87 /* Slider range along the long dimension, in widget->window coords */
88 gint GSEAL (slider_start);
89 gint GSEAL (slider_end);
91 /* Round off value to this many digits, -1 for no rounding */
92 gint GSEAL (round_digits);
95 guint GSEAL (trough_click_forward) : 1; /* trough click was on the forward side of slider */
96 guint GSEAL (update_pending) : 1; /* need to emit value_changed */
97 GtkRangeLayout *GSEAL (layout);
98 GtkRangeStepTimer *GSEAL (timer);
99 gint GSEAL (slide_initial_slider_position);
100 gint GSEAL (slide_initial_coordinate);
101 guint GSEAL (update_timeout_id);
102 GdkWindow *GSEAL (event_window);
105 struct _GtkRangeClass
107 GtkWidgetClass parent_class;
109 /* what detail to pass to GTK drawing functions */
110 gchar *slider_detail;
111 gchar *stepper_detail;
113 void (* value_changed) (GtkRange *range);
114 void (* adjust_bounds) (GtkRange *range,
117 /* action signals for keybindings */
118 void (* move_slider) (GtkRange *range,
119 GtkScrollType scroll);
121 /* Virtual functions */
122 void (* get_range_border) (GtkRange *range,
125 gboolean (* change_value) (GtkRange *range,
126 GtkScrollType scroll,
129 /* Padding for future expansion */
130 void (*_gtk_reserved1) (void);
131 void (*_gtk_reserved2) (void);
132 void (*_gtk_reserved3) (void);
136 GType gtk_range_get_type (void) G_GNUC_CONST;
138 void gtk_range_set_update_policy (GtkRange *range,
139 GtkUpdateType policy);
140 GtkUpdateType gtk_range_get_update_policy (GtkRange *range);
142 void gtk_range_set_adjustment (GtkRange *range,
143 GtkAdjustment *adjustment);
144 GtkAdjustment* gtk_range_get_adjustment (GtkRange *range);
146 void gtk_range_set_inverted (GtkRange *range,
148 gboolean gtk_range_get_inverted (GtkRange *range);
150 void gtk_range_set_flippable (GtkRange *range,
152 gboolean gtk_range_get_flippable (GtkRange *range);
154 void gtk_range_set_lower_stepper_sensitivity (GtkRange *range,
155 GtkSensitivityType sensitivity);
156 GtkSensitivityType gtk_range_get_lower_stepper_sensitivity (GtkRange *range);
157 void gtk_range_set_upper_stepper_sensitivity (GtkRange *range,
158 GtkSensitivityType sensitivity);
159 GtkSensitivityType gtk_range_get_upper_stepper_sensitivity (GtkRange *range);
161 void gtk_range_set_increments (GtkRange *range,
164 void gtk_range_set_range (GtkRange *range,
167 void gtk_range_set_value (GtkRange *range,
169 gdouble gtk_range_get_value (GtkRange *range);
171 void gtk_range_set_show_fill_level (GtkRange *range,
172 gboolean show_fill_level);
173 gboolean gtk_range_get_show_fill_level (GtkRange *range);
174 void gtk_range_set_restrict_to_fill_level (GtkRange *range,
175 gboolean restrict_to_fill_level);
176 gboolean gtk_range_get_restrict_to_fill_level (GtkRange *range);
177 void gtk_range_set_fill_level (GtkRange *range,
179 gdouble gtk_range_get_fill_level (GtkRange *range);
182 gdouble _gtk_range_get_wheel_delta (GtkRange *range,
183 GdkScrollDirection direction);
185 void _gtk_range_set_stop_values (GtkRange *range,
188 gint _gtk_range_get_stop_positions (GtkRange *range,
195 #endif /* __GTK_RANGE_H__ */