]> Pileus Git - ~andy/gtk/commitdiff
Add a11y relations between the color wheel and the spin buttons. (#132745,
authorMatthias Clasen <mclasen@redhat.com>
Wed, 14 Apr 2004 21:04:29 +0000 (21:04 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 14 Apr 2004 21:04:29 +0000 (21:04 +0000)
2004-04-14  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkcolorsel.c: Add a11y relations between the color
wheel and the spin buttons.  (#132745, Padraig, O'Briain)

* gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
the meaning of size == -1.

* gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept
a size of -1.  (#137436, Brian Cameron)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcolorsel.c
gtk/gtkiconfactory.c
gtk/gtkwidget.c

index 63b88144472014662e7b3feb80de60cf24fd056e..d0b1e824ef8dd7789890f0ff100043cb0849e112 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2004-04-14  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcolorsel.c: Add a11y relations between the color
+       wheel and the spin buttons.  (#132745)
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
+       the meaning of size == -1.
+
+       * gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept  
+       a size of -1.  (#137436, Brian Cameron)
+
        * gtk/gtkcombobox.c: Make the arrow and separator regular
        children of an hbox inside the button, and propagate state
        changes from the button to the cell view.  (part of the fix
index 63b88144472014662e7b3feb80de60cf24fd056e..d0b1e824ef8dd7789890f0ff100043cb0849e112 100644 (file)
@@ -1,5 +1,14 @@
 2004-04-14  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcolorsel.c: Add a11y relations between the color
+       wheel and the spin buttons.  (#132745)
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
+       the meaning of size == -1.
+
+       * gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept  
+       a size of -1.  (#137436, Brian Cameron)
+
        * gtk/gtkcombobox.c: Make the arrow and separator regular
        children of an hbox inside the button, and propagate state
        changes from the button to the cell view.  (part of the fix
index 63b88144472014662e7b3feb80de60cf24fd056e..d0b1e824ef8dd7789890f0ff100043cb0849e112 100644 (file)
@@ -1,5 +1,14 @@
 2004-04-14  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcolorsel.c: Add a11y relations between the color
+       wheel and the spin buttons.  (#132745)
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
+       the meaning of size == -1.
+
+       * gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept  
+       a size of -1.  (#137436, Brian Cameron)
+
        * gtk/gtkcombobox.c: Make the arrow and separator regular
        children of an hbox inside the button, and propagate state
        changes from the button to the cell view.  (part of the fix
index 63b88144472014662e7b3feb80de60cf24fd056e..d0b1e824ef8dd7789890f0ff100043cb0849e112 100644 (file)
@@ -1,5 +1,14 @@
 2004-04-14  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcolorsel.c: Add a11y relations between the color
+       wheel and the spin buttons.  (#132745)
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
+       the meaning of size == -1.
+
+       * gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept  
+       a size of -1.  (#137436, Brian Cameron)
+
        * gtk/gtkcombobox.c: Make the arrow and separator regular
        children of an hbox inside the button, and propagate state
        changes from the button to the cell view.  (part of the fix
index 63b88144472014662e7b3feb80de60cf24fd056e..d0b1e824ef8dd7789890f0ff100043cb0849e112 100644 (file)
@@ -1,5 +1,14 @@
 2004-04-14  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkcolorsel.c: Add a11y relations between the color
+       wheel and the spin buttons.  (#132745)
+
+       * gtk/gtkiconfactory.c (gtk_icon_set_render_icon): Document
+       the meaning of size == -1.
+
+       * gtk/gtkwidget.c (gtk_widget_render_icon): Explicitly accept  
+       a size of -1.  (#137436, Brian Cameron)
+
        * gtk/gtkcombobox.c: Make the arrow and separator regular
        children of an hbox inside the button, and propagate state
        changes from the button to the cell view.  (part of the fix
index b0d8856d5a83c6288e61cb188fbb564437c3876b..af2bb8d0b1aac756cf752a6f42e88799734fe195 100644 (file)
@@ -58,6 +58,7 @@
 #include "gtkintl.h"
 #include "gtkimage.h"
 #include "gtkstock.h"
+#include "gtkaccessible.h"
 
 #include <string.h>
 
@@ -170,6 +171,10 @@ static void     default_noscreen_change_palette_func    (const GdkColor    *colo
 static void     default_change_palette_func             (GdkScreen        *screen,
                                                         const GdkColor    *colors,
                                                         gint               n_colors);
+static void     make_control_relations                  (AtkObject         *atk_obj,
+                                                         GtkWidget         *widget);
+static void     make_all_relations                      (AtkObject         *atk_obj,
+                                                         ColorSelectionPrivate *priv);
 
 static gpointer parent_class = NULL;
 static guint color_selection_signals[LAST_SIGNAL] = { 0 };
@@ -1813,6 +1818,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
   GtkWidget *picker_image;
   gint i, j;
   ColorSelectionPrivate *priv;
+  AtkObject *atk_obj;
   
   gtk_widget_push_composite_child ();
 
@@ -1975,6 +1981,14 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
       gtk_widget_hide (priv->palette_frame);
     }
 
+  atk_obj = gtk_widget_get_accessible (priv->triangle_colorsel);
+  if (GTK_IS_ACCESSIBLE (atk_obj))
+    {
+      atk_object_set_name (atk_obj, _("Color Wheel"));
+      atk_object_set_role (gtk_widget_get_accessible (GTK_WIDGET (colorsel)), ATK_ROLE_COLOR_CHOOSER);
+      make_all_relations (atk_obj, priv);
+    } 
+
   gtk_widget_pop_composite_child ();
 }
 
@@ -2755,3 +2769,26 @@ gtk_color_selection_set_change_palette_with_screen_hook (GtkColorSelectionChange
 
   return old;
 }
+
+static void
+make_control_relations (AtkObject *atk_obj,
+                        GtkWidget *widget)
+{
+  AtkObject *obj;
+
+  obj = gtk_widget_get_accessible (widget);
+  atk_object_add_relationship (atk_obj, ATK_RELATION_CONTROLLED_BY, obj);
+  atk_object_add_relationship (obj, ATK_RELATION_CONTROLLER_FOR, atk_obj);
+}
+
+static void
+make_all_relations (AtkObject *atk_obj,
+                    ColorSelectionPrivate *priv)
+{
+  make_control_relations (atk_obj, priv->hue_spinbutton);
+  make_control_relations (atk_obj, priv->sat_spinbutton);
+  make_control_relations (atk_obj, priv->val_spinbutton);
+  make_control_relations (atk_obj, priv->red_spinbutton);
+  make_control_relations (atk_obj, priv->green_spinbutton);
+  make_control_relations (atk_obj, priv->blue_spinbutton);
+}
index a496cecf3f3b8cba3fc4e2ad531a932c405d9a73..37fa891892dfaca4f917638b8672d28035d7dad2 100644 (file)
@@ -1738,7 +1738,8 @@ render_fallback_image (GtkStyle          *style,
  * @style: a #GtkStyle associated with @widget, or %NULL
  * @direction: text direction
  * @state: widget state
- * @size: icon size
+ * @size: icon size. A size of (GtkIconSize)-1
+ *        means render at the size of the source and don't scale.
  * @widget: widget that will display the icon, or %NULL.
  *          The only use that is typically made of this
  *          is to determine the appropriate #GdkScreen.
index 952a21fef9f79fb30cac02cffbab47499ffce1ec..14d27f7f9a9f818324bdf21d3b99aada1596e2f1 100644 (file)
@@ -5015,7 +5015,8 @@ gtk_widget_create_pango_layout (GtkWidget   *widget,
  * gtk_widget_render_icon:
  * @widget: a #GtkWidget
  * @stock_id: a stock ID
- * @size: a stock size
+ * @size: a stock size. A size of (GtkIconSize)-1 means render at 
+      the size of the source and don't scale.
  * @detail: render detail to pass to theme engine
  * 
  * A convenience function that uses the theme engine and RC file
@@ -5043,7 +5044,7 @@ gtk_widget_render_icon (GtkWidget      *widget,
   
   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
   g_return_val_if_fail (stock_id != NULL, NULL);
-  g_return_val_if_fail (size > GTK_ICON_SIZE_INVALID, NULL);
+  g_return_val_if_fail (size > GTK_ICON_SIZE_INVALID || size == -1, NULL);
   
   gtk_widget_ensure_style (widget);