Title: [105610] trunk/Source/WebCore
Revision
105610
Author
[email protected]
Date
2012-01-23 03:55:01 -0800 (Mon, 23 Jan 2012)

Log Message

[GTK] Refactor GTK's accessibilitity code to be more modular
https://bugs.webkit.org/show_bug.cgi?id=76783

Reviewed by Martin Robinson.

Move common function returnString() from the wrapper and
hyperlink implementations to a new utility file.

* accessibility/gtk/WebKitAccessibleUtil.cpp: Added.
(returnString): Taken from WebKitAccessibleWrapperAtk.cpp and
WebKitAccessibleHyperlink.cpp
* accessibility/gtk/WebKitAccessibleUtil.h: Added.

* accessibility/gtk/WebKitAccessibleHyperlink.cpp: Remove local
implementation of returnString.
* accessibility/gtk/WebKitAccessibleWrapperAtk.cpp: Ditto.

Add new files to build files.

* GNUmakefile.list.am: Add WebKitAccessibleUtil.[h|cpp].
* WebCore.gypi: Ditto.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (105609 => 105610)


--- trunk/Source/WebCore/ChangeLog	2012-01-23 11:51:20 UTC (rev 105609)
+++ trunk/Source/WebCore/ChangeLog	2012-01-23 11:55:01 UTC (rev 105610)
@@ -5,6 +5,30 @@
 
         Reviewed by Martin Robinson.
 
+        Move common function returnString() from the wrapper and
+        hyperlink implementations to a new utility file.
+
+        * accessibility/gtk/WebKitAccessibleUtil.cpp: Added.
+        (returnString): Taken from WebKitAccessibleWrapperAtk.cpp and
+        WebKitAccessibleHyperlink.cpp
+        * accessibility/gtk/WebKitAccessibleUtil.h: Added.
+
+        * accessibility/gtk/WebKitAccessibleHyperlink.cpp: Remove local
+        implementation of returnString.
+        * accessibility/gtk/WebKitAccessibleWrapperAtk.cpp: Ditto.
+
+        Add new files to build files.
+
+        * GNUmakefile.list.am: Add WebKitAccessibleUtil.[h|cpp].
+        * WebCore.gypi: Ditto.
+
+2012-01-23  Mario Sanchez Prada  <[email protected]>
+
+        [GTK] Refactor GTK's accessibilitity code to be more modular
+        https://bugs.webkit.org/show_bug.cgi?id=76783
+
+        Reviewed by Martin Robinson.
+
         Fix typo in class struct (parent class field had the wrong type),
         fix coding style issues and update date in headers.
 

Modified: trunk/Source/WebCore/GNUmakefile.list.am (105609 => 105610)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-01-23 11:51:20 UTC (rev 105609)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-01-23 11:55:01 UTC (rev 105610)
@@ -4424,6 +4424,8 @@
 	Source/WebCore/accessibility/gtk/AXObjectCacheAtk.cpp \
 	Source/WebCore/accessibility/gtk/WebKitAccessibleHyperlink.h \
 	Source/WebCore/accessibility/gtk/WebKitAccessibleHyperlink.cpp \
+	Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.cpp \
+	Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.h \
 	Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp \
 	Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.h \
 	Source/WebCore/bindings/js/ScriptControllerGtk.cpp \

Modified: trunk/Source/WebCore/WebCore.gypi (105609 => 105610)


--- trunk/Source/WebCore/WebCore.gypi	2012-01-23 11:51:20 UTC (rev 105609)
+++ trunk/Source/WebCore/WebCore.gypi	2012-01-23 11:55:01 UTC (rev 105610)
@@ -1768,6 +1768,8 @@
             'accessibility/gtk/AccessibilityObjectAtk.cpp',
             'accessibility/gtk/WebKitAccessibleHyperlink.cpp',
             'accessibility/gtk/WebKitAccessibleHyperlink.h',
+            'accessibility/gtk/WebKitAccessibleUtil.cpp',
+            'accessibility/gtk/WebKitAccessibleUtil.h',
             'accessibility/gtk/WebKitAccessibleWrapperAtk.cpp',
             'accessibility/gtk/WebKitAccessibleWrapperAtk.h',
             'accessibility/mac/AXObjectCacheMac.mm',

Modified: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleHyperlink.cpp (105609 => 105610)


--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleHyperlink.cpp	2012-01-23 11:51:20 UTC (rev 105609)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleHyperlink.cpp	2012-01-23 11:55:01 UTC (rev 105610)
@@ -30,6 +30,7 @@
 #include "RenderListMarker.h"
 #include "RenderObject.h"
 #include "TextIterator.h"
+#include "WebKitAccessibleUtil.h"
 #include "WebKitAccessibleWrapperAtk.h"
 #include "htmlediting.h"
 
@@ -52,14 +53,6 @@
 
 static gpointer webkitAccessibleHyperlinkParentClass = 0;
 
-// Used to provide const char* returns.
-static const char* returnString(const String& str)
-{
-    static CString returnedString;
-    returnedString = str.utf8();
-    return returnedString.data();
-}
-
 static AccessibilityObject* core(WebKitAccessible* accessible)
 {
     if (!accessible || !WEBKIT_IS_ACCESSIBLE(accessible))

Added: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.cpp (0 => 105610)


--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.cpp	                        (rev 0)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.cpp	2012-01-23 11:55:01 UTC (rev 105610)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008 Nuanti Ltd.
+ * Copyright (C) 2009 Jan Alonzo
+ * Copyright (C) 2009, 2010, 2012 Igalia S.L.
+ *
+ * Portions from Mozilla a11y, copyright as follows:
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is
+ * Sun Microsystems, Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2002
+ * the Initial Developer. All Rights Reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitAccessibleUtil.h"
+
+#include <wtf/text/AtomicString.h>
+#include <wtf/text/CString.h>
+
+// Used to provide const char* returns.
+const char* returnString(const String& str)
+{
+    static CString returnedString;
+    returnedString = str.utf8();
+    return returnedString.data();
+}

Added: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.h (0 => 105610)


--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.h	                        (rev 0)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleUtil.h	2012-01-23 11:55:01 UTC (rev 105610)
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2008 Nuanti Ltd.
+ * Copyright (C) 2009 Jan Alonzo
+ * Copyright (C) 2009, 2010, 2012 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitAccessibleUtil_h
+#define WebKitAccessibleUtil_h
+
+#include <wtf/text/WTFString.h>
+
+// Returns a const char* pointing to a statically allocated string.
+const char* returnString(const String&);
+
+#endif // WebKitAccessibleUtil_h

Modified: trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp (105609 => 105610)


--- trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp	2012-01-23 11:51:20 UTC (rev 105609)
+++ trunk/Source/WebCore/accessibility/gtk/WebKitAccessibleWrapperAtk.cpp	2012-01-23 11:55:01 UTC (rev 105610)
@@ -63,6 +63,7 @@
 #include "TextEncoding.h"
 #include "TextIterator.h"
 #include "WebKitAccessibleHyperlink.h"
+#include "WebKitAccessibleUtil.h"
 #include "htmlediting.h"
 #include "visible_units.h"
 
@@ -92,14 +93,6 @@
     return object;
 }
 
-// Used to provide const char* returns.
-static const char* returnString(const String& str)
-{
-    static CString returnedString;
-    returnedString = str.utf8();
-    return returnedString.data();
-}
-
 static AccessibilityObject* core(WebKitAccessible* accessible)
 {
     if (!accessible)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to