aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/svg/model/SkSVGSVG.h
blob: 27631f5a3169c6c51b35e8eaec6b0688df1a1d60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkSVGSVG_DEFINED
#define SkSVGSVG_DEFINED

#include "SkSVGContainer.h"
#include "SkSVGTypes.h"

class SkSVGSVG : public SkSVGContainer {
public:
    virtual ~SkSVGSVG() = default;

    static sk_sp<SkSVGSVG> Make() { return sk_sp<SkSVGSVG>(new SkSVGSVG()); }

    void setX(const SkSVGLength&);
    void setY(const SkSVGLength&);
    void setWidth(const SkSVGLength&);
    void setHeight(const SkSVGLength&);

protected:
    void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;

private:
    SkSVGSVG();

    SkSVGLength fX      = SkSVGLength(0);
    SkSVGLength fY      = SkSVGLength(0);
    SkSVGLength fWidth  = SkSVGLength(100, SkSVGLength::Unit::kPercentage);
    SkSVGLength fHeight = SkSVGLength(100, SkSVGLength::Unit::kPercentage);

    typedef SkSVGContainer INHERITED;
};

#endif // SkSVGSVG_DEFINED