[banshee: 32/32] Merge branch 'a11y'



commit 53e567aa62696b8c0942e4f69a06c728376f0979
Merge: 1b11baa... ce20689...
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Sat Nov 7 14:00:44 2009 -0800

    Merge branch 'a11y'
    
    Conflicts:
    	src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellStatusIndicator.cs
    	src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs

 build/build.rules.mk                               |    6 +-
 configure.ac                                       |    6 +
 .../Banshee.Collection.Gui/ColumnCellAlbum.cs      |   22 ++-
 .../ColumnCellStatusIndicator.cs                   |  118 ++++++++--
 .../Banshee.Widgets/Banshee.Widgets/SeekSlider.cs  |   55 +++--
 .../Banshee.Widgets/VolumeButton.cs                |    1 +
 .../Accessibility/ColumnCellAccessible.cs          |  149 +++++++++++
 .../Accessibility/ColumnCellTextAccessible.cs      |   40 +++
 .../ColumnHeaderCellTextAccessible.cs              |  112 +++++++++
 .../Accessibility/ICellAccessibleParent.cs         |   45 ++++
 .../Accessibility/ListViewAccessible.cs            |  243 ++++++++++++++++++
 .../Accessibility/ListViewAccessible_Selection.cs  |   90 +++++++
 .../Accessibility/ListViewAccessible_Table.cs      |  190 ++++++++++++++
 .../Hyena.Gui/Hyena.Data.Gui/ColumnCell.cs         |   14 +-
 .../Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs     |   11 +
 .../Hyena.Data.Gui/ColumnHeaderCellText.cs         |    9 +-
 .../Hyena.Data.Gui/ListView/ListView_Accessible.cs |  174 +++++++++++++
 .../Hyena.Data.Gui/ListView/ListView_Header.cs     |   35 +++
 .../ListView/ListView_Interaction.cs               |  161 +++++++++----
 .../Hyena.Data.Gui/ListView/ListView_Model.cs      |   10 +
 .../Hyena.Data.Gui/ListView/ListView_Rendering.cs  |   41 +++-
 .../Hyena.Gui/Hyena.Gui.Theming/GtkTheme.cs        |   67 +++++-
 src/Libraries/Hyena.Gui/Hyena.Gui.Theming/Theme.cs |   22 ++-
 src/Libraries/Hyena.Gui/Hyena.Gui.csproj           |   14 +-
 .../Hyena.Gui/Hyena.Gui/BaseWidgetAccessible.cs    |  260 ++++++++++++++++++++
 .../Hyena.Gui/Hyena.Widgets/RatingEntry.cs         |   77 ++++++
 src/Libraries/Hyena.Gui/Makefile.am                |    9 +
 src/Libraries/Hyena/Hyena.Collections/Selection.cs |   15 +-
 tests/test-a11y                                    |  125 ++++++++++
 29 files changed, 1998 insertions(+), 123 deletions(-)
---
diff --cc src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellStatusIndicator.cs
index 6eb2738,06579ff..367abe3
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellStatusIndicator.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellStatusIndicator.cs
@@@ -40,10 -42,60 +42,62 @@@ using Banshee.ServiceStack
  
  namespace Banshee.Collection.Gui
  {
+     class ColumnCellStatusIndicatorAccessible : ColumnCellAccessible, Atk.ImageImplementor
+     {
+         private string image_description;
+ 
+         public ColumnCellStatusIndicatorAccessible (object bound_object, ColumnCellStatusIndicator cell, ICellAccessibleParent parent) : base (bound_object, cell as ColumnCell, parent)
+         {
+             image_description = cell.GetTextAlternative (bound_object);
+         }
+ 
+         public override void Redrawn ()
+         {
+             string new_image_description = cell.GetTextAlternative (bound_object);
+ 
+             if (image_description != new_image_description)
+                 GLib.Signal.Emit (this, "visible-data-changed");
+ 
+             image_description = new_image_description;
+         }
+ 
+         public string ImageLocale { get { return null; } }
+ 
+         public bool SetImageDescription (string description)
+         {
+             return false;
+         }
+ 
+         public void GetImageSize (out int width, out int height)
+         {
+             if (!String.IsNullOrEmpty (cell.GetTextAlternative (bound_object)))
+                 width = height = 16;
+             else
+                 width = height = Int32.MinValue;
+         }
+ 
+         public string ImageDescription {
+             get {
+                 return image_description;
+             }
+         }
+ 
+         public void GetImagePosition (out int x, out int y, Atk.CoordType coordType)
+         {
+             if (!String.IsNullOrEmpty (cell.GetTextAlternative (bound_object))) {
+                 GetPosition (out x, out y, coordType);
+                 x += 4;
+                 y += 4;
+             } else {
+                 x = y = Int32.MinValue;
+             }
+         }
+     }
+ 
 -    public class ColumnCellStatusIndicator : ColumnCell
 +    public class ColumnCellStatusIndicator : ColumnCell, ISizeRequestCell
      {
 +        const int padding = 2;
 +
          protected enum Icon : int {
              Playing,
              Paused,
@@@ -75,16 -132,27 +134,35 @@@
          public ColumnCellStatusIndicator (string property, bool expand) : base (property, expand)
          {
              LoadPixbufs ();
 +            RestrictSize = true;
 +        }
 +
 +        public bool RestrictSize { get; set; }
 +
 +        public void GetWidthRange (Pango.Layout layout, out int min_width, out int max_width)
 +        {
 +            min_width = max_width = pixbuf_size + 2 * padding;
          }
-         
+ 
+         public override Atk.Object GetAccessible (ICellAccessibleParent parent)
+         {
+             return new ColumnCellStatusIndicatorAccessible (BoundObject, this, parent);
+         }
+ 
+         public override string GetTextAlternative (object obj)
+         {
+             var track = obj as TrackInfo;
+             if (track == null)
+                 return "";
+ 
+             int icon_index = GetIconIndex (track);
+ 
+             if (icon_index < 0)
+                 return "";
+             else
+                 return icon_names[GetIconIndex (track)];
+         }
+ 
          protected virtual int PixbufCount {
              get { return 4; }
          }
diff --cc src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs
index 17ad32d,209b38a..5819189
--- a/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs
+++ b/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ColumnCellText.cs
@@@ -55,7 -56,17 +56,17 @@@ namespace Hyena.Data.Gu
          {
          }
  
+         public override Atk.Object GetAccessible (ICellAccessibleParent parent)
+         {
+             return new ColumnCellTextAccessible (BoundObject, this, parent);
+         }
+ 
+         public override string GetTextAlternative (object obj)
+         {
+             return GetText (obj);
+         }
+ 
 -        protected void SetMinMaxStrings (object min_max)
 +        public void SetMinMaxStrings (object min_max)
          {
              SetMinMaxStrings (min_max, min_max);
          }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]