Bug 1861709 replace AudioCallbackDriver::ThreadRunning() assertions that mean to...
[gecko.git] / layout / base / GeometryUtils.h
blobeabbad53050054dee9e4656ac4dbb7118778ca15
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=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
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef MOZILLA_GEOMETRYUTILS_H_
8 #define MOZILLA_GEOMETRYUTILS_H_
10 #include "nsTArray.h"
11 #include "nsCOMPtr.h"
13 /**
14 * This file defines utility functions for converting between layout
15 * coordinate systems.
18 class nsINode;
20 namespace mozilla {
21 class ErrorResult;
23 namespace dom {
24 struct BoxQuadOptions;
25 struct ConvertCoordinateOptions;
26 class DOMQuad;
27 class DOMRectReadOnly;
28 class DOMPoint;
29 struct DOMPointInit;
30 class OwningTextOrElementOrDocument;
31 class TextOrElementOrDocument;
32 enum class CallerType : uint32_t;
33 } // namespace dom
35 typedef dom::TextOrElementOrDocument GeometryNode;
36 typedef dom::OwningTextOrElementOrDocument OwningGeometryNode;
38 /**
39 * Computes quads for aNode using aOptions, according to
40 * GeometryUtils.getBoxQuads. May set an error in aRv.
42 void GetBoxQuads(nsINode* aNode, const dom::BoxQuadOptions& aOptions,
43 nsTArray<RefPtr<dom::DOMQuad> >& aResult,
44 dom::CallerType aCallerType, ErrorResult& aRv);
46 void GetBoxQuadsFromWindowOrigin(nsINode* aNode,
47 const dom::BoxQuadOptions& aOptions,
48 nsTArray<RefPtr<dom::DOMQuad> >& aResult,
49 ErrorResult& aRv);
51 already_AddRefed<dom::DOMQuad> ConvertQuadFromNode(
52 nsINode* aTo, dom::DOMQuad& aQuad, const GeometryNode& aFrom,
53 const dom::ConvertCoordinateOptions& aOptions, dom::CallerType aCallerType,
54 ErrorResult& aRv);
56 already_AddRefed<dom::DOMQuad> ConvertRectFromNode(
57 nsINode* aTo, dom::DOMRectReadOnly& aRect, const GeometryNode& aFrom,
58 const dom::ConvertCoordinateOptions& aOptions, dom::CallerType aCallerType,
59 ErrorResult& aRv);
61 already_AddRefed<dom::DOMPoint> ConvertPointFromNode(
62 nsINode* aTo, const dom::DOMPointInit& aPoint, const GeometryNode& aFrom,
63 const dom::ConvertCoordinateOptions& aOptions, dom::CallerType aCallerType,
64 ErrorResult& aRv);
66 } // namespace mozilla
68 #endif /* MOZILLA_GEOMETRYUTILS_H_ */