tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

xpcAccessibleImage.cpp (1412B)


      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/. */
      6 
      7 #include "xpcAccessibleImage.h"
      8 
      9 using namespace mozilla::a11y;
     10 
     11 ////////////////////////////////////////////////////////////////////////////////
     12 // nsISupports
     13 
     14 NS_IMPL_ISUPPORTS_INHERITED(xpcAccessibleImage, xpcAccessibleGeneric,
     15                            nsIAccessibleImage)
     16 
     17 ////////////////////////////////////////////////////////////////////////////////
     18 // nsIAccessibleImage
     19 
     20 NS_IMETHODIMP
     21 xpcAccessibleImage::GetImagePosition(uint32_t aCoordType, int32_t* aX,
     22                                     int32_t* aY) {
     23  NS_ENSURE_ARG_POINTER(aX);
     24  *aX = 0;
     25  NS_ENSURE_ARG_POINTER(aY);
     26  *aY = 0;
     27 
     28  if (!mIntl) return NS_ERROR_FAILURE;
     29 
     30  LayoutDeviceIntPoint point = mIntl->Position(aCoordType);
     31  *aX = point.x;
     32  *aY = point.y;
     33  return NS_OK;
     34 }
     35 
     36 NS_IMETHODIMP
     37 xpcAccessibleImage::GetImageSize(int32_t* aWidth, int32_t* aHeight) {
     38  NS_ENSURE_ARG_POINTER(aWidth);
     39  *aWidth = 0;
     40  NS_ENSURE_ARG_POINTER(aHeight);
     41  *aHeight = 0;
     42 
     43  if (!mIntl) return NS_ERROR_FAILURE;
     44 
     45  LayoutDeviceIntSize size = mIntl->Size();
     46  *aWidth = size.width;
     47  *aHeight = size.height;
     48  return NS_OK;
     49 }