Commit adf339ea authored by jhoneycutt@apple.com's avatar jhoneycutt@apple.com

Add AccessibilityObjectWrapper on Windows.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4faafbd5
......@@ -2,6 +2,27 @@
Reviewed by Darin.
Add AccessibilityObjectWrapper to Windows.
* WebCore.vcproj/WebCore.vcproj: Add AccessibilityObjectWrapperWin.h
* page/AccessibilityObject.h: Include COMPtr.h,
AccessibilityObjectWrapperWin.h on Windows. Define wrapper() and
setWrapper() if accessibility is present. Add an m_wrapper on Windows.
* page/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::detach): Clear m_wrapper if
accessibility is present.
* page/win/AccessibilityObjectWrapperWin.h: Added; defines a wrapper for
AccessibilityObjects on Windows.
(WebCore::AccessibilityObjectWrapper::attached): Return true if attached
to an object.
(WebCore::AccessibilityObjectWrapper::accessibilityObject): Return the
wrapped object.
(WebCore::AccessibilityObjectWrapper::AccessibilityObjectWrapper):
2008-04-15 Jon Honeycutt <jhoneycutt@apple.com>
Reviewed by Darin.
Add AXObjectCache to Windows.
* WebCore.vcproj/WebCore.vcproj: Add AXObjectCacheWin.cpp.
......@@ -3452,6 +3452,10 @@
<Filter
Name="win"
>
<File
RelativePath="..\page\win\AccessibilityObjectWrapperWin.h"
>
</File>
<File
RelativePath="..\page\win\AXObjectCacheWin.cpp"
>
......
......@@ -94,7 +94,7 @@ void AccessibilityObject::detach()
m_renderer->setHasAXObject(false);
#endif
m_renderer = 0;
#if PLATFORM(MAC)
#if HAVE(ACCESSIBILITY)
m_wrapper = 0;
#endif
clearChildren();
......
......@@ -35,6 +35,9 @@
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
#elif PLATFORM(WIN)
#include "AccessibilityObjectWrapperWin.h"
#include "COMPtr.h"
#endif
typedef struct _NSRange NSRange;
......@@ -51,7 +54,6 @@ typedef struct _NSRange NSRange;
@class WebCoreTextMarker;
@class WebCoreTextMarkerRange;
#else
class AccessibilityObjectWrapper;
class NSArray;
class NSAttributedString;
class NSData;
......@@ -302,7 +304,7 @@ public:
unsigned doAXLineForIndex(unsigned);
#if PLATFORM(MAC)
#if HAVE(ACCESSIBILITY)
AccessibilityObjectWrapper* wrapper() const { return m_wrapper.get(); }
void setWrapper(AccessibilityObjectWrapper* wrapper) { m_wrapper = wrapper; }
#endif
......@@ -320,6 +322,8 @@ private:
#if PLATFORM(MAC)
RetainPtr<AccessibilityObjectWrapper> m_wrapper;
#elif PLATFORM(WIN)
COMPtr<AccessibilityObjectWrapper> m_wrapper;
#endif
};
......
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef AccessibilityObjectWrapperWin_h
#define AccessibilityObjectWrapperWin_h
namespace WebCore {
class AccessibilityObject;
class AccessibilityObjectWrapper : public IUnknown {
public:
// IUnknown
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) = 0;
virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0;
virtual ULONG STDMETHODCALLTYPE Release(void) = 0;
virtual void detach() = 0;
bool attached() const { return m_object; }
AccessibilityObject* accessibilityObject() const { return m_object; }
protected:
AccessibilityObjectWrapper(AccessibilityObject* obj) : m_object(obj) { }
AccessibilityObjectWrapper() : m_object(0) { }
AccessibilityObject* m_object;
};
} // namespace WebCore
#endif // AccessibilityObjectWrapperWin_h
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment