Line data Source code
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 "GridLine.h"
8 :
9 : #include "GridLines.h"
10 : #include "mozilla/dom/GridBinding.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 0 : NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GridLine, mParent)
16 0 : NS_IMPL_CYCLE_COLLECTING_ADDREF(GridLine)
17 0 : NS_IMPL_CYCLE_COLLECTING_RELEASE(GridLine)
18 0 : NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GridLine)
19 0 : NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
20 0 : NS_INTERFACE_MAP_ENTRY(nsISupports)
21 0 : NS_INTERFACE_MAP_END
22 :
23 0 : GridLine::GridLine(GridLines *aParent)
24 : : mParent(aParent)
25 : , mStart(0.0)
26 : , mBreadth(0.0)
27 : , mType(GridDeclaration::Implicit)
28 0 : , mNumber(0)
29 : {
30 0 : MOZ_ASSERT(aParent, "Should never be instantiated with a null GridLines");
31 0 : }
32 :
33 0 : GridLine::~GridLine()
34 : {
35 0 : }
36 :
37 : void
38 0 : GridLine::GetNames(nsTArray<nsString>& aNames) const
39 : {
40 0 : aNames = mNames;
41 0 : }
42 :
43 : JSObject*
44 0 : GridLine::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
45 : {
46 0 : return GridLineBinding::Wrap(aCx, this, aGivenProto);
47 : }
48 :
49 : double
50 0 : GridLine::Start() const
51 : {
52 0 : return mStart;
53 : }
54 :
55 : double
56 0 : GridLine::Breadth() const
57 : {
58 0 : return mBreadth;
59 : }
60 :
61 : GridDeclaration
62 0 : GridLine::Type() const
63 : {
64 0 : return mType;
65 : }
66 :
67 : uint32_t
68 0 : GridLine::Number() const
69 : {
70 0 : return mNumber;
71 : }
72 :
73 : void
74 0 : GridLine::SetLineValues(const nsTArray<nsString>& aNames,
75 : double aStart,
76 : double aBreadth,
77 : uint32_t aNumber,
78 : GridDeclaration aType)
79 : {
80 0 : mNames = aNames;
81 0 : mStart = aStart;
82 0 : mBreadth = aBreadth;
83 0 : mNumber = aNumber;
84 0 : mType = aType;
85 0 : }
86 :
87 : } // namespace dom
88 : } // namespace mozilla
|