reset line to avoid duplicating last item
[rugen] / src / gtkenhancedscale.h
1 /* GtkEnhancedScale - A gtk(h)scale with multiple sliders
2 * Copyright (C) 2001 - Ronald Bultje
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program 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
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17 * USA.
18 */
19
20 /* Some code used was taken from GtkScale and GtkRange, all part
21 * of the Gimp Toolkit (Gtk+), http://www.gtk.org/
22 */
23
24 #ifndef __GTK_ENHANCED_SCALE_H__
25 #define __GTK_ENHANCED_SCALE_H__
26
27 #include <gdk/gdk.h>
28 #include <gtk/gtkwidget.h>
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34 #define GTK_ENHANCED_SCALE(obj) GTK_CHECK_CAST (obj, gtk_enhanced_scale_get_type (), GtkEnhancedScale)
35 #define GTK_ENHANCED_SCALE_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_enhanced_scale_get_type (), GtkEnhancedScaleClass)
36 #define GTK_IS_ENHANCED_SCALE(obj) GTK_CHECK_TYPE (obj, gtk_enhanced_scale_get_type ())
37
38 typedef struct _GtkEnhancedScale GtkEnhancedScale;
39 typedef struct _GtkEnhancedScaleClass GtkEnhancedScaleClass;
40
41 struct _GtkEnhancedScale
42 {
43 GtkWidget widget;
44
45 GdkWindow *trough;
46 GdkWindow **slider;
47
48 GtkObject **adjustment;
49 gint num_adjustments;
50 gint *handler_id;
51
52 guint in_child : 3;
53 guint click_child : 3;
54
55 gint active_slider;
56 gint clicked_slider;
57 gint x_click_point;
58 GArray *breaks;
59 };
60
61 struct _GtkEnhancedScaleClass
62 {
63 GtkWidgetClass parent_class;
64
65 gint slider_width;
66 gint trough_width;
67 gint stepper_size;
68 gint stepper_slider_spacing;
69 gint arrow_width;
70 gint arrow_height;
71
72 guint8 trough;
73 guint8 slider;
74 };
75
76 GtkWidget* gtk_enhanced_scale_new (GtkObject *adjustment[],
77 gint num_adjustments);
78 guint gtk_enhanced_scale_get_type (void);
79 void gtk_enhanced_scale_set_breaks( GtkWidget *widget, GArray *breaks );
80
81 #ifdef __cplusplus
82 }
83 #endif /* __cplusplus */
84
85
86 #endif /* __GTK_ENHANCED_SCALE_H__ */