Ardour  9.0-pre0-582-g084a23a80d
gtkrange.h
Go to the documentation of this file.
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 
20 /*
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/.
25  */
26 
27 #ifndef __GTK_RANGE_H__
28 #define __GTK_RANGE_H__
29 
30 
31 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
32 #error "Only <gtk/gtk.h> can be included directly."
33 #endif
34 
35 #include <gtk/gtkadjustment.h>
36 #include <gtk/gtkwidget.h>
37 
38 
39 G_BEGIN_DECLS
40 
41 
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))
48 
49 /* These two are private/opaque types, ignore */
50 typedef struct _GtkRangeLayout GtkRangeLayout;
51 typedef struct _GtkRangeStepTimer GtkRangeStepTimer;
52 
53 typedef struct _GtkRange GtkRange;
54 typedef struct _GtkRangeClass GtkRangeClass;
55 
56 struct _GtkRange
57 {
59 
60  GtkAdjustment *GSEAL (adjustment);
61  GtkUpdateType GSEAL (update_policy);
62  guint GSEAL (inverted) : 1;
63 
64  /*< protected >*/
65 
66  guint GSEAL (flippable) : 1;
67 
68  /* Steppers are: < > ---- < >
69  * a b c d
70  */
71 
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;
76 
77  guint GSEAL (need_recalc) : 1;
78 
79  guint GSEAL (slider_size_fixed) : 1;
80 
81  gint GSEAL (min_slider_size);
82 
83  GtkOrientation GSEAL (orientation);
84 
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);
90 
91  /* Round off value to this many digits, -1 for no rounding */
92  gint GSEAL (round_digits);
93 
94  /*< private >*/
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);
99  gint GSEAL (slide_initial_slider_position);
100  gint GSEAL (slide_initial_coordinate);
101  guint GSEAL (update_timeout_id);
102  GdkWindow *GSEAL (event_window);
103 };
104 
106 {
108 
109  /* what detail to pass to GTK drawing functions */
112 
113  void (* value_changed) (GtkRange *range);
114  void (* adjust_bounds) (GtkRange *range,
115  gdouble new_value);
116 
117  /* action signals for keybindings */
118  void (* move_slider) (GtkRange *range,
119  GtkScrollType scroll);
120 
121  /* Virtual functions */
122  void (* get_range_border) (GtkRange *range,
123  GtkBorder *border_);
124 
125  gboolean (* change_value) (GtkRange *range,
126  GtkScrollType scroll,
127  gdouble new_value);
128 
129  /* Padding for future expansion */
130  void (*_gtk_reserved1) (void);
131  void (*_gtk_reserved2) (void);
132  void (*_gtk_reserved3) (void);
133 };
134 
135 
136 GType gtk_range_get_type (void) G_GNUC_CONST;
137 
138 #ifndef GTK_DISABLE_DEPRECATED
140  GtkUpdateType policy);
142 #endif /* GTK_DISABLE_DEPRECATED */
143 
145  GtkAdjustment *adjustment);
147 
149  gboolean setting);
151 
153  gboolean flippable);
155 
157  gboolean size_fixed);
159 
161  gboolean min_size);
163 
165  GdkRectangle *range_rect);
167  gint *slider_start,
168  gint *slider_end);
169 
171  GtkSensitivityType sensitivity);
174  GtkSensitivityType sensitivity);
176 
178  gdouble step,
179  gdouble page);
181  gdouble min,
182  gdouble max);
184  gdouble value);
185 gdouble gtk_range_get_value (GtkRange *range);
186 
188  gboolean show_fill_level);
191  gboolean restrict_to_fill_level);
194  gdouble fill_level);
197  gint round_digits);
199 
200 
201 /* internal API */
203  GdkEventScroll *event);
204 
206  gdouble *values,
207  gint n_values);
209  gint **values);
210 
211 
212 G_END_DECLS
213 
214 
215 #endif /* __GTK_RANGE_H__ */
GtkSensitivityType
Definition: gtkenums.h:155
GtkUpdateType
Definition: gtkenums.h:435
GtkOrientation
Definition: gtkenums.h:263
GtkScrollType
Definition: gtkenums.h:359
gdouble gtk_range_get_fill_level(GtkRange *range)
gdouble gtk_range_get_value(GtkRange *range)
void gtk_range_set_fill_level(GtkRange *range, gdouble fill_level)
void gtk_range_set_show_fill_level(GtkRange *range, gboolean show_fill_level)
gdouble _gtk_range_get_wheel_delta(GtkRange *range, GdkEventScroll *event)
void _gtk_range_set_stop_values(GtkRange *range, gdouble *values, gint n_values)
void gtk_range_get_range_rect(GtkRange *range, GdkRectangle *range_rect)
GType gtk_range_get_type(void) G_GNUC_CONST
void gtk_range_set_value(GtkRange *range, gdouble value)
gboolean gtk_range_get_slider_size_fixed(GtkRange *range)
void gtk_range_set_adjustment(GtkRange *range, GtkAdjustment *adjustment)
void gtk_range_set_slider_size_fixed(GtkRange *range, gboolean size_fixed)
GtkUpdateType gtk_range_get_update_policy(GtkRange *range)
void gtk_range_set_round_digits(GtkRange *range, gint round_digits)
void gtk_range_set_increments(GtkRange *range, gdouble step, gdouble page)
gint gtk_range_get_min_slider_size(GtkRange *range)
struct _GtkRangeLayout GtkRangeLayout
Definition: gtkrange.h:50
void gtk_range_set_flippable(GtkRange *range, gboolean flippable)
gint gtk_range_get_round_digits(GtkRange *range)
void gtk_range_set_inverted(GtkRange *range, gboolean setting)
gboolean gtk_range_get_inverted(GtkRange *range)
void gtk_range_get_slider_range(GtkRange *range, gint *slider_start, gint *slider_end)
gboolean gtk_range_get_show_fill_level(GtkRange *range)
GtkSensitivityType gtk_range_get_lower_stepper_sensitivity(GtkRange *range)
void gtk_range_set_min_slider_size(GtkRange *range, gboolean min_size)
gint _gtk_range_get_stop_positions(GtkRange *range, gint **values)
GtkAdjustment * gtk_range_get_adjustment(GtkRange *range)
GtkSensitivityType gtk_range_get_upper_stepper_sensitivity(GtkRange *range)
void gtk_range_set_update_policy(GtkRange *range, GtkUpdateType policy)
void gtk_range_set_lower_stepper_sensitivity(GtkRange *range, GtkSensitivityType sensitivity)
struct _GtkRangeStepTimer GtkRangeStepTimer
Definition: gtkrange.h:51
void gtk_range_set_upper_stepper_sensitivity(GtkRange *range, GtkSensitivityType sensitivity)
gboolean gtk_range_get_restrict_to_fill_level(GtkRange *range)
void gtk_range_set_range(GtkRange *range, gdouble min, gdouble max)
gboolean gtk_range_get_flippable(GtkRange *range)
void gtk_range_set_restrict_to_fill_level(GtkRange *range, gboolean restrict_to_fill_level)
gboolean(* change_value)(GtkRange *range, GtkScrollType scroll, gdouble new_value)
Definition: gtkrange.h:125
void(* _gtk_reserved3)(void)
Definition: gtkrange.h:132
void(* _gtk_reserved2)(void)
Definition: gtkrange.h:131
void(* move_slider)(GtkRange *range, GtkScrollType scroll)
Definition: gtkrange.h:118
void(* value_changed)(GtkRange *range)
Definition: gtkrange.h:113
gchar * stepper_detail
Definition: gtkrange.h:111
void(* get_range_border)(GtkRange *range, GtkBorder *border_)
Definition: gtkrange.h:122
void(* adjust_bounds)(GtkRange *range, gdouble new_value)
Definition: gtkrange.h:114
gchar * slider_detail
Definition: gtkrange.h:110
void(* _gtk_reserved1)(void)
Definition: gtkrange.h:130
GtkWidgetClass parent_class
Definition: gtkrange.h:107
GtkOrientation GSEAL(orientation)
guint GSEAL(trough_click_forward) guint GSEAL(update_pending) GtkRangeLayout * GSEAL(layout)
GdkWindow * GSEAL(event_window)
GtkWidget widget
Definition: gtkrange.h:58
gint GSEAL(round_digits)
gint GSEAL(slide_initial_slider_position)
GdkRectangle GSEAL(range_rect)
GtkUpdateType GSEAL(update_policy)
guint GSEAL(inverted) guint GSEAL(flippable) guint GSEAL(has_stepper_a) guint GSEAL(has_stepper_b) guint GSEAL(has_stepper_c) guint GSEAL(has_stepper_d) guint GSEAL(need_recalc) guint GSEAL(slider_size_fixed) gint GSEAL(min_slider_size)
gint GSEAL(slider_end)
GtkAdjustment * GSEAL(adjustment)
GtkRangeStepTimer * GSEAL(timer)
guint GSEAL(update_timeout_id)
gint GSEAL(slide_initial_coordinate)
gint GSEAL(slider_start)