summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJody Goldberg <jody@gnome.org>2002-02-15 05:53:08 +0000
committerJody Goldberg <jody@src.gnome.org>2002-02-15 05:53:08 +0000
commitf0ed36b324217f0eca2057f8fa64a498fe40033f (patch)
tree7d556dd99433681c2a35b414fd6fc9a89ffecf1f
parent27455dcd9001e2eaec592b35a2023e8df44ad0ce (diff)
downloadgtk+-f0ed36b324217f0eca2057f8fa64a498fe40033f.tar.gz
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
-rw-r--r--ChangeLog8
-rw-r--r--ChangeLog.pre-2-08
-rw-r--r--ChangeLog.pre-2-108
-rw-r--r--ChangeLog.pre-2-28
-rw-r--r--ChangeLog.pre-2-48
-rw-r--r--ChangeLog.pre-2-68
-rw-r--r--ChangeLog.pre-2-88
-rw-r--r--gtk/gtkmarshalers.list1
-rw-r--r--gtk/gtkrange.c15
-rw-r--r--gtk/gtkrange.h2
10 files changed, 73 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 87ddc908c2..905b70f1d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 87ddc908c2..905b70f1d3 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,11 @@
+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
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 87ddc908c2..905b70f1d3 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,11 @@
+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
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 87ddc908c2..905b70f1d3 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,11 @@
+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
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 87ddc908c2..905b70f1d3 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,11 @@
+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
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 87ddc908c2..905b70f1d3 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,11 @@
+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
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 87ddc908c2..905b70f1d3 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,11 @@
+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
diff --git a/gtk/gtkmarshalers.list b/gtk/gtkmarshalers.list
index d1e9159590..96fa6fd42c 100644
--- a/gtk/gtkmarshalers.list
+++ b/gtk/gtkmarshalers.list
@@ -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
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index 064c1840b4..de04272f5a 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -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));
diff --git a/gtk/gtkrange.h b/gtk/gtkrange.h
index 1e2110d8fd..f8c0d1e79d 100644
--- a/gtk/gtkrange.h
+++ b/gtk/gtkrange.h
@@ -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,