content/base/src/DOMQuad.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef MOZILLA_DOMQUAD_H_
michael@0 7 #define MOZILLA_DOMQUAD_H_
michael@0 8
michael@0 9 #include "nsWrapperCache.h"
michael@0 10 #include "nsISupports.h"
michael@0 11 #include "nsCycleCollectionParticipant.h"
michael@0 12 #include "mozilla/Attributes.h"
michael@0 13 #include "nsCOMPtr.h"
michael@0 14 #include "nsAutoPtr.h"
michael@0 15 #include "mozilla/dom/BindingDeclarations.h"
michael@0 16 #include "mozilla/ErrorResult.h"
michael@0 17 #include "Units.h"
michael@0 18
michael@0 19 namespace mozilla {
michael@0 20 namespace dom {
michael@0 21
michael@0 22 class DOMRectReadOnly;
michael@0 23 class DOMPoint;
michael@0 24 struct DOMPointInit;
michael@0 25
michael@0 26 class DOMQuad MOZ_FINAL : public nsWrapperCache
michael@0 27 {
michael@0 28 public:
michael@0 29 DOMQuad(nsISupports* aParent, CSSPoint aPoints[4]);
michael@0 30 DOMQuad(nsISupports* aParent);
michael@0 31 ~DOMQuad();
michael@0 32
michael@0 33 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMQuad)
michael@0 34 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMQuad)
michael@0 35
michael@0 36 nsISupports* GetParentObject() const { return mParent; }
michael@0 37 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
michael@0 38
michael@0 39 static already_AddRefed<DOMQuad>
michael@0 40 Constructor(const GlobalObject& aGlobal,
michael@0 41 const DOMPointInit& aP1,
michael@0 42 const DOMPointInit& aP2,
michael@0 43 const DOMPointInit& aP3,
michael@0 44 const DOMPointInit& aP4,
michael@0 45 ErrorResult& aRV);
michael@0 46 static already_AddRefed<DOMQuad>
michael@0 47 Constructor(const GlobalObject& aGlobal, const DOMRectReadOnly& aRect,
michael@0 48 ErrorResult& aRV);
michael@0 49
michael@0 50 DOMRectReadOnly* Bounds() const;
michael@0 51 DOMPoint* P1() const { return mPoints[0]; }
michael@0 52 DOMPoint* P2() const { return mPoints[1]; }
michael@0 53 DOMPoint* P3() const { return mPoints[2]; }
michael@0 54 DOMPoint* P4() const { return mPoints[3]; }
michael@0 55
michael@0 56 DOMPoint* Point(uint32_t aIndex) { return mPoints[aIndex]; }
michael@0 57
michael@0 58 protected:
michael@0 59 class QuadBounds;
michael@0 60
michael@0 61 nsCOMPtr<nsISupports> mParent;
michael@0 62 nsRefPtr<DOMPoint> mPoints[4];
michael@0 63 mutable nsRefPtr<QuadBounds> mBounds; // allocated lazily
michael@0 64 };
michael@0 65
michael@0 66 }
michael@0 67 }
michael@0 68
michael@0 69 #endif /*MOZILLA_DOMRECT_H_*/

mercurial