debian/0000755000000000000000000000000011714005447007171 5ustar debian/patches/0000755000000000000000000000000011714005046010613 5ustar debian/patches/use_compiler_specified_by_configure0000644000000000000000000001474611714002761020007 0ustar Index: mono-uia/UIAutomationBridge/Makefile.am =================================================================== --- mono-uia.orig/UIAutomationBridge/Makefile.am 2012-01-24 19:21:37.000000000 +0000 +++ mono-uia/UIAutomationBridge/Makefile.am 2012-01-24 19:21:47.000000000 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 -delaysign+ -keyfile:@abs_top_srcdir@/winfx3.pub ASSEMBLY = ../bin/UIAutomationBridge.dll Index: mono-uia/UIAutomationClient/Makefile.am =================================================================== --- mono-uia.orig/UIAutomationClient/Makefile.am 2012-01-24 19:21:37.000000000 +0000 +++ mono-uia/UIAutomationClient/Makefile.am 2012-01-24 19:21:54.000000000 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 -delaysign+ -keyfile:@abs_top_srcdir@/winfx3.pub ASSEMBLY = ../bin/UIAutomationClient.dll Index: mono-uia/UIAutomationClientTests/AtspiUiaClientTests/Makefile.am =================================================================== --- mono-uia.orig/UIAutomationClientTests/AtspiUiaClientTests/Makefile.am 2012-01-24 19:21:37.000000000 +0000 +++ mono-uia/UIAutomationClientTests/AtspiUiaClientTests/Makefile.am 2012-01-24 19:22:08.000000000 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" ASSEMBLY = bin/Debug/AtspiUiaClientTests.dll Index: mono-uia/UIAutomationClientTests/GtkForm/Makefile.am =================================================================== --- mono-uia.orig/UIAutomationClientTests/GtkForm/Makefile.am 2012-01-24 19:21:37.000000000 +0000 +++ mono-uia/UIAutomationClientTests/GtkForm/Makefile.am 2012-01-24 19:22:15.000000000 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = if ENABLE_DEBUG -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -debug "-define:DEBUG" ASSEMBLY = bin/Debug/GtkForm.exe @@ -16,7 +16,7 @@ endif if ENABLE_RELEASE -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize+ -keyfile:$(top_srcdir)/mono-uia.snk ASSEMBLY = bin/Release/GtkForm.exe ASSEMBLY_MDB = Index: mono-uia/UIAutomationClientTests/SampleForm/Makefile.am =================================================================== --- mono-uia.orig/UIAutomationClientTests/SampleForm/Makefile.am 2012-01-24 19:21:37.000000000 +0000 +++ mono-uia/UIAutomationClientTests/SampleForm/Makefile.am 2012-01-24 19:22:21.000000000 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" ASSEMBLY = bin/Debug/SampleForm.exe ASSEMBLY_MDB = $(ASSEMBLY).mdb Index: mono-uia/UIAutomationClientTests/UIAutomationClientTests/Makefile.am =================================================================== --- mono-uia.orig/UIAutomationClientTests/UIAutomationClientTests/Makefile.am 2012-01-24 19:21:37.000000000 +0000 +++ mono-uia/UIAutomationClientTests/UIAutomationClientTests/Makefile.am 2012-01-24 19:22:01.000000000 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -noconfig -codepage:utf8 -warn:4 -optimize- -debug "-define:DEBUG;TRACE" ASSEMBLY = bin/Debug/UIAutomationClientTests.dll Index: mono-uia/UIAutomationProvider/Makefile.am =================================================================== --- mono-uia.orig/UIAutomationProvider/Makefile.am 2012-01-24 19:21:37.000000000 +0000 +++ mono-uia/UIAutomationProvider/Makefile.am 2012-01-24 19:22:28.000000000 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 -delaysign+ -keyfile:@abs_top_srcdir@/winfx3.pub ASSEMBLY = ../bin/UIAutomationProvider.dll Index: mono-uia/UIAutomationSource/Makefile.am =================================================================== --- mono-uia.orig/UIAutomationSource/Makefile.am 2012-01-24 19:21:37.000000000 +0000 +++ mono-uia/UIAutomationSource/Makefile.am 2012-01-24 19:22:34.000000000 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 -delaysign+ -keyfile:@abs_top_srcdir@/winfx3.pub ASSEMBLY = ../bin/UIAutomationSource.dll Index: mono-uia/UIAutomationTypes/Makefile.am =================================================================== --- mono-uia.orig/UIAutomationTypes/Makefile.am 2012-01-24 19:21:37.000000000 +0000 +++ mono-uia/UIAutomationTypes/Makefile.am 2012-01-24 19:22:47.000000000 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 -delaysign+ -keyfile:@abs_top_srcdir@/winfx3.pub ASSEMBLY = ../bin/UIAutomationTypes.dll Index: mono-uia/WindowsBase/Makefile.am =================================================================== --- mono-uia.orig/WindowsBase/Makefile.am 2012-01-24 19:21:37.000000000 +0000 +++ mono-uia/WindowsBase/Makefile.am 2012-01-24 19:22:55.000000000 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = -ASSEMBLY_COMPILER_COMMAND = gmcs +ASSEMBLY_COMPILER_COMMAND = $(GMCS) ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 ASSEMBLY = ../bin/WindowsBase.dll debian/patches/0001-uia-Fix-building-with-Mono-2.8.patch0000644000000000000000000001614111707324331017501 0ustar From 326220d51c7fb96151802576d978399693d6bae4 Mon Sep 17 00:00:00 2001 From: Mario Carrion Date: Tue, 31 Aug 2010 16:29:27 -0400 Subject: [uia] Fix building with Mono 2.8. --- UIAutomation/UIAutomationBridge/AssemblyInfo.cs.in | 2 -- UIAutomation/UIAutomationBridge/Makefile.am | 2 +- UIAutomation/UIAutomationClient/AssemblyInfo.cs.in | 2 -- UIAutomation/UIAutomationClient/Makefile.am | 2 +- .../UIAutomationProvider/AssemblyInfo.cs.in | 2 -- UIAutomation/UIAutomationProvider/Makefile.am | 2 +- UIAutomation/UIAutomationSource/AssemblyInfo.cs.in | 2 -- UIAutomation/UIAutomationSource/Makefile.am | 2 +- UIAutomation/UIAutomationTypes/AssemblyInfo.cs.in | 2 -- UIAutomation/UIAutomationTypes/Makefile.am | 2 +- 10 files changed, 5 insertions(+), 15 deletions(-) diff --git a/UIAutomationBridge/AssemblyInfo.cs.in b/UIAutomationBridge/AssemblyInfo.cs.in index 6e29e8a..3608dc4 100644 --- a/UIAutomationBridge/AssemblyInfo.cs.in +++ b/UIAutomationBridge/AssemblyInfo.cs.in @@ -43,8 +43,6 @@ using System.Security.Permissions; [assembly: NeutralResourcesLanguage ("en")] [assembly: CLSCompliant (true)] -[assembly: AssemblyDelaySign (true)] -[assembly: AssemblyKeyFile ("@abs_top_srcdir@/winfx3.pub")] [assembly: ComVisible (false)] [assembly: AllowPartiallyTrustedCallers] diff --git a/UIAutomationBridge/Makefile.am b/UIAutomationBridge/Makefile.am index f7b768c..e8d95fb 100644 --- a/UIAutomationBridge/Makefile.am +++ b/UIAutomationBridge/Makefile.am @@ -2,7 +2,7 @@ EXTRA_DIST = ASSEMBLY_COMPILER_COMMAND = gmcs -ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 +ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 -delaysign+ -keyfile:@abs_top_srcdir@/winfx3.pub ASSEMBLY = ../bin/UIAutomationBridge.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb diff --git a/UIAutomationClient/AssemblyInfo.cs.in b/UIAutomationClient/AssemblyInfo.cs.in index 0223309..e4df27d 100644 --- a/UIAutomationClient/AssemblyInfo.cs.in +++ b/UIAutomationClient/AssemblyInfo.cs.in @@ -43,8 +43,6 @@ using System.Security.Permissions; [assembly: NeutralResourcesLanguage ("en")] [assembly: CLSCompliant (true)] -[assembly: AssemblyDelaySign (true)] -[assembly: AssemblyKeyFile ("@abs_top_srcdir@/winfx3.pub")] [assembly: ComVisible (false)] diff --git a/UIAutomationClient/Makefile.am b/UIAutomationClient/Makefile.am index 16c5b90..a358ed1 100644 --- a/UIAutomationClient/Makefile.am +++ b/UIAutomationClient/Makefile.am @@ -2,7 +2,7 @@ EXTRA_DIST = ASSEMBLY_COMPILER_COMMAND = gmcs -ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 +ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 -delaysign+ -keyfile:@abs_top_srcdir@/winfx3.pub ASSEMBLY = ../bin/UIAutomationClient.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb diff --git a/UIAutomationProvider/AssemblyInfo.cs.in b/UIAutomationProvider/AssemblyInfo.cs.in index 21bba13..c66987c 100644 --- a/UIAutomationProvider/AssemblyInfo.cs.in +++ b/UIAutomationProvider/AssemblyInfo.cs.in @@ -43,8 +43,6 @@ using System.Security.Permissions; [assembly: NeutralResourcesLanguage ("en")] [assembly: CLSCompliant (true)] -[assembly: AssemblyDelaySign (true)] -[assembly: AssemblyKeyFile ("@abs_top_srcdir@/winfx3.pub")] [assembly: ComVisible (false)] [assembly: AllowPartiallyTrustedCallers] diff --git a/UIAutomationProvider/Makefile.am b/UIAutomationProvider/Makefile.am index 8f1d29b..0cc7ba5 100644 --- a/UIAutomationProvider/Makefile.am +++ b/UIAutomationProvider/Makefile.am @@ -2,7 +2,7 @@ EXTRA_DIST = ASSEMBLY_COMPILER_COMMAND = gmcs -ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 +ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 -delaysign+ -keyfile:@abs_top_srcdir@/winfx3.pub ASSEMBLY = ../bin/UIAutomationProvider.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb diff --git a/UIAutomationSource/AssemblyInfo.cs.in b/UIAutomationSource/AssemblyInfo.cs.in index c14796b..b98b36c 100644 --- a/UIAutomationSource/AssemblyInfo.cs.in +++ b/UIAutomationSource/AssemblyInfo.cs.in @@ -43,8 +43,6 @@ using System.Security.Permissions; [assembly: NeutralResourcesLanguage ("en")] [assembly: CLSCompliant (true)] -[assembly: AssemblyDelaySign (true)] -[assembly: AssemblyKeyFile ("@abs_top_srcdir@/winfx3.pub")] [assembly: ComVisible (false)] [assembly: AllowPartiallyTrustedCallers] diff --git a/UIAutomationSource/Makefile.am b/UIAutomationSource/Makefile.am index 3a623e9..5587df7 100644 --- a/UIAutomationSource/Makefile.am +++ b/UIAutomationSource/Makefile.am @@ -2,7 +2,7 @@ EXTRA_DIST = ASSEMBLY_COMPILER_COMMAND = gmcs -ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 +ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -lib:@expanded_libdir@/mono/accessibility -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 -delaysign+ -keyfile:@abs_top_srcdir@/winfx3.pub ASSEMBLY = ../bin/UIAutomationSource.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb diff --git a/UIAutomationTypes/AssemblyInfo.cs.in b/UIAutomationTypes/AssemblyInfo.cs.in index 9ea6a83..dc1753e 100644 --- a/UIAutomationTypes/AssemblyInfo.cs.in +++ b/UIAutomationTypes/AssemblyInfo.cs.in @@ -43,8 +43,6 @@ using System.Security.Permissions; [assembly: NeutralResourcesLanguage ("en")] [assembly: CLSCompliant (true)] -[assembly: AssemblyDelaySign (true)] -[assembly: AssemblyKeyFile ("@abs_top_srcdir@/winfx3.pub")] [assembly: ComVisible (false)] [assembly: AllowPartiallyTrustedCallers] diff --git a/UIAutomationTypes/Makefile.am b/UIAutomationTypes/Makefile.am index b8beb9b..83a2007 100644 --- a/UIAutomationTypes/Makefile.am +++ b/UIAutomationTypes/Makefile.am @@ -2,7 +2,7 @@ EXTRA_DIST = ASSEMBLY_COMPILER_COMMAND = gmcs -ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 +ASSEMBLY_COMPILER_FLAGS = -lib:@expanded_libdir@/mono/2.0 -lib:../bin -noconfig -codepage:utf8 -warn:4 -warnaserror -optimize+ -debug "-define:DEBUG" -d:NET_2_0 -delaysign+ -keyfile:@abs_top_srcdir@/winfx3.pub ASSEMBLY = ../bin/UIAutomationTypes.dll ASSEMBLY_MDB = $(ASSEMBLY).mdb -- 1.7.5.4 debian/patches/use_net40dir_for_pcfile0000644000000000000000000000276711714005046015247 0ustar Index: mono-uia.git/data/Makefile.am =================================================================== --- mono-uia.git.orig/data/Makefile.am 2012-02-06 17:12:38.154508732 +0000 +++ mono-uia.git/data/Makefile.am 2012-02-06 17:13:04.142689270 +0000 @@ -1,7 +1,7 @@ EXTRA_DIST = -net20dir = $(prefix)/lib/mono/2.0 +net40dir = $(prefix)/lib/mono/4.0 a11ydir = $(prefix)/lib/mono/accessibility SHELL = /bin/sh @@ -13,7 +13,7 @@ REWRITE= mono-uia.pc: mono-uia.pc.in Makefile - sed -e "s,@net20dir@,$(net20dir),g" < mono-uia.pc.in > $@.tmp + sed -e "s,@net40dir@,$(net40dir),g" < mono-uia.pc.in > $@.tmp sed -e "s,@a11ydir@,$(a11ydir),g" < $@.tmp > $@.tmp2 mv $@.tmp2 $@ rm $@.tmp Index: mono-uia.git/data/mono-uia.pc.in.in =================================================================== --- mono-uia.git.orig/data/mono-uia.pc.in.in 2012-02-06 17:12:26.002424264 +0000 +++ mono-uia.git/data/mono-uia.pc.in.in 2012-02-06 17:12:32.146466976 +0000 @@ -2,4 +2,4 @@ Name: UIAutomation Libraries Description: UIAutomation implementation for Mono. Version: @VERSION@ -Libs: -r:@a11ydir@/UIAutomationTypes.dll -r:@a11ydir@/UIAutomationBridge.dll -r:@a11ydir@/UIAutomationProvider.dll -r:@a11ydir@/UIAutomationSource.dll -r:@a11ydir@/UIAutomationClient.dll -r:@net20dir@/WindowsBase.dll +Libs: -r:@a11ydir@/UIAutomationTypes.dll -r:@a11ydir@/UIAutomationBridge.dll -r:@a11ydir@/UIAutomationProvider.dll -r:@a11ydir@/UIAutomationSource.dll -r:@a11ydir@/UIAutomationClient.dll -r:@net40dir@/WindowsBase.dll debian/patches/use_specific_libX11_soname0000644000000000000000000000143011707330142015657 0ustar Index: mono-uia.git/UIAutomationClient/System.Windows.Automation/NativeMethods.cs =================================================================== --- mono-uia.git.orig/UIAutomationClient/System.Windows.Automation/NativeMethods.cs 2012-01-23 19:09:12.855314381 +0000 +++ mono-uia.git/UIAutomationClient/System.Windows.Automation/NativeMethods.cs 2012-01-23 19:09:19.595344463 +0000 @@ -148,7 +148,7 @@ [DllImport ("libgdk-x11-2.0.so.0")] internal static extern IntPtr gdk_x11_display_get_xdisplay (IntPtr handle); - [DllImport("libX11.so")] + [DllImport("libX11.so.6")] private static extern int XQueryTree(IntPtr display, IntPtr w, out IntPtr rootReturn, out IntPtr parentReturn, out IntPtr childrenReturn, out int childrenReturnCount); } -} \ No newline at end of file +} debian/patches/0001-UIAutomationClient-AutomationElement.FromLocalProvid.patch0000644000000000000000000020721511707327240024434 0ustar From 379d89f7ab15ee443d9a164d193f5e9bf3285b69 Mon Sep 17 00:00:00 2001 From: Mario Carrion Date: Tue, 16 Nov 2010 17:01:32 -0500 Subject: [UIAutomationClient] AutomationElement.FromLocalProvider implementation. Fixes BNC #489388 and building with Mono 2.8 --- MoonAtkBridge/MoonAtkBridge.sln | 5 +- UIAutomation/UIAutomationBridge/Makefile.am | 1 + .../Mono.UIAutomation.Services/ArgumentCheck.cs | 42 ++ .../UIAutomationBridge/UIAutomationBridge.csproj | 1 + UIAutomation/UIAutomationClient/Makefile.am | 7 + .../ClientAutomationBridge.cs | 87 ++++ .../ClientAutomationSource.cs | 184 +++++++ .../ClientElement.cs | 514 ++++++++++++++++++++ .../ClientEventManager.cs | 250 ++++++++++ .../ClientInvokePattern.cs | 50 ++ .../System.Windows.Automation/Automation.cs | 60 +-- .../System.Windows.Automation/AutomationElement.cs | 14 +- .../System.Windows.Automation/ClientSettings.cs | 4 +- .../ClientSideProviderDescription.cs | 26 +- .../System.Windows.Automation/SourceManager.cs | 2 + .../UIAutomationClient/UIAutomationClient.csproj | 8 + .../UIAutomationClientTests/BaseTest.cs | 2 + .../UIAutomationClientTests/LocalProviderTest.cs | 172 ++++++- .../UIAutomationClientTests.csproj | 15 +- .../AutomationInteropProvider.cs | 7 +- .../AutomationIdentifier.cs | 6 +- UiaAtkBridge/Test/AtkTest/AtkTest.csproj | 1 + UiaAtkBridge/Test/GailTestApp/gtk-gui/generated.cs | 55 +-- .../Wrappers/ProviderElementWrapper.cs | 16 +- UiaDbus/UiaDbusSource/UiaDbusElement.cs | 2 +- uia2atk.mdw | 2 +- 26 files changed, 1419 insertions(+), 114 deletions(-) create mode 100644 UIAutomation/UIAutomationBridge/Mono.UIAutomation.Services/ArgumentCheck.cs create mode 100644 UIAutomation/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientAutomationBridge.cs create mode 100644 UIAutomation/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientAutomationSource.cs create mode 100644 UIAutomation/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientElement.cs create mode 100644 UIAutomation/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientEventManager.cs create mode 100644 UIAutomation/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientInvokePattern.cs Index: mono-uia.git/UIAutomationBridge/Makefile.am =================================================================== --- mono-uia.git.orig/UIAutomationBridge/Makefile.am 2012-01-23 18:58:34.192473338 +0000 +++ mono-uia.git/UIAutomationBridge/Makefile.am 2012-01-23 18:58:44.776520265 +0000 @@ -28,6 +28,7 @@ PROJECT_SOURCE_FILES = \ Mono.UIAutomation.Bridge/IAutomationBridge.cs \ Mono.UIAutomation.Bridge/IHypertext.cs \ + Mono.UIAutomation.Services/ArgumentCheck.cs \ Mono.UIAutomation.Services/Log.cs FILES = \ Index: mono-uia.git/UIAutomationBridge/Mono.UIAutomation.Services/ArgumentCheck.cs =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ mono-uia.git/UIAutomationBridge/Mono.UIAutomation.Services/ArgumentCheck.cs 2012-01-23 18:58:44.776520265 +0000 @@ -0,0 +1,42 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2010 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Matt Guo +// + +using System; + +namespace Mono.UIAutomation.Services +{ + public static class ArgumentCheck + { + public static void NotNull (T arg, string argName) where T : class { + if (arg == null) + throw new ArgumentNullException (argName); + } + + public static void Assert (T arg, Predicate condition, string errorMessage) { + if (!condition (arg)) + throw new ArgumentException (errorMessage); + } + } +} Index: mono-uia.git/UIAutomationClient/Makefile.am =================================================================== --- mono-uia.git.orig/UIAutomationClient/Makefile.am 2012-01-23 18:58:34.192473338 +0000 +++ mono-uia.git/UIAutomationClient/Makefile.am 2012-01-23 18:58:44.780520283 +0000 @@ -31,6 +31,11 @@ all: $(ASSEMBLY) $(PROGRAMFILES) PROJECT_SOURCE_FILES = \ + Mono.UIAutomation.ClientSource/ClientAutomationBridge.cs \ + Mono.UIAutomation.ClientSource/ClientAutomationSource.cs \ + Mono.UIAutomation.ClientSource/ClientElement.cs \ + Mono.UIAutomation.ClientSource/ClientEventManager.cs \ + Mono.UIAutomation.ClientSource/ClientInvokePattern.cs \ System.Windows.Automation.Text/TextPatternRange.cs \ System.Windows.Automation/AndCondition.cs \ System.Windows.Automation/Automation.cs \ @@ -84,6 +89,8 @@ REFERENCES = \ WindowsBase \ System \ + System.Core \ + Mono.Posix \ $(GTK_SHARP_20_LIBS) DLL_REFERENCES = Index: mono-uia.git/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientAutomationBridge.cs =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ mono-uia.git/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientAutomationBridge.cs 2012-01-23 18:58:44.780520283 +0000 @@ -0,0 +1,87 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2010 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Matt Guo +// + +using System; +using System.Windows.Automation; +using System.Windows.Automation.Provider; +using Mono.UIAutomation.Bridge; + +namespace Mono.UIAutomation.ClientSource +{ + internal class ClientAutomationBridge : IAutomationBridge + { + #region IAutomationBridge implementation + public object HostProviderFromHandle (IntPtr hwnd) + { + return null; + } + + public void RaiseAutomationEvent (AutomationEvent eventId, object provider, AutomationEventArgs e) + { + var providerSimple = provider as IRawElementProviderSimple; + if (providerSimple == null) + return; + ClientEventManager.RaiseAutomationEvent (eventId, providerSimple, e); + } + + public void RaiseAutomationPropertyChangedEvent (object provider, AutomationPropertyChangedEventArgs e) + { + var providerSimple = provider as IRawElementProviderSimple; + if (providerSimple == null) + return; + ClientEventManager.RaiseAutomationPropertyChangedEvent (providerSimple, e); + } + + public void RaiseStructureChangedEvent (object provider, StructureChangedEventArgs e) + { + var providerSimple = provider as IRawElementProviderSimple; + if (providerSimple == null) + return; + ClientEventManager.RaiseStructureChangedEvent (providerSimple, e); + } + + public void Initialize () + { + } + + public void Terminate () + { + } + + public bool IsAccessibilityEnabled { + get { + return true; + } + } + + public bool ClientsAreListening { + get { + return true; + } + } + + #endregion + } +} Index: mono-uia.git/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientAutomationSource.cs =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ mono-uia.git/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientAutomationSource.cs 2012-01-23 18:58:44.780520283 +0000 @@ -0,0 +1,184 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2010 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Matt Guo +// + +using System; +using System.Threading; +using System.Windows.Automation; +using System.Windows.Automation.Provider; +using Mono.UIAutomation.Source; +using Mono.UIAutomation.Services; + +namespace Mono.UIAutomation.ClientSource +{ + internal class ClientAutomationSource : IAutomationSource + { + private static ClientAutomationSource instance = null; + private static object staticLock = new object (); + public static ClientAutomationSource Instance { + get { + if (instance == null) + lock (staticLock) + if (instance == null) + instance = new ClientAutomationSource (); + return instance; + } + } + + #region IAutomationSource implementation + public event EventHandler RootElementsChanged; + + public void Initialize () + { + } + + public IElement [] GetRootElements () + { + return new IElement [0]; + } + + public IElement GetFocusedElement () + { + return null; + } + + public IElement GetElementFromHandle (IntPtr handle) + { + return null; + } + + public void AddAutomationEventHandler (AutomationEvent eventId, IElement element, TreeScope scope, AutomationEventHandler eventHandler) + { + if (element == null) + // elements from local providers are not descendants of the RootElement. + return; + ClientElement clientElement = element as ClientElement; + if (clientElement == null) { + Log.Error ("[ClientAutomationSource.AddAutomationEventHandler] Not ClientElement"); + return; + } + ClientEventManager.AddAutomationEventHandler (eventId, + clientElement.Provider, scope, eventHandler); + } + + public void AddAutomationPropertyChangedEventHandler (IElement element, TreeScope scope, AutomationPropertyChangedEventHandler eventHandler, AutomationProperty[] properties) + { + if (element == null) + return; + ClientElement clientElement = element as ClientElement; + if (clientElement == null) { + Log.Error ("[ClientAutomationSource.AddAutomationPropertyChangedEventHandler] Not ClientElement"); + return; + } + int [] propertyIds = Array.ConvertAll (properties, p => p.Id); + ClientEventManager.AddAutomationPropertyChangedEventHandler ( + clientElement.Provider, scope, eventHandler, propertyIds); + } + + public void AddStructureChangedEventHandler (IElement element, TreeScope scope, StructureChangedEventHandler eventHandler) + { + if (element == null) + return; + ClientElement clientElement = element as ClientElement; + if (clientElement == null) { + Log.Error ("[ClientAutomationSource.AddStructureChangedEventHandler] Not ClientElement"); + return; + } + ClientEventManager.AddStructureChangedEventHandler (clientElement.Provider, + scope, eventHandler); + } + + public void AddAutomationFocusChangedEventHandler (FocusChangedEventHandler eventHandler) + { + // client provider never fires FocusChangedEvent. + return; + } + + public void RemoveAutomationEventHandler (AutomationEvent eventId, IElement element, AutomationEventHandler eventHandler) + { + if (element == null) + return; + ClientElement clientElement = element as ClientElement; + if (clientElement == null) { + Log.Error ("[ClientAutomationSource.RemoveAutomationEventHandler] Not ClientElement"); + return; + } + ClientEventManager.RemoveAutomationEventHandler (eventId, + clientElement.Provider, eventHandler); + } + + public void RemoveAutomationPropertyChangedEventHandler (IElement element, AutomationPropertyChangedEventHandler eventHandler) + { + if (element == null) + return; + ClientElement clientElement = element as ClientElement; + if (clientElement == null) { + Log.Error ("[ClientAutomationSource.RemoveAutomationPropertyChangedEventHandler] Not ClientElement"); + return; + } + ClientEventManager.RemoveAutomationPropertyChangedEventHandler ( + clientElement.Provider, eventHandler); + } + + public void RemoveStructureChangedEventHandler (IElement element, StructureChangedEventHandler eventHandler) + { + if (element == null) + return; + ClientElement clientElement = element as ClientElement; + if (clientElement == null) { + Log.Error ("[ClientAutomationSource.RemoveStructureChangedEventHandler] Not ClientElement"); + return; + } + ClientEventManager.RemoveStructureChangedEventHandler ( + clientElement.Provider, eventHandler); + } + + public void RemoveAutomationFocusChangedEventHandler (FocusChangedEventHandler eventHandler) + { + // client provider never fires FocusChangedEvent. + return; + } + + public void RemoveAllEventHandlers () + { + ClientEventManager.RemoveAllEventHandlers (); + } + + public bool IsAccessibilityEnabled { + get { + return true; + } + } + + #endregion + + public ClientElement GetOrCreateElement (IRawElementProviderSimple provider) + { + if (provider == null) + return null; + //????? + return new ClientElement (this, provider); + } + } +} \ No newline at end of file Index: mono-uia.git/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientElement.cs =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ mono-uia.git/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientElement.cs 2012-01-23 18:58:44.780520283 +0000 @@ -0,0 +1,514 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2010 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Matt Guo +// + +using System; +using System.Windows; +using System.Windows.Automation; +using System.Windows.Automation.Provider; +using Mono.UIAutomation.Source; +using AEIds = System.Windows.Automation.AutomationElementIdentifiers; +using System.Collections.Generic; +using Mono.Unix; +using Mono.UIAutomation.Services; +using System.Linq; + +namespace Mono.UIAutomation.ClientSource +{ + // TODO the ClientElement class shares many common code with UiaDbusBridge.ProviderElementWrapper, + // Any change to refactor and merge these code? + internal class ClientElement : IElement + { + #region All patterns and properties + private static int [] allPatternIds = { + ExpandCollapsePatternIdentifiers.Pattern.Id, + GridItemPatternIdentifiers.Pattern.Id, + GridPatternIdentifiers.Pattern.Id, + InvokePatternIdentifiers.Pattern.Id, + MultipleViewPatternIdentifiers.Pattern.Id, + RangeValuePatternIdentifiers.Pattern.Id, + ScrollPatternIdentifiers.Pattern.Id, + SelectionItemPatternIdentifiers.Pattern.Id, + SelectionPatternIdentifiers.Pattern.Id, + TablePatternIdentifiers.Pattern.Id, + TextPatternIdentifiers.Pattern.Id, + TogglePatternIdentifiers.Pattern.Id, + TransformPatternIdentifiers.Pattern.Id, + ValuePatternIdentifiers.Pattern.Id, + WindowPatternIdentifiers.Pattern.Id, + ScrollItemPatternIdentifiers.Pattern.Id, + DockPatternIdentifiers.Pattern.Id, + TableItemPatternIdentifiers.Pattern.Id + }; + + private static int [] allPropertyIds = { + AutomationElementIdentifiers.IsControlElementProperty.Id, + AutomationElementIdentifiers.ControlTypeProperty.Id, + AutomationElementIdentifiers.IsContentElementProperty.Id, + AutomationElementIdentifiers.LabeledByProperty.Id, + AutomationElementIdentifiers.NativeWindowHandleProperty.Id, + AutomationElementIdentifiers.AutomationIdProperty.Id, + AutomationElementIdentifiers.ItemTypeProperty.Id, + AutomationElementIdentifiers.IsPasswordProperty.Id, + AutomationElementIdentifiers.LocalizedControlTypeProperty.Id, + AutomationElementIdentifiers.NameProperty.Id, + AutomationElementIdentifiers.AcceleratorKeyProperty.Id, + AutomationElementIdentifiers.AccessKeyProperty.Id, + AutomationElementIdentifiers.HasKeyboardFocusProperty.Id, + AutomationElementIdentifiers.IsKeyboardFocusableProperty.Id, + AutomationElementIdentifiers.IsEnabledProperty.Id, + AutomationElementIdentifiers.BoundingRectangleProperty.Id, + AutomationElementIdentifiers.ProcessIdProperty.Id, + AutomationElementIdentifiers.RuntimeIdProperty.Id, + AutomationElementIdentifiers.ClassNameProperty.Id, + AutomationElementIdentifiers.HelpTextProperty.Id, + AutomationElementIdentifiers.ClickablePointProperty.Id, + AutomationElementIdentifiers.CultureProperty.Id, + AutomationElementIdentifiers.IsOffscreenProperty.Id, + AutomationElementIdentifiers.OrientationProperty.Id, + AutomationElementIdentifiers.FrameworkIdProperty.Id, + AutomationElementIdentifiers.IsRequiredForFormProperty.Id, + AutomationElementIdentifiers.ItemStatusProperty.Id, + // Comment Is*PatternAvailableProperty since MS.Net never include those + // properties in the return value of AutomationElement.GetSupportedProperties () + //AutomationElementIdentifiers.IsDockPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsExpandCollapsePatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsGridItemPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsGridPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsInvokePatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsMultipleViewPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsRangeValuePatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsSelectionItemPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsSelectionPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsScrollPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsScrollItemPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsTablePatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsTableItemPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsTextPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsTogglePatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsTransformPatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsValuePatternAvailableProperty.Id, + //AutomationElementIdentifiers.IsWindowPatternAvailableProperty.Id, + ExpandCollapsePatternIdentifiers.ExpandCollapseStateProperty.Id, + GridItemPatternIdentifiers.RowProperty.Id, + GridItemPatternIdentifiers.ColumnProperty.Id, + GridItemPatternIdentifiers.RowSpanProperty.Id, + GridItemPatternIdentifiers.ColumnSpanProperty.Id, + GridItemPatternIdentifiers.ContainingGridProperty.Id, + GridPatternIdentifiers.RowCountProperty.Id, + GridPatternIdentifiers.ColumnCountProperty.Id, + MultipleViewPatternIdentifiers.CurrentViewProperty.Id, + MultipleViewPatternIdentifiers.SupportedViewsProperty.Id, + RangeValuePatternIdentifiers.ValueProperty.Id, + RangeValuePatternIdentifiers.IsReadOnlyProperty.Id, + RangeValuePatternIdentifiers.MinimumProperty.Id, + RangeValuePatternIdentifiers.MaximumProperty.Id, + RangeValuePatternIdentifiers.LargeChangeProperty.Id, + RangeValuePatternIdentifiers.SmallChangeProperty.Id, + ScrollPatternIdentifiers.HorizontalScrollPercentProperty.Id, + ScrollPatternIdentifiers.HorizontalViewSizeProperty.Id, + ScrollPatternIdentifiers.VerticalScrollPercentProperty.Id, + ScrollPatternIdentifiers.VerticalViewSizeProperty.Id, + ScrollPatternIdentifiers.HorizontallyScrollableProperty.Id, + ScrollPatternIdentifiers.VerticallyScrollableProperty.Id, + SelectionItemPatternIdentifiers.IsSelectedProperty.Id, + SelectionItemPatternIdentifiers.SelectionContainerProperty.Id, + SelectionPatternIdentifiers.SelectionProperty.Id, + SelectionPatternIdentifiers.CanSelectMultipleProperty.Id, + SelectionPatternIdentifiers.IsSelectionRequiredProperty.Id, + TablePatternIdentifiers.RowHeadersProperty.Id, + TablePatternIdentifiers.ColumnHeadersProperty.Id, + TablePatternIdentifiers.RowOrColumnMajorProperty.Id, + TogglePatternIdentifiers.ToggleStateProperty.Id, + TransformPatternIdentifiers.CanMoveProperty.Id, + TransformPatternIdentifiers.CanResizeProperty.Id, + TransformPatternIdentifiers.CanRotateProperty.Id, + ValuePatternIdentifiers.ValueProperty.Id, + ValuePatternIdentifiers.IsReadOnlyProperty.Id, + WindowPatternIdentifiers.CanMaximizeProperty.Id, + WindowPatternIdentifiers.CanMinimizeProperty.Id, + WindowPatternIdentifiers.IsModalProperty.Id, + WindowPatternIdentifiers.WindowVisualStateProperty.Id, + WindowPatternIdentifiers.WindowInteractionStateProperty.Id, + WindowPatternIdentifiers.IsTopmostProperty.Id, + DockPatternIdentifiers.DockPositionProperty.Id, + TableItemPatternIdentifiers.RowHeaderItemsProperty.Id, + TableItemPatternIdentifiers.ColumnHeaderItemsProperty.Id + }; + #endregion + + #region Private FIelds + + private ClientAutomationSource source = null; + private IRawElementProviderSimple provider = null; + private IRawElementProviderFragment providerFragment = null; + private IRawElementProviderFragmentRoot providerFragmentRoot = null; + + #endregion + + #region Constructor + + public ClientElement (ClientAutomationSource source, IRawElementProviderSimple provider) + { + ArgumentCheck.NotNull (source, "source"); + ArgumentCheck.NotNull (provider, "provider"); + + this.source = source; + this.provider = provider; + providerFragment = provider as IRawElementProviderFragment; + providerFragmentRoot = provider as IRawElementProviderFragmentRoot; + } + + #endregion + + internal IRawElementProviderSimple Provider { + get { return provider; } + } + + #region IElement implementation + + public bool SupportsProperty (AutomationProperty property) + { + ArgumentCheck.NotNull (property, "property"); + + object val = provider.GetPropertyValue (property.Id); + return val != null && val != AEIds.NotSupported; + } + + public object GetCurrentPattern (AutomationPattern pattern) + { + ArgumentCheck.NotNull (pattern, "pattern"); + + var patternProvider = provider.GetPatternProvider (pattern.Id); + if (patternProvider == null) + throw new InvalidOperationException (); + object ret = null; + if (pattern == InvokePattern.Pattern) + ret = new ClientInvokePattern ((IInvokeProvider) patternProvider); + // TODO implement + // we still have more pattern to implement + else + throw new System.InvalidOperationException (); + return ret; + } + + public AutomationPattern[] GetSupportedPatterns () + { + return (from patternId in allPatternIds + where provider.GetPatternProvider (patternId) != null + select AutomationPattern.LookupById (patternId)).ToArray (); + } + + public AutomationProperty[] GetSupportedProperties () + { + return (from propertyId in allPropertyIds + let val = provider.GetPropertyValue (propertyId) + where val != null && val != AEIds.NotSupported + select AutomationProperty.LookupById (propertyId)).ToArray (); + } + + public void SetFocus () + { + if (!IsKeyboardFocusable) + // as tested on Windows, the InvalidOperationException hasn't any error message + throw new InvalidOperationException (); + if (providerFragment != null) + providerFragment.SetFocus (); + } + + public IElement GetDescendantFromPoint (double x, double y) + { + if (providerFragmentRoot != null) { + var childProvider = + providerFragmentRoot.ElementProviderFromPoint (x, y); + return source.GetOrCreateElement (childProvider); + } + return null; + } + + public string AcceleratorKey { + get { + return provider.GetPropertyValue (AEIds.AcceleratorKeyProperty.Id) + as string ?? string.Empty; + } + } + + public string AccessKey { + get { + return provider.GetPropertyValue (AEIds.AccessKeyProperty.Id) + as string ?? string.Empty; + } + } + + public string AutomationId { + get { + return provider.GetPropertyValue (AEIds.AutomationIdProperty.Id) + as string ?? string.Empty; + } + } + + public Rect BoundingRectangle { + get { + // As tested on Windows, runtime id is solely decided + // by providerFragment.BoundingRectangle, and is irrelevant with + // IRawElementProviderSimple.GetPropertyValue (AEIds.BoundingRectangleProperty) + + if (providerFragment != null) + return providerFragment.BoundingRectangle; + else + return Rect.Empty; + } + } + + public string ClassName { + get { + return provider.GetPropertyValue (AEIds.ClassNameProperty.Id) + as string ?? string.Empty; + } + } + + public Point ClickablePoint { + get { + object obj = provider.GetPropertyValue (AEIds.ClickablePointProperty.Id); + return (obj != null) ? (Point) obj : + new Point (double.NegativeInfinity, double.NegativeInfinity); + } + } + + public ControlType ControlType { + get { + object obj = provider.GetPropertyValue (AEIds.ControlTypeProperty.Id); + return (obj != null) ? ControlType.LookupById ((int) obj) : ControlType.Custom; + } + } + + public string FrameworkId { + get { + return provider.GetPropertyValue (AEIds.FrameworkIdProperty.Id) + as string ?? string.Empty; + } + } + + public bool HasKeyboardFocus { + get { + object obj = provider.GetPropertyValue (AEIds.HasKeyboardFocusProperty.Id); + return (obj != null) ? (bool) obj : false; + } + } + + public string HelpText { + get { + return provider.GetPropertyValue (AEIds.HelpTextProperty.Id) + as string ?? string.Empty; + } + } + + public bool IsContentElement { + get { + object obj = provider.GetPropertyValue (AEIds.IsContentElementProperty.Id); + return (obj != null) ? (bool) obj : false; + } + } + + public bool IsControlElement { + get { + object obj = provider.GetPropertyValue (AEIds.IsControlElementProperty.Id); + return (obj != null) ? (bool) obj : false; + } + } + + public bool IsEnabled { + get { + object obj = provider.GetPropertyValue (AEIds.IsEnabledProperty.Id); + return (obj != null) ? (bool) obj : false; + } + } + + public bool IsKeyboardFocusable { + get { + object obj = provider.GetPropertyValue (AEIds.IsKeyboardFocusableProperty.Id); + return (obj != null) ? (bool) obj : false; + } + } + + public bool IsOffscreen { + get { + object obj = provider.GetPropertyValue (AEIds.IsOffscreenProperty.Id); + return (obj != null) ? (bool) obj : false; + } + } + + public bool IsPassword { + get { + object obj = provider.GetPropertyValue (AEIds.IsPasswordProperty.Id); + return (obj != null) ? (bool) obj : false; + } + } + + public bool IsRequiredForForm { + get { + object obj = provider.GetPropertyValue (AEIds.IsRequiredForFormProperty.Id); + return (obj != null) ? (bool) obj : false; + } + } + + public string ItemStatus { + get { + return provider.GetPropertyValue (AEIds.ItemStatusProperty.Id) + as string ?? string.Empty; + } + } + + public string ItemType { + get { + return provider.GetPropertyValue (AEIds.ItemTypeProperty.Id) + as string ?? string.Empty; + } + } + + public IElement LabeledBy { + get { + var labeledBy = provider.GetPropertyValue (AEIds.LabeledByProperty.Id) + as IRawElementProviderSimple; + return (labeledBy != null) ? source.GetOrCreateElement (labeledBy) : null; + } + } + + public string LocalizedControlType { + get { + var controlType = this.ControlType; + if (controlType == ControlType.DataGrid) + return Catalog.GetString ("data grid"); + else if (controlType == ControlType.DataItem) + return Catalog.GetString ("data item"); + else if (controlType == ControlType.List) + return Catalog.GetString ("list"); + else + return controlType.LocalizedControlType; + } + } + + public string Name { + get { + return provider.GetPropertyValue (AEIds.NameProperty.Id) + as string ?? string.Empty; + } + } + + public int NativeWindowHandle { + get { + object obj = provider.GetPropertyValue (AEIds.NativeWindowHandleProperty.Id); + return (obj != null) ? (int) obj : 0; + } + } + + public OrientationType Orientation { + get { + object obj = provider.GetPropertyValue (AEIds.OrientationProperty.Id); + return (obj != null) ? (OrientationType) obj : OrientationType.None; + } + } + + public int ProcessId { + get { + object obj = provider.GetPropertyValue (AEIds.ProcessIdProperty.Id); + return (obj != null) ? (int) obj : 0; + } + } + + public int[] RuntimeId { + get { + // As tested on Windows, runtime id is solely decided + // by providerFragment.GetRuntimeId, and is irrelevant with + // IRawElementProviderSimple.GetPropertyValue (AEIds.RuntimeIdProperty) + // + // An expcetion: if the runtime id is not explicitly provided, while + // native handle is provided, then UIA will generate a runtime id for the provider, + // on Windows 7 the runtime id is [42, NativeHandleValue] + int [] runtimeId = null; + if (providerFragment != null) + runtimeId = providerFragment.GetRuntimeId (); + else { + int hwnd = this.NativeWindowHandle; + if (hwnd != 0) + runtimeId = new int [] {42, hwnd}; + } + return runtimeId; + } + } + + public IElement Parent { + get { + if (providerFragment == null) + return null; + return source.GetOrCreateElement ( + providerFragment.Navigate (NavigateDirection.Parent)); + } + } + + public IElement FirstChild { + get { + if (providerFragment == null) + return null; + return source.GetOrCreateElement ( + providerFragment.Navigate (NavigateDirection.FirstChild)); + } + } + + public IElement LastChild { + get { + if (providerFragment == null) + return null; + return source.GetOrCreateElement ( + providerFragment.Navigate (NavigateDirection.LastChild)); + } + } + + public IElement NextSibling { + get { + if (providerFragment == null) + return null; + return source.GetOrCreateElement ( + providerFragment.Navigate (NavigateDirection.NextSibling)); + } + } + + public IElement PreviousSibling { + get { + if (providerFragment == null) + return null; + return source.GetOrCreateElement ( + providerFragment.Navigate (NavigateDirection.PreviousSibling)); + } + } + + public IAutomationSource AutomationSource { + get { + return source; + } + } + + #endregion + } +} Index: mono-uia.git/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientEventManager.cs =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ mono-uia.git/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientEventManager.cs 2012-01-23 18:58:44.780520283 +0000 @@ -0,0 +1,250 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2010 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Matt Guo +// + +using System; +using System.Collections.Generic; +using System.Windows.Automation; +using System.Windows.Automation.Provider; +using Mono.UIAutomation.Source; + +namespace Mono.UIAutomation.ClientSource +{ + internal static class ClientEventManager + { + private static List propertyChangedEventEntries + = new List (); + private static List automationEventEntries + = new List (); + private static List structureChangedEventEntries + = new List (); + + public static void AddAutomationEventHandler (AutomationEvent eventId, + IRawElementProviderSimple provider, TreeScope scope, + AutomationEventHandler eventHandler) + { + var entry = new AutomationEventEntry (eventId, provider, scope, eventHandler); + lock (automationEventEntries) + automationEventEntries.Add (entry); + } + + public static void AddAutomationPropertyChangedEventHandler ( + IRawElementProviderSimple provider, TreeScope scope, + AutomationPropertyChangedEventHandler eventHandler, + int [] properties) + { + var entry = new PropertyChangedEventEntry (provider, scope, properties, eventHandler); + lock (propertyChangedEventEntries) + propertyChangedEventEntries.Add (entry); + } + + public static void AddStructureChangedEventHandler ( + IRawElementProviderSimple provider, TreeScope scope, + StructureChangedEventHandler eventHandler) + { + var entry = new StructureChangedEventEntry (provider, scope, eventHandler); + lock (structureChangedEventEntries) + structureChangedEventEntries.Add (entry); + } + + public static void RemoveAutomationEventHandler (AutomationEvent eventId, IRawElementProviderSimple provider, AutomationEventHandler eventHandler) + { + lock (automationEventEntries) + automationEventEntries.RemoveAll (e => + e.EventId == eventId && + e.Provider == provider && + e.Handler == eventHandler); + } + + public static void RemoveAutomationPropertyChangedEventHandler (IRawElementProviderSimple provider, AutomationPropertyChangedEventHandler eventHandler) + { + lock (propertyChangedEventEntries) + propertyChangedEventEntries.RemoveAll (e => + e.Provider == provider && + e.Handler == eventHandler); + } + + public static void RemoveStructureChangedEventHandler (IRawElementProviderSimple provider, StructureChangedEventHandler eventHandler) + { + lock (structureChangedEventEntries) + structureChangedEventEntries.RemoveAll (e => + e.Provider == provider && + e.Handler == eventHandler); + } + + public static void RemoveAllEventHandlers () + { + lock (automationEventEntries) + automationEventEntries.Clear (); + lock (structureChangedEventEntries) + structureChangedEventEntries.Clear (); + lock (propertyChangedEventEntries) + propertyChangedEventEntries.Clear (); + } + + public static void RaiseAutomationEvent (AutomationEvent eventId, + IRawElementProviderSimple provider, AutomationEventArgs e) + { + lock (automationEventEntries) + foreach (var entry in automationEventEntries) + if (entry.EventId == eventId && + IsProviderInScope (provider, entry.Provider, entry.Scope)) { + var clientElement = + ClientAutomationSource.Instance.GetOrCreateElement (provider); + var element = SourceManager.GetOrCreateAutomationElement (clientElement); + entry.Handler (element, e); + } + } + + public static void RaiseAutomationPropertyChangedEvent (IRawElementProviderSimple provider, + AutomationPropertyChangedEventArgs e) + { + lock (propertyChangedEventEntries) + foreach (var entry in propertyChangedEventEntries) + if (IsProviderInScope (provider, entry.Provider, entry.Scope) && + Array.Exists (entry.Properties, i => i == e.Property.Id)) { + var clientElement = + ClientAutomationSource.Instance.GetOrCreateElement (provider); + var element = SourceManager.GetOrCreateAutomationElement (clientElement); + // TODO implement + // Translate e.NewValue && e.OldValue + entry.Handler (element, e); + } + } + + public static void RaiseStructureChangedEvent (IRawElementProviderSimple provider, + StructureChangedEventArgs e) + { + lock (structureChangedEventEntries) + foreach (var entry in structureChangedEventEntries) + if (IsProviderInScope (provider, entry.Provider, entry.Scope)) { + var clientElement = + ClientAutomationSource.Instance.GetOrCreateElement (provider); + var element = SourceManager.GetOrCreateAutomationElement (clientElement); + entry.Handler (element, e); + } + } + + private static bool IsProviderInScope (IRawElementProviderSimple target, + IRawElementProviderSimple element, TreeScope scope) + { + if ((scope & TreeScope.Element) == TreeScope.Element && target == element) + return true; + + IRawElementProviderFragment targetFragment = target as IRawElementProviderFragment; + IRawElementProviderFragment elementFragment = element as IRawElementProviderFragment; + if (targetFragment == null || elementFragment == null) + return false; + + IRawElementProviderFragment targetFragmentRoot = + targetFragment.Navigate (NavigateDirection.Parent); + if ((scope & TreeScope.Children) == TreeScope.Children && + targetFragmentRoot != null && + targetFragmentRoot == elementFragment) + return true; + if ((scope & TreeScope.Descendants) == TreeScope.Descendants) { + while (targetFragmentRoot != null) { + if (targetFragmentRoot == elementFragment) + return true; + targetFragmentRoot = targetFragmentRoot.Navigate (NavigateDirection.Parent); + } + } + + IRawElementProviderFragment elementFragmentRoot = + elementFragment.Navigate (NavigateDirection.Parent); + if ((scope & TreeScope.Parent) == TreeScope.Parent && + elementFragmentRoot != null && + elementFragmentRoot == targetFragment) + return true; + if ((scope & TreeScope.Ancestors) == TreeScope.Ancestors) { + while (elementFragmentRoot != null) { + if (elementFragmentRoot == targetFragment) + return true; + elementFragmentRoot = elementFragmentRoot.Navigate (NavigateDirection.Parent); + } + } + + return false; + } +#region Internal Classes + + private class AutomationEventEntryBase + { + public AutomationEventEntryBase (IRawElementProviderSimple provider, + TreeScope scope) + { + this.Provider = provider; + this.Scope = scope; + } + + public IRawElementProviderSimple Provider { get; private set; } + public TreeScope Scope { get; private set; } + } + + private class StructureChangedEventEntry : AutomationEventEntryBase + { + public StructureChangedEventEntry (IRawElementProviderSimple provider, + TreeScope scope, + StructureChangedEventHandler handler) + : base (provider, scope) + { + this.Handler = handler; + } + public StructureChangedEventHandler Handler { get; private set; } + } + + private class AutomationEventEntry : AutomationEventEntryBase + { + public AutomationEventEntry (AutomationEvent eventId, + IRawElementProviderSimple provider, + TreeScope scope, + AutomationEventHandler handler) + : base (provider, scope) + { + this.EventId = eventId; + this.Handler = handler; + } + + public AutomationEvent EventId { get; private set; } + public AutomationEventHandler Handler { get; private set; } + } + + private class PropertyChangedEventEntry : AutomationEventEntryBase + { + public PropertyChangedEventEntry (IRawElementProviderSimple provider, + TreeScope scope, + int [] properties, + AutomationPropertyChangedEventHandler handler) + : base (provider, scope) + { + this.Properties = properties; + this.Handler = handler; + } + + public int [] Properties { get; private set; } + public AutomationPropertyChangedEventHandler Handler { get; private set; } + } +#endregion + } +} Index: mono-uia.git/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientInvokePattern.cs =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ mono-uia.git/UIAutomationClient/Mono.UIAutomation.ClientSource/ClientInvokePattern.cs 2012-01-23 18:58:44.780520283 +0000 @@ -0,0 +1,50 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2010 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Matt Guo +// + +using System; +using System.Windows.Automation; +using System.Windows.Automation.Provider; +using Mono.UIAutomation.Source; + +namespace Mono.UIAutomation.ClientSource +{ + internal class ClientInvokePattern : IInvokePattern + { + private IInvokeProvider provider = null; + + public ClientInvokePattern (IInvokeProvider provider) + { + this.provider = provider; + } + + #region IInvokePattern implementation + public void Invoke () + { + provider.Invoke (); + } + + #endregion + } +} Index: mono-uia.git/UIAutomationClient/System.Windows.Automation/Automation.cs =================================================================== --- mono-uia.git.orig/UIAutomationClient/System.Windows.Automation/Automation.cs 2011-03-06 12:25:27.000000000 +0000 +++ mono-uia.git/UIAutomationClient/System.Windows.Automation/Automation.cs 2012-01-23 18:58:44.780520283 +0000 @@ -28,6 +28,7 @@ using AEIds = System.Windows.Automation.AutomationElementIdentifiers; using MUS = Mono.UIAutomation.Source; +using Mono.UIAutomation.Services; namespace System.Windows.Automation { @@ -309,14 +310,13 @@ TreeScope scope, AutomationEventHandler eventHandler) { - if (element == null) - throw new ArgumentNullException ("element"); - if (eventHandler == null) - throw new ArgumentNullException ("eventHandler"); + CheckAutomationEventId (eventId); + ArgumentCheck.NotNull (element, "element"); + ArgumentCheck.NotNull (eventHandler, "eventHandler"); + //TODO In theory we shall also check scope not equals to Parent or Ancestors, //but .Net didn't test/throw exceptions for "scope" - CheckAutomationEventId (eventId.Id); if (element == AutomationElement.RootElement) foreach (var source in SourceManager.GetAutomationSources ()) source.AddAutomationEventHandler ( @@ -330,8 +330,7 @@ public static void AddAutomationFocusChangedEventHandler (AutomationFocusChangedEventHandler eventHandler) { - if (eventHandler == null) - throw new ArgumentNullException ("eventHandler"); + ArgumentCheck.NotNull (eventHandler, "eventHandler"); MUS.FocusChangedEventHandler sourceHandler; //according to the spec, all static methods in the UIA lib shall be thread safe. @@ -352,10 +351,8 @@ AutomationPropertyChangedEventHandler eventHandler, params AutomationProperty [] properties) { - if (element == null) - throw new ArgumentNullException ("element"); - if (eventHandler == null) - throw new ArgumentNullException ("eventHandler"); + ArgumentCheck.NotNull (element, "element"); + ArgumentCheck.NotNull (eventHandler, "eventHandler"); if (element == AutomationElement.RootElement) foreach (var source in SourceManager.GetAutomationSources ()) @@ -372,10 +369,8 @@ TreeScope scope, StructureChangedEventHandler eventHandler) { - if (element == null) - throw new ArgumentNullException ("element"); - if (eventHandler == null) - throw new ArgumentNullException ("eventHandler"); + ArgumentCheck.NotNull (element, "element"); + ArgumentCheck.NotNull (eventHandler, "eventHandler"); if (element == AutomationElement.RootElement) foreach (var source in SourceManager.GetAutomationSources ()) @@ -402,12 +397,9 @@ AutomationElement element, AutomationEventHandler eventHandler) { - if (element == null) - throw new ArgumentNullException ("element"); - if (eventHandler == null) - throw new ArgumentNullException ("eventHandler"); - - CheckAutomationEventId (eventId.Id); + CheckAutomationEventId (eventId); + ArgumentCheck.NotNull (element, "element"); + ArgumentCheck.NotNull (eventHandler, "eventHandler"); if (element == AutomationElement.RootElement) foreach (var source in SourceManager.GetAutomationSources ()) @@ -421,8 +413,7 @@ public static void RemoveAutomationFocusChangedEventHandler (AutomationFocusChangedEventHandler eventHandler) { - if (eventHandler == null) - throw new ArgumentNullException ("eventHandler"); + ArgumentCheck.NotNull (eventHandler, "eventHandler"); MUS.FocusChangedEventHandler sourceHandler; lock (focusHandlerMapping) { @@ -437,10 +428,8 @@ public static void RemoveAutomationPropertyChangedEventHandler ( AutomationElement element, AutomationPropertyChangedEventHandler eventHandler) { - if (element == null) - throw new ArgumentNullException ("element"); - if (eventHandler == null) - throw new ArgumentNullException ("eventHandler"); + ArgumentCheck.NotNull (element, "element"); + ArgumentCheck.NotNull (eventHandler, "eventHandler"); if (element == AutomationElement.RootElement) foreach (var source in SourceManager.GetAutomationSources ()) @@ -456,10 +445,8 @@ public static void RemoveStructureChangedEventHandler ( AutomationElement element, StructureChangedEventHandler eventHandler) { - if (element == null) - throw new ArgumentNullException ("element"); - if (eventHandler == null) - throw new ArgumentNullException ("eventHandler"); + ArgumentCheck.NotNull (element, "element"); + ArgumentCheck.NotNull (eventHandler, "eventHandler"); if (element == AutomationElement.RootElement) foreach (var source in SourceManager.GetAutomationSources ()) @@ -472,12 +459,13 @@ } } - private static void CheckAutomationEventId (int eventId) + private static void CheckAutomationEventId (AutomationEvent eventId) { - if (AutomationElementIdentifiers.AutomationFocusChangedEvent.Id == eventId - || AutomationElementIdentifiers.AutomationFocusChangedEvent.Id == eventId - || AutomationElementIdentifiers.AutomationPropertyChangedEvent.Id == eventId - || AutomationElementIdentifiers.StructureChangedEvent.Id == eventId) + ArgumentCheck.NotNull (eventId, "eventId"); + if (AutomationElementIdentifiers.AutomationFocusChangedEvent == eventId + || AutomationElementIdentifiers.AutomationFocusChangedEvent == eventId + || AutomationElementIdentifiers.AutomationPropertyChangedEvent == eventId + || AutomationElementIdentifiers.StructureChangedEvent == eventId) throw new ArgumentException ("eventId"); } Index: mono-uia.git/UIAutomationClient/System.Windows.Automation/AutomationElement.cs =================================================================== --- mono-uia.git.orig/UIAutomationClient/System.Windows.Automation/AutomationElement.cs 2011-03-06 12:25:27.000000000 +0000 +++ mono-uia.git/UIAutomationClient/System.Windows.Automation/AutomationElement.cs 2012-01-23 18:58:44.780520283 +0000 @@ -523,8 +523,7 @@ #region Public Static Methods public static AutomationElement FromHandle (IntPtr hwnd) { - if (hwnd == (IntPtr) null || hwnd == IntPtr.Zero) - throw new ArgumentException ("hwnd"); + ArgumentCheck.Assert (hwnd, (h => h != IntPtr.Zero), "hwnd"); if (hwnd == NativeMethods.RootWindowHandle) return RootElement; AutomationElement element = null; @@ -542,7 +541,9 @@ public static AutomationElement FromLocalProvider (IRawElementProviderSimple localImpl) { - throw new NotImplementedException (); + IElement sourceElement = Mono.UIAutomation.ClientSource.ClientAutomationSource.Instance + .GetOrCreateElement (localImpl); + return new AutomationElement (sourceElement); } public static AutomationElement FromPoint (Point pt) @@ -550,7 +551,12 @@ IntPtr handle = NativeMethods.WindowAtPosition ((int) pt.X, (int) pt.Y); if (handle == IntPtr.Zero) return RootElement; - AutomationElement startElement = FromHandle (handle); + AutomationElement startElement = null; + try { + startElement = FromHandle (handle); + } catch (ElementNotAvailableException) { + return RootElement; + } if (startElement == RootElement) return RootElement; //Keep searching the descendant element which are not native window Index: mono-uia.git/UIAutomationClient/System.Windows.Automation/ClientSettings.cs =================================================================== --- mono-uia.git.orig/UIAutomationClient/System.Windows.Automation/ClientSettings.cs 2011-03-06 12:25:27.000000000 +0000 +++ mono-uia.git/UIAutomationClient/System.Windows.Automation/ClientSettings.cs 2012-01-23 18:58:44.780520283 +0000 @@ -26,6 +26,7 @@ using System; using System.Reflection; using System.IO; +using Mono.UIAutomation.Services; namespace System.Windows.Automation { @@ -33,8 +34,7 @@ { public static void RegisterClientSideProviderAssembly (AssemblyName assemblyName) { - if (assemblyName == null) - throw new ArgumentNullException ("assemblyName"); + ArgumentCheck.NotNull (assemblyName, "assemblyName"); Assembly assembly = null; // TODO, wrap exception messages into Catalog.GetString Index: mono-uia.git/UIAutomationClient/System.Windows.Automation/ClientSideProviderDescription.cs =================================================================== --- mono-uia.git.orig/UIAutomationClient/System.Windows.Automation/ClientSideProviderDescription.cs 2011-03-06 12:25:27.000000000 +0000 +++ mono-uia.git/UIAutomationClient/System.Windows.Automation/ClientSideProviderDescription.cs 2012-01-23 18:58:44.780520283 +0000 @@ -44,16 +44,23 @@ string imageName, ClientSideProviderMatchIndicator flags) { - this.ClientSideProviderFactoryCallback = clientSideProviderFactoryCallback; - this.ClassName = className; - this.ImageName = imageName; - this.Flags = flags; + this.clientSideProviderFactoryCallback = clientSideProviderFactoryCallback; + this.className = className; + this.imageName = imageName; + this.flags = flags; } - public string ClassName { get; private set; } - public ClientSideProviderMatchIndicator Flags { get; private set; } - public string ImageName { get; private set; } - public ClientSideProviderFactoryCallback ClientSideProviderFactoryCallback { get; private set; } + public string ClassName { get { return className; } } + public ClientSideProviderMatchIndicator Flags { get { return flags; } } + public string ImageName { get { return imageName; } } + public ClientSideProviderFactoryCallback ClientSideProviderFactoryCallback { + get { return clientSideProviderFactoryCallback; } + } + + private string className; + private ClientSideProviderFactoryCallback clientSideProviderFactoryCallback; + private ClientSideProviderMatchIndicator flags; + private string imageName; } [Flags] @@ -64,5 +71,6 @@ DisallowBaseClassNameMatch } - public delegate IRawElementProviderSimple ClientSideProviderFactoryCallback (IntPtr hwnd, int idChild, int idObject); + public delegate IRawElementProviderSimple ClientSideProviderFactoryCallback ( + IntPtr hwnd, int idChild, int idObject); } Index: mono-uia.git/UIAutomationClient/System.Windows.Automation/SourceManager.cs =================================================================== --- mono-uia.git.orig/UIAutomationClient/System.Windows.Automation/SourceManager.cs 2011-03-06 12:25:27.000000000 +0000 +++ mono-uia.git/UIAutomationClient/System.Windows.Automation/SourceManager.cs 2012-01-23 18:58:44.780520283 +0000 @@ -29,6 +29,7 @@ using Mono.UIAutomation.Source; using Mono.UIAutomation.Services; +using Mono.UIAutomation.ClientSource; namespace System.Windows.Automation { @@ -63,6 +64,7 @@ if (source != null) sourcesList.Add (source); } + sourcesList.Add (ClientAutomationSource.Instance); sources = sourcesList.ToArray (); } } Index: mono-uia.git/UIAutomationClientTests/UIAutomationClientTests/BaseTest.cs =================================================================== --- mono-uia.git.orig/UIAutomationClientTests/UIAutomationClientTests/BaseTest.cs 2011-03-06 12:25:27.000000000 +0000 +++ mono-uia.git/UIAutomationClientTests/UIAutomationClientTests/BaseTest.cs 2012-01-23 18:58:44.780520283 +0000 @@ -471,6 +471,8 @@ public static string PrintRuntimeId (int [] runtimeId) { + if (runtimeId == null) + return "(null)"; StringBuilder sb = new StringBuilder(); sb.Append ("["); foreach (int id in runtimeId) Index: mono-uia.git/UIAutomationClientTests/UIAutomationClientTests/LocalProviderTest.cs =================================================================== --- mono-uia.git.orig/UIAutomationClientTests/UIAutomationClientTests/LocalProviderTest.cs 2011-03-06 12:25:27.000000000 +0000 +++ mono-uia.git/UIAutomationClientTests/UIAutomationClientTests/LocalProviderTest.cs 2012-01-23 19:01:38.121289614 +0000 @@ -38,17 +38,27 @@ [TestFixture] public class LocalProviderTest { + const int FakeHandle = 12345; + + private AutomationElement simple = null; + private AutomationElement simple2 = null; private AutomationElement child = null; private AutomationElement root = null; + private CustomProviderSimple simpleProvider =null; + private CustomProviderSimple simpleProvider2 =null; private CustomProviderFragment childProvider =null; private CustomProviderRoot rootProvider =null; [TestFixtureSetUp] public virtual void FixtureSetUp () { + simpleProvider = new CustomProviderSimple (); + simpleProvider2 = new CustomProviderSimple (FakeHandle); childProvider = new CustomProviderFragment (null); - rootProvider = new CustomProviderRoot(childProvider); + rootProvider = new CustomProviderRoot (childProvider); childProvider.Root = rootProvider; + simple = AutomationElement.FromLocalProvider (simpleProvider); + simple2 = AutomationElement.FromLocalProvider (simpleProvider2); child = AutomationElement.FromLocalProvider(childProvider); root = AutomationElement.FromLocalProvider(rootProvider); } @@ -57,12 +67,93 @@ [Test] public void PropertyTest () { - Assert.AreEqual ("Custom Simple", child.Current.Name); + Assert.AreEqual ("Custom Child", child.Current.Name); Assert.AreEqual (ControlType.TabItem, child.Current.ControlType); Assert.AreEqual ("Custom Root", root.Current.Name); Assert.AreEqual (ControlType.Tab, root.Current.ControlType); } + // IRawElementFragment's GetRuntimeId method will override + // the value returned by GetPropertyValue + [Test] + public void RuntimeIdOverrideTest () + { + var rid1 = root.GetRuntimeId (); + var rid2 = (int []) root.GetCurrentPropertyValue (AEIds.RuntimeIdProperty); + Assert.AreEqual (rid1, rid2, "rid1 == rid2"); + Assert.AreEqual (CustomProviderBase.CustomRuntimeIdPrefix, rid1 [0], "Check rid1"); + Assert.AreEqual (CustomProviderBase.CustomRuntimeIdPrefix, rid2 [0], "Check rid2"); + + // RuntimeId is null even if it is explicitly returned by + // IRawElementSimple.GetPropertyValue + Assert.IsNull (simple.GetRuntimeId (), "simple.GetRuntimeId ()" ); + Assert.IsNull (simple.GetCurrentPropertyValue (AEIds.RuntimeIdProperty), + "simple.GetGetCurrentPropertyValue (RuntimeId)" ); + + // However if the IRawElementSimple has NativeHandleProperty, + // then UIA will generate a runtime id for the provider, + // on Windows 7 the runtime id is [42, NativeHandleValue] + Assert.IsNotNull (simple2.GetRuntimeId (), "simple2.GetRuntimeId ()" ); + } + + // IRawElementFragment's BoundingRectangle property will override + // the value returned by GetPropertyValue + [Test] + public void BoundingRectangleOverrideTest () + { + var bound = root.Current.BoundingRectangle; + Assert.AreEqual (200.0, bound.Width, "bound.Width"); + + // BoundingRectangle is empty even if it is explicitly returned by + // IRawElementSimple.GetPropertyValue + Assert.IsTrue (simple.Current.BoundingRectangle.IsEmpty); + } + + [Test] + public void DefaultPropertyValueTest () + { + // LocalizedControlType is compatible with the ControlType though + // LocalizedControlType is not explicitly returned by ControlType + Assert.AreEqual (ControlType.Tab.LocalizedControlType, root.Current.LocalizedControlType, + "root.LocalizedControlType"); + // IsInvokePatternAvailableProperty is automatically set to true as long as + // the pattern can be returned by GetPatternProvider + Assert.IsTrue ((bool) child.GetCurrentPropertyValue (AEIds.IsInvokePatternAvailableProperty), + "child.IsInvokePatternAvailable"); + Assert.IsFalse ((bool) root.GetCurrentPropertyValue (AEIds.IsInvokePatternAvailableProperty), + "root.IsInvokePatternAvailable"); + } + + [Test] + public void FromPointTest () + { + var element = AutomationElement.FromPoint (new SW.Point (100, 100)); + // though child and root defined their bounds, they won't be returned by + // AutomationElement.FromPoint, actually on Windows what returned is the + // "Desktop" element. + Assert.AreNotEqual (element, child, "child is never returned by FromPoint"); + Assert.AreNotEqual (element, root, "root is never returned by FromPoint"); + } + + [Test] + public void FromHandleTest () + { + BaseTest.AssertRaises ( + () => AutomationElement.FromHandle (new IntPtr (FakeHandle)), + "simple2 is never returned by FromHandle"); + } + + [Test] + public void FocusedElementTest () + { + BaseTest.AssertRaises ( + () => child.SetFocus (), "child.IsKeyboardFocusable is not set"); + // root.IsKeyboardFocusable is set to ture, so no exception + root.SetFocus (); + Assert.AreNotEqual (AutomationElement.FocusedElement, root, + "root is never returned by FocusedElement"); + } + [Test] public void PatternTest () { @@ -112,10 +203,58 @@ #endregion } + internal class CustomProviderSimple : IRawElementProviderSimple + { + private int handle = -1; + + public CustomProviderSimple () + { + } + + public CustomProviderSimple (int handle) + { + this.handle = handle; + } + + #region IRawElementProviderSimple Members + + public virtual object GetPatternProvider (int patternId) + { + return null; + } + + public virtual object GetPropertyValue (int propertyId) + { + if (propertyId == AEIds.NameProperty.Id) + return "Custom Simple"; + if (propertyId == AEIds.ControlTypeProperty.Id) + return ControlType.Pane.Id; + else if (propertyId == AEIds.RuntimeIdProperty.Id) + return new int[] {1, 2, 3, 4, 5}; + else if (propertyId == AEIds.BoundingRectangleProperty.Id) + return new SW.Rect (0, 0, 1000, 1000); + else if (propertyId == AEIds.NativeWindowHandleProperty.Id && handle != -1) + return handle; + else + return null; + } + + public IRawElementProviderSimple HostRawElementProvider { + get { return null; } + } + + public ProviderOptions ProviderOptions { + get { return ProviderOptions.ClientSideProvider; } + } + + #endregion + } + internal class CustomProviderBase : IRawElementProviderFragment { + public const int CustomRuntimeIdPrefix = 8888; private int[] runtimeId = null; - private SW.Rect rect = new SW.Rect (100.0, 100.0, 200.0, 200.0); + private SW.Rect bound = new SW.Rect (50.0, 50.0, 200.0, 200.0); public CustomProviderBase (IRawElementProviderFragmentRoot root) { @@ -127,7 +266,7 @@ #region IRawElementProviderFragment Members public SW.Rect BoundingRectangle { - get { return rect; } + get { return bound; } } public IRawElementProviderFragmentRoot FragmentRoot { @@ -139,13 +278,12 @@ return new IRawElementProviderSimple[0]; } - public int [] GetRuntimeId () + public int[] GetRuntimeId () { - const int CustomPrefix = 8888; if (runtimeId == null) { - byte [] bytes = new Guid ().ToByteArray (); + byte [] bytes = Guid.NewGuid ().ToByteArray (); runtimeId = new int [bytes.Length + 1]; - runtimeId [0] = CustomPrefix; + runtimeId [0] = CustomRuntimeIdPrefix; for (int i = 0; i < bytes.Length; i++) runtimeId [i + 1] = bytes [i]; } @@ -198,11 +336,10 @@ } public int ClickCount { get; set; } - - public void PerformInvoke () + public void PerformInvoke() { ClickCount++; - AutomationInteropProvider.RaiseAutomationEvent(InvokePattern.InvokedEvent, this, + AutomationInteropProvider.RaiseAutomationEvent (InvokePattern.InvokedEvent, this, new AutomationEventArgs(InvokePattern.InvokedEvent)); } @@ -216,7 +353,7 @@ public override object GetPropertyValue (int propertyId) { if (propertyId == AEIds.NameProperty.Id) - return "Custom Simple"; + return "Custom Child"; else if (propertyId == AEIds.ControlTypeProperty.Id) return ControlType.TabItem.Id; else @@ -283,6 +420,14 @@ return "Custom Root"; else if (propertyId == AEIds.ControlTypeProperty.Id) return ControlType.Tab.Id; + else if (propertyId == AEIds.RuntimeIdProperty.Id) + // this return value won't be effective since the base class defined GetRuntimeId method + return new int[] {1, 2, 3, 4, 5}; + else if (propertyId == AEIds.BoundingRectangleProperty.Id) + // this return value won't be effective since the base class defined BoundingRectangle property + return new SW.Rect (0, 0, 1000, 1000); + else if (propertyId == AEIds.IsKeyboardFocusableProperty.Id) + return true; else return base.GetPropertyValue (propertyId); } Index: mono-uia.git/UIAutomationProvider/System.Windows.Automation.Provider/AutomationInteropProvider.cs =================================================================== --- mono-uia.git.orig/UIAutomationProvider/System.Windows.Automation.Provider/AutomationInteropProvider.cs 2011-03-06 12:25:27.000000000 +0000 +++ mono-uia.git/UIAutomationProvider/System.Windows.Automation.Provider/AutomationInteropProvider.cs 2012-01-23 18:58:44.784520301 +0000 @@ -123,11 +123,13 @@ "UiaAtkBridge, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f4ceacb585d99812"; private static string UiaDbusBridgeAssembly = "UiaDbusBridge, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f4ceacb585d99812"; + private static string clientBridgeAssembly = + "UIAutomationClient, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; public static IList GetAutomationBridges () { List bridges = new List (); - + // Let MONO_UIA_BRIDGE env var override default bridge string bridgeAssemblyNames = Environment.GetEnvironmentVariable ("MONO_UIA_BRIDGE"); @@ -135,7 +137,8 @@ if (string.IsNullOrEmpty (bridgeAssemblyNames)) bridgeAssemblyNames = UiaAtkBridgeAssembly + ";" + UiaDbusBridgeAssembly; - + bridgeAssemblyNames += ";" + clientBridgeAssembly; + foreach (string bridgeAssembly in bridgeAssemblyNames.Split (';')) { if (string.IsNullOrEmpty (bridgeAssembly)) continue; Index: mono-uia.git/UIAutomationTypes/System.Windows.Automation/AutomationIdentifier.cs =================================================================== --- mono-uia.git.orig/UIAutomationTypes/System.Windows.Automation/AutomationIdentifier.cs 2011-03-06 12:25:27.000000000 +0000 +++ mono-uia.git/UIAutomationTypes/System.Windows.Automation/AutomationIdentifier.cs 2012-01-23 18:58:44.784520301 +0000 @@ -57,10 +57,14 @@ public int CompareTo (object obj) { + if (obj == null) + throw new ArgumentNullException ("obj"); AutomationIdentifier other = obj as AutomationIdentifier; if (other == null) - return 1; // TODO: What? + // As tested on Windows, when the object is not an AutomationIdentifier, + // a strange large integer will be returned, so we just return the MaxValue. + return int.MaxValue; return id.CompareTo (other.Id); } debian/patches/avoid_obsolete_security_requests0000644000000000000000000001574211714002761017430 0ustar Index: mono-uia/UIAutomationBridge/AssemblyInfo.cs.in =================================================================== --- mono-uia.orig/UIAutomationBridge/AssemblyInfo.cs.in 2012-01-24 19:29:28.000000000 +0000 +++ mono-uia/UIAutomationBridge/AssemblyInfo.cs.in 2012-01-24 19:29:43.000000000 +0000 @@ -50,5 +50,3 @@ [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -[assembly: PermissionSet (SecurityAction.RequestMinimum, Name = "FullTrust")] -[assembly: SecurityPermission (SecurityAction.RequestMinimum, SkipVerification = true)] Index: mono-uia/UIAutomationClient/AssemblyInfo.cs.in =================================================================== --- mono-uia.orig/UIAutomationClient/AssemblyInfo.cs.in 2012-01-24 19:29:28.000000000 +0000 +++ mono-uia/UIAutomationClient/AssemblyInfo.cs.in 2012-01-24 19:29:50.000000000 +0000 @@ -49,8 +49,6 @@ [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -[assembly: PermissionSet (SecurityAction.RequestMinimum, Name = "FullTrust")] [assembly: InternalsVisibleTo ("UiaDbusSource, PublicKey=00240000048000009400000006020000002400005253413100040000110000004bb98b1af6c1df0df8c02c380e116b7a7f0c8c827aecfccddc6e29b7c754cd608b49dfcef4df9699ad182e50f66afa4e68dabc7b6aeeec0aa4719a5f8e0aae8c193080a706adc3443a8356b1f254142034995532ac176398e12a30f6a74a119a89ac47672c9ae24d7e90de686557166e3b873cd707884431a0451d9d6f7fe795")] [assembly: InternalsVisibleTo ("AtspiUiaSource, PublicKey=00240000048000009400000006020000002400005253413100040000110000004bb98b1af6c1df0df8c02c380e116b7a7f0c8c827aecfccddc6e29b7c754cd608b49dfcef4df9699ad182e50f66afa4e68dabc7b6aeeec0aa4719a5f8e0aae8c193080a706adc3443a8356b1f254142034995532ac176398e12a30f6a74a119a89ac47672c9ae24d7e90de686557166e3b873cd707884431a0451d9d6f7fe795")] -[assembly: SecurityPermission (SecurityAction.RequestMinimum, SkipVerification = true)] Index: mono-uia/UIAutomationProvider/AssemblyInfo.cs.in =================================================================== --- mono-uia.orig/UIAutomationProvider/AssemblyInfo.cs.in 2012-01-24 19:29:28.000000000 +0000 +++ mono-uia/UIAutomationProvider/AssemblyInfo.cs.in 2012-01-24 19:29:55.000000000 +0000 @@ -50,8 +50,6 @@ [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -[assembly: PermissionSet (SecurityAction.RequestMinimum, Name = "FullTrust")] -[assembly: SecurityPermission (SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: InternalsVisibleTo("UIAutomationWinforms, PublicKey=00240000048000009400000006020000002400005253413100040000110000004bb98b1af6c1df0df8c02c380e116b7a7f0c8c827aecfccddc6e29b7c754cd608b49dfcef4df9699ad182e50f66afa4e68dabc7b6aeeec0aa4719a5f8e0aae8c193080a706adc3443a8356b1f254142034995532ac176398e12a30f6a74a119a89ac47672c9ae24d7e90de686557166e3b873cd707884431a0451d9d6f7fe795")] [assembly: InternalsVisibleTo("UiaAtkBridge, PublicKey=00240000048000009400000006020000002400005253413100040000110000004bb98b1af6c1df0df8c02c380e116b7a7f0c8c827aecfccddc6e29b7c754cd608b49dfcef4df9699ad182e50f66afa4e68dabc7b6aeeec0aa4719a5f8e0aae8c193080a706adc3443a8356b1f254142034995532ac176398e12a30f6a74a119a89ac47672c9ae24d7e90de686557166e3b873cd707884431a0451d9d6f7fe795")] Index: mono-uia/UIAutomationSource/AssemblyInfo.cs.in =================================================================== --- mono-uia.orig/UIAutomationSource/AssemblyInfo.cs.in 2012-01-24 19:29:28.000000000 +0000 +++ mono-uia/UIAutomationSource/AssemblyInfo.cs.in 2012-01-24 19:29:58.000000000 +0000 @@ -50,5 +50,3 @@ [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -[assembly: PermissionSet (SecurityAction.RequestMinimum, Name = "FullTrust")] -[assembly: SecurityPermission (SecurityAction.RequestMinimum, SkipVerification = true)] Index: mono-uia/UIAutomationTypes/AssemblyInfo.cs.in =================================================================== --- mono-uia.orig/UIAutomationTypes/AssemblyInfo.cs.in 2012-01-24 19:29:28.000000000 +0000 +++ mono-uia/UIAutomationTypes/AssemblyInfo.cs.in 2012-01-24 19:30:04.000000000 +0000 @@ -50,8 +50,6 @@ [assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)] [assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] -[assembly: PermissionSet (SecurityAction.RequestMinimum, Name = "FullTrust")] -[assembly: SecurityPermission (SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: InternalsVisibleTo("UIAutomationWinforms, PublicKey=00240000048000009400000006020000002400005253413100040000110000004bb98b1af6c1df0df8c02c380e116b7a7f0c8c827aecfccddc6e29b7c754cd608b49dfcef4df9699ad182e50f66afa4e68dabc7b6aeeec0aa4719a5f8e0aae8c193080a706adc3443a8356b1f254142034995532ac176398e12a30f6a74a119a89ac47672c9ae24d7e90de686557166e3b873cd707884431a0451d9d6f7fe795")] [assembly: InternalsVisibleTo("UiaAtkBridge, PublicKey=00240000048000009400000006020000002400005253413100040000110000004bb98b1af6c1df0df8c02c380e116b7a7f0c8c827aecfccddc6e29b7c754cd608b49dfcef4df9699ad182e50f66afa4e68dabc7b6aeeec0aa4719a5f8e0aae8c193080a706adc3443a8356b1f254142034995532ac176398e12a30f6a74a119a89ac47672c9ae24d7e90de686557166e3b873cd707884431a0451d9d6f7fe795")] [assembly: InternalsVisibleTo("UIAutomationWinformsTests, PublicKey=00240000048000009400000006020000002400005253413100040000110000004bb98b1af6c1df0df8c02c380e116b7a7f0c8c827aecfccddc6e29b7c754cd608b49dfcef4df9699ad182e50f66afa4e68dabc7b6aeeec0aa4719a5f8e0aae8c193080a706adc3443a8356b1f254142034995532ac176398e12a30f6a74a119a89ac47672c9ae24d7e90de686557166e3b873cd707884431a0451d9d6f7fe795")] Index: mono-uia/WindowsBase/AssemblyInfo.cs.in =================================================================== --- mono-uia.orig/WindowsBase/AssemblyInfo.cs.in 2012-01-24 19:29:28.000000000 +0000 +++ mono-uia/WindowsBase/AssemblyInfo.cs.in 2012-01-24 19:30:09.000000000 +0000 @@ -60,8 +60,6 @@ [assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)] [assembly: Dependency ("System,", LoadHint.Always)] [assembly: SecurityCritical] -[assembly: PermissionSet (SecurityAction.RequestMinimum, Name = "FullTrust")] -[assembly: SecurityPermission (SecurityAction.RequestMinimum, SkipVerification = true)] //[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/xps/2005/06", "metro")] //[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "wpf")] debian/patches/series0000644000000000000000000000034211714004760012031 0ustar 0001-uia-Fix-building-with-Mono-2.8.patch 0001-UIAutomationClient-AutomationElement.FromLocalProvid.patch use_specific_libX11_soname use_compiler_specified_by_configure avoid_obsolete_security_requests use_net40dir_for_pcfile debian/rules0000755000000000000000000000165211714002761010251 0ustar #!/usr/bin/make -f MAKEFILE = $(firstword $(MAKEFILE_LIST)) DEBIAN_DIR = $(dir $(MAKEFILE)) DEB_SOURCE_NAME = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | grep ^Source | cut -d" " -f2) DEB_VERSION = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | grep ^Version | cut -d" " -f2) VERSION = $(shell echo $(DEB_VERSION) | cut -d"-" -f1 | sed 's/+dfsg.*//') override_dh_cli_strip: dh_cli_strip --dbg-package=mono-uia-dbg override_dh_autoreconf: dh_autoreconf autoreconf -- -f -i -I . override_dh_clideps: dh_clideps --exclude-moduleref=libgdk-win32-2.0-0.dll override_dh_auto_configure: dh_auto_configure -- GMCS=/usr/bin/mono-csc get-orig-source: uscan \ --package $(DEB_SOURCE_NAME) \ --watchfile $(DEBIAN_DIR)/watch \ --upstream-version $(VERSION) \ --download-version $(VERSION) \ --destdir . \ --force-download \ --rename \ --repack %: dh $@ --with cli,autoreconf .PHONY: get-orig-source debian/control0000644000000000000000000000243411714004545010575 0ustar Source: mono-uia Section: cli-mono Priority: optional Maintainer: Debian Mono Group Uploaders: Ray Wang Build-Depends: debhelper (>= 7.0.50~), dh-autoreconf Build-Depends-Indep: mono-devel (>= 2.6), mono-gmcs, cli-common-dev (>= 0.6.0), libgtk2.0-cil-dev (>= 2.12.8), libglib2.0-cil-dev (>= 2.12.8) Standards-Version: 3.9.1 Homepage: http://www.mono-project.com/Accessibility Vcs-Git: git://git.debian.org/git/pkg-mono/packages/mono-uia.git Vcs-Browser: http://git.debian.org/?p=pkg-mono/packages/mono-uia.git Package: libmono-uia3.0-cil Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends}, ${cli:Depends} Description: Implementations of members and interfaces based on MS UIA API Implementations of the members and interfaces based on MS UIA API. . This package contains the UIA assemblies themselves. Package: libmono-uia-cil-dev Architecture: all Depends: libmono-uia3.0-cil (= ${binary:Version}), ${misc:Depends} Replaces: libmono-uia3.0-cil (<< 1.0-2) Description: Implementations of members and interfaces based on MS UIA API Implementations of the members and interfaces based on MS UIA API. . This package contains development files related to the UIA libraries, and should be used for compilation. debian/copyright0000644000000000000000000000264511707322356011136 0ustar Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat Upstream-Name: mono-uia Upstream-Source: http://mono-a11y.org/releases/2.1/sources/ Files: * Copyright: © 2001-2003 Ximian, Inc. Copyright: © 2004, 2007-2009, Novell, Inc Copyright: © 2006 Mainsoft, Inc Copyright: © 2005-2006 Kornel Pal License: MIT Files: debian/* Copyright: © 2010, Novell, Inc License: MIT License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/watch0000644000000000000000000000012111707322356010217 0ustar version=3 http://mono-a11y.org/releases/2.1/sources/ mono-uia-([.\d]+)\.tar\.bz2 debian/docs0000644000000000000000000000001411707322356010042 0ustar README NEWS debian/libmono-uia3.0-cil.install0000644000000000000000000000042211707322356013763 0ustar debian/tmp/usr/lib/mono/accessibility debian/tmp/usr/lib/mono/gac/UIAutomationProvider debian/tmp/usr/lib/mono/gac/UIAutomationBridge debian/tmp/usr/lib/mono/gac/UIAutomationTypes debian/tmp/usr/lib/mono/gac/UIAutomationSource debian/tmp/usr/lib/mono/gac/UIAutomationClient debian/changelog0000644000000000000000000000502711714005351011041 0ustar mono-uia (2.1-4) unstable; urgency=low * [a4eb742] Remove manual WindowsBase dependency * [6833aa1] Use net40dir not net20dir in mono-uia.pc - otherwise mono-uia-winforms build fails due to different versions of WindowsBase. -- Jo Shields Mon, 06 Feb 2012 17:15:57 +0000 mono-uia (2.1-3) unstable; urgency=low * [3da992b] Use compiler from GMCS configure variable, not hardcoded gmcs * [977b552] Use system default compiler mono-csc, not gmcs * [451e066] .NET 4.0 has deprecated support for RequestMinimum from the SecurityAction enumeration. Using it causes a compiler error -- Jo Shields Tue, 24 Jan 2012 19:32:48 +0000 mono-uia (2.1-2) unstable; urgency=low * [5afc538] Update debian/rules for DH8-compatible "--with cli" * [9606347] Add a build-dep on mono-gmcs. Mono-UIA is platform code, so using mono-csc is not mandatory (especially since it would prevent usage of third party 2.0 WinForms apps) * [d173151] Add upstream commit 326220d51c7fb96151802576d978399693d6bae4 to fix FTBFS on Mono 2.8+ * [3a18e87] Add dh-autoreconf due to Makefile.am changes * [bbc26f2] Override dh_autoreconf to add . to includes, since extensions.m4 isn't in m4/ * [e4c547f] Add a stripped down version of upstream 379d89f7ab15ee443d9a164d193f5e9bf3285b69 to fix building with Mono 2.8+ * [32018e7] Exclude libgdk-win32-2.0-0.dll modulref, which is only needed on Windows * [015dac7] Use libX11.so.6 when calling into libX11, otherwise this will only work when development headers are installed -- Jo Shields Mon, 23 Jan 2012 19:13:29 +0000 mono-uia (2.1-1) experimental; urgency=low * New upstream release. -- Ray Wang Tue, 07 Sep 2010 15:38:33 +0800 mono-uia (1.0-3) unstable; urgency=low * Change Uploader email, since it's not in use. -- Ray Wang Tue, 15 Jun 2010 00:14:47 +0800 mono-uia (1.0-2) unstable; urgency=low [ Ray Wang ] * add licenses of debian/*. [ Jo Shields ] * debian/control, debian/libmono-windowsbase-cil-dev.install, debian/libmono-uia3.0-cil.install, debian/libmono-uia-cil-dev.install: + Create unversioned -dev packages containing pkg-config files * debian/control: + No-change bump to Standards 3.8.4 -- Jo Shields Thu, 08 Dec 2009 13:31:26 +0000 mono-uia (1.0-1) unstable; urgency=low * initial release. (Closes: #531827) -- Ray Wang Thu, 25 Jun 2009 14:28:31 +0800 debian/compat0000644000000000000000000000000211707322356010372 0ustar 7 debian/source/0000755000000000000000000000000011707322356010474 5ustar debian/source/format0000644000000000000000000000001411707322356011702 0ustar 3.0 (quilt) debian/libmono-uia-cil-dev.install0000644000000000000000000000003511707322356014316 0ustar debian/tmp/usr/lib/pkgconfig