[245521] Refactoring GUI Vizualization part (merge swtbridge)
diff --git a/features/org.eclipse.actf.visualization-feature/feature.xml b/features/org.eclipse.actf.visualization-feature/feature.xml
index 191ea92..c4e3a74 100644
--- a/features/org.eclipse.actf.visualization-feature/feature.xml
+++ b/features/org.eclipse.actf.visualization-feature/feature.xml
@@ -55,13 +55,6 @@
unpack="false"/>
<plugin
- id="org.eclipse.actf.accservice.swtbridge"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="org.eclipse.actf.model.flash.proxy"
download-size="0"
install-size="0"
diff --git a/plugins/org.eclipse.actf.visualization.gui/AccessibilityJavaMsaaLibrary.dll b/plugins/org.eclipse.actf.visualization.gui/AccessibilityJavaMsaaLibrary.dll
new file mode 100644
index 0000000..bc281cd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/AccessibilityJavaMsaaLibrary.dll
Binary files differ
diff --git a/plugins/org.eclipse.actf.visualization.gui/META-INF/MANIFEST.MF b/plugins/org.eclipse.actf.visualization.gui/META-INF/MANIFEST.MF
index 42ef715..644e44d 100644
--- a/plugins/org.eclipse.actf.visualization.gui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.actf.visualization.gui/META-INF/MANIFEST.MF
@@ -9,7 +9,6 @@
Require-Bundle: org.eclipse.ui,
org.eclipse.ui.views,
org.eclipse.core.runtime,
- org.eclipse.actf.accservice.swtbridge,
org.eclipse.actf.core,
org.eclipse.actf.ai.voice,
org.eclipse.actf.model.ui,
@@ -17,4 +16,4 @@
org.eclipse.actf.util.win32,
org.eclipse.actf.ui
Eclipse-LazyStart: true
-Export-Package: org.eclipse.actf.visualization.gui
+Export-Package: org.eclipse.actf.visualization.gui
diff --git a/plugins/org.eclipse.actf.visualization.gui/build.properties b/plugins/org.eclipse.actf.visualization.gui/build.properties
index ea41392..4e4fe3f 100644
--- a/plugins/org.eclipse.actf.visualization.gui/build.properties
+++ b/plugins/org.eclipse.actf.visualization.gui/build.properties
@@ -9,12 +9,13 @@
# IBM Corporation - initial API and implementation
###############################################################################
bin.includes = plugin.xml,\
- about.html,\
+ about.html,\
META-INF/,\
icons/,\
plugin.properties,\
plugin_ja.properties,\
- .
+ .,\
+ AccessibilityJavaMsaaLibrary.dll
jars.compile.order = .
source.. = src/
output.. = bin/
diff --git a/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/.cvsignore b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/.cvsignore
new file mode 100644
index 0000000..4776fff
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/.cvsignore
@@ -0,0 +1,5 @@
+Debug
+Release
+*.ncb
+*.suo
+*.user
diff --git a/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/AccessibilityJavaMsaaLibrary.cpp b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/AccessibilityJavaMsaaLibrary.cpp
new file mode 100644
index 0000000..5fe0715
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/AccessibilityJavaMsaaLibrary.cpp
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+// AccessibilityJavaMsaaLibrary.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+
+
+#ifdef _MANAGED
+#pragma managed(push, off)
+#endif
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ return TRUE;
+}
+
+#ifdef _MANAGED
+#pragma managed(pop)
+#endif
+
diff --git a/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/AccessibilityJavaMsaaLibrary.sln b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/AccessibilityJavaMsaaLibrary.sln
new file mode 100644
index 0000000..e62f7ae
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/AccessibilityJavaMsaaLibrary.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AccessibilityJavaMsaaLibrary", "AccessibilityJavaMsaaLibrary.vcproj", "{F8B67A86-F2D8-4AC2-B9FE-EB4ADB80B02D}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {F8B67A86-F2D8-4AC2-B9FE-EB4ADB80B02D}.Debug|Win32.ActiveCfg = Debug|Win32
+ {F8B67A86-F2D8-4AC2-B9FE-EB4ADB80B02D}.Debug|Win32.Build.0 = Debug|Win32
+ {F8B67A86-F2D8-4AC2-B9FE-EB4ADB80B02D}.Release|Win32.ActiveCfg = Release|Win32
+ {F8B67A86-F2D8-4AC2-B9FE-EB4ADB80B02D}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/AccessibilityJavaMsaaLibrary.vcproj b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/AccessibilityJavaMsaaLibrary.vcproj
new file mode 100644
index 0000000..60b1bfd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/AccessibilityJavaMsaaLibrary.vcproj
@@ -0,0 +1,235 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="AccessibilityJavaMsaaLibrary"
+ ProjectGUID="{F8B67A86-F2D8-4AC2-B9FE-EB4ADB80B02D}"
+ RootNamespace="AccessibilityJavaMsaaLibrary"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;ACCESSIBILITYJAVAMSAALIBRARY_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="oleacc.lib"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(JAVA_HOME)\include;$(JAVA_HOME)\include\win32"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;ACCESSIBILITYJAVAMSAALIBRARY_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="2"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="oleacc.lib"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\AccessibilityJavaMsaaLibrary.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\org_eclipse_actf_accservice_swtbridge_MSAA.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\stdafx.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/org_eclipse_actf_accservice_swtbridge_MSAA.cpp b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/org_eclipse_actf_accservice_swtbridge_MSAA.cpp
new file mode 100644
index 0000000..43c88aa
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/org_eclipse_actf_accservice_swtbridge_MSAA.cpp
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+#include "stdafx.h"
+#include "org_eclipse_actf_accservice_swtbridge_MSAA.h"
+
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_AccessibleObjectFromPoint
+ (JNIEnv *env, jclass that, jint x, jint y, jint pvarChild)
+{
+ IAccessible *pAcc = NULL;
+ POINT ptScreen = {x,y};
+ if( FAILED( AccessibleObjectFromPoint(ptScreen,&pAcc,(VARIANT*)pvarChild) ) ) {
+ return NULL;
+ }
+ return (jint)pAcc;
+}
+
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_AccessibleObjectFromWindow
+ (JNIEnv *env, jclass that, jint hwnd)
+{
+ void *pObject = NULL;
+// if( FAILED( AccessibleObjectFromWindow((HWND)hwnd,OBJID_CLIENT,IID_IAccessible,&pObject) ) ) {
+ if( FAILED( AccessibleObjectFromWindow((HWND)hwnd,OBJID_WINDOW,IID_IAccessible,&pObject) ) ) {
+ return NULL;
+ }
+ return (jint)pObject;
+}
+
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_AccessibleChildren
+ (JNIEnv *env, jclass that, jint paccContainer, jint iChildStart, jint cChildren, jint rgvarChildren)
+{
+ LONG count = 0;
+ if( FAILED( AccessibleChildren((IAccessible*)paccContainer,iChildStart,cChildren,(VARIANT*)rgvarChildren,&count) ) ) {
+ return 0;
+ }
+ return (jint)count;
+}
+
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_WindowFromAccessibleObject
+ (JNIEnv *env, jclass that, jint pAcc)
+{
+ HWND hwnd = NULL;
+ if( FAILED(WindowFromAccessibleObject((IAccessible*)pAcc,&hwnd)) ) {
+ return NULL;
+ }
+ return (jint)hwnd;
+}
+
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_GetRoleText
+ (JNIEnv *env, jclass that, jint lRole, jcharArray szRole, jint cchRoleMax)
+{
+ int count = 0;
+ jchar *lpRole = NULL;
+ if( szRole ) {
+ lpRole = env->GetCharArrayElements(szRole,NULL);
+ }
+ count = (jint)GetRoleTextW(lRole, (LPWSTR)lpRole, cchRoleMax);
+ if( lpRole ) {
+ env->ReleaseCharArrayElements(szRole,lpRole,0);
+ }
+ return count;
+}
+
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_GetStateText
+ (JNIEnv *env, jclass that, jint lStateBit, jcharArray szState, jint cchState)
+{
+ jint count = 0;
+ jchar *lpState = NULL;
+ if( szState ) {
+ lpState = env->GetCharArrayElements(szState,NULL);
+ }
+ count = (jint)GetStateTextW(lStateBit, (LPWSTR)lpState, cchState);
+ if( lpState ) {
+ env->ReleaseCharArrayElements(szState,lpState,0);
+ }
+ return count;
+}
+
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_AccessibleObjectFromEvent
+ (JNIEnv *env, jclass that, jint hwnd, jint dwId, jint dwChildId, jint pvarChild)
+{
+ IAccessible *pAcc = NULL;
+ if( FAILED( AccessibleObjectFromEvent((HWND)hwnd, dwId, dwChildId, &pAcc, (VARIANT*)pvarChild) ) ) {
+ return NULL;
+ }
+ return (jint)pAcc;
+}
+
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_SetWinEventHook
+ (JNIEnv *env, jclass that, jint eventMin, jint eventMax, jint hmodWinEventProc, jint lpfnWinEventProc, jint idProcess,jint idThread,jint dwFlags)
+{
+ jint rc = 0;
+ rc = (jint)SetWinEventHook(eventMin, eventMax, (HMODULE)hmodWinEventProc, (WINEVENTPROC)lpfnWinEventProc, idProcess, idThread, dwFlags);
+ return rc;
+}
+
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_UnhookWinEvent
+ (JNIEnv *env, jclass that, jint hEvent)
+{
+ return (jint)UnhookWinEvent((HWINEVENTHOOK)hEvent);
+}
+
+static UINT MSG_GETOBJECT = RegisterWindowMessage(TEXT("WM_HTML_GETOBJECT"));
+
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_HTMLDocumentFromWindow
+ (JNIEnv *env, jclass that, jint hwnd)
+{
+ void *pObject = NULL;
+ LRESULT lRes = NULL;
+
+ SendMessageTimeout((HWND)hwnd, MSG_GETOBJECT, 0L, 0L, SMTO_ABORTIFHUNG, 1000, (DWORD*)&lRes );
+ if( lRes==NULL || FAILED( ObjectFromLresult(lRes, IID_IHTMLDocument, 0, &pObject) ) ) {
+ return NULL;
+ }
+ return (jint)pObject;
+}
+
diff --git a/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/org_eclipse_actf_accservice_swtbridge_MSAA.h b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/org_eclipse_actf_accservice_swtbridge_MSAA.h
new file mode 100644
index 0000000..488fa4e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/org_eclipse_actf_accservice_swtbridge_MSAA.h
@@ -0,0 +1,261 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_eclipse_actf_accservice_swtbridge_MSAA */
+
+#ifndef _Included_org_eclipse_actf_accservice_swtbridge_MSAA
+#define _Included_org_eclipse_actf_accservice_swtbridge_MSAA
+#ifdef __cplusplus
+extern "C" {
+#endif
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_TITLEBAR
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_TITLEBAR 1L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_MENUBAR
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_MENUBAR 2L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SCROLLBAR
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SCROLLBAR 3L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_GRIP
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_GRIP 4L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_SOUND
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_SOUND 5L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_CURSOR
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_CURSOR 6L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_CARET
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_CARET 7L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_ALERT
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_ALERT 8L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_WINDOW
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_WINDOW 9L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_CLIENT_AREA
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_CLIENT_AREA 10L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_MENU
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_MENU 11L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_MENUITEM
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_MENUITEM 12L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TOOLTIP
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TOOLTIP 13L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_APPLICATION
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_APPLICATION 14L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_DOCUMENT
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_DOCUMENT 15L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYATEM_PANE
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYATEM_PANE 16L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_CHART
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_CHART 17L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_DIALOG
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_DIALOG 18L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_BORDER
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_BORDER 19L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_GROUPING
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_GROUPING 20L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SEPARATOR
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SEPARATOR 21L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TOOLBAR
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TOOLBAR 22L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_STATUSBAR
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_STATUSBAR 23L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABLE
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABLE 24L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABLECOLUMNHEADER
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABLECOLUMNHEADER 25L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABLEROWHEADER
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABLEROWHEADER 26L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_COLUMN
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_COLUMN 27L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_ROW
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_ROW 28L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABLECELL
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABLECELL 29L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_LINK
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_LINK 30L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_HELPBALLOON
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_HELPBALLOON 31L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_LIST
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_LIST 33L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_LISTITEM
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_LISTITEM 34L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TREE
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TREE 35L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TREEITEM
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TREEITEM 36L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABITEM
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABITEM 37L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_PROPERTYPAGE
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_PROPERTYPAGE 38L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_INDICATOR
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_INDICATOR 39L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_GRAPHIC
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_GRAPHIC 40L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_LABEL
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_LABEL 41L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TEXT
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TEXT 42L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_PUSHBUTTON
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_PUSHBUTTON 43L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_CHECKBUTTON
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_CHECKBUTTON 44L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_RADIOBUTTON
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_RADIOBUTTON 45L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_COMBOBOX
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_COMBOBOX 46L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_DROPLIST
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_DROPLIST 47L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_PROGRESSBAR
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_PROGRESSBAR 48L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_DIAL
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_DIAL 49L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_HOTKEYFIELD
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_HOTKEYFIELD 50L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SLIDER
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SLIDER 51L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_SPINBUTTON
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_SPINBUTTON 52L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_DIAGRAM
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_DIAGRAM 53L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_ANIMATION
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_ANIMATION 54L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_EQUATION
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_EQUATION 55L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_BUTTONDROPDOWN
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_BUTTONDROPDOWN 56L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_BUTTONMENU
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_BUTTONMENU 57L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_BUTTONDROPDOWNGRID
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_BUTTONDROPDOWNGRID 58L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_WHITESPACE
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_WHITESPACE 59L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABFOLDER
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_TABFOLDER 60L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_CLOCK
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_CLOCK 61L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_SPLITBUTTON
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_SPLITBUTTON 62L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_OUTLINEBUTTON
+#define org_eclipse_actf_accservice_swtbridge_MSAA_ROLE_SYSTEM_OUTLINEBUTTON 64L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_NORMAL
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_NORMAL 0L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_SELECTED
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_SELECTED 2L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_SELECTABLE
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_SELECTABLE 2097152L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_MULTISELECTABLE
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_MULTISELECTABLE 16777216L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_FOCUSED
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_FOCUSED 4L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_FOCUSABLE
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_FOCUSABLE 1048576L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_PRESSED
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_PRESSED 8L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_CHECKED
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_CHECKED 16L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_EXPANDED
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_EXPANDED 512L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_COLLAPSED
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_COLLAPSED 1024L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_HOTTRACKED
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_HOTTRACKED 128L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_BUSY
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_BUSY 2048L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_READONLY
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_READONLY 64L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_INVISIBLE
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_INVISIBLE 32768L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_OFFSCREEN
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_OFFSCREEN 65536L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_SIZEABLE
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_SIZEABLE 131072L
+#undef org_eclipse_actf_accservice_swtbridge_MSAA_STATE_LINKED
+#define org_eclipse_actf_accservice_swtbridge_MSAA_STATE_LINKED 4194304L
+/*
+ * Class: org_eclipse_actf_accservice_swtbridge_MSAA
+ * Method: AccessibleObjectFromPoint
+ * Signature: (III)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_AccessibleObjectFromPoint
+ (JNIEnv *, jclass, jint, jint, jint);
+
+/*
+ * Class: org_eclipse_actf_accservice_swtbridge_MSAA
+ * Method: AccessibleObjectFromWindow
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_AccessibleObjectFromWindow
+ (JNIEnv *, jclass, jint);
+
+/*
+ * Class: org_eclipse_actf_accservice_swtbridge_MSAA
+ * Method: AccessibleChildren
+ * Signature: (IIII)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_AccessibleChildren
+ (JNIEnv *, jclass, jint, jint, jint, jint);
+
+/*
+ * Class: org_eclipse_actf_accservice_swtbridge_MSAA
+ * Method: WindowFromAccessibleObject
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_WindowFromAccessibleObject
+ (JNIEnv *, jclass, jint);
+
+/*
+ * Class: org_eclipse_actf_accservice_swtbridge_MSAA
+ * Method: GetRoleText
+ * Signature: (I[CI)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_GetRoleText
+ (JNIEnv *, jclass, jint, jcharArray, jint);
+
+/*
+ * Class: org_eclipse_actf_accservice_swtbridge_MSAA
+ * Method: GetStateText
+ * Signature: (I[CI)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_GetStateText
+ (JNIEnv *, jclass, jint, jcharArray, jint);
+
+/*
+ * Class: org_eclipse_actf_accservice_swtbridge_MSAA
+ * Method: AccessibleObjectFromEvent
+ * Signature: (IIII)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_AccessibleObjectFromEvent
+ (JNIEnv *, jclass, jint, jint, jint, jint);
+
+/*
+ * Class: org_eclipse_actf_accservice_swtbridge_MSAA
+ * Method: SetWinEventHook
+ * Signature: (IIIIIII)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_SetWinEventHook
+ (JNIEnv *, jclass, jint, jint, jint, jint, jint, jint, jint);
+
+/*
+ * Class: org_eclipse_actf_accservice_swtbridge_MSAA
+ * Method: UnhookWinEvent
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_UnhookWinEvent
+ (JNIEnv *, jclass, jint);
+
+/*
+ * Class: org_eclipse_actf_accservice_swtbridge_MSAA
+ * Method: HTMLDocumentFromWindow
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_org_eclipse_actf_accservice_swtbridge_MSAA_HTMLDocumentFromWindow
+ (JNIEnv *, jclass, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/stdafx.cpp b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/stdafx.cpp
new file mode 100644
index 0000000..0d63323
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/stdafx.cpp
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+// stdafx.cpp : source file that includes just the standard includes
+// AccessibilityJavaMsaaLibrary.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/stdafx.h b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/stdafx.h
new file mode 100644
index 0000000..e35c0dd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/library_src/AccessibilityJavaMsaaLibrary/stdafx.h
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+// Modify the following defines if you have to target a platform prior to the ones specified below.
+// Refer to MSDN for the latest info on corresponding values for different platforms.
+#ifndef WINVER // Allow use of features specific to Windows XP or later.
+#define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
+#endif
+
+#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
+#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
+#endif
+
+#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
+#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
+#endif
+
+#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
+#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
+#endif
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include <oleacc.h>
+#include <mshtml.h>
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/AccessibleFactoryEntry.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/AccessibleFactoryEntry.java
new file mode 100644
index 0000000..08ce581
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/AccessibleFactoryEntry.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge;
+
+
+
+public class AccessibleFactoryEntry {
+ public IAccessibleObjectFactory accessibleObjectFactory;
+
+ public String factoryName;
+
+ public AccessibleFactoryEntry(String factoryName, IAccessibleObjectFactory accessibleObjectFactory) {
+ this.factoryName = factoryName;
+ this.accessibleObjectFactory = accessibleObjectFactory;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/AccessibleObject.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/AccessibleObject.java
new file mode 100644
index 0000000..5b55c36
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/AccessibleObject.java
@@ -0,0 +1,291 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.accservice.swtbridge;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleApplication;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleComponent;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHyperlink;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHypertext;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleImage;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleValue;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.swt.graphics.Rectangle;
+
+
+public interface AccessibleObject extends IAdaptable {
+
+ /**
+ * Reset cached resources
+ */
+ public void reset();
+
+ /**
+ * Free allocated resources
+ *
+ * @throws Exception
+ */
+ public void dispose() throws Exception;
+
+ /**
+ * Get cached parent object
+ *
+ * @return
+ */
+ public AccessibleObject getCachedParent();
+
+ /**
+ * Get cached children objects
+ *
+ * @return
+ */
+ public AccessibleObject[] getCachedChildren();
+
+ /**
+ * Get child objects
+ *
+ * @return
+ */
+ public AccessibleObject[] getChildren();
+
+ /**
+ * Get number of children
+ *
+ * @return
+ */
+ public int getChildCount();
+
+ /**
+ * Get low level window handle
+ *
+ * @return window handle
+ */
+ public int getWindow();
+
+ /**
+ * Get accRole value
+ *
+ * @return
+ */
+ public int getAccRole();
+
+ /**
+ * Get accRole text
+ *
+ * @return role text
+ */
+ public String getRoleText();
+
+ /**
+ * Get window classname
+ *
+ * @return classname
+ */
+ public String getClassName();
+
+ /**
+ * Get accState value
+ *
+ * @return acc state bits
+ */
+ public int getAccState();
+
+ /**
+ * Get accName string
+ *
+ * @return
+ */
+ public String getAccName();
+
+ /**
+ * Get accValue
+ *
+ * @return accValue string
+ */
+ public String getAccValue();
+
+ /**
+ * Get accDescription string
+ *
+ * @return accDescription string
+ */
+ public String getAccDescription();
+
+ /**
+ * Get accHelp string
+ *
+ * @return
+ */
+ public String getAccHelp();
+
+ /**
+ * Get accKeyboardShortcut string
+ *
+ * @return
+ */
+ public String getAccKeyboardShortcut();
+
+ /**
+ * Get accDefaultAction string
+ *
+ * @return
+ */
+ public String getAccDefaultAction();
+
+ /**
+ * Get accHelpTopic
+ *
+ * @param pTopicIndex
+ * @param pHelpFile
+ * @return
+ */
+ public boolean getAccHelpTopic(int[] pTopicIndex, String[] pHelpFile);
+
+ /**
+ * Get accLocation
+ *
+ * @return
+ */
+ public Rectangle getAccLocation();
+
+ /**
+ * Performs default action
+ *
+ * @return
+ */
+ public boolean doDefaultAction();
+
+ /**
+ * @param flagsSelect
+ * @return
+ */
+ public boolean select(int flagsSelect);
+
+ /**
+ * @param strName
+ * @return
+ * @deprecated no longer supported
+ */
+ public boolean setAccName(String strName);
+
+ /**
+ * @param strValue
+ * @return
+ * @deprecated no longer supported
+ */
+ public boolean setAccValue(String strValue);
+
+ /**
+ * Get parent accessible object. <BR>
+ * Use getParent for cached parent.
+ *
+ * @return
+ */
+ public AccessibleObject getAccParent();
+
+ /**
+ * Get IDispatch for the object
+ * @return
+ */
+ public IAccessible getIAccessible();
+
+ /**
+ * Get Accessible2 interface
+ * @return
+ */
+ public Accessible2 getAccessible2();
+
+ /**
+ * Get AccessibleAction interface
+ * @return
+ */
+ public AccessibleAction getAccessibleAction();
+
+ /**
+ * Get AccessibleApplication interface
+ * @return
+ */
+ public AccessibleApplication getAccessibleApplication();
+
+ /**
+ * Get AccessibleComponent interface
+ * @return
+ */
+ public AccessibleComponent getAccessibleComponent();
+
+ /**
+ * Get AccessibleText interface
+ * @return
+ */
+ public AccessibleEditableText getAccessibleEditableText();
+
+ /**
+ * Get AccessibleHyperlink interface
+ * @return
+ */
+ public AccessibleHyperlink getAccessibleHyperlink();
+
+ /**
+ * Get AccessibleHypertext interface
+ * @return
+ */
+ public AccessibleHypertext getAccessibleHypertext();
+
+ /**
+ * Get AccessibleImage interface
+ * @return
+ */
+ public AccessibleImage getAccessibleImage();
+
+ /**
+ * Get AccessibleTable interface
+ * @return
+ */
+ public AccessibleTable getAccessibleTable();
+
+ /**
+ * Get AccessibleText interface
+ * @return
+ */
+ public AccessibleText getAccessibleText();
+
+ /**
+ * Get AccessibleValue interface
+ * @return
+ */
+ public AccessibleValue getAccessibleValue();
+
+ /**
+ * Get String for debug
+ * @return
+ */
+ public String toString();
+
+ /**
+ * Get IA1 accRole value
+ *
+ * @return
+ */
+ public int getRealAccRole();
+
+ /**
+ * Get IA1 accRole text
+ *
+ * @return role text
+ */
+ public String getRealRoleText();
+
+ public int getPtr();
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/AccessibleObjectFactory.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/AccessibleObjectFactory.java
new file mode 100644
index 0000000..84fd69f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/AccessibleObjectFactory.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ * Kentarou FUKUDA - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.accservice.swtbridge;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.actf.accservice.swtbridge.event.IAccessibleEventMonitor;
+import org.eclipse.actf.accservice.swtbridge.internal.InternalAccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.internal.InternalAccessibleObjectFactory;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.Variant;
+
+public class AccessibleObjectFactory {
+
+ public static String currentFactoryId;
+ private static IAccessibleObjectFactory currentFactory;
+ private static Map<String, AccessibleFactoryEntry> factoryEntries = new HashMap<String, AccessibleFactoryEntry>();
+ static {
+ addFactoryEntry(InternalAccessibleObjectFactory.ID,
+ new AccessibleFactoryEntry("Default (SWT based)",
+ new InternalAccessibleObjectFactory()));
+ setActiveFactory(InternalAccessibleObjectFactory.ID);
+ }
+
+ public static AccessibleObject getAccessibleObjectFromPoint(Point point) {
+ if (null != currentFactory) {
+ return currentFactory.getAccessibleObjectFromPoint(point);
+ }
+ return null;
+ }
+
+ public static AccessibleObject getAccessibleObjectFromWindow(int hwnd) {
+ if (null != currentFactory) {
+ return currentFactory.getAccessibleObjectFromWindow(hwnd);
+ }
+ return null;
+ }
+
+ public static AccessibleObject getAccessibleObjectFromEvent(int hwnd,
+ int dwId, int dwChildId) {
+ if (null != currentFactory) {
+ return currentFactory.getAccessibleObjectFromEvent(hwnd, dwId,
+ dwChildId);
+ }
+ return null;
+ }
+
+ public static IAccessibleEventMonitor getAccessibleEventMonitor() {
+ if (null != currentFactory) {
+ return currentFactory.getAccessibleEventMonitor();
+ }
+ return null;
+ }
+
+ /*
+ * Returns Accessible Object from Variant
+ */
+ public static AccessibleObject getAccessibleObjectFromVariant(
+ Variant varDispatch) {
+ if ((null != varDispatch) && (OLE.VT_DISPATCH == varDispatch.getType())) {
+ return new InternalAccessibleObject(null, varDispatch);
+ }
+ return null;
+ }
+
+ /*
+ * Controls
+ */
+
+ public static boolean setActiveFactory(String id) {
+ if (id.equals(currentFactoryId)) {
+ return false;
+ }
+ AccessibleFactoryEntry entry = (AccessibleFactoryEntry) factoryEntries
+ .get(id);
+ if (null != entry) {
+ currentFactoryId = id;
+ currentFactory = entry.accessibleObjectFactory;
+ return true;
+ }
+ return false;
+ }
+
+ public static AccessibleFactoryEntry getFactoryEntry(String id) {
+ return (AccessibleFactoryEntry) factoryEntries.get(id);
+ }
+
+ public static String[] getFactoryIds() {
+ return (String[]) factoryEntries.keySet().toArray(
+ new String[factoryEntries.size()]);
+ }
+
+ public static void addFactoryEntry(String id, AccessibleFactoryEntry factory) {
+ factoryEntries.put(id, factory);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IA2.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IA2.java
new file mode 100644
index 0000000..f2738db
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IA2.java
@@ -0,0 +1,697 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+
+public class IA2 {
+
+ /**
+ * Unknown role. The object contains some Accessible information, but its
+ * role is not known.
+ */
+ public static final int IA2_ROLE_UNKNOWN = 0;
+
+ /** An object that can be drawn into and to manage events from the objects
+ drawn into it. Also refer to ::IA2_ROLE_FRAME,
+ ::IA2_ROLE_GLASS_PANE, and ::IA2_ROLE_LAYERED_PANE.
+ */
+ public static final int IA2_ROLE_CANVAS = 0x401;
+
+ // / A caption describing another object.
+ public static final int IA2_ROLE_CAPTION = 0x402;
+
+ // / Used for check buttons that are menu items.
+ public static final int IA2_ROLE_CHECK_MENU_ITEM = 0x403;
+
+ // / A specialized dialog that lets the user choose a color.
+ public static final int IA2_ROLE_COLOR_CHOOSER = 0x404;
+
+ // / A date editor.
+ public static final int IA2_ROLE_DATE_EDITOR = 0x405;
+
+ /**
+ * An iconified internal frame in an ::IA2_ROLE_DESKTOP_PANE. Also refer to
+ * ::IA2_ROLE_INTERNAL_FRAME.
+ */
+ public static final int IA2_ROLE_DESKTOP_ICON = 0x406;
+
+ /**
+ * A desktop pane. A pane that supports internal frames and iconified
+ * versions of those internal frames. Also refer to ::IA2_ROLE_INTERNAL_FRAME.
+ */
+ public static final int IA2_ROLE_DESKTOP_PANE = 0x407;
+
+ /**
+ * A directory pane. A pane that allows the user to navigate through and
+ * select the contents of a directory. May be used by a file chooser. Also
+ * refer to ::IA2_ROLE_FILE_CHOOSER.
+ */
+ public static final int IA2_ROLE_DIRECTORY_PANE = 0x408;
+
+ // / An editable text object in a toolbar.
+ public static final int IA2_ROLE_EDITBAR = 0x409;
+
+ // / Embeded (OLE) object.
+ public static final int IA2_ROLE_EMBEDDED_OBJECT = 0x40A;
+
+ // / Text that is used as an endnote (footnote at the end of a chapter or
+ // section).
+ public static final int IA2_ROLE_ENDNOTE = 0x40B;
+
+ /**
+ * A file chooser. A specialized dialog that displays the files in the
+ * directory and lets the user select a file, browse a different directory,
+ * or specify a filename. May use the directory pane to show the contents of
+ * a directory. Also refer to ::IA2_ROLE_DIRECTORY_PANE.
+ */
+ public static final int IA2_ROLE_FILE_CHOOSER = 0x40C;
+
+ /**
+ * A font chooser. A font chooser is a component that lets the user pick
+ * various attributes for fonts.
+ */
+ public static final int IA2_ROLE_FONT_CHOOSER = 0x40D;
+
+ /**
+ * Footer of a document page. Also refer to ::IA2_ROLE_HEADER.
+ */
+ public static final int IA2_ROLE_FOOTER = 0x40E;
+
+ // / Text that is used as a footnote. Also refer to ::IA2_ROLE_ENDNOTE.
+ public static final int IA2_ROLE_FOOTNOTE = 0x40F;
+
+ /** A container of form controls. An example of the use of this role is to
+ represent an HTML FORM tag.
+ */
+ public static final int IA2_ROLE_FORM =0x410;
+
+ /**
+ * Frame role. A top level window with a title bar, border, menu bar, etc.
+ * It is often used as the primary window for an application. Also refer to
+ * ::IA2_ROLE_CANVAS and the MSAA roles of dialog and window.
+ */
+ public static final int IA2_ROLE_FRAME = 0x411;
+
+ /**
+ * A glass pane. A pane that is guaranteed to be painted on top of all panes
+ * beneath it. Also refer to ::IA2_ROLE_CANVAS, ::IA2_ROLE_INTERNAL_FRAME, and
+ * ::IA2_ROLE_ROOT_PANE.
+ */
+ public static final int IA2_ROLE_GLASS_PANE = 0x412;
+
+ /**
+ * Header of a document page. Also refer to ::IA2_ROLE_FOOTER.
+ */
+ public static final int IA2_ROLE_HEADER = 0x413;
+
+ /// Heading. Use the IAccessible2::attributes heading-level attribute to determine the heading level.
+ public static final int IA2_ROLE_HEADING = 0x414;
+
+ // / A small fixed size picture, typically used to decorate components.
+ public static final int IA2_ROLE_ICON = 0x415;
+
+ /**
+ * An image map object. Usually a graphic with multiple hotspots, where each
+ * hotspot can be activated resulting in the loading of another document or
+ * section of a document.
+ */
+ public static final int IA2_ROLE_IMAGE_MAP = 0x416;
+
+ /** An object which is used to allow input of characters not found on a keyboard,
+ such as the input of Chinese characters on a Western keyboard.
+ */
+ public static final int IA2_ROLE_INPUT_METHOD_WINDOW = 0x417;
+
+ /**
+ * An internal frame. A frame-like object that is clipped by a desktop pane.
+ * The desktop pane, internal frame, and desktop icon objects are often used
+ * to create multiple document interfaces within an application. Also refer
+ * to ::IA2_ROLE_DESKTOP_ICON, ::IA2_ROLE_DESKTOP_PANE, and ::IA2_ROLE_FRAME
+ */
+ public static final int IA2_ROLE_INTERNAL_FRAME = 0x418;
+
+ // / An object used to present an icon or short string in an interface.
+ public static final int IA2_ROLE_LABEL = 0x419;
+
+ /**
+ * A layered pane. A specialized pane that allows its children to be drawn
+ * in layers, providing a form of stacking order. This is usually the pane that
+ * holds the menu bar as well as the pane that contains most of the visual
+ * components in a window.
+ * Also refer to ::IA2_ROLE_CANVAS, ::IA2_ROLE_GLASS_PANE, and ::IA2_ROLE_ROOT_PANE.
+ */
+ public static final int IA2_ROLE_LAYERED_PANE = 0x41A;
+
+ // / An embedded note which is not visible until activated.
+ public static final int IA2_ROLE_NOTE = 0x41B;
+
+ /**
+ * A specialized pane whose primary use is inside a dialog. Also refer to
+ * MSAA's dialog role.
+ */
+ public static final int IA2_ROLE_OPTION_PANE = 0x41C;
+
+ /** An object representing a page of document content. It is used in documents
+ which are accessed by the user on a page by page basis.
+ */
+ public static final int IA2_ROLE_PAGE = 0x41D;
+
+ // / A paragraph of text.
+ public static final int IA2_ROLE_PARAGRAPH = 0x41E;
+
+ /**
+ * A radio button that is a menu item. Also refer to MSAA's button and menu
+ * item roles.
+ */
+ public static final int IA2_ROLE_RADIO_MENU_ITEM = 0x41F;
+
+ /** An object which is redundant with another object in the accessible hierarchy.
+ ATs typically ignore objects with this role.
+ */
+ public static final int IA2_ROLE_REDUNDANT_OBJECT = 0x420;
+
+ /**
+ * A root pane. A specialized pane that has a glass pane and a layered pane
+ * as its children. Also refer to ::IA2_ROLE_GLASS_PANE and
+ * ::IA2_ROLE_LAYERED_PANE
+ */
+ public static final int IA2_ROLE_ROOT_PANE = 0x421;
+
+ /**
+ * A ruler such as those used in word processors.
+ */
+ public static final int IA2_ROLE_RULER = 0x422;
+
+ /**
+ * A scroll pane. An object that allows a user to incrementally view a large
+ * amount of information. Its children can include scroll bars and a
+ * viewport. Also refer to ::IA2_ROLE_VIEW_PORT and MSAA's scroll bar role.
+ */
+ public static final int IA2_ROLE_SCROLL_PANE = 0x423;
+
+ /** A container of document content. An example of the use of this role is to
+ represent an HTML DIV tag.
+
+ A section may be used as a region. A region is a group of elements that
+ together form a perceivable unit. A region does not necessarily follow the
+ logical structure of the content, but follows the perceivable structure of
+ the page. A region may have an attribute in the set of
+ IAccessible2::attributes which indicates that it is "live". A live region
+ is content that is likely to change in response to a timed change, a user
+ event, or some other programmed logic or event.
+ */
+ public static final int IA2_ROLE_SECTION = 0x424;
+
+ // / Object with graphical representation used to represent content on draw
+ // pages.
+ public static final int IA2_ROLE_SHAPE = 0x425;
+
+ /**
+ * A split pane. A specialized panel that presents two other panels at the
+ * same time. Between the two panels is a divider the user can manipulate to
+ * make one panel larger and the other panel smaller.
+ */
+ public static final int IA2_ROLE_SPLIT_PANE = 0x426;
+
+ /** An object that forms part of a menu system but which can be "undocked"
+ from or "torn off" the menu system to exist as a separate window.
+ */
+ public static final int IA2_ROLE_TEAR_OFF_MENU = 0x427;
+
+ /// An object used as a terminal emulator.
+ public static final int IA2_ROLE_TERMINAL = 0x428;
+
+ // / Collection of objects that constitute a logical text entity.
+ public static final int IA2_ROLE_TEXT_FRAME = 0x429;
+
+ /**
+ * A toggle button. A specialized push button that can be checked or
+ * unchecked, but does not provide a separate indicator for the current
+ * state. Also refer to MSAA's roles of push button, check box, and radio
+ * button.
+ */
+ public static final int IA2_ROLE_TOGGLE_BUTTON = 0x42A;
+
+ /**
+ * A viewport. An object usually used in a scroll pane. It represents the
+ * portion of the entire data that the user can see. As the user manipulates
+ * the scroll bars, the contents of the viewport can change. Also refer to
+ * ::IA2_ROLE_SCROLL_PANE.
+ */
+ public static final int IA2_ROLE_VIEW_PORT = 0x42B;
+
+
+ public static final String[] IA2_ROLETEXTS = new String[] {
+ "IA2_ROLE_CANVAS", // 0x401 //$NON-NLS-1$
+ "IA2_ROLE_CAPTION", // 0x402 //$NON-NLS-1$
+ "IA2_ROLE_CHECK_MENU_ITEM", // 0x403 //$NON-NLS-1$
+ "IA2_ROLE_COLOR_CHOOSER", // 0x404 //$NON-NLS-1$
+ "IA2_ROLE_DATE_EDITOR", // 0x405 //$NON-NLS-1$
+ "IA2_ROLE_DESKTOP_ICON", // 0x406 //$NON-NLS-1$
+ "IA2_ROLE_DESKTOP_PANE", // 0x407 //$NON-NLS-1$
+ "IA2_ROLE_DIRECTORY_PANE", // 0x408 //$NON-NLS-1$
+ "IA2_ROLE_EDITBAR", // 0x409 //$NON-NLS-1$
+ "IA2_ROLE_EMBEDDED_OBJECT", // 0x40A //$NON-NLS-1$
+ "IA2_ROLE_ENDNOTE", // 0x40B //$NON-NLS-1$
+ "IA2_ROLE_FILE_CHOOSER", // 0x40C //$NON-NLS-1$
+ "IA2_ROLE_FONT_CHOOSER", // 0x40D //$NON-NLS-1$
+ "IA2_ROLE_FOOTER", // 0x40E //$NON-NLS-1$
+ "IA2_ROLE_FOOTNOTE", // 0x40F //$NON-NLS-1$
+ "IA2_ROLE_FORM", // 0x410 //$NON-NLS-1$
+ "IA2_ROLE_FRAME", // 0x411 //$NON-NLS-1$
+ "IA2_ROLE_GLASS_PANE", // 0x412 //$NON-NLS-1$
+ "IA2_ROLE_HEADER", // 0x413 //$NON-NLS-1$
+ "IA2_ROLE_HEADING", // 0x414 //$NON-NLS-1$
+ "IA2_ROLE_ICON", // 0x415 //$NON-NLS-1$
+ "IA2_ROLE_IMAGE_MAP", // 0x416 //$NON-NLS-1$
+ "IA2_ROLE_INPUT_METHOD_WINDOW", // 0x417 //$NON-NLS-1$
+ "IA2_ROLE_INTERNAL_FRAME", // 0x418 //$NON-NLS-1$
+ "IA2_ROLE_LABEL", // 0x419 //$NON-NLS-1$
+ "IA2_ROLE_LAYERED_PANE", // 0x41A //$NON-NLS-1$
+ "IA2_ROLE_NOTE", // 0x41B //$NON-NLS-1$
+ "IA2_ROLE_OPTION_PANE", // 0x41C //$NON-NLS-1$
+ "IA2_ROLE_PAGE", // 0x41D //$NON-NLS-1$
+ "IA2_ROLE_PARAGRAPH", // 0x41E //$NON-NLS-1$
+ "IA2_ROLE_RADIO_MENU_ITEM", // 0x41F //$NON-NLS-1$
+ "IA2_ROLE_REDUNDANT_OBJECT", // 0x420 //$NON-NLS-1$
+ "IA2_ROLE_ROOT_PANE", // 0x421 //$NON-NLS-1$
+ "IA2_ROLE_RULER", // 0x422 //$NON-NLS-1$
+ "IA2_ROLE_SCROLL_PANE", // 0x423 //$NON-NLS-1$
+ "IA2_ROLE_SECTION", // 0x424 //$NON-NLS-1$
+ "IA2_ROLE_SHAPE", // 0x425 //$NON-NLS-1$
+ "IA2_ROLE_SPLIT_PANE", // 0x426 //$NON-NLS-1$
+ "IA2_ROLE_TEAR_OFF_MENU", // 0x427 //$NON-NLS-1$
+ "IA2_ROLE_TERMINAL", // 0x428 //$NON-NLS-1$
+ "IA2_ROLE_TEXT_FRAME", // 0x429 //$NON-NLS-1$
+ "IA2_ROLE_TOGGLE_BUTTON", // 0x42A //$NON-NLS-1$
+ "IA2_ROLE_VIEW_PORT" // 0x42B //$NON-NLS-1$
+ };
+
+ public static String getRoleText(int role) {
+ if (IA2_ROLE_CANVAS <= role && role <= IA2_ROLE_VIEW_PORT) {
+ return IA2_ROLETEXTS[role - IA2_ROLE_CANVAS];
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ public static final String[] IA2_STATETEXTS = new String[] {
+ "IA2_STATE_ACTIVE", // 0x1; //$NON-NLS-1$
+ "IA2_STATE_ARMED", // 0x2; //$NON-NLS-1$
+ "IA2_STATE_DEFUNCT", // 0x4; //$NON-NLS-1$
+ "IA2_STATE_EDITABLE", // 0x8; //$NON-NLS-1$
+ "IA2_STATE_HORIZONTAL", // 0x10; //$NON-NLS-1$
+ "IA2_STATE_ICONIFIED", // 0x20; //$NON-NLS-1$
+ "IA2_STATE_INVALID_ENTRY", // 0x40; //$NON-NLS-1$
+ "IA2_STATE_MANAGES_DESCENDANTS", // 0x80; //$NON-NLS-1$
+ "IA2_STATE_MODAL", // 0x100; //$NON-NLS-1$
+ "IA2_STATE_MULTI_LINE", // 0x200; //$NON-NLS-1$
+ "IA2_STATE_OPAQUE", // 0x400; //$NON-NLS-1$
+ "IA2_STATE_REQUIRED", // 0x800; //$NON-NLS-1$
+ "IA2_STATE_SELECTABLE_TEXT", // 0x1000; //$NON-NLS-1$
+ "IA2_STATE_SINGLE_LINE", // 0x2000; //$NON-NLS-1$
+ "IA2_STATE_STALE", // 0x4000; //$NON-NLS-1$
+ "IA2_STATE_SUPPORTS_AUTOCOMPLETION", // 0x8000; //$NON-NLS-1$
+ "IA2_STATE_TRANSIENT", // 0x10000; //$NON-NLS-1$
+ "IA2_STATE_VERTICAL" // 0x20000; //$NON-NLS-1$
+
+ };
+ public static String[] getStateTextAsArray(int state) {
+ List result = new ArrayList();
+ for( int i=0; i<IA2_STATETEXTS.length; i++ ) {
+ int bits = 1<<i;
+ if( 0 != (state & bits) ) {
+ result.add(IA2_STATETEXTS[i]+" (0x"+Integer.toHexString(bits)+")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ return (String[])result.toArray(new String[result.size()]);
+ }
+ /**
+ * The change of the number or attributes of actions of an accessible object
+ * is signaled by events of this type.
+ */
+ public static final int IA2_EVENT_ACTION_CHANGED = 0x101;
+
+ /**
+ * The active descendant of a component has changed. The active descendant
+ * is used in objects with transient children.
+ */
+ public static final int IA2_EVENT_ACTIVE_DECENDENT_CHANGED = 0x102;
+
+ /**
+ * The document wide attributes of the document object have changed.
+ */
+ public static final int IA2_EVENT_DOCUMENT_ATTRIBUTE_CHANGED = 0x103;
+
+ /**
+ * The contents of the document have changed.
+ */
+ public static final int IA2_EVENT_DOCUMENT_CONTENT_CHANGED = 0x104;
+
+ /**
+ * The loading of the document has completed.
+ */
+ public static final int IA2_EVENT_DOCUMENT_LOAD_COMPLETE = 0x105;
+
+ /**
+ * The loading of the document was interrupted.
+ */
+ public static final int IA2_EVENT_DOCUMENT_LOAD_STOPPED = 0x106;
+
+ /**
+ * The document contents are being reloaded.
+ */
+ public static final int IA2_EVENT_DOCUMENT_RELOAD = 0x107;
+
+ /**
+ * The ending index of this link within the containing string has changed.
+ */
+ public static final int IA2_EVENT_HYPERLINK_END_INDEX_CHANGED = 0x108;
+
+ /**
+ * The number of anchors assoicated with this hyperlink object has changed.
+ */
+ public static final int IA2_EVENT_HYPERLINK_NUMBER_OF_ANCHORS_CHANGED = 0x109;
+
+ /**
+ * The hyperlink selected state changed from selected to unselected or from
+ * unselected to selected.
+ */
+ public static final int IA2_EVENT_HYPERLINK_SELECTED_LINK_CHANGED = 0x10A;
+
+ /**
+ * One of the links associated with the hypertext object has been activated.
+ */
+ public static final int IA2_EVENT_HYPERTEXT_LINK_ACTIVATED = 0x10B;
+
+ /**
+ * One of the links associated with the hypertext object has been selected.
+ */
+ public static final int IA2_EVENT_HYPERTEXT_LINK_SELECTED = 0x10C;
+
+ /**
+ * The starting index of this link within the containing string has changed.
+ */
+ public static final int IA2_EVENT_HYPERLINK_START_INDEX_CHANGED = 0x10D;
+
+ /**
+ * Focus has changed from one hypertext object to another, or focus moved
+ * from a non-hypertext object to a hypertext object, or focus moved from a
+ * hypertext object to a non-hypertext object.
+ */
+ public static final int IA2_EVENT_HYPERTEXT_CHANGED = 0x10E;
+
+ /**
+ * The number of hyperlinks associated with a hypertext object changed
+ */
+ public static final int IA2_EVENT_HYPERTEXT_NLINKS_CHANGED = 0x10F;
+
+ /**
+ * An object's attributes changed. Also see
+ * ::IA2_EVENT_TEXT_ATTRIBUTE_CHANGED.
+ */
+ public static final int IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED = 0x110;
+
+ /**
+ * A slide changed in a presentation document or a page boundary was crossed
+ * in a word processing document.
+ */
+ public static final int IA2_EVENT_PAGE_CHANGED = 0x111;
+
+ /** The caret moved from one section to the next.
+ */
+ public static final int IA2_EVENT_SECTION_CHANGED = 0x112;
+
+ /**
+ * A table caption changed.
+ */
+ public static final int IA2_EVENT_TABLE_CAPTION_CHANGED = 0x113;
+
+ /**
+ * A table's column description changed.
+ */
+ public static final int IA2_EVENT_TABLE_COLUMN_DESCRIPTION_CHANGED = 0x114;
+
+ /**
+ * A table's column header changed.
+ */
+ public static final int IA2_EVENT_TABLE_COLUMN_HEADER_CHANGED = 0x115;
+
+ /**
+ * A table's data changed.
+ */
+ public static final int IA2_EVENT_TABLE_MODEL_CHANGED = 0x116;
+
+ /**
+ * A table's row description changed.
+ */
+ public static final int IA2_EVENT_TABLE_ROW_DESCRIPTION_CHANGED = 0x117;
+
+ /**
+ * A table's row header changed.
+ */
+ public static final int IA2_EVENT_TABLE_ROW_HEADER_CHANGED = 0x118;
+
+ /**
+ * A table's summary changed.
+ */
+ public static final int IA2_EVENT_TABLE_SUMMARY_CHANGED = 0x119;
+
+ /**
+ * A text object's attributes changed. Also see
+ * ::IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED.
+ */
+ public static final int IA2_EVENT_TEXT_ATTRIBUTE_CHANGED = 0x11A;
+
+ /**
+ * The caret has moved to a new position.
+ */
+ public static final int IA2_EVENT_TEXT_CARET_MOVED = 0x11B;
+
+ /**
+ * This event indicates general text changes, i.e. changes to text that is
+ * exposed through the IAccessibleText and IAccessibleEditableText
+ * interfaces.
+ */
+ public static final int IA2_EVENT_TEXT_CHANGED = 0x11C;
+
+ /** The caret moved from one column to the next.
+ */
+ public static final int IA2_EVENT_TEXT_COLUMN_CHANGED = 0x11D;
+
+ /**
+ * Text was inserted.
+ */
+ public static final int IA2_EVENT_TEXT_INSERTED = 0x11E;
+
+ /**
+ * Text was removed.
+ */
+ public static final int IA2_EVENT_TEXT_REMOVED = 0x11F;
+
+ /**
+ * Text was updated.
+ */
+ public static final int IA2_EVENT_TEXT_UPDATED = 0x120;
+
+ /**
+ * The text selection changed.
+ */
+ public static final int IA2_EVENT_TEXT_SELECTION_CHANGED = 0x121;
+
+ /**
+ * A visibile data event indicates the change of the visual appearance of an
+ * accessible object. This includes for example most of the attributes
+ * available via the IAccessibleComponent interface.
+ */
+ public static final int IA2_EVENT_VISIBLE_DATA_CHANGED = 0x122;
+
+
+/*
+ * IAccessible2 state constants.
+ */
+
+ /** Indicates a window is currently the active window. */
+ public static final int IA2_STATE_ACTIVE = 0x1;
+
+ /** Indicates that the object is armed. */
+ public static final int IA2_STATE_ARMED = 0x2;
+
+ /** Indicates the user interface object corresponding to this object no longer exists. */
+ public static final int IA2_STATE_DEFUNCT = 0x4;
+
+ /** Indicates the user can change the contents of this object. */
+ public static final int IA2_STATE_EDITABLE = 0x8;
+
+ /** Indicates the orientation of this object is horizontal. */
+ public static final int IA2_STATE_HORIZONTAL = 0x10;
+
+ /** Indicates this object is minimized and is represented only by an icon. */
+ public static final int IA2_STATE_ICONIFIED = 0x20;
+
+ /** Indicates an input validation failure. */
+ public static final int IA2_STATE_INVALID_ENTRY = 0x40;
+
+ /** Indicates that this object manages its children.
+
+ Used when children are transient. In this case it is not necessary to add
+ listeners to the children.
+
+ The state is added to improve performance in the case of large containers such
+ as tables. When an object manages its children it is not necessary to iterate
+ over all the children and add listeners. The parent object will provide state
+ notifications regarding the state of its children.
+ */
+ public static final int IA2_STATE_MANAGES_DESCENDANTS = 0x80;
+
+ /** Indicates that an object is modal.
+
+ Modal objects have the behavior that something must be done with the object
+ before the user can interact with an object in a different window.
+ */
+ public static final int IA2_STATE_MODAL = 0x100;
+
+ /** Indicates this text object can contain multiple lines of text. */
+ public static final int IA2_STATE_MULTI_LINE = 0x200;
+
+ /** Indicates this object paints every pixel within its rectangular region. */
+ public static final int IA2_STATE_OPAQUE = 0x400;
+
+ /** Indicates that user interaction is required.
+
+ An example of when this state is used is when a field in a form must be filled
+ before a form can be processed.
+ */
+ public static final int IA2_STATE_REQUIRED = 0x800;
+
+ /** Indicates an object which supports text selection.
+
+ Note: This is different than MSAA STATE_SYSTEM_SELECTABLE.
+ */
+ public static final int IA2_STATE_SELECTABLE_TEXT = 0x1000;
+
+ /** Indicates that this text object can contain only a single line of text. */
+ public static final int IA2_STATE_SINGLE_LINE = 0x2000;
+
+ /** Indicates that the accessible object is stale.
+
+ This state is used when the accessible object no longer accurately
+ represents the state of the object which it is representing such as when an
+ object is transient or when an object has been or is in the process of being
+ destroyed.
+ */
+ public static final int IA2_STATE_STALE = 0x4000;
+
+ /** Indicates that the object implements autocompletion.
+
+ This state indicates that that a text control will respond to the input of
+ one ore more characters and cause a sub-item to become selected. The
+ selection may also result in events fired on the parent object.
+ */
+ public static final int IA2_STATE_SUPPORTS_AUTOCOMPLETION = 0x8000;
+
+ /** Indicates this object is transient. */
+ public static final int IA2_STATE_TRANSIENT = 0x10000;
+
+ /** Indicates the orientation of this object is vertical. */
+ public static final int IA2_STATE_VERTICAL = 0x20000;
+
+
+/*
+ * These constants control the scrolling of an object or substring into a window.
+ */
+
+ /** Scroll the top left of the object or substring to the top left of the
+ window (or as close as possible).
+ */
+ public static final int IA2_SCROLL_TYPE_TOP_LEFT = 0;
+
+ /** Scroll the bottom right of the object or substring to the bottom right of
+ the window (or as close as possible).
+ */
+ public static final int IA2_SCROLL_TYPE_BOTTOM_RIGHT = 1;
+
+ /** Scroll the top edge of the object or substring to the top edge of the
+ window (or as close as possible).
+ */
+ public static final int IA2_SCROLL_TYPE_TOP_EDGE = 2;
+
+ /** Scroll the bottom edge of the object or substring to the bottom edge of
+ the window (or as close as possible).
+ */
+ public static final int IA2_SCROLL_TYPE_BOTTOM_EDGE = 3;
+
+ /** Scroll the left edge of the object or substring to the left edge of the
+ window (or as close as possible).
+ */
+ public static final int IA2_SCROLL_TYPE_LEFT_EDGE = 4;
+
+ /** Scroll the right edge of the object or substring to the right edge of the
+ window (or as close as possible).
+ */
+ public static final int IA2_SCROLL_TYPE_RIGHT_EDGE =5;
+
+ public static String getScrollTypeText(int scrollType) {
+ switch( scrollType ) {
+ case IA2_SCROLL_TYPE_TOP_LEFT: return "IA2_SCROLL_TYPE_TOP_LEFT"; //$NON-NLS-1$
+ case IA2_SCROLL_TYPE_BOTTOM_RIGHT: return "IA2_SCROLL_TYPE_BOTTOM_RIGHT"; //$NON-NLS-1$
+ case IA2_SCROLL_TYPE_TOP_EDGE: return "IA2_SCROLL_TYPE_TOP_EDGE"; //$NON-NLS-1$
+ case IA2_SCROLL_TYPE_BOTTOM_EDGE: return "IA2_SCROLL_TYPE_BOTTOM_EDGE"; //$NON-NLS-1$
+ case IA2_SCROLL_TYPE_LEFT_EDGE: return "IA2_SCROLL_TYPE_LEFT_EDGE"; //$NON-NLS-1$
+ case IA2_SCROLL_TYPE_RIGHT_EDGE: return "IA2_SCROLL_TYPE_RIGHT_EDGE"; //$NON-NLS-1$
+ }
+ return null;
+ }
+
+/*
+ * These constants define which coordinate system a point is located in.
+ */
+ /** The coordinates are relative to the screen.
+ */
+ public static final int IA2_COORDTYPE_SCREEN_RELATIVE = 0;
+
+ /** The coordinates are relative to the upper left corner of the bounding box
+ of the immediate parent.
+ */
+ public static final int IA2_COORDTYPE_PARENT_RELATIVE = 1;
+
+ public static String getCoordTypeText(int coordType) {
+ switch( coordType ) {
+ case IA2_COORDTYPE_SCREEN_RELATIVE: return "IA2_COORDTYPE_SCREEN_RELATIVE"; //$NON-NLS-1$
+ case IA2_COORDTYPE_PARENT_RELATIVE: return "IA2_COORDTYPE_PARENT_RELATIVE"; //$NON-NLS-1$
+ }
+ return null;
+ }
+
+ // IA2TextBoundaryType
+ public static final int IA2_TEXT_BOUNDARY_CHAR = 0;
+ public static final int IA2_TEXT_BOUNDARY_WORD = 1;
+ public static final int IA2_TEXT_BOUNDARY_SENTENCE = 2;
+ public static final int IA2_TEXT_BOUNDARY_PARAGRAPH = 3;
+ public static final int IA2_TEXT_BOUNDARY_LINE = 4;
+ public static final int IA2_TEXT_BOUNDARY_ALL = 5;
+
+ public static String getTextBoundaryTypeText(int textBoundaryType) {
+ switch( textBoundaryType ) {
+ case IA2_TEXT_BOUNDARY_CHAR: return "IA2_TEXT_BOUNDARY_CHAR"; //$NON-NLS-1$
+ case IA2_TEXT_BOUNDARY_WORD: return "IA2_TEXT_BOUNDARY_WORD"; //$NON-NLS-1$
+ case IA2_TEXT_BOUNDARY_SENTENCE: return "IA2_TEXT_BOUNDARY_SENTENCE"; //$NON-NLS-1$
+ case IA2_TEXT_BOUNDARY_PARAGRAPH: return "IA2_TEXT_BOUNDARY_PARAGRAPH"; //$NON-NLS-1$
+ case IA2_TEXT_BOUNDARY_LINE: return "IA2_TEXT_BOUNDARY_LINE"; //$NON-NLS-1$
+ case IA2_TEXT_BOUNDARY_ALL: return "IA2_TEXT_BOUNDARY_ALL"; //$NON-NLS-1$
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IAccessible.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IAccessible.java
new file mode 100644
index 0000000..21f4d25
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IAccessible.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.accservice.swtbridge;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IDispatch;
+
+
+public class IAccessible extends IDispatch {
+ public static final GUID IID = COMUtil.IIDFromString("{618736E0-3C3D-11CF-810C-00AA00389B71}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessible(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int getAddress() {
+ return address;
+ }
+
+ public int get_accParent(int ppdispParent) {
+ return COMUtil.VtblCall(7, address, ppdispParent);
+ }
+ public int get_accChildCount(int pcountChildren) {
+ return COMUtil.VtblCall(8, address, pcountChildren);
+ }
+ public int get_accChild(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int ppdispChild) {
+ return COMUtil.VtblCall(9, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, ppdispChild);
+ }
+ public int get_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszName) {
+ return COMUtil.VtblCall(10, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszName);
+ }
+ public int get_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszValue) {
+ return COMUtil.VtblCall(11, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszValue);
+ }
+ public int get_accDescription(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDescription) {
+ return COMUtil.VtblCall(12, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszDescription);
+ }
+ public int get_accRole(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarRole) {
+ return COMUtil.VtblCall(13, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pvarRole);
+ }
+ public int get_accState(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pvarState) {
+ return COMUtil.VtblCall(14, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pvarState);
+ }
+ public int get_accHelp(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszHelp) {
+ return COMUtil.VtblCall(15, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszHelp);
+ }
+ public int get_accHelpTopic(int pszHelpFile, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pidTopic) {
+ return COMUtil.VtblCall(16, address, pszHelpFile, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pidTopic);
+ }
+ public int get_accKeyboardShortcut(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszKeyboardShortcut) {
+ return COMUtil.VtblCall(17, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszKeyboardShortcut);
+ }
+ public int get_accFocus(int pvarChild) {
+ return COMUtil.VtblCall(18, address, pvarChild);
+ }
+ public int get_accSelection(int pvarChildren) {
+ return COMUtil.VtblCall(19, address, pvarChildren);
+ }
+ public int get_accDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int pszDefaultAction) {
+ return COMUtil.VtblCall(20, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, pszDefaultAction);
+ }
+ public int accSelect(int flagsSelect, int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
+ return COMUtil.VtblCall(21, address, flagsSelect, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
+ }
+ public int accLocation(int pxLeft, int pyTop, int pcxWidth, int pcyHeight,
+ int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
+ return COMUtil.VtblCall(22, address, pxLeft, pyTop, pcxWidth, pcyHeight, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
+ }
+ public int accNavigate(int navDir, int varStart_vt, int varStart_reserved1, int varStart_lVal, int varStart_reserved2, int pvarEndUpAt) {
+ return COMUtil.VtblCall(23, address, navDir, varStart_vt, varStart_reserved1, varStart_lVal, varStart_reserved2, pvarEndUpAt);
+ }
+ public int accHitTest(int xLeft, int yTop, int pvarChild) {
+ return COMUtil.VtblCall(24, address, xLeft, yTop, pvarChild);
+ }
+ public int accDoDefaultAction(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2) {
+ return COMUtil.VtblCall(25, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2);
+ }
+ public int put_accName(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szName) {
+ return COMUtil.VtblCall(26, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szName);
+ }
+ public int put_accValue(int varChild_vt, int varChild_reserved1, int varChild_lVal, int varChild_reserved2, int szValue) {
+ return COMUtil.VtblCall(27, address, varChild_vt, varChild_reserved1, varChild_lVal, varChild_reserved2, szValue);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IAccessibleObjectFactory.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IAccessibleObjectFactory.java
new file mode 100644
index 0000000..6c93afd
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IAccessibleObjectFactory.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.accservice.swtbridge;
+
+import org.eclipse.actf.accservice.swtbridge.event.IAccessibleEventMonitor;
+import org.eclipse.swt.graphics.Point;
+
+
+public interface IAccessibleObjectFactory {
+
+ public AccessibleObject getAccessibleObjectFromPoint(Point point);
+
+ public AccessibleObject getAccessibleObjectFromWindow(int hwnd);
+
+ public AccessibleObject getAccessibleObjectFromEvent(int hwnd, int dwId, int dwChildId);
+
+ public IAccessibleEventMonitor getAccessibleEventMonitor();
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IServiceProvider.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IServiceProvider.java
new file mode 100644
index 0000000..77ef521
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/IServiceProvider.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.COM;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+import org.eclipse.swt.internal.win32.OS;
+
+
+
+
+public class IServiceProvider extends IUnknown {
+ public static final GUID IID = COMUtil.IIDFromString("{6d5140c1-7436-11ce-8034-00aa006009fa}"); //$NON-NLS-1$
+
+ public IServiceProvider(int address) {
+ super(address);
+ }
+
+ public int QueryService(int pGuidService, int pRiid, int ppvObject[]) {
+ return COM.VtblCall(3, getAddress(), pGuidService, pRiid, ppvObject);
+ }
+
+ public int QueryService(GUID guidService, GUID riid, int ppvObject[]) {
+ int pGuidService = OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, GUID.sizeof);
+ int pRiid = OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, GUID.sizeof);
+ try {
+ COM.MoveMemory(pGuidService, guidService, GUID.sizeof);
+ COM.MoveMemory(pRiid, riid, GUID.sizeof);
+ return QueryService(pGuidService, pRiid, ppvObject);
+ }
+ finally {
+ OS.GlobalFree(pGuidService);
+ OS.GlobalFree(pRiid);
+ }
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/MSAA.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/MSAA.java
new file mode 100644
index 0000000..847d90b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/MSAA.java
@@ -0,0 +1,392 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.accservice.swtbridge;
+
+import org.eclipse.actf.util.win32.NativeVariantAccess;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.ole.win32.IDispatch;
+import org.eclipse.swt.internal.win32.OS;
+import org.eclipse.swt.internal.win32.TCHAR;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.Variant;
+
+
+public class MSAA {
+
+ static {
+ try {
+ System.loadLibrary("AccessibilityJavaMsaaLibrary"); //$NON-NLS-1$
+ }
+ catch( Exception e ) {
+ e.printStackTrace();
+ }
+ }
+
+ public static final int CHILDID_SELF = 0;
+
+ // Role 0x0*
+ public static final int ROLE_SYSTEM_TITLEBAR = 0x01;
+ public static final int ROLE_SYSTEM_MENUBAR = ACC.ROLE_MENUBAR; // 0x02
+ public static final int ROLE_SYSTEM_SCROLLBAR = ACC.ROLE_SCROLLBAR; // 0x03
+ public static final int ROLE_SYSTEM_GRIP = 0x04;
+ public static final int ROLE_SYSTEM_SOUND = 0x5;
+ public static final int ROLE_SYSTEM_CURSOR = 0x6;
+ public static final int ROLE_SYSTEM_CARET = 0x7;
+ public static final int ROLE_SYSTEM_ALERT = 0x8;
+ public static final int ROLE_SYSTEM_WINDOW = ACC.ROLE_WINDOW; // 0x09
+ public static final int ROLE_SYSTEM_CLIENT = ACC.ROLE_CLIENT_AREA; // 0x0a
+ public static final int ROLE_SYSTEM_MENUPOPUP = ACC.ROLE_MENU; // 0x0b
+ public static final int ROLE_SYSTEM_MENUITEM = ACC.ROLE_MENUITEM; // 0x0c
+ public static final int ROLE_SYSTEM_TOOLTIP = ACC.ROLE_TOOLTIP; // 0x0d
+ public static final int ROLE_SYSTEM_APPLICATION = 0xe;
+ public static final int ROLE_SYSTEM_DOCUMENT = 0xf;
+ // Role 0x1*
+ public static final int ROLE_SYSTEM_PANE = 0x10;
+ public static final int ROLE_SYSTEM_CHART = 0x11;
+ public static final int ROLE_SYSTEM_DIALOG = ACC.ROLE_DIALOG; // 0x12
+ public static final int ROLE_SYSTEM_BORDER = 0x13;
+ public static final int ROLE_SYSTEM_GROUPING = 0x14;
+ public static final int ROLE_SYSTEM_SEPARATOR = ACC.ROLE_SEPARATOR; // 0x15
+ public static final int ROLE_SYSTEM_TOOLBAR = ACC.ROLE_TOOLBAR; // 0x16
+ public static final int ROLE_SYSTEM_STATUSBAR = 0x17;
+ public static final int ROLE_SYSTEM_TABLE = ACC.ROLE_TABLE; // 0x18
+ public static final int ROLE_SYSTEM_COLUMNHEADER = ACC.ROLE_TABLECOLUMNHEADER; // 0x19
+ public static final int ROLE_SYSTEM_ROWHEADER = ACC.ROLE_TABLEROWHEADER; // 0x1a
+ public static final int ROLE_SYSTEM_COLUMN = 0x1b;
+ public static final int ROLE_SYSTEM_ROW = 0x1c;
+ public static final int ROLE_SYSTEM_CELL = ACC.ROLE_TABLECELL; // 0x1d
+ public static final int ROLE_SYSTEM_LINK = ACC.ROLE_LINK; // 0x1e
+ public static final int ROLE_SYSTEM_HELPBALLOON = 0x1f;
+ // Role 0x2*
+ public static final int ROLE_SYSTEM_CHARACTER = 0x20;
+ public static final int ROLE_SYSTEM_LIST = ACC.ROLE_LIST; // 0x21
+ public static final int ROLE_SYSTEM_LISTITEM = ACC.ROLE_LISTITEM; // 0x22
+ public static final int ROLE_SYSTEM_OUTLINE = ACC.ROLE_TREE; // 0x23
+ public static final int ROLE_SYSTEM_OUTLINEITEM = ACC.ROLE_TREEITEM; // 0x24
+ public static final int ROLE_SYSTEM_PAGETAB = ACC.ROLE_TABITEM; // 0x25
+ public static final int ROLE_SYSTEM_PROPERTYPAGE = 0x26;
+ public static final int ROLE_SYSTEM_INDICATOR = 0x27;
+ public static final int ROLE_SYSTEM_GRAPHIC = 0x28;
+ public static final int ROLE_SYSTEM_STATICTEXT = ACC.ROLE_LABEL; // 0x29
+ public static final int ROLE_SYSTEM_TEXT = ACC.ROLE_TEXT; // 0x2a
+ public static final int ROLE_SYSTEM_PUSHBUTTON = ACC.ROLE_PUSHBUTTON; // 0x2b
+ public static final int ROLE_SYSTEM_CHECKBUTTON = ACC.ROLE_CHECKBUTTON; // 0x2c
+ public static final int ROLE_SYSTEM_RADIOBUTTON = ACC.ROLE_RADIOBUTTON; // 0x2d
+ public static final int ROLE_SYSTEM_COMBOBOX = ACC.ROLE_COMBOBOX; // 0x2e
+ public static final int ROLE_SYSTEM_DROPLIST = 0x2f;
+ // Role 0x3*
+ public static final int ROLE_SYSTEM_PROGRESSBAR = ACC.ROLE_PROGRESSBAR; // 0x30
+ public static final int ROLE_SYSTEM_DIAL = 0x31;
+ public static final int ROLE_SYSTEM_HOTKEYFIELD = 0x32;
+ public static final int ROLE_SYSTEM_SLIDER = ACC.ROLE_SLIDER; // 0x33
+ public static final int ROLE_SYSTEM_SPINBUTTON = 0x34;
+ public static final int ROLE_SYSTEM_DIAGRAM = 0x35;
+ public static final int ROLE_SYSTEM_ANIMATION = 0x36;
+ public static final int ROLE_SYSTEM_EQUATION = 0x37;
+ public static final int ROLE_SYSTEM_BUTTONDROPDOWN = 0x38;
+ public static final int ROLE_SYSTEM_BUTTONMENU = 0x39;
+ public static final int ROLE_SYSTEM_BUTTONDROPDOWNGRID = 0x3a;
+ public static final int ROLE_SYSTEM_WHITESPACE = 0x3b;
+ public static final int ROLE_SYSTEM_PAGETABLIST = ACC.ROLE_TABFOLDER; // 0x3c
+ public static final int ROLE_SYSTEM_CLOCK = 0x3d;
+ public static final int ROLE_SYSTEM_SPLITBUTTON = 0x3e;
+ public static final int ROLE_SYSTEM_IPADDRESS = 0x3f;
+ // Role 0x4*
+ public static final int ROLE_SYSTEM_OUTLINEBUTTON = 0x40;
+
+ // State
+ public static final int STATE_NORMAL = 0x00000000;
+ public static final int STATE_SELECTED = 0x00000002;
+ public static final int STATE_SELECTABLE = 0x00200000;
+ public static final int STATE_MULTISELECTABLE = 0x1000000;
+ public static final int STATE_FOCUSED = 0x00000004;
+ public static final int STATE_FOCUSABLE = 0x00100000;
+ public static final int STATE_PRESSED = 0x8;
+ public static final int STATE_CHECKED = 0x10;
+ public static final int STATE_EXPANDED = 0x200;
+ public static final int STATE_COLLAPSED = 0x400;
+ public static final int STATE_HOTTRACKED = 0x80;
+ public static final int STATE_BUSY = 0x800;
+ public static final int STATE_READONLY = 0x40;
+ public static final int STATE_INVISIBLE = 0x8000;
+ public static final int STATE_OFFSCREEN = 0x10000;
+ public static final int STATE_SIZEABLE = 0x20000;
+ public static final int STATE_LINKED = 0x400000;
+
+ public static final int STATE_SYSTEM_UNAVAILABLE = 0x1;
+// public static final int STATE_SYSTEM_MIXED = 0x20;
+// public static final int STATE_SYSTEM_INDETERMINATE = STATE_SYSTEM_MIXED;
+// public static final int STATE_SYSTEM_DEFAULT = 0x100;
+// public static final int STATE_SYSTEM_FLOATING = 0x1000;
+// public static final int STATE_SYSTEM_MARQUEED = 0x2000;
+// public static final int STATE_SYSTEM_ANIMATED = 0x4000;
+// public static final int STATE_SYSTEM_MOVEABLE = 0x40000;
+// public static final int STATE_SYSTEM_SELFVOICING = 0x80000;
+// public static final int STATE_SYSTEM_TRAVERSED = 0x800000;
+// public static final int STATE_SYSTEM_EXTSELECTABLE = 0x2000000;
+// public static final int STATE_SYSTEM_ALERT_LOW = 0x4000000;
+// public static final int STATE_SYSTEM_ALERT_MEDIUM = 0x8000000;
+// public static final int STATE_SYSTEM_ALERT_HIGH = 0x10000000;
+// public static final int STATE_SYSTEM_PROTECTED = 0x20000000;
+// public static final int STATE_SYSTEM_VALID = 0x3fffffff;
+
+ // Events
+ public static final int EVENT_SYSTEM_SOUND = 0x0001;
+ public static final int EVENT_SYSTEM_ALERT = 0x0002;
+ public static final int EVENT_SYSTEM_FOREGROUND = 0x0003;
+ public static final int EVENT_SYSTEM_MENUSTART = 0x0004;
+ public static final int EVENT_SYSTEM_MENUEND = 0x0005;
+ public static final int EVENT_SYSTEM_MENUPOPUPSTART = 0x0006;
+ public static final int EVENT_SYSTEM_MENUPOPUPEND = 0x0007;
+ public static final int EVENT_SYSTEM_CAPTURESTART = 0x0008;
+ public static final int EVENT_SYSTEM_CAPTUREEND = 0x0009;
+ public static final int EVENT_SYSTEM_MOVESIZESTART = 0x000A;
+ public static final int EVENT_SYSTEM_MOVESIZEEND = 0x000B;
+ public static final int EVENT_SYSTEM_CONTEXTHELPSTART = 0x000C;
+ public static final int EVENT_SYSTEM_CONTEXTHELPEND = 0x000D;
+ public static final int EVENT_SYSTEM_DRAGDROPSTART = 0x000E;
+ public static final int EVENT_SYSTEM_DRAGDROPEND = 0x000F;
+ public static final int EVENT_SYSTEM_DIALOGSTART = 0x0010;
+ public static final int EVENT_SYSTEM_DIALOGEND = 0x0011;
+ public static final int EVENT_SYSTEM_SCROLLINGSTART = 0x0012;
+ public static final int EVENT_SYSTEM_SCROLLINGEND = 0x0013;
+ public static final int EVENT_SYSTEM_SWITCHSTART = 0x0014;
+ public static final int EVENT_SYSTEM_SWITCHEND = 0x0015;
+ public static final int EVENT_SYSTEM_MINIMIZESTART = 0x0016;
+ public static final int EVENT_SYSTEM_MINIMIZEEND = 0x0017;
+ public static final int EVENT_OBJECT_CREATE = 0x8000; // hwnd + ID + idChild is created item
+ public static final int EVENT_OBJECT_DESTROY = 0x8001; // hwnd + ID + idChild is destroyed item
+ public static final int EVENT_OBJECT_SHOW = 0x8002; // hwnd + ID + idChild is shown item
+ public static final int EVENT_OBJECT_HIDE = 0x8003; // hwnd + ID + idChild is hidden item
+ public static final int EVENT_OBJECT_REORDER = 0x8004; // hwnd + ID + idChild is parent of zordering children
+ public static final int EVENT_OBJECT_FOCUS = 0x8005; // hwnd + ID + idChild is focused item
+ public static final int EVENT_OBJECT_SELECTION = 0x8006; // hwnd + ID + idChild is selected item (if only one), or idChild is OBJID_WINDOW if complex
+ public static final int EVENT_OBJECT_SELECTIONADD = 0x8007; // hwnd + ID + idChild is item added
+ public static final int EVENT_OBJECT_SELECTIONREMOVE = 0x8008; // hwnd + ID + idChild is item removed
+ public static final int EVENT_OBJECT_SELECTIONWITHIN = 0x8009; // hwnd + ID + idChild is parent of changed selected items
+ public static final int EVENT_OBJECT_STATECHANGE = 0x800A; // hwnd + ID + idChild is item w/ state change
+ public static final int EVENT_OBJECT_LOCATIONCHANGE = 0x800B; // hwnd + ID + idChild is moved/sized item
+ public static final int EVENT_OBJECT_NAMECHANGE = 0x800C; // hwnd + ID + idChild is item w/ name change
+ public static final int EVENT_OBJECT_DESCRIPTIONCHANGE = 0x800D; // hwnd + ID + idChild is item w/ desc change
+ public static final int EVENT_OBJECT_VALUECHANGE = 0x800E; // hwnd + ID + idChild is item w/ value change
+ public static final int EVENT_OBJECT_PARENTCHANGE = 0x800F; // hwnd + ID + idChild is item w/ new parent
+ public static final int EVENT_OBJECT_HELPCHANGE = 0x8010; // hwnd + ID + idChild is item w/ help change
+ public static final int EVENT_OBJECT_DEFACTIONCHANGE = 0x8011; // hwnd + ID + idChild is item w/ def action change
+ public static final int EVENT_OBJECT_ACCELERATORCHANGE = 0x8012; // hwnd + ID + idChild is item w/ keybd accel change
+
+ // flagsSelect
+ public static final int
+ SELFLAG_NONE = 0, // Performs no action.
+ SELFLAG_TAKEFOCUS = 1, // Sets the focus to the object and makes it the selection anchor.
+ SELFLAG_TAKESELECTION = 2, // Selects the object and removes the selection from all other objects in the container.
+ SELFLAG_EXTENDSELECTION = 4, // Alters the selection so that all objects between the selection anchor and this object take on the anchor object's selection state.
+ SELFLAG_ADDSELECTION = 8, // Adds the object to the current selection.
+ SELFLAG_REMOVESELECTION = 16; // Removes the object from the current selection.
+
+ public static int getAccessibleObjectFromPoint(Point point, int[] pChild) {
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ int pvObject = AccessibleObjectFromPoint(point.x,point.y,nva.getAddress());
+ if( OLE.VT_I4 == nva.getType() ) {
+ pChild[0] = nva.getInt();
+ }
+ return pvObject;
+ }
+ finally {
+ nva.dispose();
+ }
+ }
+
+ public static int getAccessibleObjectFromEvent(int hwnd, int dwId, int dwChildId, int[] pChild) {
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ int pvObject = AccessibleObjectFromEvent(hwnd, dwId, dwChildId, nva.getAddress());
+ if( OLE.VT_I4 == nva.getType() ) {
+ pChild[0] = nva.getInt();
+ }
+ return pvObject;
+ }
+ finally {
+ nva.dispose();
+ }
+ }
+
+ public static void getAccessibleChildren(int address, Variant[] pVarResult) {
+ int resultLength = pVarResult.length;
+ NativeVariantAccess nva = new NativeVariantAccess(resultLength);
+ try {
+ int count = MSAA.AccessibleChildren(address,0,resultLength,nva.getAddress());
+ for( int i=0; i<count; i++ ) {
+ switch( nva.getType(i) ) {
+ case OLE.VT_DISPATCH:
+ IDispatch childDispatch = nva.getDispatch(i);
+ childDispatch.AddRef();
+ pVarResult[i] = new Variant(childDispatch);
+ break;
+ case OLE.VT_I4:
+ pVarResult[i] = new Variant(nva.getInt(i));
+ break;
+ }
+ }
+ }
+ finally {
+ nva.dispose();
+ }
+ }
+
+ public static int getWindowFromAccessibleObject(int address) {
+ return WindowFromAccessibleObject(address);
+ }
+
+ public static String getRoleText(int role) {
+ int size = GetRoleText(role, null, 0);
+ if( 0 == size ) {
+ return IA2.getRoleText(role);
+ }
+ TCHAR buffer = new TCHAR(0, size+1);
+ int result = GetRoleText(role, buffer.chars, buffer.length());
+ return buffer.toString(0,result);
+ }
+
+ public static String getStateText(int state) {
+ int size = GetStateText(state, null, 0);
+ if( 0 == size ) {
+ return ""; //$NON-NLS-1$
+ }
+ TCHAR buffer = new TCHAR(0, size+1);
+ int result = GetStateText(state, buffer.chars, buffer.length());
+ return buffer.toString(0,result);
+ }
+
+ /** Accessibility natives */
+ public static final native int AccessibleObjectFromPoint(int x, int y, int pvarChild);
+ public static final native int AccessibleObjectFromWindow(int hwnd);
+ public static final native int AccessibleChildren(int paccContainer, int iChildStart, int cChildren, int rgvarChildren);
+ public static final native int WindowFromAccessibleObject(int pAcc);
+ public static final native int GetRoleText(int lRole, char[] lpszRole, int cchRoleMax);
+ public static final native int GetStateText(int lStateBit, char[] lpszState, int cchState);
+
+ public static final native int AccessibleObjectFromEvent(int hwnd, int dwId, int dwChildId, int pvarChild);
+ public static final native int SetWinEventHook(int eventMin, int eventMax, int hmodWinEventProc, int lpfnWinEventProc, int idProcess,int idThread,int dwFlags);
+ public static final native int UnhookWinEvent(int hEvent);
+
+ /** */
+ public static final native int HTMLDocumentFromWindow(int hwnd);
+
+ /** SPI Support **/
+ private final static int SPI_GETSCREENREADER = 70;
+ private final static int SPI_SETSCREENREADER = 71;
+ private final static int SPIF_UPDATEINIFILE = 0x01;
+ private final static int SPIF_SENDCHANGE = 0x02;
+ private final static int HWND_BROADCAST = 0xffff;
+ private final static int WM_WININICHANGE = 0x001A;
+
+ public static void setScreenReader(boolean set) {
+ if( OS.SystemParametersInfo( SPI_SETSCREENREADER, set ? 1:0, (int[])null, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE ) ) {
+ OS.PostMessage( HWND_BROADCAST, WM_WININICHANGE, SPI_SETSCREENREADER, 0 );
+ }
+ }
+
+ public static boolean getScreenReader() {
+ int[] pResult = new int[1];
+ if( OS.SystemParametersInfo( SPI_GETSCREENREADER, 0, pResult, 0 ) ) {
+ return 0!=pResult[0];
+ }
+ return false;
+ }
+
+ public static String getEventTypeText(int event) {
+ switch( event ) {
+ case EVENT_SYSTEM_SOUND: return"EVENT_SYSTEM_SOUND"; //$NON-NLS-1$
+ case EVENT_SYSTEM_ALERT: return"EVENT_SYSTEM_ALERT"; //$NON-NLS-1$
+ case EVENT_SYSTEM_FOREGROUND: return"EVENT_SYSTEM_FOREGROUND"; //$NON-NLS-1$
+ case EVENT_SYSTEM_CAPTURESTART: return "EVENT_SYSTEM_CAPTURESTART"; //$NON-NLS-1$
+ case EVENT_SYSTEM_CAPTUREEND: return "EVENT_SYSTEM_CAPTUREEND"; //$NON-NLS-1$
+ case EVENT_SYSTEM_MOVESIZESTART: return "EVENT_SYSTEM_MOVESIZESTART"; //$NON-NLS-1$
+ case EVENT_SYSTEM_MOVESIZEEND: return "EVENT_SYSTEM_MOVESIZEEND"; //$NON-NLS-1$
+ case EVENT_SYSTEM_CONTEXTHELPSTART: return "EVENT_SYSTEM_CONTEXTHELPSTART"; //$NON-NLS-1$
+ case EVENT_SYSTEM_CONTEXTHELPEND: return "EVENT_SYSTEM_CONTEXTHELPEND"; //$NON-NLS-1$
+ case EVENT_SYSTEM_DRAGDROPSTART: return "EVENT_SYSTEM_DRAGDROPSTART"; //$NON-NLS-1$
+ case EVENT_SYSTEM_DRAGDROPEND: return "EVENT_SYSTEM_DRAGDROPEND"; //$NON-NLS-1$
+ case EVENT_SYSTEM_DIALOGSTART: return "EVENT_SYSTEM_DIALOGSTART"; //$NON-NLS-1$
+ case EVENT_SYSTEM_DIALOGEND: return "EVENT_SYSTEM_DIALOGEND"; //$NON-NLS-1$
+ case EVENT_SYSTEM_SCROLLINGSTART: return "EVENT_SYSTEM_SCROLLINGSTART"; //$NON-NLS-1$
+ case EVENT_SYSTEM_SCROLLINGEND: return "EVENT_SYSTEM_SCROLLINGEND"; //$NON-NLS-1$
+ case EVENT_SYSTEM_SWITCHSTART: return "EVENT_SYSTEM_SWITCHSTART"; //$NON-NLS-1$
+ case EVENT_SYSTEM_SWITCHEND: return "EVENT_SYSTEM_SWITCHEND"; //$NON-NLS-1$
+ case EVENT_SYSTEM_MINIMIZESTART: return "EVENT_SYSTEM_MINIMIZESTART"; //$NON-NLS-1$
+ case EVENT_SYSTEM_MINIMIZEEND: return "EVENT_SYSTEM_MINIMIZEEND"; //$NON-NLS-1$
+
+ case EVENT_SYSTEM_MENUSTART: return "EVENT_SYSTEM_MENUSTART"; //$NON-NLS-1$
+ case EVENT_SYSTEM_MENUPOPUPSTART: return "EVENT_SYSTEM_MENUPOPUPSTART"; //$NON-NLS-1$
+ case EVENT_SYSTEM_MENUEND: return "EVENT_SYSTEM_MENUEND"; //$NON-NLS-1$
+ case EVENT_SYSTEM_MENUPOPUPEND: return "EVENT_SYSTEM_MENUPOPUPEND"; //$NON-NLS-1$
+
+ case EVENT_OBJECT_FOCUS: return "EVENT_OBJECT_FOCUS"; //$NON-NLS-1$
+ case EVENT_OBJECT_STATECHANGE: return "EVENT_OBJECT_STATECHANGE"; //$NON-NLS-1$
+ case EVENT_OBJECT_NAMECHANGE: return "EVENT_OBJECT_NAMECHANGE"; //$NON-NLS-1$
+ case EVENT_OBJECT_DESCRIPTIONCHANGE: return "EVENT_OBJECT_DESCRIPTIONCHANGE"; //$NON-NLS-1$
+ case EVENT_OBJECT_VALUECHANGE: return "EVENT_OBJECT_VALUECHANGE"; //$NON-NLS-1$
+ case EVENT_OBJECT_CREATE: return "EVENT_OBJECT_CREATE"; //$NON-NLS-1$
+ case EVENT_OBJECT_DESTROY: return "EVENT_OBJECT_DESTROY"; //$NON-NLS-1$
+ case EVENT_OBJECT_SHOW: return "EVENT_OBJECT_SHOW"; //$NON-NLS-1$
+ case EVENT_OBJECT_HIDE: return "EVENT_OBJECT_HIDE"; //$NON-NLS-1$
+ case EVENT_OBJECT_REORDER: return "EVENT_OBJECT_REORDER"; //$NON-NLS-1$
+ case EVENT_OBJECT_SELECTION: return "EVENT_OBJECT_SELECTION"; //$NON-NLS-1$
+ case EVENT_OBJECT_SELECTIONADD: return "EVENT_OBJECT_SELECTIONADD"; //$NON-NLS-1$
+ case EVENT_OBJECT_SELECTIONREMOVE: return "EVENT_OBJECT_SELECTIONREMOVE"; //$NON-NLS-1$
+ case EVENT_OBJECT_SELECTIONWITHIN: return "EVENT_OBJECT_SELECTIONWITHIN"; //$NON-NLS-1$
+ case EVENT_OBJECT_LOCATIONCHANGE: return "EVENT_OBJECT_LOCATIONCHANGE"; //$NON-NLS-1$
+ case EVENT_OBJECT_PARENTCHANGE: return "EVENT_OBJECT_PARENTCHANGE"; //$NON-NLS-1$
+ case EVENT_OBJECT_HELPCHANGE: return "EVENT_OBJECT_HELPCHANGE"; //$NON-NLS-1$
+ case EVENT_OBJECT_DEFACTIONCHANGE: return "EVENT_OBJECT_DEFACTIONCHANGE"; //$NON-NLS-1$
+ case EVENT_OBJECT_ACCELERATORCHANGE: return "EVENT_OBJECT_ACCELERATORCHANGE"; //$NON-NLS-1$
+
+ case IA2.IA2_EVENT_ACTION_CHANGED: return "IA2_EVENT_ACTION_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_ACTIVE_DECENDENT_CHANGED: return "IA2_EVENT_ACTIVE_DECENDENT_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_DOCUMENT_ATTRIBUTE_CHANGED: return "IA2_EVENT_DOCUMENT_ATTRIBUTE_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_DOCUMENT_CONTENT_CHANGED: return "IA2_EVENT_DOCUMENT_CONTENT_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_DOCUMENT_LOAD_COMPLETE: return "IA2_EVENT_DOCUMENT_LOAD_COMPLETE"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_DOCUMENT_LOAD_STOPPED: return "IA2_EVENT_DOCUMENT_LOAD_STOPPED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_DOCUMENT_RELOAD: return "IA2_EVENT_DOCUMENT_RELOAD"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_HYPERLINK_END_INDEX_CHANGED: return "IA2_EVENT_HYPERLINK_END_INDEX_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_HYPERLINK_NUMBER_OF_ANCHORS_CHANGED: return "IA2_EVENT_HYPERLINK_NUMBER_OF_ANCHORS_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_HYPERLINK_SELECTED_LINK_CHANGED: return "IA2_EVENT_HYPERLINK_SELECTED_LINK_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_HYPERTEXT_LINK_ACTIVATED: return "IA2_EVENT_HYPERTEXT_LINK_ACTIVATED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_HYPERTEXT_LINK_SELECTED: return "IA2_EVENT_HYPERTEXT_LINK_SELECTED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_HYPERLINK_START_INDEX_CHANGED: return "IA2_EVENT_HYPERLINK_START_INDEX_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_HYPERTEXT_CHANGED: return "IA2_EVENT_HYPERTEXT_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_HYPERTEXT_NLINKS_CHANGED: return "IA2_EVENT_HYPERTEXT_NLINKS_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED: return "IA2_EVENT_OBJECT_ATTRIBUTE_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_PAGE_CHANGED: return "IA2_EVENT_PAGE_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_SECTION_CHANGED: return "IA2_EVENT_SECTION_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TABLE_CAPTION_CHANGED: return "IA2_EVENT_TABLE_CAPTION_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TABLE_COLUMN_DESCRIPTION_CHANGED: return "IA2_EVENT_TABLE_COLUMN_DESCRIPTION_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TABLE_COLUMN_HEADER_CHANGED: return "IA2_EVENT_TABLE_COLUMN_HEADER_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TABLE_MODEL_CHANGED: return "IA2_EVENT_TABLE_MODEL_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TABLE_ROW_DESCRIPTION_CHANGED: return "IA2_EVENT_TABLE_ROW_DESCRIPTION_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TABLE_ROW_HEADER_CHANGED: return "IA2_EVENT_TABLE_ROW_HEADER_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TABLE_SUMMARY_CHANGED: return "IA2_EVENT_TABLE_SUMMARY_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TEXT_ATTRIBUTE_CHANGED: return "IA2_EVENT_TEXT_ATTRIBUTE_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TEXT_CARET_MOVED: return "IA2_EVENT_TEXT_CARET_MOVED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TEXT_CHANGED: return "IA2_EVENT_TEXT_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TEXT_COLUMN_CHANGED: return "IA2_EVENT_TEXT_COLUMN_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TEXT_INSERTED: return "IA2_EVENT_TEXT_INSERTED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TEXT_REMOVED: return "IA2_EVENT_TEXT_REMOVED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TEXT_UPDATED: return "IA2_EVENT_TEXT_UPDATED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_TEXT_SELECTION_CHANGED: return "IA2_EVENT_TEXT_SELECTION_CHANGED"; //$NON-NLS-1$
+ case IA2.IA2_EVENT_VISIBLE_DATA_CHANGED: return "IA2_EVENT_VISIBLE_DATA_CHANGED"; //$NON-NLS-1$
+ }
+ return null;
+ // return "0x"+Integer.toHexString(event);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/MsaaPlugin.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/MsaaPlugin.java
new file mode 100644
index 0000000..35e19b7
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/MsaaPlugin.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.accservice.swtbridge;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class MsaaPlugin extends AbstractUIPlugin {
+
+ //The shared instance.
+ private static MsaaPlugin plugin;
+
+ /**
+ * The constructor.
+ */
+ public MsaaPlugin() {
+ plugin = this;
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static MsaaPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path.
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.actf.accservice.swtbridge", path); //$NON-NLS-1$
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/event/IAccessibleEventListener.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/event/IAccessibleEventListener.java
new file mode 100644
index 0000000..093b398
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/event/IAccessibleEventListener.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.accservice.swtbridge.event;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+
+public interface IAccessibleEventListener {
+
+ public void handleEvent(int event, int hwnd, int idObject, int idChild, AccessibleObject accObject);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/event/IAccessibleEventMonitor.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/event/IAccessibleEventMonitor.java
new file mode 100644
index 0000000..e593b68
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/event/IAccessibleEventMonitor.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.accservice.swtbridge.event;
+
+import java.util.Set;
+
+public interface IAccessibleEventMonitor {
+
+ public void installEventHook(IAccessibleEventListener listener, Set filter);
+
+ public void removeEventHook();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/Accessible2.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/Accessible2.java
new file mode 100644
index 0000000..9d4c9f4
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/Accessible2.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+import java.util.Locale;
+
+
+
+public interface Accessible2 {
+
+ public void dispose();
+
+ public int getAccessibleRelationCount();
+
+ public AccessibleRelation getAccessibleRelation(int relationIndex);
+
+ public AccessibleRelation[] getAccessibleRelations(int maxRelations);
+
+ public int getAccessibleRole();
+
+ public boolean scrollTo(int scrollType);
+
+ public boolean scrollToPoint(int coordinateType, int x, int y);
+
+ public int[] getGroupPosition();
+
+ public int getStates();
+
+ public String getExtendedRole();
+
+ public String getLocalizedExtendedRole();
+
+ public int getExtendedStateCount();
+
+ public String[] getExtendedStates(int maxExtendedStates);
+
+ public String[] getLocalizedExtendedStates(int maxLocalizedExtendedStates);
+
+ public int getUniqueID();
+
+ public int getWindowHandle();
+
+ public int getAccessibleIndexInParent();
+
+ public Locale getLocale();
+
+ public String getAttributes();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleAction.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleAction.java
new file mode 100644
index 0000000..e356d6d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleAction.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+
+
+
+public interface AccessibleAction {
+
+ public void dispose();
+
+ public int getAccessibleActionCount();
+
+ public boolean doAccessibleAction(int actionIndex);
+
+ public String getAccessibleActionDescription(int actionIndex);
+
+ public String[] getAccessibleActionKeyBinding(int actionIndex, int nMaxBinding);
+
+ public String getAccessibleActionName(int actionIndex);
+
+ public String getLocalizedAccessibleActionName(int actionIndex);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleApplication.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleApplication.java
new file mode 100644
index 0000000..f06fcf6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleApplication.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+
+
+public interface AccessibleApplication {
+
+ public void dispose();
+
+ public String getApplicationName();
+
+ public String getApplicationVersion();
+
+ public String getToolkitName();
+
+ public String getToolkitVersion();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleComponent.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleComponent.java
new file mode 100644
index 0000000..079be5d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleComponent.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+import org.eclipse.swt.graphics.Point;
+
+
+
+public interface AccessibleComponent {
+
+ public void dispose();
+
+ public Point getLocation();
+
+ public int getForeground();
+
+ public int getBackground();
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleEditableText.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleEditableText.java
new file mode 100644
index 0000000..fc84420
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleEditableText.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+
+
+
+public interface AccessibleEditableText {
+
+ public void dispose();
+
+ public boolean copyText(int startOffset, int endOffset);
+
+ public boolean deleteText(int startOffset, int endOffset);
+
+ public boolean insertText(int offset, String strText);
+
+ public boolean cutText(int startOffset, int endOffset);
+
+ public boolean pasteText(int offset);
+
+ public boolean replaceText(int startOffset, int endOffset, String strText);
+
+ public boolean setAttributes(int startOffset, int endOffset, String strAttributes);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleHyperlink.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleHyperlink.java
new file mode 100644
index 0000000..253e0ad
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleHyperlink.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+import org.eclipse.swt.ole.win32.Variant;
+
+
+
+public interface AccessibleHyperlink {
+
+ public void dispose();
+
+ public Variant getAccessibleActionAnchor(int index);
+
+ public Variant getAccessibleActionObject(int index);
+
+ public int getStartIndex();
+
+ public int getEndIndex();
+
+ public boolean isValid();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleHypertext.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleHypertext.java
new file mode 100644
index 0000000..deae174
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleHypertext.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+
+
+
+public interface AccessibleHypertext {
+
+ public void dispose();
+
+ public int getHyperLinkCount();
+
+ public AccessibleHyperlink getHyperLink(int index);
+
+ public int getHyperLinkIndex(int charIndex);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleImage.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleImage.java
new file mode 100644
index 0000000..737f4e6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleImage.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+import org.eclipse.swt.graphics.Point;
+
+
+
+public interface AccessibleImage {
+
+ public void dispose();
+
+ public String getAccessibleImageDescription();
+
+ public Point getAccessibleImagePosition(int coordinateType);
+
+ public Point getAccessibleImageSize();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleRelation.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleRelation.java
new file mode 100644
index 0000000..0a48191
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleRelation.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+
+
+
+public interface AccessibleRelation {
+
+ public void dispose();
+
+ public String getRelationType();
+
+ public String getLocalizedRelationType();
+
+ public int getTargetCount();
+
+ public AccessibleObject getTarget(int targetIndex);
+
+ public AccessibleObject[] getTargets(int maxTargets);
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleTable.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleTable.java
new file mode 100644
index 0000000..4aefaaa
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleTable.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+
+
+
+public interface AccessibleTable {
+
+ public void dispose();
+
+ public AccessibleObject getAccessibleCellAt(int row, int column);
+
+ public Object getAccessibleCaption();
+
+ public int getAccessibleIndex(int rowIndex, int columnIndex);
+
+ public String getAccessibleColumnDescription(int column);
+
+ public int getAccessibleColumnExtentAt(int row, int column);
+
+ public AccessibleTable getAccessibleColumnHeaders(int[] startingRowIndex);
+
+ public int getAccessibleColumnIndex(int childIndex);
+
+ public int getAccessibleColumnCount();
+
+ public int getAccessibleRowCount();
+
+ public int getSelectedAccessibleChildCount();
+
+ public int getSelectedAccessibleColumnCount();
+
+ public int getSelectedAccessibleRowCount();
+
+ public String getAccessibleRowDescription(int row);
+
+ public int getAccessibleRowExtentAt(int row, int column);
+
+ public AccessibleTable getAccessibleRowHeaders(int[] startingColumnIndex);
+
+ public int getAccessibleRowIndex(int childIndex);
+
+ public int[] getSelectedAccessibleChildren(int maxChildren);
+
+ public int[] getSelectedAccessibleRows(int maxRows);
+
+ public int[] getSelectedAccessibleColumns(int maxColumns);
+
+ public Object getAccessibleSummary();
+
+ public boolean isAccessibleColumnSelected(int column);
+
+ public boolean isAccessibleRowSelected(int row);
+
+ public boolean isAccessibleSelected(int row, int column);
+
+ public boolean selectAccessibleRow(int row);
+
+ public boolean selectAccessibleColumn(int column);
+
+ public boolean unselectAccessibleRow(int row);
+
+ public boolean unselectAccessibleColumn(int column);
+
+ public RowColumnExtents getAccessibleRowColumnExtentAtIndex(int index);
+
+ public AccessibleTableModelChange getAccessibleTableModelChange();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleTableModelChange.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleTableModelChange.java
new file mode 100644
index 0000000..c0133f9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleTableModelChange.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+
+public class AccessibleTableModelChange {
+
+ public int type;
+ public int firstRow;
+ public int lastRow;
+ public int firstColumn;
+ public int lastColumn;
+
+ public AccessibleTableModelChange(int type, int firstRow, int lastRow, int firstColumn, int lastColumn) {
+ this.type = type;
+ this.firstRow = firstRow;
+ this.lastRow = lastRow;
+ this.firstColumn = firstColumn;
+ this.lastColumn = lastColumn;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleText.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleText.java
new file mode 100644
index 0000000..1a204e2
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleText.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+
+
+
+public interface AccessibleText {
+
+ public void dispose();
+
+ public boolean addSelection(int startOffset, int endOffset);
+
+ public TextSegment getCharacterAttributes(int offset);
+
+ public int getCaretPosition();
+
+ public Rectangle getCharacterBounds(int offset, int coordType);
+
+ public int getSelectionCount();
+
+ public int getIndexAtPoint(Point point, int coordType);
+
+ public Point getSelection(int selectionIndex);
+
+ public String getTextRange(int startOffset, int endOffset);
+
+ public TextSegment getTextBeforeIndex(int offset, int boundaryType);
+
+ public TextSegment getTextAfterIndex(int offset, int boundaryType);
+
+ public TextSegment getTextAtIndex(int offset, int boundaryType);
+
+ public boolean removeSelection(int selectionIndex);
+
+ public boolean setCaretPosition(int offset);
+
+ public boolean setSelection(int selectionIndex, int startOffset, int endOffset);
+
+ public int getCharacterCount();
+
+ public boolean scrollSubstringTo(int startIndex, int endIndex, int scrollType);
+
+ public boolean scrollSubstringToPoint(int startIndex, int endIndex, int coordinateType, int x, int y);
+
+ public TextSegment getNewText();
+
+ public TextSegment getOldText();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleValue.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleValue.java
new file mode 100644
index 0000000..045fb5e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/AccessibleValue.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+
+
+
+public interface AccessibleValue {
+
+ public void dispose();
+
+ public Object getCurrentValue();
+
+ public boolean setCurrentValue(Object objValue);
+
+ public Object getMaximumValue();
+
+ public Object getMinimumValue();
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/IA2Util.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/IA2Util.java
new file mode 100644
index 0000000..763caa5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/IA2Util.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+import java.util.StringTokenizer;
+
+
+
+public class IA2Util {
+
+ public static String getAttribute(String attributes, String name) {
+ if( null != attributes ) {
+ StringTokenizer st = new StringTokenizer(attributes,";"); //$NON-NLS-1$
+ while( st.hasMoreTokens() ) {
+ String nameValue = st.nextToken();
+ int sep = nameValue.indexOf(':');
+ if( sep > 0 ) {
+ if( name.equals(nameValue.substring(0,sep)) ) {
+ return nameValue.substring(sep+1);
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public static boolean getExtendedState(String[] extendedStates, String name) {
+ if( null != extendedStates) {
+ for( int i=0; i<extendedStates.length; i++ ) {
+ if( extendedStates[i].equals(name) ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/RowColumnExtents.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/RowColumnExtents.java
new file mode 100644
index 0000000..a41955f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/RowColumnExtents.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+
+public class RowColumnExtents {
+
+ public int row;
+ public int column;
+ public int rowExtents;
+ public int columnExtents;
+ public boolean isSelected;
+
+ public RowColumnExtents(int row, int column, int rowExtents, int columnExtents, boolean isSelected) {
+ this.row = row;
+ this.column = column;
+ this.rowExtents = rowExtents;
+ this.columnExtents = columnExtents;
+ this.isSelected = isSelected;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/TextSegment.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/TextSegment.java
new file mode 100644
index 0000000..593b29b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/ia2/TextSegment.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.ia2;
+
+
+public class TextSegment {
+
+ public String text;
+ public int start;
+ public int end;
+
+ public TextSegment() {
+ }
+ public TextSegment(String text, int start, int end) {
+ this.text = text;
+ this.start = start;
+ this.end = end;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/InternalAccessibleObject.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/InternalAccessibleObject.java
new file mode 100644
index 0000000..cfd46d6
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/InternalAccessibleObject.java
@@ -0,0 +1,870 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.accservice.swtbridge.internal;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.IAccessible;
+import org.eclipse.actf.accservice.swtbridge.IServiceProvider;
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleApplication;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleComponent;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHyperlink;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHypertext;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleImage;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleValue;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessible2;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessibleAction;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessibleApplication;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessibleComponent;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessibleHyperlink;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessibleHypertext;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessibleImage;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessibleTable;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessibleText;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.IAccessibleValue;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessible2;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessibleAction;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessibleApplication;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessibleComponent;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessibleEditableText;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessibleHyperlink;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessibleHypertext;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessibleImage;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessibleTable;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessibleText;
+import org.eclipse.actf.accservice.swtbridge.internal.ia2.InternalAccessibleValue;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.actf.util.win32.NativeStringAccess;
+import org.eclipse.actf.util.win32.NativeVariantAccess;
+import org.eclipse.actf.util.win32.WindowUtil;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.ole.win32.IDispatch;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.Variant;
+
+
+public class InternalAccessibleObject implements AccessibleObject {
+
+ private InternalAccessibleObject parent = null;
+
+ private Variant varChildIndex = null;
+
+ private IAccessible iAccessible = null;
+
+ private Accessible2 accessible2 = null;
+ private AccessibleAction accessibleAction = null;
+ private AccessibleApplication accessibleApplication = null;
+ private AccessibleComponent accessibleComponent = null;
+ private AccessibleEditableText accessibleEditableText = null;
+ private AccessibleHyperlink accessibleHyperlink = null;
+ private AccessibleHypertext accessibleHypertext = null;
+ private AccessibleImage accessibleImage = null;
+ private AccessibleTable accessibleTable = null;
+ private AccessibleText accessibleText = null;
+ private AccessibleValue accessibleValue = null;
+
+ private HashMap childMap = new HashMap();
+
+ private InternalAccessibleObject[] cachedChildren = new InternalAccessibleObject[0];
+
+ private boolean disposed = false;
+
+ private int accRole;
+ private int ia1Role,ia2Role;
+ private int accWindow;
+ private String strClassName;
+ private static final String STR_NULL = null;//"";
+
+ private InternalAccessibleObject(int address) {
+ this((InternalAccessibleObject) null, new Variant(new IDispatch(address)));
+ }
+
+ public InternalAccessibleObject(InternalAccessibleObject parent, Variant varChild) {
+ this.parent = parent;
+ varChildIndex = varChild;
+ switch (varChild.getType()) {
+ case OLE.VT_I4:
+ varChild = parent.getAccChild(varChild);
+ if (null == varChild || OLE.VT_DISPATCH != varChild.getType()) {
+ break;
+ }
+ case OLE.VT_DISPATCH:
+ int[] ppvObject = new int[1];
+ int[] ppvServiceProvider = new int[1];
+ if( OLE.S_OK == varChild.getDispatch().QueryInterface(IServiceProvider.IID,ppvServiceProvider) ) {
+ IServiceProvider sp = new IServiceProvider(ppvServiceProvider[0]);
+ try {
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessible2.IID,ppvObject) ) {
+ iAccessible = new IAccessible2(ppvObject[0]);
+ iAccessible.AddRef();
+ accessible2 = new InternalAccessible2((IAccessible2)iAccessible);
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessibleAction.IID,ppvObject) ) {
+ accessibleAction = new InternalAccessibleAction(ppvObject[0]);
+ }
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessibleApplication.IID,ppvObject) ) {
+ accessibleApplication = new InternalAccessibleApplication(ppvObject[0]);
+ }
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessibleComponent.IID,ppvObject) ) {
+ accessibleComponent = new InternalAccessibleComponent(ppvObject[0]);
+ }
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessibleEditableText.IID,ppvObject) ) {
+ accessibleEditableText = new InternalAccessibleEditableText(ppvObject[0]);
+ }
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessibleHyperlink.IID,ppvObject) ) {
+ accessibleHyperlink = new InternalAccessibleHyperlink(ppvObject[0]);
+ }
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessibleHypertext.IID,ppvObject) ) {
+ accessibleHypertext = new InternalAccessibleHypertext(ppvObject[0]);
+ }
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessibleImage.IID,ppvObject) ) {
+ accessibleImage = new InternalAccessibleImage(ppvObject[0]);
+ }
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessibleTable.IID,ppvObject) ) {
+ accessibleTable = new InternalAccessibleTable(ppvObject[0]);
+ }
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessibleText.IID,ppvObject) ) {
+ accessibleText = new InternalAccessibleText(ppvObject[0]);
+ }
+ if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessibleValue.IID,ppvObject) ) {
+ accessibleValue = new InternalAccessibleValue(ppvObject[0]);
+ }
+ }
+ else if( OLE.S_OK == sp.QueryService(IAccessible.IID,IAccessible.IID,ppvObject) ) {
+ iAccessible = new IAccessible(ppvObject[0]);
+ iAccessible.AddRef();
+ }
+
+ }
+ finally {
+ sp.Release();
+ }
+ }
+ if( null == iAccessible ) {
+ if( OLE.S_OK == varChild.getDispatch().QueryInterface(IAccessible.IID,ppvObject) ) {
+ iAccessible = new IAccessible(ppvObject[0]);
+ iAccessible.AddRef();
+ }
+ else {
+ System.out.println("Error: Can not get IAccessible"); //$NON-NLS-1$
+ }
+ }
+ varChildIndex = new Variant(0);
+ varChild.dispose();
+ break;
+ }
+ reset();
+ }
+
+ public void reset() {
+ disposeChildren();
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accRole(OLE.VT_I4,0,varChildIndex.getInt(),0,nva.getAddress()) ) {
+ accRole = nva.getInt();
+ }
+ }
+ finally {
+ nva.dispose();
+ }
+ accWindow = -1;
+ strClassName = null;
+ ia1Role = accRole;
+ ia2Role = -1;
+ Accessible2 ia2 = getAccessible2();
+ if( null != ia2 ) {
+ ia2Role = accRole = ia2.getAccessibleRole();
+ }
+ }
+
+ public void dispose() throws Exception {
+ if( disposed ) {
+ throw new Exception("Already disposed"); //$NON-NLS-1$
+ }
+ disposed = true;
+ disposeChildren();
+ if (null != iAccessible) {
+ iAccessible.Release();
+ iAccessible = null;
+ }
+ if( null != accessible2 ) {
+ accessible2.dispose();
+ accessible2 = null;
+ }
+ if( null != accessibleAction ) {
+ accessibleAction.dispose();
+ accessibleAction = null;
+ }
+ if( null != accessibleApplication ) {
+ accessibleApplication.dispose();
+ accessibleApplication = null;
+ }
+ if( null != accessibleComponent ) {
+ accessibleComponent.dispose();
+ accessibleComponent = null;
+ }
+ if( null != accessibleEditableText ) {
+ accessibleEditableText.dispose();
+ accessibleEditableText = null;
+ }
+ if( null != accessibleHyperlink ) {
+ accessibleHyperlink.dispose();
+ accessibleHyperlink = null;
+ }
+ if( null != accessibleHypertext ) {
+ accessibleHypertext.dispose();
+ accessibleHypertext = null;
+ }
+ if( null != accessibleImage ) {
+ accessibleImage.dispose();
+ accessibleImage = null;
+ }
+ if( null != accessibleTable ) {
+ accessibleTable.dispose();
+ accessibleTable = null;
+ }
+ if( null != accessibleText ) {
+ accessibleText.dispose();
+ accessibleText = null;
+ }
+ if( null != accessibleValue ) {
+ accessibleValue.dispose();
+ accessibleValue = null;
+ }
+ if (null != varChildIndex) {
+ varChildIndex.dispose();
+ varChildIndex = null;
+ }
+ if (null != parent) {
+ parent.removeChildObject(this);
+ }
+ }
+
+ private void disposeChildren() {
+ cachedChildren = new InternalAccessibleObject[0];
+ InternalAccessibleObject[] children = (InternalAccessibleObject[]) childMap.values().toArray(
+ new InternalAccessibleObject[childMap.size()]);
+ for (int i = 0; i < children.length; i++) {
+ try {
+ children[i].dispose();
+ }
+ catch( Exception e ) {};
+ }
+ }
+
+ public static AccessibleObject getAccessibleObjectFromPoint(Point point) {
+ int[] pChild = new int[1];
+ int address = MSAA.getAccessibleObjectFromPoint(point, pChild);
+ return newInstance(address,pChild[0]);
+ }
+
+ public static AccessibleObject getAccessibleObjectFromWindow(int hwnd) {
+ int address = MSAA.AccessibleObjectFromWindow(hwnd);
+ return newInstance(address);
+ }
+
+ public static AccessibleObject getAccessibleObjectFromEvent(int hwnd, int dwId, int dwChildId) {
+ int[] pChild = new int[1];
+ int address = MSAA.getAccessibleObjectFromEvent(hwnd, dwId, dwChildId, pChild);
+ return newInstance(address,pChild[0]);
+ }
+
+ public static AccessibleObject newInstance(int address) {
+ if (0 == address) {
+ return null;
+ }
+ return new InternalAccessibleObject(address);
+ }
+
+ private static AccessibleObject newInstance(int address, int childId) {
+ AccessibleObject accObject = newInstance(address);
+ if( (null != accObject) && (MSAA.CHILDID_SELF != childId) ) {
+ return ((InternalAccessibleObject)accObject).getChildObject(new Variant(childId));
+ }
+ return accObject;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getCachedParent()
+ */
+ public AccessibleObject getCachedParent() {
+ return parent;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getCachedChildren()
+ */
+ public AccessibleObject[] getCachedChildren() {
+ return cachedChildren;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getChildren()
+ */
+ public AccessibleObject[] getChildren() {
+ int childCount = Math.max(0,getChildCount());
+ if( childCount == cachedChildren.length ) {
+ return cachedChildren;
+ }
+ if( childCount > 32*1024 ) {
+ System.err.println("Too many children("+childCount+"), we don't fectch."); //$NON-NLS-1$ //$NON-NLS-2$
+ if( null != accessibleTable ) {
+ int nRows = accessibleTable.getAccessibleRowCount();
+ int nCols = accessibleTable.getAccessibleColumnCount();
+ if( 0x10000==nRows && 0x100==nCols) {
+ if( 16*16 == cachedChildren.length ) {
+ return cachedChildren;
+ }
+ cachedChildren = new InternalAccessibleObject[16*16];
+ for( int row=0; row<16; row++ ) {
+ for( int col=0; col<16; col++ ) {
+ InternalAccessibleObject cell = (InternalAccessibleObject)accessibleTable.getAccessibleCellAt(row,col);
+ cell.parent = this;
+ cachedChildren[row*16+col] = cell;
+ }
+ }
+ System.err.println("getChildren() returned 256(16x16) table cells."); //$NON-NLS-1$
+ return cachedChildren;
+ }
+ }
+ return new InternalAccessibleObject[0];
+ }
+ cachedChildren = new InternalAccessibleObject[childCount];
+ if (childCount > 0) {
+ Variant[] varChildren = new Variant[childCount];
+ MSAA.getAccessibleChildren(getIAccessible().getAddress(), varChildren);
+ for (int i = 0; i < childCount; i++) {
+ if (null != varChildren[i]) {
+ cachedChildren[i] = getChildObject(varChildren[i]);
+ }
+ }
+ }
+ return cachedChildren;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getChildCount()
+ */
+ public int getChildCount() {
+ try {
+ if( varChildIndex.getInt() == 0 ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accChildCount(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ } catch (Exception e) {
+ }
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getWindow()
+ */
+ public int getWindow() {
+ if( -1 == accWindow ) {
+ try {
+ accWindow = MSAA.WindowFromAccessibleObject(getIAccessible().getAddress());
+ }
+ catch( Exception e ) {
+ accWindow = 0;
+ }
+ }
+ return accWindow;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccRole()
+ */
+ public int getAccRole() {
+ return accRole;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getRoleText()
+ */
+ public String getRoleText() {
+ if( -1 == accRole ) {
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accRole(OLE.VT_I4,0,varChildIndex.getInt(),0,nva.getAddress()) ) {
+ return nva.getString();
+ }
+ }
+ finally {
+ nva.dispose();
+ }
+ }
+ else {
+ return MSAA.getRoleText(accRole);
+ }
+ return STR_NULL;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getClassName()
+ */
+ public String getClassName() {
+ if( null == strClassName ) {
+ int hwnd = this.getWindow();
+ strClassName = STR_NULL;
+ if (0 != hwnd) {
+ strClassName = WindowUtil.GetWindowClassName(hwnd);
+ }
+ }
+ return strClassName;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccState()
+ */
+ public int getAccState() {
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accState(OLE.VT_I4,0,varChildIndex.getInt(),0,nva.getAddress()) ) {
+ return nva.getInt();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nva.dispose();
+ }
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccName()
+ */
+ public String getAccName() {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accName(OLE.VT_I4,0,varChildIndex.getInt(),0,nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ return STR_NULL;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccValue()
+ */
+ public String getAccValue() {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accValue(OLE.VT_I4,0,varChildIndex.getInt(),0,nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ return STR_NULL;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccDescription()
+ */
+ public String getAccDescription() {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accDescription(OLE.VT_I4,0,varChildIndex.getInt(),0,nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ return STR_NULL;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccHelp()
+ */
+ public String getAccHelp() {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accHelp(OLE.VT_I4,0,varChildIndex.getInt(),0,nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ return STR_NULL;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccKeyboardShortcut()
+ */
+ public String getAccKeyboardShortcut() {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accKeyboardShortcut(OLE.VT_I4,0,varChildIndex.getInt(),0,nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ return STR_NULL;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccDefaultAction()
+ */
+ public String getAccDefaultAction() {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accDefaultAction(OLE.VT_I4,0,varChildIndex.getInt(),0,nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ return STR_NULL;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccHelpTopic(int[], java.lang.String[])
+ */
+ public boolean getAccHelpTopic(int[] pTopicIndex, String[] pHelpFile) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accHelpTopic(nsa.getAddress(),OLE.VT_I4,0,varChildIndex.getInt(),0,nia.getAddress()) ) {
+ pTopicIndex[0] = nia.getInt();
+ pHelpFile[0] = nsa.getString();
+ return true;
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ nsa.dispose();
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccLocation()
+ */
+ public Rectangle getAccLocation() {
+ if( disposed ) return null;
+ NativeIntAccess nia = new NativeIntAccess(4);
+ try {
+ if( OLE.S_OK == getIAccessible().accLocation(
+ nia.getAddress(0),
+ nia.getAddress(1),
+ nia.getAddress(2),
+ nia.getAddress(3),
+ OLE.VT_I4,0,varChildIndex.getInt(),0) )
+ {
+ return new Rectangle(nia.getInt(0), nia.getInt(1), nia.getInt(2), nia.getInt(3));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ return null;
+ }
+
+ public boolean doDefaultAction() {
+ return OLE.S_OK == getIAccessible().accDoDefaultAction(OLE.VT_I4,0,varChildIndex.getInt(),0);
+ }
+
+ public boolean select(int flagsSelect) {
+ return OLE.S_OK == getIAccessible().accSelect(flagsSelect,OLE.VT_I4,0,varChildIndex.getInt(),0);
+ }
+
+ public boolean setAccName(String strName) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ nsa.setString(strName);
+ return OLE.S_OK == getIAccessible().put_accName(OLE.VT_I4,0,varChildIndex.getInt(),0, nsa.getAddress());
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+
+ public boolean setAccValue(String strValue) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ nsa.setString(strValue);
+ return OLE.S_OK == getIAccessible().put_accValue(OLE.VT_I4,0,varChildIndex.getInt(),0, nsa.getAddress());
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getAccParent()
+ */
+ public AccessibleObject getAccParent() {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accParent(nia.getAddress()) ) {
+ return newInstance(nia.getInt());
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ return null;
+ }
+
+ /*
+ * Internal functions
+ */
+
+ private Variant getAccChild(Variant varChild) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accChild(OLE.VT_I4,0,varChild.getInt(),0,nia.getAddress()) ) {
+ return new Variant(new IDispatch(nia.getInt()));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ return null;
+ }
+
+ public IAccessible getIAccessible() {
+ if( null != iAccessible ) {
+ return iAccessible;
+ }
+ if( null != parent ) {
+ return parent.getIAccessible();
+ }
+ return null;
+ }
+
+ public Accessible2 getAccessible2() {
+ if( null != accessible2 ) {
+ return accessible2;
+ }
+ if( null != parent ) {
+ return parent.getAccessible2();
+ }
+ return null;
+ }
+ public AccessibleAction getAccessibleAction() {
+ if( null != accessibleAction ) {
+ return accessibleAction;
+ }
+ if( null != parent ) {
+ return parent.getAccessibleAction();
+ }
+ return null;
+ }
+ public AccessibleApplication getAccessibleApplication() {
+ if( null != accessibleApplication ) {
+ return accessibleApplication;
+ }
+ if( null != parent ) {
+ return parent.getAccessibleApplication();
+ }
+ return null;
+ }
+ public AccessibleComponent getAccessibleComponent() {
+ if( null != accessibleComponent ) {
+ return accessibleComponent;
+ }
+ if( null != parent ) {
+ return parent.getAccessibleComponent();
+ }
+ return null;
+ }
+ public AccessibleEditableText getAccessibleEditableText() {
+ if( null != accessibleEditableText ) {
+ return accessibleEditableText;
+ }
+ if( null != parent ) {
+ return parent.getAccessibleEditableText();
+ }
+ return null;
+ }
+ public AccessibleHyperlink getAccessibleHyperlink() {
+ if( null != accessibleHyperlink ) {
+ return accessibleHyperlink;
+ }
+ if( null != parent ) {
+ return parent.getAccessibleHyperlink();
+ }
+ return null;
+ }
+ public AccessibleHypertext getAccessibleHypertext() {
+ if( null != accessibleHypertext ) {
+ return accessibleHypertext;
+ }
+ if( null != parent ) {
+ return parent.getAccessibleHypertext();
+ }
+ return null;
+ }
+ public AccessibleImage getAccessibleImage() {
+ if( null != accessibleImage ) {
+ return accessibleImage;
+ }
+ if( null != parent ) {
+ return parent.getAccessibleImage();
+ }
+ return null;
+ }
+ public AccessibleTable getAccessibleTable() {
+ if( null != accessibleTable ) {
+ return accessibleTable;
+ }
+ if( null != parent ) {
+ return parent.getAccessibleTable();
+ }
+ return null;
+ }
+ public AccessibleText getAccessibleText() {
+ if( null != accessibleText ) {
+ return accessibleText;
+ }
+ if( null != parent ) {
+ return parent.getAccessibleText();
+ }
+ return null;
+ }
+ public AccessibleValue getAccessibleValue() {
+ if( null != accessibleValue ) {
+ return accessibleValue;
+ }
+ if( null != parent ) {
+ return parent.getAccessibleValue();
+ }
+ return null;
+ }
+
+ private InternalAccessibleObject getChildObject(Variant varChild) {
+ String key = varChild.toString();
+ InternalAccessibleObject accObject = (InternalAccessibleObject) childMap.get(key);
+ if (null == accObject) {
+ childMap.put(key, accObject = new InternalAccessibleObject(this, varChild));
+ if( accObject.checkInactiveControl() ) {
+ accObject.reset();
+ }
+ }
+ return accObject;
+ }
+
+ private void removeChildObject(InternalAccessibleObject accObject) {
+ for (Iterator it = childMap.keySet().iterator(); it.hasNext();) {
+ Object key = (Object) it.next();
+ if (accObject == childMap.get(key)) {
+ childMap.remove(key);
+ break;
+ }
+ }
+ }
+
+ private boolean checkInactiveControl() {
+ if( "Inactive Control".equals(getAccName()) && MSAA.ROLE_SYSTEM_PUSHBUTTON==getAccRole() ) { //$NON-NLS-1$
+ return doDefaultAction();
+ }
+ return false;
+ }
+
+ protected void finalize() throws Throwable {
+ if( !disposed ) {
+ dispose();
+ }
+ super.finalize();
+ }
+
+ public String toString() {
+ if( disposed ) {
+ return super.toString()+" disposed"; //$NON-NLS-1$
+ }
+ return "AccessibleObject role="+getRoleText()+ ", name="+getAccName()+", state="+getAccState()+", location="+getAccLocation(); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getRealAccRole()
+ */
+ public int getRealAccRole() {
+ return ia1Role;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.AccessibleObject#getRealRoleText()
+ */
+ public String getRealRoleText() {
+ if( -1 == ia1Role ) {
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ if( OLE.S_OK == getIAccessible().get_accRole(OLE.VT_I4,0,varChildIndex.getInt(),0,nva.getAddress()) ) {
+ return nva.getString();
+ }
+ }
+ finally {
+ nva.dispose();
+ }
+ }
+ else {
+ return MSAA.getRoleText(ia1Role);
+ }
+ return STR_NULL;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class adapter) {
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+
+ public int getPtr() {
+ return getIAccessible().getAddress();
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/InternalAccessibleObjectFactory.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/InternalAccessibleObjectFactory.java
new file mode 100644
index 0000000..257382b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/InternalAccessibleObjectFactory.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.IAccessibleObjectFactory;
+import org.eclipse.actf.accservice.swtbridge.event.IAccessibleEventMonitor;
+import org.eclipse.swt.graphics.Point;
+
+
+
+
+public class InternalAccessibleObjectFactory implements IAccessibleObjectFactory {
+
+ public static final String ID = InternalAccessibleObjectFactory.class.getName();
+
+ private static IAccessibleEventMonitor monitor = null;
+
+ public IAccessibleEventMonitor getAccessibleEventMonitor() {
+ if( null == monitor ) {
+ monitor = new InternalEventMonitor();
+ }
+ return monitor;
+ }
+
+ public AccessibleObject getAccessibleObjectFromEvent(int hwnd, int dwId, int dwChildId) {
+ return InternalAccessibleObject.getAccessibleObjectFromEvent(hwnd, dwId, dwChildId);
+ }
+
+ public AccessibleObject getAccessibleObjectFromPoint(Point point) {
+ return InternalAccessibleObject.getAccessibleObjectFromPoint(point);
+ }
+
+ public AccessibleObject getAccessibleObjectFromWindow(int hwnd) {
+ return InternalAccessibleObject.getAccessibleObjectFromWindow(hwnd);
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/InternalEventMonitor.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/InternalEventMonitor.java
new file mode 100644
index 0000000..5180060
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/InternalEventMonitor.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.actf.accservice.swtbridge.internal;
+
+import java.util.Set;
+
+import org.eclipse.actf.accservice.swtbridge.MSAA;
+import org.eclipse.actf.accservice.swtbridge.event.IAccessibleEventListener;
+import org.eclipse.actf.accservice.swtbridge.event.IAccessibleEventMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.internal.Callback;
+
+
+public class InternalEventMonitor implements IAccessibleEventMonitor {
+
+ private Callback callback = null;
+ private int hWinEventHook = 0;
+ private IAccessibleEventListener listener = null;
+ private Set filter;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.IAccessibleEventMonitor#installEventHook(org.eclipse.actf.accservice.swtbridge.IAccessibleEventListener, int[])
+ */
+ public void installEventHook(IAccessibleEventListener listener, Set filter) {
+ removeEventHook();
+ this.listener = listener;
+ this.filter = filter;
+ callback = new Callback(this,"WinEventProc",7); //$NON-NLS-1$
+ int address = callback.getAddress();
+ if (address == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
+ hWinEventHook = MSAA.SetWinEventHook(0x00000001, 0x7FFFFFFF, 0, address, 0, 0,0);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.actf.accservice.swtbridge.IAccessibleEventMonitor#removeEventHook()
+ */
+ public void removeEventHook() {
+ if( 0 != hWinEventHook ) {
+ MSAA.UnhookWinEvent(hWinEventHook);
+ hWinEventHook = 0;
+ }
+ if( null != callback ) {
+ callback.dispose();
+ callback = null;
+ }
+ }
+
+ int WinEventProc(int hEvent, int event, int hwnd, int idObject, int idChild, int idThread, int dwEventTime) {
+// System.out.println( "hEvent=0x"+Integer.toHexString(hEvent) +", "+
+// "event=0x"+Integer.toHexString(event) +", "+
+// "hwnd=0x"+Integer.toHexString(hwnd) +", "+
+// "idObject=0x"+Integer.toHexString(idObject) +", "+
+// "idChild=0x"+Integer.toHexString(idChild) +", "+
+// "idThread=0x"+Integer.toHexString(idThread) +", "+
+// "dwEventTime=0x"+Integer.toHexString(dwEventTime) );
+ if( null != listener && checkFilter(event) ) {
+ listener.handleEvent(event, hwnd, idObject, idChild, null);
+ }
+ return 0;
+ }
+
+ private boolean checkFilter(int event) {
+ if( null == filter ) return true;
+ return filter.contains(new Integer(event));
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessible2.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessible2.java
new file mode 100644
index 0000000..ff31f42
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessible2.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.IAccessible;
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.COM;
+import org.eclipse.swt.internal.ole.win32.GUID;
+
+
+
+
+public class IAccessible2 extends IAccessible {
+ public static final GUID IID = COMUtil.IIDFromString("{E89F726E-C4F4-4C19-BB19-B647D7FA8478}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessible2(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int get_nRelations(int pnRelations) {
+ return COMUtil.VtblCall(28, address, pnRelations);
+ }
+ public int get_relation(int relationIndex, int pdispRelation){
+ return COMUtil.VtblCall(29, address, relationIndex, pdispRelation);
+ }
+ public int get_relations(int maxRelations, int pdispRelation,int pnRelations) {
+ return COMUtil.VtblCall(30, address, maxRelations, pdispRelation, pnRelations);
+ }
+ public int get_role(int pRole) {
+ return COM.VtblCall(31, address, pRole);
+ }
+ public int scrollTo(int scrollType) {
+ return COM.VtblCall(32, address, scrollType); // TODO
+ }
+ public int scrollToPoint(int coordinateType, int x, int y) {
+ return COMUtil.VtblCall(33, address, coordinateType, x, y); // TODO
+ }
+ public int get_groupPosition(int pGroupLevel, int pSimilarItemsInGroup, int pPositionInGroup) {
+ return COMUtil.VtblCall(34, address, pGroupLevel, pSimilarItemsInGroup, pPositionInGroup);
+ }
+ public int get_states(int pdispStates ) {
+ return COMUtil.VtblCall(35, address, pdispStates);
+ }
+ public int get_extendedRole(int pszExtendedRole) {
+ return COMUtil.VtblCall(36, address, pszExtendedRole);
+ }
+ public int get_localizedExtendedRole(int pszLocalizedExtendedRole) {
+ return COMUtil.VtblCall(37, address, pszLocalizedExtendedRole);
+ }
+ public int get_nExtendedStates(int pnExtendedStates) {
+ return COMUtil.VtblCall(38, address, pnExtendedStates);
+ }
+ public int get_extendedStates(int maxExtendedStates,int ppszExtendedStates,int pnExtendedStates) {
+ return COMUtil.VtblCall(39, address, maxExtendedStates, ppszExtendedStates, pnExtendedStates);
+ }
+ public int get_localizedExtendedStates(int maxLocalizedExtendedStates,int ppszLocalizedExtendedStates,int pnLocalizedExtendedStates) {
+ return COMUtil.VtblCall(40, address, maxLocalizedExtendedStates, ppszLocalizedExtendedStates, pnLocalizedExtendedStates);
+ }
+ public int get_uniqueID(int pUniqueID) {
+ return COMUtil.VtblCall(41, address, pUniqueID);
+ }
+ public int get_windowHandle(int pWindowHandle) {
+ return COMUtil.VtblCall(42, address, pWindowHandle);
+ }
+ public int get_indexInParent(int pIndexInParent) {
+ return COMUtil.VtblCall(43, address, pIndexInParent);
+ }
+ public int get_locale(int pLocale) {
+ return COMUtil.VtblCall(44, address, pLocale);
+ }
+ public int get_attributes(int pszAttributes) {
+ return COMUtil.VtblCall(45, address, pszAttributes);
+ }
+
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleAction.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleAction.java
new file mode 100644
index 0000000..8831a2e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleAction.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+
+
+
+public class IAccessibleAction extends IUnknown {
+ public static final GUID IID = COMUtil.IIDFromString("{B70D9F59-3B5A-4dba-AB9E-22012F607DF5}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleAction(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int nActions(int pnActions) {
+ return COMUtil.VtblCall(3, address, pnActions);
+ }
+ public int doAction(int actionIndex) {
+ return COMUtil.VtblCall(4, address, actionIndex);
+ }
+ public int get_description(int actionIndex, int pszDescription) {
+ return COMUtil.VtblCall(5, address, actionIndex, pszDescription);
+ }
+ public int get_keyBinding(int actionIndex, int nMaxBinding, int ppszKeyBinding, int pnBinding) {
+ return COMUtil.VtblCall(6, address, actionIndex, nMaxBinding, ppszKeyBinding, pnBinding);
+ }
+ public int get_name(int actionIndex, int pszName) {
+ return COMUtil.VtblCall(7, address, actionIndex, pszName);
+ }
+ public int get_localizedName(int actionIndex, int pszLocalizedName) {
+ return COMUtil.VtblCall(8, address, actionIndex, pszLocalizedName);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleApplication.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleApplication.java
new file mode 100644
index 0000000..cbf2d2d
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleApplication.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+
+
+
+public class IAccessibleApplication extends IUnknown {
+ public static final GUID IID = COMUtil.IIDFromString("{D49DED83-5B25-43F4-9B95-93B44595979E}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleApplication(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int get_appName(int pszName) {
+ return COMUtil.VtblCall(3, address, pszName);
+ }
+ public int get_appVersion(int pszVersion) {
+ return COMUtil.VtblCall(4, address, pszVersion);
+ }
+ public int get_toolkitName(int pszName) {
+ return COMUtil.VtblCall(5, address, pszName);
+ }
+ public int get_toolkitVersion(int pszVersion) {
+ return COMUtil.VtblCall(6, address, pszVersion);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleComponent.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleComponent.java
new file mode 100644
index 0000000..747037b
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleComponent.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+
+
+
+public class IAccessibleComponent extends IUnknown {
+ public static final GUID IID = COMUtil.IIDFromString("{1546D4B0-4C98-4bda-89AE-9A64748BDDE4}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleComponent(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int get_locationInParent(int pX, int pY) {
+ return COMUtil.VtblCall(3, address, pX, pY);
+ }
+ public int get_foreground(int pForeground) {
+ return COMUtil.VtblCall(4, address, pForeground);
+ }
+ public int get_background(int pBackground) {
+ return COMUtil.VtblCall(5, address, pBackground);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleEditableText.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleEditableText.java
new file mode 100644
index 0000000..6cc1201
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleEditableText.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+
+
+
+public class IAccessibleEditableText extends IUnknown {
+ public static final GUID IID = COMUtil.IIDFromString("{A59AA09A-7011-4b65-939D-32B1FB5547E3}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleEditableText(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int copyText(int startOffset, int endOffset) {
+ return COMUtil.VtblCall(3, address, startOffset, endOffset);
+ }
+ public int deleteText(int startOffset, int endOffset) {
+ return COMUtil.VtblCall(4, address, startOffset, endOffset);
+ }
+ public int insertText(int offset, int pszText) {
+ return COMUtil.VtblCall(5, address, offset, pszText);
+ }
+ public int cutText(int startOffset, int endOffset) {
+ return COMUtil.VtblCall(6, address, startOffset, endOffset);
+ }
+ public int pasteText(int offset) {
+ return COMUtil.VtblCall(7, address, offset);
+ }
+ public int replaceText(int startOffset, int endOffset, int pszText) {
+ return COMUtil.VtblCall(8, address, startOffset, endOffset, pszText);
+ }
+ public int setAttributes(int startOffset, int endOffset, int pszAttributes) {
+ return COMUtil.VtblCall(9, address, startOffset, endOffset, pszAttributes);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleHyperlink.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleHyperlink.java
new file mode 100644
index 0000000..7a1da2e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleHyperlink.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+
+
+
+public class IAccessibleHyperlink extends IAccessibleAction {
+ public static final GUID IID = COMUtil.IIDFromString("{01C20F2B-3DD2-400f-949F-AD00BDAB1D41}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleHyperlink(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int get_anchor(int index, int pvarAnchor) {
+ return COMUtil.VtblCall(9, address, index, pvarAnchor);
+ }
+ public int get_anchorTarget(int index, int pvarAnchorTarget) {
+ return COMUtil.VtblCall(10, address, index, pvarAnchorTarget);
+ }
+ public int get_startIndex(int pIndex) {
+ return COMUtil.VtblCall(11, address, pIndex);
+ }
+ public int get_endIndex(int pIndex) {
+ return COMUtil.VtblCall(12, address, pIndex);
+ }
+ public int get_valid(int pValid) {
+ return COMUtil.VtblCall(13, address, pValid);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleHypertext.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleHypertext.java
new file mode 100644
index 0000000..33b4f28
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleHypertext.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+
+
+
+public class IAccessibleHypertext extends IAccessibleText {
+ public static final GUID IID = COMUtil.IIDFromString("{6B4F8BBF-F1F2-418a-B35E-A195BC4103B9}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleHypertext(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int get_nHyperlinks(int pHyperlinkCount) {
+ return COMUtil.VtblCall(22, address, pHyperlinkCount);
+ }
+ public int get_hyperlink(int index, int pdispHyperlink) {
+ return COMUtil.VtblCall(23, address, index, pdispHyperlink);
+ }
+ public int get_hyperlinkIndex(int charIndex, int pHyperlinkIndex) {
+ return COMUtil.VtblCall(24, address, charIndex, pHyperlinkIndex);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleImage.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleImage.java
new file mode 100644
index 0000000..4b4781e
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleImage.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+
+
+
+public class IAccessibleImage extends IUnknown {
+ public static final GUID IID = COMUtil.IIDFromString("{FE5ABB3D-615E-4f7b-909F-5F0EDA9E8DDE}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleImage(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int get_description(int pszDescription) {
+ return COMUtil.VtblCall(3, address, pszDescription);
+ }
+ public int get_imagePosition(int coordinateType, int pX, int pY) {
+ return COMUtil.VtblCall(4, address, coordinateType, pX, pY);
+ }
+ public int get_imageSize(int pWidth, int pHeight) {
+ return COMUtil.VtblCall(5, address, pWidth, pHeight);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleRelation.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleRelation.java
new file mode 100644
index 0000000..0987aa9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleRelation.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+
+
+
+public class IAccessibleRelation extends IUnknown {
+ public static final GUID IID = COMUtil.IIDFromString("{7CDF86EE-C3DA-496a-BDA4-281B336E1FDC}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleRelation(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int get_relationType(int pszRelationType) {
+ return COMUtil.VtblCall(3, address, pszRelationType);
+ }
+ public int get_localizedRelationType(int pszLocalizedRelationType) {
+ return COMUtil.VtblCall(4, address, pszLocalizedRelationType);
+ }
+ public int get_nTargets(int pnTargets) {
+ return COMUtil.VtblCall(5, address, pnTargets);
+ }
+ public int get_target(int targetIndex, int punkTarget) {
+ return COMUtil.VtblCall(6, address, targetIndex, punkTarget);
+ }
+ public int get_targets(int maxTargets, int punkTarget, int pnTargets) {
+ return COMUtil.VtblCall(7, address, maxTargets, punkTarget, pnTargets);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleTable.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleTable.java
new file mode 100644
index 0000000..7993cf5
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleTable.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+
+
+
+public class IAccessibleTable extends IUnknown {
+ public static final GUID IID = COMUtil.IIDFromString("{35AD8070-C20C-4fb4-B094-F4F7275DD469}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleTable(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int get_accessibleAt(int row, int column, int pdispAccessible) {
+ return COMUtil.VtblCall(3, address, row, column, pdispAccessible);
+ }
+ public int get_caption(int pdispAccessible) {
+ return COMUtil.VtblCall(4, address, pdispAccessible);
+ }
+ public int get_childIndex(int rowIndex, int columnIndex, int pChildIndex) {
+ return COMUtil.VtblCall(5, address, rowIndex, columnIndex, pChildIndex);
+ }
+ public int get_columnDescription(int column, int pszDescription) {
+ return COMUtil.VtblCall(6, address, column, pszDescription);
+ }
+ public int get_columnExtentAt(int row, int column, int pnColumnsSpanned) {
+ return COMUtil.VtblCall(7, address, row, column, pnColumnsSpanned);
+ }
+ public int get_columnHeader(int pdispAccessibleTable, int pStartingRowIndex) {
+ return COMUtil.VtblCall(8, address, pdispAccessibleTable, pStartingRowIndex);
+ }
+ public int get_columnIndex(int childIndex, int pColumnIndex) {
+ return COMUtil.VtblCall(9, address, childIndex, pColumnIndex);
+ }
+ public int get_nColumns(int pColumnCount) {
+ return COMUtil.VtblCall(10, address, pColumnCount);
+ }
+ public int get_nRows(int pRowCount) {
+ return COMUtil.VtblCall(11, address, pRowCount);
+ }
+ public int get_nSelectedChildren(int pChildCount) {
+ return COMUtil.VtblCall(12, address, pChildCount);
+ }
+ public int get_nSelectedColumns(int pColumnCount) {
+ return COMUtil.VtblCall(13, address, pColumnCount);
+ }
+ public int get_nSelectedRows(int pRowCount) {
+ return COMUtil.VtblCall(14, address, pRowCount);
+ }
+ public int get_rowDescription(int row, int pszDescription) {
+ return COMUtil.VtblCall(15, address, row, pszDescription);
+ }
+ public int get_rowExtentAt(int row, int column, int pnRowsSpanned) {
+ return COMUtil.VtblCall(16, address, row, column, pnRowsSpanned);
+ }
+ public int get_rowHeader(int pdispAccessibleTable, int pStartingColumnIndex) {
+ return COMUtil.VtblCall(17, address, pdispAccessibleTable, pStartingColumnIndex);
+ }
+ public int get_rowIndex(int childIndex, int pRowIndex) {
+ return COMUtil.VtblCall(18, address, childIndex, pRowIndex);
+ }
+ public int get_selectedChildren(int maxChildren, int ppChildren, int pnChildren) {
+ return COMUtil.VtblCall(19, address, maxChildren, ppChildren, pnChildren);
+ }
+ public int get_selectedRows(int maxRows, int ppRows, int pnRows) {
+ return COMUtil.VtblCall(20, address, maxRows, ppRows, pnRows);
+ }
+ public int get_selectedColumns(int maxColumns, int ppColumns, int pnColumns) {
+ return COMUtil.VtblCall(21, address, maxColumns, ppColumns, pnColumns);
+ }
+ public int get_summary(int pdispAccessible) {
+ return COMUtil.VtblCall(22, address, pdispAccessible);
+ }
+ public int get_isColumnSelected(int column, int pIsSelected) {
+ return COMUtil.VtblCall(23, address, column, pIsSelected);
+ }
+ public int get_isRowSelected(int row, int pIsSelected) {
+ return COMUtil.VtblCall(24, address, row, pIsSelected);
+ }
+ public int get_isSelected(int row, int column, int pIsSelected) {
+ return COMUtil.VtblCall(25, address, row, column, pIsSelected);
+ }
+ public int selectRow(int row) {
+ return COMUtil.VtblCall(26, address, row);
+ }
+ public int selectColumn(int column) {
+ return COMUtil.VtblCall(27, address, column);
+ }
+ public int unselectRow(int row) {
+ return COMUtil.VtblCall(28, address, row);
+ }
+ public int unselectColumn(int column) {
+ return COMUtil.VtblCall(29, address, column);
+ }
+ public int get_rowColumnExtentsAtIndex(int index, int pRow, int pColumn, int pRowExtents, int pColumnExtents, int pIsSelected) {
+ return COMUtil.VtblCall(30, address, index, pRow, pColumn, pRowExtents, pColumnExtents, pIsSelected);
+ }
+ public int get_modelChange(int pModelChange) {
+ return COMUtil.VtblCall(31, address, pModelChange);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleText.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleText.java
new file mode 100644
index 0000000..4779c17
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleText.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+
+
+
+public class IAccessibleText extends IUnknown {
+ public static final GUID IID = COMUtil.IIDFromString("{24FD2FFB-3AAD-4a08-8335-A3AD89C0FB4B}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleText(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int addSelection(int startOffset, int endOffset) {
+ return COMUtil.VtblCall(3, address, startOffset, endOffset);
+ }
+ public int get_attributes(int offset,int pStartOffset, int pEndOffset, int pszTextAttributes) {
+ return COMUtil.VtblCall(4, address, offset, pStartOffset, pEndOffset, pszTextAttributes);
+ }
+ public int get_caretOffset(int pOffset) {
+ return COMUtil.VtblCall(5, address, pOffset);
+ }
+ public int get_characterExtents(int offset, int coordType,int pX, int pY, int pWidth, int pHeight) {
+ return COMUtil.VtblCall(6, address, offset, coordType, pX, pY, pWidth, pHeight);
+ }
+ public int get_nSelections(int pnSelections) {
+ return COMUtil.VtblCall(7, address, pnSelections);
+ }
+ public int get_offsetAtPoint(int x, int y, int coordType, int pOffset) {
+ return COMUtil.VtblCall(8, address, x, y, coordType, pOffset);
+ }
+ public int get_selection(int selectionIndex,int pStartOffset,int pEndOffset) {
+ return COMUtil.VtblCall(9, address, selectionIndex, pStartOffset, pEndOffset);
+ }
+ public int get_text(int startOffset, int endOffset, int pszText) {
+ return COMUtil.VtblCall(10, address, startOffset, endOffset, pszText);
+ }
+ public int get_textBeforeOffset(int offset, int boundaryType, int pStartOffset, int pEndOffset, int pszText) {
+ return COMUtil.VtblCall(11, address, offset, boundaryType, pStartOffset, pEndOffset, pszText);
+ }
+ public int get_textAfterOffset(int offset, int boundaryType, int pStartOffset, int pEndOffset, int pszText) {
+ return COMUtil.VtblCall(12, address, offset, boundaryType, pStartOffset, pEndOffset, pszText);
+ }
+ public int get_textAtOffset(int offset, int boundaryType, int pStartOffset, int pEndOffset, int pszText) {
+ return COMUtil.VtblCall(13, address, offset, boundaryType, pStartOffset, pEndOffset, pszText);
+ }
+ public int removeSelection(int selectionIndex) {
+ return COMUtil.VtblCall(14, address, selectionIndex);
+ }
+ public int setCaretOffset(int offset) {
+ return COMUtil.VtblCall(15, address, offset);
+ }
+ public int setSelection(int selectionIndex, int startOffset, int endOffset) {
+ return COMUtil.VtblCall(16, address, selectionIndex, startOffset, endOffset);
+ }
+ public int get_nCharacters(int pnCharacters) {
+ return COMUtil.VtblCall(17, address, pnCharacters);
+ }
+ public int scrollSubstringTo(int startIndex, int endIndex, int scrollType) {
+ return COMUtil.VtblCall(18, address, startIndex, endIndex, scrollType);
+ }
+ public int scrollSubstringToPoint(int startIndex, int endIndex, int coordinateType, int x, int y) {
+ return COMUtil.VtblCall(19, address, startIndex, endIndex, coordinateType, x, y);
+ }
+ public int get_newText(int pNewText) {
+ return COMUtil.VtblCall(20, address, pNewText);
+ }
+ public int get_oldText(int pOldText) {
+ return COMUtil.VtblCall(21, address, pOldText);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleValue.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleValue.java
new file mode 100644
index 0000000..f93d6e1
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/IAccessibleValue.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.util.win32.COMUtil;
+import org.eclipse.swt.internal.ole.win32.GUID;
+import org.eclipse.swt.internal.ole.win32.IUnknown;
+
+
+
+public class IAccessibleValue extends IUnknown {
+ public static final GUID IID = COMUtil.IIDFromString("{35855B5B-C566-4fd0-A7B1-E65465600394}"); //$NON-NLS-1$
+
+ int address;
+ public IAccessibleValue(int address) {
+ super(address);
+ this.address = address;
+ }
+
+ public int get_currentValue(int pvarCurrentValue) {
+ return COMUtil.VtblCall(3, address, pvarCurrentValue);
+ }
+ public int setCurrentValue(int varValue) {
+ return COMUtil.VtblCall(4, address, varValue);
+ }
+ public int get_maximumValue(int pvarMaximumValue) {
+ return COMUtil.VtblCall(5, address, pvarMaximumValue);
+ }
+ public int get_minimumValue(int pvarMinimumValue) {
+ return COMUtil.VtblCall(6, address, pvarMinimumValue);
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessible2.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessible2.java
new file mode 100644
index 0000000..e98e9e8
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessible2.java
@@ -0,0 +1,335 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import java.util.Locale;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.Accessible2;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleRelation;
+import org.eclipse.actf.util.win32.MemoryUtil;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.actf.util.win32.NativeStringAccess;
+import org.eclipse.swt.internal.ole.win32.COM;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+public class InternalAccessible2 implements Accessible2 {
+
+ private IAccessible2 ia2 = null;
+
+ public InternalAccessible2(IAccessible2 accessible2) {
+ this.ia2 = accessible2;
+ }
+ public void dispose() {
+ ia2 = null;
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public int getAccessibleRelationCount() {
+ if( null != ia2 ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == ia2.get_nRelations(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+
+ public AccessibleRelation getAccessibleRelation(int relationIndex){
+ if( null != ia2 ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == ia2.get_relation(relationIndex, nia.getAddress()) ) {
+ return new InternalAccessibleRelation(nia.getInt());
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+
+ public AccessibleRelation[] getAccessibleRelations(int maxRelations) {
+ if( null != ia2 && maxRelations > 0 ) {
+ NativeIntAccess nia = new NativeIntAccess(maxRelations+1);
+ try {
+ if( OLE.S_OK == ia2.get_relations(maxRelations, nia.getAddress(1), nia.getAddress(0)) ) {
+ int count = nia.getInt(0);
+ AccessibleRelation[] retRelations = new AccessibleRelation[count];
+ for( int i=0; i<count; i++ ) {
+ retRelations[i] = new InternalAccessibleRelation(nia.getInt(i+1));
+ }
+ return retRelations;
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+
+ public int getAccessibleRole() {
+ if( null != ia2 ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == ia2.get_role(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+
+ public boolean scrollTo(int scrollType) {
+ if( null != ia2 ) {
+ ia2.scrollTo(scrollType);
+ }
+ return false;
+ }
+
+ public boolean scrollToPoint(int coordinateType, int x, int y) {
+ if( null != ia2 ) {
+ ia2.scrollToPoint(coordinateType, x, y);
+ }
+ return false;
+ }
+
+ public int[] getGroupPosition() {
+ if( null != ia2 ) {
+ NativeIntAccess nia = new NativeIntAccess(3);
+ try {
+ if( OLE.S_OK == ia2.get_groupPosition(nia.getAddress(0),nia.getAddress(1),nia.getAddress(2)) ) {
+ return new int[] {nia.getInt(0),nia.getInt(1),nia.getInt(2)};
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+
+ public int getStates() {
+ if( null != ia2 ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == ia2.get_states(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+
+ public String getExtendedRole() {
+ if( null != ia2 ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == ia2.get_extendedRole(nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+
+ public String getLocalizedExtendedRole() {
+ if( null != ia2 ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == ia2.get_localizedExtendedRole(nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+
+ public int getExtendedStateCount() {
+ if( null != ia2 ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == ia2.get_nExtendedStates(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+
+ public String[] getExtendedStates(int maxExtendedStates) {
+ if( null != ia2 && maxExtendedStates > 0 ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ try {
+ if( OLE.S_OK == ia2.get_extendedStates(maxExtendedStates,nia.getAddress(0),nia.getAddress(1)) ) {
+ return getStringArray(nia.getInt(0),nia.getInt(1),true);
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+
+ public String[] getLocalizedExtendedStates(int maxLocalizedExtendedStates) {
+ if( null != ia2 && maxLocalizedExtendedStates > 0 ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ try {
+ if( OLE.S_OK == ia2.get_localizedExtendedStates(maxLocalizedExtendedStates,nia.getAddress(0),nia.getAddress(1)) ) {
+ return getStringArray(nia.getInt(0),nia.getInt(1),true);
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+
+ public int getUniqueID() {
+ if( null != ia2 ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == ia2.get_uniqueID(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+
+ public int getWindowHandle() {
+ if( null != ia2 ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == ia2.get_windowHandle(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+
+ public int getAccessibleIndexInParent() {
+ if( null != ia2 ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == ia2.get_indexInParent(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+
+ public Locale getLocale() {
+ if( null != ia2 ) {
+ NativeIntAccess nia = new NativeIntAccess(3);
+ try {
+ if( OLE.S_OK == ia2.get_locale(nia.getAddress()) ) {
+ String[] ls = getStringArray(nia.getAddress(),3, false);
+ return new Locale(ls[0],ls[1],ls[2]);
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+
+ public String getAttributes() {
+ if( null != ia2 ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == ia2.get_attributes(nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+
+ public static String[] getStringArray(int pBSTR, int count, boolean bFree) {
+ String[] sRet = new String[count];
+ if( count > 0 ) {
+ int[] hMem = new int[count];
+ MemoryUtil.MoveMemory(hMem, pBSTR, 4*count);
+ for( int i=0; i<count; i++) {
+ sRet[i] = ""; //$NON-NLS-1$
+ if (0 != hMem[i]) {
+ int size = COM.SysStringByteLen(hMem[i]);
+ if (size > 0) {
+ char[] buffer = new char[(size + 1) / 2];
+ MemoryUtil.MoveMemory(buffer, hMem[i], size);
+ sRet[i] = new String(buffer);
+ }
+ COM.SysFreeString(hMem[i]);
+ }
+ }
+ }
+ if( bFree ) {
+ COM.CoTaskMemFree(pBSTR);
+ }
+ return sRet;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleAction.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleAction.java
new file mode 100644
index 0000000..f273643
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleAction.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleAction;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.actf.util.win32.NativeStringAccess;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+
+public class InternalAccessibleAction implements AccessibleAction {
+
+ private IAccessibleAction accessibleAction = null;
+
+ public InternalAccessibleAction(int address) {
+ accessibleAction = new IAccessibleAction(address);
+ accessibleAction.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleAction ) {
+ accessibleAction.Release();
+ accessibleAction = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public int getAccessibleActionCount() {
+ if( null != accessibleAction ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleAction.nActions(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public boolean doAccessibleAction(int actionIndex) {
+ if( null != accessibleAction ) {
+ return OLE.S_OK == accessibleAction.doAction(actionIndex);
+ }
+ return false;
+ }
+ public String getAccessibleActionDescription(int actionIndex) {
+ if( null != accessibleAction ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleAction.get_description(actionIndex, nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+ public String[] getAccessibleActionKeyBinding(int actionIndex, int nMaxBinding) {
+ if( null != accessibleAction && nMaxBinding > 0 ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ try {
+ if( OLE.S_OK == accessibleAction.get_keyBinding(actionIndex,nMaxBinding,nia.getAddress(0),nia.getAddress(1)) ) {
+ return InternalAccessible2.getStringArray(nia.getInt(0),nia.getInt(1),true);
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public String getAccessibleActionName(int actionIndex) {
+ if( null != accessibleAction ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleAction.get_name(actionIndex, nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+ public String getLocalizedAccessibleActionName(int actionIndex) {
+ if( null != accessibleAction ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleAction.get_localizedName(actionIndex, nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleApplication.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleApplication.java
new file mode 100644
index 0000000..924b4da
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleApplication.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleApplication;
+import org.eclipse.actf.util.win32.NativeStringAccess;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+public class InternalAccessibleApplication implements AccessibleApplication {
+
+ private IAccessibleApplication accessibleApplication = null;
+
+ public InternalAccessibleApplication(int address) {
+ accessibleApplication = new IAccessibleApplication(address);
+ accessibleApplication.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleApplication ) {
+ accessibleApplication.Release();
+ accessibleApplication = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public String getApplicationName() {
+ if( null != accessibleApplication ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleApplication.get_appName(nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+ public String getApplicationVersion() {
+ if( null != accessibleApplication ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleApplication.get_appVersion(nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+ public String getToolkitName() {
+ if( null != accessibleApplication ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleApplication.get_toolkitName(nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+ public String getToolkitVersion() {
+ if( null != accessibleApplication ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleApplication.get_toolkitVersion(nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleComponent.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleComponent.java
new file mode 100644
index 0000000..22d0b27
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleComponent.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleComponent;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+public class InternalAccessibleComponent implements AccessibleComponent {
+
+ private IAccessibleComponent accessibleComponent = null;
+
+ public InternalAccessibleComponent(int address) {
+ accessibleComponent = new IAccessibleComponent(address);
+ accessibleComponent.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleComponent ) {
+ accessibleComponent.Release();
+ accessibleComponent = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public Point getLocation() {
+ if( null != accessibleComponent ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ try {
+ if( OLE.S_OK == accessibleComponent.get_locationInParent(nia.getAddress(0),nia.getAddress(1)) ) {
+ return new Point(nia.getInt(0),nia.getInt(1));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public int getForeground() {
+ if( null != accessibleComponent ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleComponent.get_foreground(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public int getBackground() {
+ if( null != accessibleComponent ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleComponent.get_background(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleEditableText.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleEditableText.java
new file mode 100644
index 0000000..7cf47c7
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleEditableText.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleEditableText;
+import org.eclipse.actf.util.win32.NativeStringAccess;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+public class InternalAccessibleEditableText implements AccessibleEditableText {
+
+ private IAccessibleEditableText accessibleEditableText = null;
+
+ public InternalAccessibleEditableText(int address) {
+ accessibleEditableText = new IAccessibleEditableText(address);
+ accessibleEditableText.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleEditableText ) {
+ accessibleEditableText.Release();
+ accessibleEditableText = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public boolean copyText(int startOffset, int endOffset) {
+ if( null != accessibleEditableText ) {
+ return OLE.S_OK == accessibleEditableText.copyText(startOffset, endOffset);
+
+ }
+ return false;
+ }
+ public boolean deleteText(int startOffset, int endOffset) {
+ if( null != accessibleEditableText ) {
+ return OLE.S_OK == accessibleEditableText.deleteText(startOffset, endOffset);
+ }
+ return false;
+ }
+ public boolean insertText(int offset, String strText) {
+ if( null != accessibleEditableText ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ nsa.setString(strText);
+ return OLE.S_OK == accessibleEditableText.insertText(offset,nsa.getAddress());
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return false;
+ }
+ public boolean cutText(int startOffset, int endOffset) {
+ if( null != accessibleEditableText ) {
+ return OLE.S_OK == accessibleEditableText.cutText(startOffset, endOffset);
+ }
+ return false;
+ }
+ public boolean pasteText(int offset) {
+ if( null != accessibleEditableText ) {
+ return OLE.S_OK == accessibleEditableText.pasteText(offset);
+ }
+ return false;
+ }
+ public boolean replaceText(int startOffset, int endOffset, String strText) {
+ if( null != accessibleEditableText ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ nsa.setString(strText);
+ return OLE.S_OK == accessibleEditableText.replaceText(startOffset, endOffset, nsa.getAddress());
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return false;
+ }
+ public boolean setAttributes(int startOffset, int endOffset, String strAttributes) {
+ if( null != accessibleEditableText ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ nsa.setString(strAttributes);
+ return OLE.S_OK == accessibleEditableText.setAttributes(startOffset, endOffset, nsa.getAddress());
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleHyperlink.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleHyperlink.java
new file mode 100644
index 0000000..814a210
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleHyperlink.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHyperlink;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.actf.util.win32.NativeVariantAccess;
+import org.eclipse.swt.ole.win32.OLE;
+import org.eclipse.swt.ole.win32.Variant;
+
+
+
+
+public class InternalAccessibleHyperlink implements AccessibleHyperlink {
+
+ private IAccessibleHyperlink accessibleHyperlink = null;
+
+ public InternalAccessibleHyperlink(int address) {
+ accessibleHyperlink = new IAccessibleHyperlink(address);
+ accessibleHyperlink.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleHyperlink ) {
+ accessibleHyperlink.Release();
+ accessibleHyperlink = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public Variant getAccessibleActionAnchor(int index) {
+ if( null != accessibleHyperlink ) {
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ if( OLE.S_OK == accessibleHyperlink.get_anchor(index, nva.getAddress()) ) {
+ return nva.getVariant();
+ }
+ }
+ finally {
+ nva.dispose();
+ }
+ }
+ return null;
+ }
+ public Variant getAccessibleActionObject(int index) {
+ if( null != accessibleHyperlink ) {
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ if( OLE.S_OK == accessibleHyperlink.get_anchorTarget(index, nva.getAddress()) ) {
+ return nva.getVariant();
+ }
+ }
+ finally {
+ nva.dispose();
+ }
+ }
+ return null;
+ }
+ public int getStartIndex() {
+ if( null != accessibleHyperlink ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleHyperlink.get_startIndex(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return -1;
+ }
+ public int getEndIndex() {
+ if( null != accessibleHyperlink ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleHyperlink.get_endIndex(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return -1;
+ }
+ public boolean isValid() {
+ if( null != accessibleHyperlink ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleHyperlink.get_valid(nia.getAddress()) ) {
+ return 0 != nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return false;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleHypertext.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleHypertext.java
new file mode 100644
index 0000000..8cd3f84
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleHypertext.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleHypertext;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+public class InternalAccessibleHypertext implements AccessibleHypertext {
+
+ private IAccessibleHypertext accessibleHypertext = null;
+
+ public InternalAccessibleHypertext(int address) {
+ accessibleHypertext = new IAccessibleHypertext(address);
+ accessibleHypertext.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleHypertext ) {
+ accessibleHypertext.Release();
+ accessibleHypertext = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public int getHyperLinkCount() {
+ if( null != accessibleHypertext ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleHypertext.get_nHyperlinks(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public InternalAccessibleHyperlink getHyperLink(int index) {
+ if( null != accessibleHypertext ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleHypertext.get_hyperlink(index,nia.getAddress()) ) {
+ return new InternalAccessibleHyperlink(nia.getInt());
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public int getHyperLinkIndex(int charIndex) {
+ if( null != accessibleHypertext ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleHypertext.get_hyperlinkIndex(charIndex, nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return -1;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleImage.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleImage.java
new file mode 100644
index 0000000..95f0162
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleImage.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleImage;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.actf.util.win32.NativeStringAccess;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+public class InternalAccessibleImage implements AccessibleImage {
+
+ private IAccessibleImage accessibleImage = null;
+
+ public InternalAccessibleImage(int address) {
+ accessibleImage = new IAccessibleImage(address);
+ accessibleImage.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleImage ) {
+ accessibleImage.Release();
+ accessibleImage = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public String getAccessibleImageDescription() {
+ if( null != accessibleImage ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleImage.get_description(nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+ public Point getAccessibleImagePosition(int coordinateType) {
+ if( null != accessibleImage ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleImage.get_imagePosition(coordinateType, nia.getAddress(0), nia.getAddress(1)) ) {
+ return new Point(nia.getInt(0),nia.getInt(1));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public Point getAccessibleImageSize() {
+ if( null != accessibleImage ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleImage.get_imageSize(nia.getAddress(0), nia.getAddress(1)) ) {
+ return new Point(nia.getInt(0),nia.getInt(1));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleRelation.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleRelation.java
new file mode 100644
index 0000000..bae4c92
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleRelation.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleRelation;
+import org.eclipse.actf.accservice.swtbridge.internal.InternalAccessibleObject;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.actf.util.win32.NativeStringAccess;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+public class InternalAccessibleRelation implements AccessibleRelation {
+
+ private IAccessibleRelation accessibleRelation = null;
+
+ public InternalAccessibleRelation(int address) {
+ accessibleRelation = new IAccessibleRelation(address);
+ accessibleRelation.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleRelation ) {
+ accessibleRelation.Release();
+ accessibleRelation = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public String getRelationType() {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleRelation.get_relationType(nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ return null;
+ }
+ public String getLocalizedRelationType() {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleRelation.get_localizedRelationType(nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ return null;
+ }
+ public int getTargetCount() {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleRelation.get_nTargets(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ return 0;
+ }
+ public AccessibleObject getTarget(int targetIndex) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleRelation.get_target(targetIndex, nia.getAddress()) ) {
+ return InternalAccessibleObject.newInstance(nia.getInt());
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ return null;
+ }
+ public AccessibleObject[] getTargets(int maxTargets) {
+ if( maxTargets > 0 ) {
+ NativeIntAccess nia = new NativeIntAccess(maxTargets+1);
+ try {
+ if( OLE.S_OK == accessibleRelation.get_targets(maxTargets, nia.getAddress(1), nia.getAddress(0)) ) {
+ int count = nia.getInt();
+ AccessibleObject[] retUnknowns = new AccessibleObject[count];
+ for( int i=0; i<count; i++ ) {
+ retUnknowns[i] = InternalAccessibleObject.newInstance(nia.getInt(i+1));
+ }
+ return retUnknowns;
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleTable.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleTable.java
new file mode 100644
index 0000000..61febbe
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleTable.java
@@ -0,0 +1,451 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.AccessibleObject;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTable;
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleTableModelChange;
+import org.eclipse.actf.accservice.swtbridge.ia2.RowColumnExtents;
+import org.eclipse.actf.accservice.swtbridge.internal.InternalAccessibleObject;
+import org.eclipse.actf.util.win32.MemoryUtil;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.actf.util.win32.NativeStringAccess;
+import org.eclipse.swt.internal.ole.win32.COM;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+public class InternalAccessibleTable implements AccessibleTable {
+
+ private IAccessibleTable accessibleTable = null;
+
+ public InternalAccessibleTable(int address) {
+ accessibleTable = new IAccessibleTable(address);
+ accessibleTable.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleTable ) {
+ accessibleTable.Release();
+ accessibleTable = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public AccessibleObject getAccessibleCellAt(int row, int column) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_accessibleAt(row,column,nia.getAddress()) ) {
+ return InternalAccessibleObject.newInstance(nia.getInt());
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public Object getAccessibleCaption() {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_caption(nia.getAddress()) ) {
+ return InternalAccessibleObject.newInstance(nia.getInt());
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public int getAccessibleIndex(int rowIndex, int columnIndex) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_childIndex(rowIndex, columnIndex, nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return -1;
+ }
+ public String getAccessibleColumnDescription(int column) {
+ if( null != accessibleTable ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_columnDescription(column, nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+ public int getAccessibleColumnExtentAt(int row, int column) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_columnExtentAt(row, column, nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return -1;
+ }
+ public InternalAccessibleTable getAccessibleColumnHeaders(int[] startingRowIndex) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ try {
+ if( OLE.S_OK == accessibleTable.get_columnHeader(nia.getAddress(0),nia.getAddress(1)) ) {
+ startingRowIndex[0] = nia.getInt(1);
+ return new InternalAccessibleTable(nia.getInt(0));
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public int getAccessibleColumnIndex(int childIndex) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_columnIndex(childIndex, nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return -1;
+ }
+ public int getAccessibleColumnCount() {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_nColumns(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public int getAccessibleRowCount() {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_nRows(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public int getSelectedAccessibleChildCount() {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_nSelectedChildren(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public int getSelectedAccessibleColumnCount() {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_nSelectedColumns(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public int getSelectedAccessibleRowCount() {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_nSelectedRows(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public String getAccessibleRowDescription(int row) {
+ if( null != accessibleTable ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_rowDescription(row, nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+ public int getAccessibleRowExtentAt(int row, int column) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_rowExtentAt(row, column, nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public InternalAccessibleTable getAccessibleRowHeaders(int[] startingColumnIndex) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ try {
+ if( OLE.S_OK == accessibleTable.get_rowHeader(nia.getAddress(0),nia.getAddress(1)) ) {
+ startingColumnIndex[0] = nia.getInt(1);
+ return new InternalAccessibleTable(nia.getInt(0));
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public int getAccessibleRowIndex(int childIndex) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_rowIndex(childIndex, nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public int[] getSelectedAccessibleChildren(int maxChildren) {
+ if( null != accessibleTable && maxChildren > 0 ) {
+ NativeIntAccess nia = new NativeIntAccess(maxChildren+1);
+ try {
+ if( OLE.S_OK == accessibleTable.get_selectedChildren(maxChildren, nia.getAddress(1),nia.getAddress(0)) ) {
+ int count = nia.getInt(0);
+ int[] pRet = new int[count];
+ MemoryUtil.MoveMemory(pRet, nia.getInt(1), 4*count);
+ COM.CoTaskMemFree(nia.getInt(1));
+ return pRet;
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public int[] getSelectedAccessibleRows(int maxRows) {
+ if( null != accessibleTable && maxRows > 0 ) {
+ NativeIntAccess nia = new NativeIntAccess(maxRows+1);
+ try {
+ if( OLE.S_OK == accessibleTable.get_selectedRows(maxRows, nia.getAddress(1),nia.getAddress(0)) ) {
+ int count = nia.getInt(0);
+ int[] pRet = new int[count];
+ MemoryUtil.MoveMemory(pRet, nia.getInt(1), 4*count);
+ COM.CoTaskMemFree(nia.getInt(1));
+ return pRet;
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public int[] getSelectedAccessibleColumns(int maxColumns) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess(maxColumns+1);
+ try {
+ if( OLE.S_OK == accessibleTable.get_selectedColumns(maxColumns, nia.getAddress(1),nia.getAddress(0)) ) {
+ int count = nia.getInt(0);
+ int[] pRet = new int[count];
+ MemoryUtil.MoveMemory(pRet, nia.getInt(1), 4*count);
+ COM.CoTaskMemFree(nia.getInt(1));
+ return pRet;
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public Object getAccessibleSummary() {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_summary(nia.getAddress()) ) {
+ return InternalAccessibleObject.newInstance(nia.getInt());
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public boolean isAccessibleColumnSelected(int column) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_isColumnSelected(column, nia.getAddress()) ) {
+ return 0 != nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return false;
+ }
+ public boolean isAccessibleRowSelected(int row) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_isRowSelected(row, nia.getAddress()) ) {
+ return 0 != nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return false;
+ }
+ public boolean isAccessibleSelected(int row, int column) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleTable.get_isSelected(row, column, nia.getAddress()) ) {
+ return 0 != nia.getInt();
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return false;
+ }
+ public boolean selectAccessibleRow(int row) {
+ if( null != accessibleTable ) {
+ return OLE.S_OK == accessibleTable.selectRow(row);
+ }
+ return false;
+ }
+ public boolean selectAccessibleColumn(int column) {
+ if( null != accessibleTable ) {
+ return OLE.S_OK == accessibleTable.selectColumn(column);
+ }
+ return false;
+ }
+ public boolean unselectAccessibleRow(int row) {
+ if( null != accessibleTable ) {
+ return OLE.S_OK == accessibleTable.unselectRow(row);
+ }
+ return false;
+ }
+ public boolean unselectAccessibleColumn(int column) {
+ if( null != accessibleTable ) {
+ return OLE.S_OK == accessibleTable.unselectColumn(column);
+ }
+ return false;
+ }
+ public RowColumnExtents getAccessibleRowColumnExtentAtIndex(int index) {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess(5);
+ try {
+ if( OLE.S_OK == accessibleTable.get_rowColumnExtentsAtIndex(index,
+ nia.getAddress(0),
+ nia.getAddress(1),
+ nia.getAddress(2),
+ nia.getAddress(3),
+ nia.getAddress(4)) ) {
+ return new RowColumnExtents(
+ nia.getAddress(0),
+ nia.getAddress(1),
+ nia.getAddress(2),
+ nia.getAddress(3),
+ 0!=nia.getAddress(4));
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public AccessibleTableModelChange getAccessibleTableModelChange() {
+ if( null != accessibleTable ) {
+ NativeIntAccess nia = new NativeIntAccess(5);
+ try {
+ if( OLE.S_OK == accessibleTable.get_modelChange(nia.getAddress()) ) {
+ return new AccessibleTableModelChange(
+ nia.getAddress(0),
+ nia.getAddress(1),
+ nia.getAddress(2),
+ nia.getAddress(3),
+ nia.getAddress(4));
+ }
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleText.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleText.java
new file mode 100644
index 0000000..97ed8c9
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleText.java
@@ -0,0 +1,329 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleText;
+import org.eclipse.actf.accservice.swtbridge.ia2.TextSegment;
+import org.eclipse.actf.util.win32.MemoryUtil;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.actf.util.win32.NativeStringAccess;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.ole.win32.COM;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+public class InternalAccessibleText implements AccessibleText {
+
+ private IAccessibleText accessibleText = null;
+
+ public InternalAccessibleText(int address) {
+ accessibleText = new IAccessibleText(address);
+ accessibleText.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleText ) {
+ accessibleText.Release();
+ accessibleText = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public boolean addSelection(int startOffset, int endOffset) {
+ if( null != accessibleText ) {
+ return OLE.S_OK == accessibleText.addSelection(startOffset, endOffset);
+ }
+ return false;
+ }
+ public TextSegment getCharacterAttributes(int offset) {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleText.get_attributes(offset, nia.getAddress(0), nia.getAddress(1), nsa.getAddress()) ) {
+ return new TextSegment(nsa.getString(),nia.getInt(0),nia.getInt(1));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public int getCaretPosition() {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleText.get_caretOffset(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return -1;
+ }
+ public Rectangle getCharacterBounds(int offset, int coordType) {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess(4);
+ try {
+ if( OLE.S_OK == accessibleText.get_characterExtents(offset, coordType,
+ nia.getAddress(0),
+ nia.getAddress(1),
+ nia.getAddress(2),
+ nia.getAddress(3)) ) {
+ return new Rectangle(
+ nia.getInt(0),
+ nia.getInt(1),
+ nia.getInt(2),
+ nia.getInt(3));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public int getSelectionCount() {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleText.get_nSelections(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public int getIndexAtPoint(Point point, int coordType) {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleText.get_offsetAtPoint(point.x, point.y, coordType, nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return -1;
+ }
+ public Point getSelection(int selectionIndex) {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ try {
+ if( OLE.S_OK == accessibleText.get_selection(selectionIndex, nia.getAddress(0), nia.getAddress(1)) ) {
+ return new Point(nia.getInt(0),nia.getInt(1));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public String getTextRange(int startOffset, int endOffset) {
+ if( null != accessibleText ) {
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleText.get_text(startOffset, endOffset, nsa.getAddress()) ) {
+ return nsa.getString();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ }
+ }
+ return null;
+ }
+ public TextSegment getTextBeforeIndex(int offset, int boundaryType) {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleText.get_textBeforeOffset(offset, boundaryType, nia.getAddress(0), nia.getAddress(1), nsa.getAddress()) ) {
+ return new TextSegment(nsa.getString(),nia.getInt(0),nia.getInt(1));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public TextSegment getTextAfterIndex(int offset, int boundaryType) {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleText.get_textAfterOffset(offset, boundaryType, nia.getAddress(0), nia.getAddress(1), nsa.getAddress()) ) {
+ return new TextSegment(nsa.getString(),nia.getInt(0),nia.getInt(1));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public TextSegment getTextAtIndex(int offset, int boundaryType) {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess(2);
+ NativeStringAccess nsa = new NativeStringAccess();
+ try {
+ if( OLE.S_OK == accessibleText.get_textAtOffset(offset, boundaryType, nia.getAddress(0), nia.getAddress(1), nsa.getAddress()) ) {
+ return new TextSegment(nsa.getString(),nia.getInt(0),nia.getInt(1));
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nsa.dispose();
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public boolean removeSelection(int selectionIndex) {
+ if( null != accessibleText ) {
+ return OLE.S_OK == accessibleText.removeSelection(selectionIndex);
+ }
+ return false;
+ }
+ public boolean setCaretPosition(int offset) {
+ if( null != accessibleText ) {
+ return OLE.S_OK == accessibleText.setCaretOffset(offset);
+ }
+ return false;
+ }
+ public boolean setSelection(int selectionIndex, int startOffset, int endOffset) {
+ if( null != accessibleText ) {
+ return OLE.S_OK == accessibleText.setSelection(selectionIndex, startOffset, endOffset);
+ }
+ return false;
+ }
+ public int getCharacterCount() {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess();
+ try {
+ if( OLE.S_OK == accessibleText.get_nCharacters(nia.getAddress()) ) {
+ return nia.getInt();
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return 0;
+ }
+ public boolean scrollSubstringTo(int startIndex, int endIndex, int scrollType) {
+ if( null != accessibleText ) {
+ return OLE.S_OK == accessibleText.scrollSubstringTo(startIndex, endIndex, scrollType);
+ }
+ return false;
+ }
+ public boolean scrollSubstringToPoint(int startIndex, int endIndex, int coordinateType, int x, int y) {
+ if( null != accessibleText ) {
+ return OLE.S_OK == accessibleText.scrollSubstringToPoint(startIndex, endIndex, coordinateType, x, y);
+ }
+ return false;
+ }
+ public TextSegment getNewText() {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess(3);
+ try {
+ if( OLE.S_OK == accessibleText.get_newText(nia.getAddress()) ) {
+ return getTextSegment(nia);
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+ public TextSegment getOldText() {
+ if( null != accessibleText ) {
+ NativeIntAccess nia = new NativeIntAccess(3);
+ try {
+ if( OLE.S_OK == accessibleText.get_oldText(nia.getAddress()) ) {
+ return getTextSegment(nia);
+ }
+ }
+ catch (Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ return null;
+ }
+
+ private static TextSegment getTextSegment(NativeIntAccess nia) {
+ int[] hMem = new int[3];
+ MemoryUtil.MoveMemory(hMem, nia.getAddress(), 4*hMem.length);
+ if (0 != hMem[0]) {
+ try {
+ TextSegment textSegment = new TextSegment("",0,0); //$NON-NLS-1$
+ int size = COM.SysStringByteLen(hMem[0]);
+ if (size > 0) {
+ char[] buffer = new char[(size + 1) / 2];
+ MemoryUtil.MoveMemory(buffer, hMem[0], size);
+ textSegment.text = new String(buffer);
+ }
+ textSegment.start = hMem[1];
+ textSegment.end = hMem[2];
+ return textSegment;
+ }
+ finally {
+ COM.SysFreeString(hMem[0]);
+ }
+ }
+ return null;
+ }
+}
diff --git a/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleValue.java b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleValue.java
new file mode 100644
index 0000000..7874d9f
--- /dev/null
+++ b/plugins/org.eclipse.actf.visualization.gui/src/org/eclipse/actf/accservice/swtbridge/internal/ia2/InternalAccessibleValue.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and Others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Takashi ITOH - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.actf.accservice.swtbridge.internal.ia2;
+
+import org.eclipse.actf.accservice.swtbridge.ia2.AccessibleValue;
+import org.eclipse.actf.util.win32.NativeIntAccess;
+import org.eclipse.actf.util.win32.NativeVariantAccess;
+import org.eclipse.swt.ole.win32.OLE;
+
+
+
+
+public class InternalAccessibleValue implements AccessibleValue {
+
+ private IAccessibleValue accessibleValue = null;
+
+ public InternalAccessibleValue(int address) {
+ accessibleValue = new IAccessibleValue(address);
+ accessibleValue.AddRef();
+ }
+ public void dispose() {
+ if( null != accessibleValue ) {
+ accessibleValue.Release();
+ accessibleValue = null;
+ }
+ }
+ protected void finalize() throws Throwable {
+ dispose();
+ super.finalize();
+ }
+
+ public Object getCurrentValue() {
+ if( null != accessibleValue ) {
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ if( OLE.S_OK == accessibleValue.get_currentValue(nva.getAddress()) ) {
+ return nva.getVariant();
+ }
+ }
+ catch( Exception e) {
+ }
+ finally {
+ nva.dispose();
+ }
+ }
+ return null;
+ }
+ public boolean setCurrentValue(Object objValue) {
+ if( null != accessibleValue ) {
+ if( objValue instanceof Number ) {
+ NativeIntAccess nia = new NativeIntAccess(4);
+ try {
+ nia.setInt(0,OLE.VT_I4);
+ nia.setInt(1,0);
+ nia.setInt(2,((Number)objValue).intValue());
+ nia.setInt(3,0);
+ return OLE.S_OK == accessibleValue.setCurrentValue(nia.getAddress());
+ }
+ catch( Exception e) {
+ }
+ finally {
+ nia.dispose();
+ }
+ }
+ }
+ return false;
+ }
+ public Object getMaximumValue() {
+ if( null != accessibleValue ) {
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ if( OLE.S_OK == accessibleValue.get_maximumValue(nva.getAddress()) ) {
+ return nva.getVariant();
+ }
+ }
+ catch( Exception e) {
+ }
+ finally {
+ nva.dispose();
+ }
+ }
+ return null;
+ }
+ public Object getMinimumValue() {
+ if( null != accessibleValue ) {
+ NativeVariantAccess nva = new NativeVariantAccess();
+ try {
+ if( OLE.S_OK == accessibleValue.get_minimumValue(nva.getAddress()) ) {
+ return nva.getVariant();
+ }
+ }
+ catch( Exception e) {
+ }
+ finally {
+ nva.dispose();
+ }
+ }
+ return null;
+ }
+}