[hyena/gtk3: 4/13] [gtk3] Fix a11y build



commit 822bc60d593053a14ee810cc8ba826aad67856a8
Author: Olivier Dufour <olivier duff gmail com>
Date:   Thu Apr 21 17:28:48 2011 +0200

    [gtk3] Fix a11y build

 .../Accessibility/ListViewAccessible_Table.cs      |   10 +-------
 .../Hyena.Data.Gui/ListView/ListView_Accessible.cs |   22 ++++++++-----------
 .../Hyena.Data.Gui/ListView/ListView_Windowing.cs  |    5 +--
 Hyena.Gui/Hyena.Gui/BaseWidgetAccessible.cs        |    7 +++--
 Hyena.Gui/Hyena.Widgets/RatingEntry.cs             |   15 +++++--------
 5 files changed, 23 insertions(+), 36 deletions(-)
---
diff --git a/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible_Table.cs b/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible_Table.cs
index ed43a8c..0f3ee0e 100644
--- a/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible_Table.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/Accessibility/ListViewAccessible_Table.cs
@@ -127,14 +127,8 @@ namespace Hyena.Data.Gui.Accessibility
 
 // Ensure https://bugzilla.novell.com/show_bug.cgi?id=512477 is fixed
 #if ENABLE_ATK
-        private static readonly int [] empty_int_array = new int[0];
-        public int [] SelectedColumns {
-            get { return empty_int_array; }
-        }
-
-        public int [] SelectedRows {
-            get { return list_view.Selection.ToArray (); }
-        }
+		public int GetSelectedRows (out int row) { row = 0; return 0; }
+        public int GetSelectedColumns (out int cols) { cols = 0; return 0; }
 #else
         public int GetSelectedRows (out int row) { row = 0; return 0; }
         public int GetSelectedColumns (out int cols) { cols = 0; return 0; }
diff --git a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Accessible.cs b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Accessible.cs
index d31eba4..e55a4e8 100644
--- a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Accessible.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Accessible.cs
@@ -166,19 +166,15 @@ namespace Hyena.Data.Gui
         {
             new ListViewAccessibleFactory<T> ();
             Atk.Global.DefaultRegistry.SetFactoryType ((GLib.GType)typeof (ListView<T>), (GLib.GType)typeof (ListViewAccessibleFactory<T>));
-        }
-
-        protected override Atk.Object OnCreateAccessible (GLib.Object obj)
-        {
-            Log.InformationFormat ("Creating Accessible for {0}", obj);
-            var accessible = new ListViewAccessible<T> (obj);
-            (obj as ListView<T>).accessible = accessible;
-            return accessible;
-        }
-
-        protected override GLib.GType OnGetAccessibleType ()
-        {
-            return ListViewAccessible<T>.GType;
+            CreateAccessibleHandler = (obj) => {
+                Log.InformationFormat ("Creating Accessible for {0}", obj);
+                var accessible = new ListViewAccessible<T> (obj);
+                (obj as ListView<T>).accessible = accessible;
+                return accessible;
+            };
+            GetAccessibleTypeHandler = ()=> {
+                return ListViewAccessible<T>.GType;
+            };
         }
     }
 #endif
diff --git a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Windowing.cs b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Windowing.cs
index 58b570a..645a7f6 100644
--- a/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Windowing.cs
+++ b/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Windowing.cs
@@ -156,12 +156,11 @@ namespace Hyena.Data.Gui
 
         protected Requisition SizeRequested ()
         {
-            var requisition = new Requisition ();
-
             // TODO give the minimum height of the header
             if (Theme == null) {
-                return requisition;
+                return Requisition.Zero;
             }
+            var requisition = new Requisition ();
             requisition.Width = Theme.TotalBorderWidth * 2;
             requisition.Height = HeaderHeight + Theme.TotalBorderWidth * 2;
             return requisition;
diff --git a/Hyena.Gui/Hyena.Gui/BaseWidgetAccessible.cs b/Hyena.Gui/Hyena.Gui/BaseWidgetAccessible.cs
index dea5da0..eda1eab 100644
--- a/Hyena.Gui/Hyena.Gui/BaseWidgetAccessible.cs
+++ b/Hyena.Gui/Hyena.Gui/BaseWidgetAccessible.cs
@@ -215,7 +215,7 @@ namespace Hyena.Gui
 
         private bool SetSizeAndPosition (int x, int y, int w, int h, Atk.CoordType coordType, bool setSize)
         {
-            if (!widget.IsTopLevel) {
+            if (!widget.IsToplevel) {
                 return false;
             }
 
@@ -231,7 +231,8 @@ namespace Hyena.Gui
             }
 
             #pragma warning disable 0612
-            widget.SetUposition (x, y);
+            //widget.SetUposition (x, y);
+			widget.SetAllocation (new Gdk.Rectangle (x, y, w, h));
             #pragma warning restore 0612
 
             if (setSize) {
@@ -243,7 +244,7 @@ namespace Hyena.Gui
 
         public bool SetSize (int w, int h)
         {
-            if (widget.IsTopLevel) {
+            if (widget.IsToplevel) {
                 widget.SetSizeRequest (w, h);
                 return true;
             } else {
diff --git a/Hyena.Gui/Hyena.Widgets/RatingEntry.cs b/Hyena.Gui/Hyena.Widgets/RatingEntry.cs
index e04657f..d4405f6 100644
--- a/Hyena.Gui/Hyena.Widgets/RatingEntry.cs
+++ b/Hyena.Gui/Hyena.Widgets/RatingEntry.cs
@@ -463,16 +463,13 @@ namespace Hyena.Widgets
         {
             new RatingAccessibleFactory ();
             Atk.Global.DefaultRegistry.SetFactoryType ((GLib.GType)typeof (RatingEntry), (GLib.GType)typeof (RatingAccessibleFactory));
-        }
+            CreateAccessibleHandler = (obj) => {
+                return new RatingAccessible (obj);
+            };
+            GetAccessibleTypeHandler = () => {
+                return RatingAccessible.GType;
+            };
 
-        protected override Atk.Object OnCreateAccessible (GLib.Object obj)
-        {
-            return new RatingAccessible (obj);
-        }
-
-        protected override GLib.GType OnGetAccessibleType ()
-        {
-            return RatingAccessible.GType;
         }
     }
 #endif



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