Bug 1753131 - wait for focus before dispatching devicechange events r=jib
[gecko.git] / accessible / xpcom / xpcAccessibleImage.cpp
blob9419e4a5d93326502e7ca4e6de9ab434c7320af8
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "xpcAccessibleImage.h"
9 #include "ImageAccessible.h"
11 using namespace mozilla::a11y;
13 ////////////////////////////////////////////////////////////////////////////////
14 // nsISupports
16 NS_IMPL_ISUPPORTS_INHERITED(xpcAccessibleImage, xpcAccessibleGeneric,
17 nsIAccessibleImage)
19 ////////////////////////////////////////////////////////////////////////////////
20 // nsIAccessibleImage
22 NS_IMETHODIMP
23 xpcAccessibleImage::GetImagePosition(uint32_t aCoordType, int32_t* aX,
24 int32_t* aY) {
25 NS_ENSURE_ARG_POINTER(aX);
26 *aX = 0;
27 NS_ENSURE_ARG_POINTER(aY);
28 *aY = 0;
30 if (!Intl()) return NS_ERROR_FAILURE;
32 LayoutDeviceIntPoint point = Intl()->Position(aCoordType);
33 *aX = point.x;
34 *aY = point.y;
35 return NS_OK;
38 NS_IMETHODIMP
39 xpcAccessibleImage::GetImageSize(int32_t* aWidth, int32_t* aHeight) {
40 NS_ENSURE_ARG_POINTER(aWidth);
41 *aWidth = 0;
42 NS_ENSURE_ARG_POINTER(aHeight);
43 *aHeight = 0;
45 if (!Intl()) return NS_ERROR_FAILURE;
47 LayoutDeviceIntSize size = Intl()->Size();
48 *aWidth = size.width;
49 *aHeight = size.height;
50 return NS_OK;