~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-private-shapes

« back to all changes in this revision

Viewing changes to src/Ubuntu/Components/plugin/privates/frame.h

  • Committer: Loïc Molinari
  • Date: 2016-01-12 22:10:21 UTC
  • Revision ID: loic.molinari@canonical.com-20160112221021-yjj2hej5347pheyd
Renamed StrokeRectangle to Frame.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Author: Loïc Molinari <loic.molinari@canonical.com>
17
17
 */
18
18
 
19
 
#ifndef UCSTROKESHAPE_H
20
 
#define UCSTROKESHAPE_H
 
19
#ifndef FRAME_H
 
20
#define FRAME_H
21
21
 
22
22
#include <QtQuick/QQuickItem>
23
23
#include <QtQuick/QSGMaterial>
24
24
#include <QtQuick/QSGNode>
25
25
 
26
 
class UCStrokeShapeMaterial : public QSGMaterial
 
26
class UCFrameMaterial : public QSGMaterial
27
27
{
28
28
public:
29
 
    UCStrokeShapeMaterial();
 
29
    UCFrameMaterial();
30
30
    virtual QSGMaterialType* type() const;
31
31
    virtual QSGMaterialShader* createShader() const;
32
32
    virtual int compare(const QSGMaterial* other) const;
37
37
    quint32 m_textureId;
38
38
};
39
39
 
40
 
class UCStrokeShapeNode : public QSGGeometryNode
 
40
class UCFrameNode : public QSGGeometryNode
41
41
{
42
42
public:
43
43
  struct Vertex { float x, y, s1, t1, s2, t2; quint32 color; };
45
45
    static const unsigned short* indices();
46
46
    static const QSGGeometry::AttributeSet& attributeSet();
47
47
 
48
 
    UCStrokeShapeNode();
 
48
    UCFrameNode();
49
49
    void updateGeometry(const QSizeF& itemSize, float weight, float radius, QRgb color);
50
50
 
51
51
private:
52
 
    UCStrokeShapeMaterial m_material;
 
52
    UCFrameMaterial m_material;
53
53
    QSGGeometry m_geometry;
54
54
};
55
55
 
56
 
class UCStrokeShape : public QQuickItem
 
56
class UCFrame : public QQuickItem
57
57
{
58
58
    Q_OBJECT
59
59
 
62
62
    Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
63
63
 
64
64
public:
65
 
    UCStrokeShape(QQuickItem* parent = 0);
 
65
    UCFrame(QQuickItem* parent = 0);
66
66
 
67
67
    qreal weight() const { return m_weight; }
68
68
    void setWeight(qreal weight);
84
84
    float m_weight;
85
85
    float m_radius;
86
86
 
87
 
    Q_DISABLE_COPY(UCStrokeShape)
 
87
    Q_DISABLE_COPY(UCFrame)
88
88
};
89
89
 
90
 
QML_DECLARE_TYPE(UCStrokeShape)
 
90
QML_DECLARE_TYPE(UCFrame)
91
91
 
92
 
#endif  // UCSTROKESHAPE_H
 
92
#endif  // FRAME_H