diff options
author | Vsevolod Kukol <sevoku@microsoft.com> | 2019-10-31 01:32:05 +0300 |
---|---|---|
committer | Vsevolod Kukol <sevoku@microsoft.com> | 2019-10-31 01:32:05 +0300 |
commit | 27727714985ea2c25120679fd8909e4c9dbfc6f3 (patch) | |
tree | 5f9cd9034338454e435771e77eb664f47b5ecc68 /Xwt.Gtk.Mac | |
parent | a393bbb4f1fb5f6e93c336e8a70e4ed5c5213c8d (diff) |
[Gtk][Mac] Add missing IsAccessible and Bounds implementations
Diffstat (limited to 'Xwt.Gtk.Mac')
-rw-r--r-- | Xwt.Gtk.Mac/GtkMacAccessibleBackend.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Xwt.Gtk.Mac/GtkMacAccessibleBackend.cs b/Xwt.Gtk.Mac/GtkMacAccessibleBackend.cs index 8c247453..c365bdf7 100644 --- a/Xwt.Gtk.Mac/GtkMacAccessibleBackend.cs +++ b/Xwt.Gtk.Mac/GtkMacAccessibleBackend.cs @@ -26,6 +26,7 @@ using System; using System.Linq; using AppKit; +using CoreGraphics; using Foundation; using ObjCRuntime; using Xwt.Accessibility; @@ -49,6 +50,23 @@ namespace Xwt.Gtk.Mac return Runtime.GetNSObject<NSObject> (handle, false) as INSAccessibility; } + public override bool IsAccessible { + get { + var nsa = GetNSAccessibilityElement (widget.Accessible); + if (nsa == null) { + return false; + } + return nsa.AccessibilityElement; + } + set { + var nsa = GetNSAccessibilityElement (widget.Accessible); + if (nsa == null) { + return; + } + nsa.AccessibilityElement = value; + } + } + public override string Label { get { var nsa = GetNSAccessibilityElement (widget.Accessible); @@ -140,6 +158,24 @@ namespace Xwt.Gtk.Mac } } + public override Rectangle Bounds { + get { + var nsa = GetNSAccessibilityElement (widget.Accessible); + if (nsa == null) { + return Rectangle.Zero; + } + var r = nsa.AccessibilityFrame; + return new Rectangle (r.X, r.Y, r.Width, r.Height); + } + set { + var nsa = GetNSAccessibilityElement (widget.Accessible); + if (nsa == null) { + return; + } + nsa.AccessibilityFrame = new CGRect ((nfloat)value.X, (nfloat)value.Y, (nfloat)value.Width, (nfloat)value.Height); ; + } + } + public override void AddChild (object nativeChild) { var nsa = GetNSAccessibilityElement (widget.Accessible); |