Commit f0ed36b3 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

add new signal 'adjust_bounds' to potentialy change the bounds before

2002-02-14  Jody Goldberg <jody@gnome.org>

	* gtk/gtkrange.c (gtk_range_class_init) : add new signal
	  'adjust_bounds' to potentialy change the bounds before assigning the
	  new value and camping it to the existing bounds.
	(gtk_range_internal_set_value) : used here. #68800.
	* gtk/gtkmarshalers.list : add VOID:DOUBLE
parent 27455dcd
2002-02-14 Jody Goldberg <jody@gnome.org>
* gtk/gtkrange.c (gtk_range_class_init) : add new signal
'adjust_bounds' to potentialy change the bounds before assigning the
new value and camping it to the existing bounds.
(gtk_range_internal_set_value) : used here. #68800.
* gtk/gtkmarshalers.list : add VOID:DOUBLE
Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
......
2002-02-14 Jody Goldberg <jody@gnome.org>
* gtk/gtkrange.c (gtk_range_class_init) : add new signal
'adjust_bounds' to potentialy change the bounds before assigning the
new value and camping it to the existing bounds.
(gtk_range_internal_set_value) : used here. #68800.
* gtk/gtkmarshalers.list : add VOID:DOUBLE
Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
......
2002-02-14 Jody Goldberg <jody@gnome.org>
* gtk/gtkrange.c (gtk_range_class_init) : add new signal
'adjust_bounds' to potentialy change the bounds before assigning the
new value and camping it to the existing bounds.
(gtk_range_internal_set_value) : used here. #68800.
* gtk/gtkmarshalers.list : add VOID:DOUBLE
Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
......
2002-02-14 Jody Goldberg <jody@gnome.org>
* gtk/gtkrange.c (gtk_range_class_init) : add new signal
'adjust_bounds' to potentialy change the bounds before assigning the
new value and camping it to the existing bounds.
(gtk_range_internal_set_value) : used here. #68800.
* gtk/gtkmarshalers.list : add VOID:DOUBLE
Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
......
2002-02-14 Jody Goldberg <jody@gnome.org>
* gtk/gtkrange.c (gtk_range_class_init) : add new signal
'adjust_bounds' to potentialy change the bounds before assigning the
new value and camping it to the existing bounds.
(gtk_range_internal_set_value) : used here. #68800.
* gtk/gtkmarshalers.list : add VOID:DOUBLE
Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
......
2002-02-14 Jody Goldberg <jody@gnome.org>
* gtk/gtkrange.c (gtk_range_class_init) : add new signal
'adjust_bounds' to potentialy change the bounds before assigning the
new value and camping it to the existing bounds.
(gtk_range_internal_set_value) : used here. #68800.
* gtk/gtkmarshalers.list : add VOID:DOUBLE
Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
......
2002-02-14 Jody Goldberg <jody@gnome.org>
* gtk/gtkrange.c (gtk_range_class_init) : add new signal
'adjust_bounds' to potentialy change the bounds before assigning the
new value and camping it to the existing bounds.
(gtk_range_internal_set_value) : used here. #68800.
* gtk/gtkmarshalers.list : add VOID:DOUBLE
Thu Feb 14 21:08:49 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkglobals.c: Remove GDKVAR from C file, see
......
......@@ -41,6 +41,7 @@ NONE:INT,INT
NONE:NONE
NONE:STRING,INT,POINTER
STRING:DOUBLE
VOID:DOUBLE
VOID:BOOLEAN
VOID:BOOLEAN,BOOLEAN,BOOLEAN
VOID:BOXED
......
......@@ -46,6 +46,7 @@ enum {
enum {
VALUE_CHANGED,
ADJUST_BOUNDS,
MOVE_SLIDER,
LAST_SIGNAL
};
......@@ -244,6 +245,16 @@ gtk_range_class_init (GtkRangeClass *class)
_gtk_marshal_NONE__NONE,
G_TYPE_NONE, 0);
signals[ADJUST_BOUNDS] =
g_signal_new ("adjust_bounds",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkRangeClass, adjust_bounds),
NULL, NULL,
_gtk_marshal_VOID__DOUBLE,
G_TYPE_NONE, 1,
G_TYPE_DOUBLE);
signals[MOVE_SLIDER] =
g_signal_new ("move_slider",
G_TYPE_FROM_CLASS (object_class),
......@@ -254,7 +265,6 @@ gtk_range_class_init (GtkRangeClass *class)
G_TYPE_NONE, 1,
GTK_TYPE_SCROLL_TYPE);
g_object_class_install_property (gobject_class,
PROP_UPDATE_POLICY,
g_param_spec_enum ("update_policy",
......@@ -2149,6 +2159,9 @@ static void
gtk_range_internal_set_value (GtkRange *range,
gdouble value)
{
/* potentially adjust the bounds _before we clamp */
g_signal_emit (G_OBJECT (range), signals[ADJUST_BOUNDS], 0, value);
value = CLAMP (value, range->adjustment->lower,
(range->adjustment->upper - range->adjustment->page_size));
......
......@@ -109,6 +109,8 @@ struct _GtkRangeClass
gchar *stepper_detail;
void (* value_changed) (GtkRange *range);
void (* adjust_bounds) (GtkRange *range,
gdouble new_value);
/* action signals for keybindings */
void (* move_slider) (GtkRange *range,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment