/src/mozilla-central/dom/base/DOMPoint.cpp
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #include "mozilla/dom/DOMPoint.h" |
8 | | |
9 | | #include "mozilla/dom/DOMPointBinding.h" |
10 | | #include "mozilla/dom/BindingDeclarations.h" |
11 | | |
12 | | using namespace mozilla; |
13 | | using namespace mozilla::dom; |
14 | | |
15 | | NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DOMPointReadOnly, mParent) |
16 | | |
17 | | NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMPointReadOnly, AddRef) |
18 | | NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMPointReadOnly, Release) |
19 | | |
20 | | already_AddRefed<DOMPointReadOnly> |
21 | | DOMPointReadOnly::FromPoint(const GlobalObject& aGlobal, const DOMPointInit& aParams) |
22 | 0 | { |
23 | 0 | RefPtr<DOMPointReadOnly> obj = |
24 | 0 | new DOMPointReadOnly(aGlobal.GetAsSupports(), aParams.mX, aParams.mY, |
25 | 0 | aParams.mZ, aParams.mW); |
26 | 0 | return obj.forget(); |
27 | 0 | } |
28 | | |
29 | | already_AddRefed<DOMPointReadOnly> |
30 | | DOMPointReadOnly::Constructor(const GlobalObject& aGlobal, double aX, double aY, |
31 | | double aZ, double aW, ErrorResult& aRV) |
32 | 0 | { |
33 | 0 | RefPtr<DOMPointReadOnly> obj = |
34 | 0 | new DOMPointReadOnly(aGlobal.GetAsSupports(), aX, aY, aZ, aW); |
35 | 0 | return obj.forget(); |
36 | 0 | } |
37 | | |
38 | | JSObject* |
39 | | DOMPointReadOnly::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) |
40 | 0 | { |
41 | 0 | return DOMPointReadOnly_Binding::Wrap(aCx, this, aGivenProto); |
42 | 0 | } |
43 | | |
44 | | already_AddRefed<DOMPoint> |
45 | | DOMPoint::FromPoint(const GlobalObject& aGlobal, const DOMPointInit& aParams) |
46 | 0 | { |
47 | 0 | RefPtr<DOMPoint> obj = |
48 | 0 | new DOMPoint(aGlobal.GetAsSupports(), aParams.mX, aParams.mY, |
49 | 0 | aParams.mZ, aParams.mW); |
50 | 0 | return obj.forget(); |
51 | 0 | } |
52 | | |
53 | | already_AddRefed<DOMPoint> |
54 | | DOMPoint::Constructor(const GlobalObject& aGlobal, double aX, double aY, |
55 | | double aZ, double aW, ErrorResult& aRV) |
56 | 0 | { |
57 | 0 | RefPtr<DOMPoint> obj = |
58 | 0 | new DOMPoint(aGlobal.GetAsSupports(), aX, aY, aZ, aW); |
59 | 0 | return obj.forget(); |
60 | 0 | } |
61 | | |
62 | | JSObject* |
63 | | DOMPoint::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) |
64 | 0 | { |
65 | 0 | return DOMPoint_Binding::Wrap(aCx, this, aGivenProto); |
66 | 0 | } |