Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceImage.cpp

Issue 13726025: Remove GTK AX support, we've never used it (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /*
2 * Copyright (C) 2008 Nuanti Ltd.
3 * Copyright (C) 2009 Jan Alonzo
4 * Copyright (C) 2009, 2012 Igalia S.L.
5 * Copyright (C) 2013 Samsung Electronics
6 *
7 * Portions from Mozilla a11y, copyright as follows:
8 *
9 * The Original Code is mozilla.org code.
10 *
11 * The Initial Developer of the Original Code is
12 * Sun Microsystems, Inc.
13 * Portions created by the Initial Developer are Copyright (C) 2002
14 * the Initial Developer. All Rights Reserved.
15 *
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Library General Public
18 * License as published by the Free Software Foundation; either
19 * version 2 of the License, or (at your option) any later version.
20 *
21 * This library is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Library General Public License for more details.
25 *
26 * You should have received a copy of the GNU Library General Public License
27 * along with this library; see the file COPYING.LIB. If not, write to
28 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
29 * Boston, MA 02110-1301, USA.
30 */
31
32 #include "config.h"
33 #include "WebKitAccessibleInterfaceImage.h"
34
35 #if HAVE(ACCESSIBILITY)
36
37 #include "AccessibilityObject.h"
38 #include "IntRect.h"
39 #include "WebKitAccessibleUtil.h"
40 #include "WebKitAccessibleWrapperAtk.h"
41
42 using namespace WebCore;
43
44 static AccessibilityObject* core(AtkImage* image)
45 {
46 if (!WEBKIT_IS_ACCESSIBLE(image))
47 return 0;
48
49 return webkitAccessibleGetAccessibilityObject(WEBKIT_ACCESSIBLE(image));
50 }
51
52 static void webkitAccessibleImageGetImagePosition(AtkImage* image, gint* x, gint * y, AtkCoordType coordType)
53 {
54 IntRect rect = pixelSnappedIntRect(core(image)->elementRect());
55 contentsRelativeToAtkCoordinateType(core(image), coordType, rect, x, y);
56 }
57
58 static const gchar* webkitAccessibleImageGetImageDescription(AtkImage* image)
59 {
60 return cacheAndReturnAtkProperty(ATK_OBJECT(image), AtkCachedImageDescriptio n, accessibilityDescription(core(image)));
61 }
62
63 static void webkitAccessibleImageGetImageSize(AtkImage* image, gint* width, gint * height)
64 {
65 IntSize size = core(image)->pixelSnappedSize();
66
67 if (width)
68 *width = size.width();
69 if (height)
70 *height = size.height();
71 }
72
73 void webkitAccessibleImageInterfaceInit(AtkImageIface* iface)
74 {
75 iface->get_image_position = webkitAccessibleImageGetImagePosition;
76 iface->get_image_description = webkitAccessibleImageGetImageDescription;
77 iface->get_image_size = webkitAccessibleImageGetImageSize;
78 }
79
80 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698