gtkrange.h 7.27 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
Elliot Lee's avatar
Elliot Lee committed
2 3 4
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
Elliot Lee's avatar
Elliot Lee committed
6 7 8 9 10 11
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 * Lesser General Public License for more details.
Elliot Lee's avatar
Elliot Lee committed
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
Elliot Lee's avatar
Elliot Lee committed
16
 */
17 18

/*
19
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
20 21
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
22
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 24
 */

Elliot Lee's avatar
Elliot Lee committed
25 26 27 28
#ifndef __GTK_RANGE_H__
#define __GTK_RANGE_H__


29 30 31 32
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

Elliot Lee's avatar
Elliot Lee committed
33 34 35
#include <gtk/gtkwidget.h>


36
G_BEGIN_DECLS
Elliot Lee's avatar
Elliot Lee committed
37 38


39
#define GTK_TYPE_RANGE            (gtk_range_get_type ())
Manish Singh's avatar
Manish Singh committed
40 41 42 43 44
#define GTK_RANGE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_RANGE, GtkRange))
#define GTK_RANGE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RANGE, GtkRangeClass))
#define GTK_IS_RANGE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_RANGE))
#define GTK_IS_RANGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_RANGE))
#define GTK_RANGE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_RANGE, GtkRangeClass))
Elliot Lee's avatar
Elliot Lee committed
45

46 47 48
typedef struct _GtkRange              GtkRange;
typedef struct _GtkRangePrivate       GtkRangePrivate;
typedef struct _GtkRangeClass         GtkRangeClass;
Elliot Lee's avatar
Elliot Lee committed
49 50 51 52 53

struct _GtkRange
{
  GtkWidget widget;

54
  GtkRangePrivate *priv;
Elliot Lee's avatar
Elliot Lee committed
55 56 57 58 59 60
};

struct _GtkRangeClass
{
  GtkWidgetClass parent_class;

61
  void (* value_changed)    (GtkRange     *range);
62 63
  void (* adjust_bounds)    (GtkRange     *range,
                             gdouble	   new_value);
64

65 66
  /* action signals for keybindings */
  void (* move_slider)      (GtkRange     *range,
67 68 69 70
                             GtkScrollType scroll);

  /* Virtual functions */
  void (* get_range_border) (GtkRange     *range,
71
                             GtkBorder    *border_);
72

73 74 75 76
  gboolean (* change_value) (GtkRange     *range,
                             GtkScrollType scroll,
                             gdouble       new_value);

77 78 79 80 81
   void (* get_range_size_request) (GtkRange       *range,
                                    GtkOrientation  orientation,
                                    gint           *minimum,
                                    gint           *natural);

82 83 84 85
  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
Elliot Lee's avatar
Elliot Lee committed
86 87 88
};


89
GDK_AVAILABLE_IN_ALL
90 91
GType              gtk_range_get_type                      (void) G_GNUC_CONST;

92
GDK_AVAILABLE_IN_ALL
93 94
void               gtk_range_set_adjustment                (GtkRange      *range,
                                                            GtkAdjustment *adjustment);
95
GDK_AVAILABLE_IN_ALL
96 97
GtkAdjustment*     gtk_range_get_adjustment                (GtkRange      *range);

98
GDK_AVAILABLE_IN_ALL
99 100
void               gtk_range_set_inverted                  (GtkRange      *range,
                                                            gboolean       setting);
101
GDK_AVAILABLE_IN_ALL
102 103
gboolean           gtk_range_get_inverted                  (GtkRange      *range);

104
GDK_AVAILABLE_IN_ALL
105 106
void               gtk_range_set_flippable                 (GtkRange      *range,
                                                            gboolean       flippable);
107
GDK_AVAILABLE_IN_ALL
108 109
gboolean           gtk_range_get_flippable                 (GtkRange      *range);

110
GDK_AVAILABLE_IN_ALL
111 112
void               gtk_range_set_slider_size_fixed         (GtkRange      *range,
                                                            gboolean       size_fixed);
113
GDK_AVAILABLE_IN_ALL
114 115
gboolean           gtk_range_get_slider_size_fixed         (GtkRange      *range);

116
GDK_AVAILABLE_IN_ALL
117 118
void               gtk_range_get_range_rect                (GtkRange      *range,
                                                            GdkRectangle  *range_rect);
119
GDK_AVAILABLE_IN_ALL
120 121 122 123
void               gtk_range_get_slider_range              (GtkRange      *range,
                                                            gint          *slider_start,
                                                            gint          *slider_end);

124
GDK_AVAILABLE_IN_ALL
125 126
void               gtk_range_set_lower_stepper_sensitivity (GtkRange      *range,
                                                            GtkSensitivityType sensitivity);
127
GDK_AVAILABLE_IN_ALL
128
GtkSensitivityType gtk_range_get_lower_stepper_sensitivity (GtkRange      *range);
129
GDK_AVAILABLE_IN_ALL
130 131
void               gtk_range_set_upper_stepper_sensitivity (GtkRange      *range,
                                                            GtkSensitivityType sensitivity);
132
GDK_AVAILABLE_IN_ALL
133 134
GtkSensitivityType gtk_range_get_upper_stepper_sensitivity (GtkRange      *range);

135
GDK_AVAILABLE_IN_ALL
136 137 138
void               gtk_range_set_increments                (GtkRange      *range,
                                                            gdouble        step,
                                                            gdouble        page);
139
GDK_AVAILABLE_IN_ALL
140 141 142
void               gtk_range_set_range                     (GtkRange      *range,
                                                            gdouble        min,
                                                            gdouble        max);
143
GDK_AVAILABLE_IN_ALL
144 145
void               gtk_range_set_value                     (GtkRange      *range,
                                                            gdouble        value);
146
GDK_AVAILABLE_IN_ALL
147 148
gdouble            gtk_range_get_value                     (GtkRange      *range);

149
GDK_AVAILABLE_IN_ALL
150 151
void               gtk_range_set_show_fill_level           (GtkRange      *range,
                                                            gboolean       show_fill_level);
152
GDK_AVAILABLE_IN_ALL
153
gboolean           gtk_range_get_show_fill_level           (GtkRange      *range);
154
GDK_AVAILABLE_IN_ALL
155 156
void               gtk_range_set_restrict_to_fill_level    (GtkRange      *range,
                                                            gboolean       restrict_to_fill_level);
157
GDK_AVAILABLE_IN_ALL
158
gboolean           gtk_range_get_restrict_to_fill_level    (GtkRange      *range);
159
GDK_AVAILABLE_IN_ALL
160 161
void               gtk_range_set_fill_level                (GtkRange      *range,
                                                            gdouble        fill_level);
162
GDK_AVAILABLE_IN_ALL
163
gdouble            gtk_range_get_fill_level                (GtkRange      *range);
164
GDK_AVAILABLE_IN_ALL
165 166
void               gtk_range_set_round_digits              (GtkRange      *range,
                                                            gint           round_digits);
167
GDK_AVAILABLE_IN_ALL
168
gint                gtk_range_get_round_digits              (GtkRange      *range);
169

170 171

G_END_DECLS
Elliot Lee's avatar
Elliot Lee committed
172 173 174


#endif /* __GTK_RANGE_H__ */