[ATK] Support compilation of EFL/GTK without accessibility
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Nov 2013 10:02:00 +0000 (10:02 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Nov 2013 10:02:00 +0000 (10:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=122448

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-11-13
Reviewed by Chris Fleizach.

Added missing HAVE(ACCESSIBILITY) guards and stubs to ATK's related files,
so that in case of turning off the HAVE_ACCESSIBILITY macro EFL/GTK would compile properly.

* DumpRenderTree/AccessibilityController.h:
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/atk/AccessibilityCallbacks.h:
* DumpRenderTree/atk/AccessibilityNotificationHandlerAtk.cpp:
* DumpRenderTree/atk/AccessibilityNotificationHandlerAtk.h:
* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
(WTR::AccessibilityController::rootElement):
(WTR::AccessibilityController::focusedElement):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.h:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
* WebKitTestRunner/PlatformEfl.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159181 268f45cc-cd09-0410-ab3c-d52691b4dbfc

17 files changed:
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityController.h
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/atk/AccessibilityCallbacks.h
Tools/DumpRenderTree/atk/AccessibilityNotificationHandlerAtk.cpp
Tools/DumpRenderTree/atk/AccessibilityNotificationHandlerAtk.h
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.h
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/PlatformEfl.cmake

index d062062..60058a2 100644 (file)
@@ -1,3 +1,28 @@
+2013-11-13  Krzysztof Czech  <k.czech@samsung.com>
+
+        [ATK] Support compilation of EFL/GTK without accessibility
+        https://bugs.webkit.org/show_bug.cgi?id=122448
+
+        Reviewed by Chris Fleizach.
+
+        Added missing HAVE(ACCESSIBILITY) guards and stubs to ATK's related files,
+        so that in case of turning off the HAVE_ACCESSIBILITY macro EFL/GTK would compile properly.
+
+        * DumpRenderTree/AccessibilityController.h:
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/atk/AccessibilityCallbacks.h:
+        * DumpRenderTree/atk/AccessibilityNotificationHandlerAtk.cpp:
+        * DumpRenderTree/atk/AccessibilityNotificationHandlerAtk.h:
+        * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp:
+        (WTR::AccessibilityController::rootElement):
+        (WTR::AccessibilityController::focusedElement):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp:
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp:
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.h:
+        * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
+        * WebKitTestRunner/PlatformEfl.cmake:
+
 2013-11-12  Ryuan Choi  <ryuan.choi@samsung.com>
 
         [EFL] Added libxss-dev to install-dependencies
index 0c1b6f6..33f9082 100644 (file)
@@ -90,7 +90,7 @@ private:
     RetainPtr<NotificationHandler> m_globalNotificationHandler;
 #endif
 
-#if PLATFORM(GTK) || PLATFORM(EFL)
+#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
     RefPtr<AccessibilityNotificationHandler> m_globalNotificationHandler;
 #endif
 };
index d4942b7..3533e06 100644 (file)
@@ -281,7 +281,7 @@ private:
     NotificationHandler m_notificationHandler;
 #endif
 
-#if PLATFORM(GTK) || PLATFORM(EFL)
+#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
     RefPtr<AccessibilityNotificationHandler> m_notificationHandler;
 #endif
 };
index 188272c..0feef55 100644 (file)
@@ -29,6 +29,8 @@
 #ifndef AccessibilityCallbacks_h
 #define AccessibilityCallbacks_h
 
+#if HAVE(ACCESSIBILITY)
+
 #include "AccessibilityNotificationHandlerAtk.h"
 #include "AccessibilityUIElement.h"
 
@@ -37,4 +39,6 @@ bool disconnectAccessibilityCallbacks();
 void addAccessibilityNotificationHandler(AccessibilityNotificationHandler*);
 void removeAccessibilityNotificationHandler(AccessibilityNotificationHandler*);
 
-#endif
+#endif // HAVE(ACCESSIBILITY)
+
+#endif // AccessibilityCallbacks_h
index 9ffb75e..55f3a1f 100644 (file)
@@ -20,6 +20,8 @@
 #include "config.h"
 #include "AccessibilityNotificationHandlerAtk.h"
 
+#if HAVE(ACCESSIBILITY)
+
 #include "AccessibilityCallbacks.h"
 
 AccessibilityNotificationHandler::AccessibilityNotificationHandler(void)
@@ -49,3 +51,5 @@ void AccessibilityNotificationHandler::setNotificationFunctionCallback(JSObjectR
     connectAccessibilityCallbacks();
     addAccessibilityNotificationHandler(this);
 }
+
+#endif // HAVE(ACCESSIBILITY)
index b653e86..9018e72 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef AccessibilityNotificationHandlerAtk_h
 #define AccessibilityNotificationHandlerAtk_h
 
+#if HAVE(ACCESSIBILITY)
+
 #include <JavaScriptCore/JSObjectRef.h>
 #include <atk/atk.h>
 #include <wtf/PassRefPtr.h>
@@ -44,4 +46,6 @@ private:
     JSObjectRef m_notificationFunctionCallback;
 };
 
+#endif // HAVE(ACCESSIBILITY)
+
 #endif // AccessibilityNotificationHandlerAtk_h
index bfb63d6..c8ad406 100644 (file)
@@ -87,19 +87,18 @@ PassRefPtr<AccessibilityUIElement> AccessibilityController::elementAtPoint(int x
 
 // Unsupported methods on various platforms.
 // As they're implemented on other platforms this list should be modified.
-#if !PLATFORM(GTK) && !PLATFORM(MAC) && !PLATFORM(EFL)
+#if (!PLATFORM(GTK) && !PLATFORM(MAC) && !PLATFORM(EFL)) || !HAVE(ACCESSIBILITY)
 bool AccessibilityController::addNotificationListener(JSValueRef) { return false; }
 bool AccessibilityController::removeNotificationListener() { return false; }
-#endif
-
-#if !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(EFL)
 PassRefPtr<AccessibilityUIElement> AccessibilityController::accessibleElementById(JSStringRef attribute) { return nullptr; }
-#endif
-
-#if !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(MAC)
 void AccessibilityController::logAccessibilityEvents() { }
 void AccessibilityController::resetToConsistentState() { }
 #endif
 
+#if !HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
+PassRefPtr<AccessibilityUIElement> AccessibilityController::rootElement() { return nullptr; }
+PassRefPtr<AccessibilityUIElement> AccessibilityController::focusedElement() { return nullptr; }
+#endif
+
 } // namespace WTR
 
index 3470447..0edb4ca 100644 (file)
@@ -30,7 +30,7 @@
 #include "JSWrappable.h"
 #include <JavaScriptCore/JSObjectRef.h>
 #include <wtf/Platform.h>
-#if PLATFORM(GTK) || (PLATFORM(EFL) && HAVE(ACCESSIBILITY))
+#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
 #include "AccessibilityNotificationHandlerAtk.h"
 #endif
 
@@ -68,7 +68,7 @@ private:
     RetainPtr<NotificationHandler> m_globalNotificationHandler;
 #endif
 
-#if PLATFORM(GTK) || (PLATFORM(EFL) && HAVE(ACCESSIBILITY))
+#if HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
     RefPtr<AccessibilityNotificationHandler> m_globalNotificationHandler;
 #endif
 };
index b81f2bd..5f88b42 100644 (file)
@@ -54,7 +54,7 @@ bool AccessibilityUIElement::isValid() const
 }
 
 // Unsupported methods on various platforms. As they're implemented on other platforms this list should be modified.
-#if !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(EFL)
+#if (!PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(EFL)) || !HAVE(ACCESSIBILITY)
 AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement) { }
 AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement&) { }
 AccessibilityUIElement::~AccessibilityUIElement() { }
index 7597442..f1d32f6 100644 (file)
@@ -41,7 +41,7 @@ typedef id PlatformUIElement;
 #else
 typedef struct objc_object* PlatformUIElement;
 #endif
-#elif PLATFORM(GTK) || (PLATFORM(EFL) && HAVE(ACCESSIBILITY))
+#elif HAVE(ACCESSIBILITY) && (PLATFORM(GTK) || PLATFORM(EFL))
 #include "AccessibilityNotificationHandlerAtk.h"
 #include <atk/atk.h>
 #include <wtf/gobject/GRefPtr.h>
@@ -248,6 +248,7 @@ private:
     PlatformUIElement m_element;
     
     // A retained, platform specific object used to help manage notifications for this object.
+#if HAVE(ACCESSIBILITY)
 #if PLATFORM(MAC)
     NotificationHandler m_notificationHandler;
 
@@ -255,14 +256,15 @@ private:
     void getDocumentLinks(Vector<RefPtr<AccessibilityUIElement> >&);
 #endif
 
-#if PLATFORM(MAC) || PLATFORM(GTK) || (PLATFORM(EFL) && HAVE(ACCESSIBILITY))
+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL)
     void getChildren(Vector<RefPtr<AccessibilityUIElement> >&);
     void getChildrenWithRange(Vector<RefPtr<AccessibilityUIElement> >&, unsigned location, unsigned length);
 #endif
 
-#if PLATFORM(GTK) || (PLATFORM(EFL) && HAVE(ACCESSIBILITY))
+#if PLATFORM(GTK) || PLATFORM(EFL)
     RefPtr<AccessibilityNotificationHandler> m_notificationHandler;
 #endif
+#endif
 };
     
 } // namespace WTR
index bac1edf..e7f2872 100644 (file)
@@ -28,6 +28,8 @@
 #include "config.h"
 #include "AccessibilityController.h"
 
+#if HAVE(ACCESSIBILITY)
+
 #include "InjectedBundle.h"
 #include "InjectedBundlePage.h"
 
@@ -151,3 +153,5 @@ bool AccessibilityController::removeNotificationListener()
 }
 
 } // namespace WTR
+
+#endif // HAVE(ACCESSIBILITY)
index ce96a33..04637b3 100644 (file)
@@ -20,6 +20,8 @@
 #include "config.h"
 #include "AccessibilityNotificationHandlerAtk.h"
 
+#if HAVE(ACCESSIBILITY)
+
 #include "InjectedBundle.h"
 #include "InjectedBundlePage.h"
 #include "JSWrapper.h"
@@ -283,3 +285,5 @@ bool AccessibilityNotificationHandler::disconnectAccessibilityCallbacks()
 }
 
 } // namespace WTR
+
+#endif // HAVE(ACCESSIBILITY)
index d79dec2..3443bce 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef AccessibilityNotificationHandlerAtk_h
 #define AccessibilityNotificationHandlerAtk_h
 
+#if HAVE(ACCESSIBILITY)
+
 #include <JavaScriptCore/JSObjectRef.h>
 #include <atk/atk.h>
 #include <atk/atkobject.h>
@@ -54,4 +56,6 @@ private:
 
 } // namespace WTR
 
+#endif // HAVE(ACCESSIBILITY)
+
 #endif // AccessibilityNotificationHandlerAtk_h
index 2f20fe9..8473041 100644 (file)
@@ -31,6 +31,9 @@
 #import "config.h"
 #import "AccessibilityCommonMac.h"
 #import "AccessibilityController.h"
+
+#if HAVE(ACCESSIBILITY)
+
 #import "AccessibilityNotificationHandler.h"
 #import "InjectedBundle.h"
 #import "InjectedBundlePage.h"
@@ -110,3 +113,5 @@ PassRefPtr<AccessibilityUIElement> AccessibilityController::accessibleElementByI
 }
 
 } // namespace WTR
+
+#endif // HAVE(ACCESSIBILITY)
index ec9172a..f11d11b 100644 (file)
@@ -25,6 +25,9 @@
 
 #import "config.h"
 #import "AccessibilityCommonMac.h"
+
+#if HAVE(ACCESSIBILITY)
+
 #import "AccessibilityNotificationHandler.h"
 #import "AccessibilityUIElement.h"
 #import "InjectedBundle.h"
@@ -1645,3 +1648,4 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::supportedActions() const
 
 } // namespace WTR
 
+#endif // HAVE(ACCESSIBILITY)
index 9d26d89..9c70f40 100644 (file)
@@ -57,6 +57,10 @@ endif ()
 list(APPEND WebKitTestRunnerInjectedBundle_SOURCES
     ${TOOLS_DIR}/DumpRenderTree/efl/FontManagement.cpp
 
+    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/atk/AccessibilityControllerAtk.cpp
+    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/atk/AccessibilityNotificationHandlerAtk.cpp
+    ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/atk/AccessibilityUIElementAtk.cpp
+
     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/ActivateFontsEfl.cpp
     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/InjectedBundleEfl.cpp
     ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/efl/TestRunnerEfl.cpp
@@ -68,11 +72,6 @@ add_definitions(-DFONTS_CONF_DIR="${TOOLS_DIR}/DumpRenderTree/gtk/fonts"
                 -DDOWNLOADED_FONTS_DIR="${CMAKE_SOURCE_DIR}/WebKitBuild/Dependencies/Source/webkitgtk-test-fonts-0.0.3")
 
 if (ENABLE_ACCESSIBILITY)
-    list(APPEND WebKitTestRunnerInjectedBundle_SOURCES
-        ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/atk/AccessibilityControllerAtk.cpp
-        ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/atk/AccessibilityNotificationHandlerAtk.cpp
-        ${WEBKIT_TESTRUNNER_INJECTEDBUNDLE_DIR}/atk/AccessibilityUIElementAtk.cpp
-    )
     list(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES
         ${ATK_INCLUDE_DIRS}
     )