]> Pileus Git - ~andy/gtk/commitdiff
add new signal 'adjust_bounds' to potentialy change the bounds before
authorJody Goldberg <jody@gnome.org>
Fri, 15 Feb 2002 05:53:08 +0000 (05:53 +0000)
committerJody Goldberg <jody@src.gnome.org>
Fri, 15 Feb 2002 05:53:08 +0000 (05:53 +0000)
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

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkmarshalers.list
gtk/gtkrange.c
gtk/gtkrange.h

index 87ddc908c247a5b429a3489ff179091b35f4e4cb..905b70f1d3f52a5027be155cc850ab59931e5c29 100644 (file)
--- 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
index 87ddc908c247a5b429a3489ff179091b35f4e4cb..905b70f1d3f52a5027be155cc850ab59931e5c29 100644 (file)
@@ -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
index 87ddc908c247a5b429a3489ff179091b35f4e4cb..905b70f1d3f52a5027be155cc850ab59931e5c29 100644 (file)
@@ -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
index 87ddc908c247a5b429a3489ff179091b35f4e4cb..905b70f1d3f52a5027be155cc850ab59931e5c29 100644 (file)
@@ -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
index 87ddc908c247a5b429a3489ff179091b35f4e4cb..905b70f1d3f52a5027be155cc850ab59931e5c29 100644 (file)
@@ -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
index 87ddc908c247a5b429a3489ff179091b35f4e4cb..905b70f1d3f52a5027be155cc850ab59931e5c29 100644 (file)
@@ -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
index 87ddc908c247a5b429a3489ff179091b35f4e4cb..905b70f1d3f52a5027be155cc850ab59931e5c29 100644 (file)
@@ -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
index d1e9159590d36bf44e3aac0afd7d53b9e5b63774..96fa6fd42c0ec40be3c3c3d0651db6b9884db9ea 100644 (file)
@@ -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
index 064c1840b4eadbe98e43e32512e866f1d9cd99cb..de04272f5a417e87cf9405bc8c16145d40602ebe 100644 (file)
@@ -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));
 
index 1e2110d8fd2044218a0c51d605ed435b444cf324..f8c0d1e79d6034466ed2bef5e0c24aabe9c7ba9b 100644 (file)
@@ -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,