Mercurial > hg > svgui
comparison layer/TextLayer.h @ 1414:fa986b91d77f
Merge from branch fix-static-analysis
author | Chris Cannam |
---|---|
date | Wed, 09 Jan 2019 15:24:51 +0000 |
parents | 05d614f6e46d |
children | e2b6a13a1f69 |
comparison
equal
deleted
inserted
replaced
1413:0930a27ebea2 | 1414:fa986b91d77f |
---|---|
11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the |
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef _TEXT_LAYER_H_ | 16 #ifndef SV_TEXT_LAYER_H |
17 #define _TEXT_LAYER_H_ | 17 #define SV_TEXT_LAYER_H |
18 | 18 |
19 #include "SingleColourLayer.h" | 19 #include "SingleColourLayer.h" |
20 #include "data/model/TextModel.h" | 20 #include "data/model/TextModel.h" |
21 | 21 |
22 #include <QObject> | 22 #include <QObject> |
30 Q_OBJECT | 30 Q_OBJECT |
31 | 31 |
32 public: | 32 public: |
33 TextLayer(); | 33 TextLayer(); |
34 | 34 |
35 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; | 35 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; |
36 | 36 |
37 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; | 37 QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; |
38 | 38 |
39 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, | 39 bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, |
40 int &resolution, | 40 int &resolution, |
41 SnapType snap) const; | 41 SnapType snap) const override; |
42 | 42 |
43 virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *); | 43 void drawStart(LayerGeometryProvider *v, QMouseEvent *) override; |
44 virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *); | 44 void drawDrag(LayerGeometryProvider *v, QMouseEvent *) override; |
45 virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *); | 45 void drawEnd(LayerGeometryProvider *v, QMouseEvent *) override; |
46 | 46 |
47 virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *); | 47 void eraseStart(LayerGeometryProvider *v, QMouseEvent *) override; |
48 virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *); | 48 void eraseDrag(LayerGeometryProvider *v, QMouseEvent *) override; |
49 virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *); | 49 void eraseEnd(LayerGeometryProvider *v, QMouseEvent *) override; |
50 | 50 |
51 virtual void editStart(LayerGeometryProvider *v, QMouseEvent *); | 51 void editStart(LayerGeometryProvider *v, QMouseEvent *) override; |
52 virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *); | 52 void editDrag(LayerGeometryProvider *v, QMouseEvent *) override; |
53 virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *); | 53 void editEnd(LayerGeometryProvider *v, QMouseEvent *) override; |
54 | 54 |
55 virtual void moveSelection(Selection s, sv_frame_t newStartFrame); | 55 void moveSelection(Selection s, sv_frame_t newStartFrame) override; |
56 virtual void resizeSelection(Selection s, Selection newSize); | 56 void resizeSelection(Selection s, Selection newSize) override; |
57 virtual void deleteSelection(Selection s); | 57 void deleteSelection(Selection s) override; |
58 | 58 |
59 virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to); | 59 void copy(LayerGeometryProvider *v, Selection s, Clipboard &to) override; |
60 virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, | 60 bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset, |
61 bool interactive); | 61 bool interactive) override; |
62 | 62 |
63 virtual bool editOpen(LayerGeometryProvider *, QMouseEvent *); // on double-click | 63 bool editOpen(LayerGeometryProvider *, QMouseEvent *) override; // on double-click |
64 | 64 |
65 virtual const Model *getModel() const { return m_model; } | 65 const Model *getModel() const override { return m_model; } |
66 void setModel(TextModel *model); | 66 void setModel(TextModel *model); |
67 | 67 |
68 virtual PropertyList getProperties() const; | 68 PropertyList getProperties() const override; |
69 virtual QString getPropertyLabel(const PropertyName &) const; | 69 QString getPropertyLabel(const PropertyName &) const override; |
70 virtual PropertyType getPropertyType(const PropertyName &) const; | 70 PropertyType getPropertyType(const PropertyName &) const override; |
71 virtual int getPropertyRangeAndValue(const PropertyName &, | 71 int getPropertyRangeAndValue(const PropertyName &, |
72 int *min, int *max, int *deflt) const; | 72 int *min, int *max, int *deflt) const override; |
73 virtual QString getPropertyValueLabel(const PropertyName &, | 73 QString getPropertyValueLabel(const PropertyName &, |
74 int value) const; | 74 int value) const override; |
75 virtual void setProperty(const PropertyName &, int value); | 75 void setProperty(const PropertyName &, int value) override; |
76 | 76 |
77 virtual bool isLayerScrollable(const LayerGeometryProvider *v) const; | 77 bool isLayerScrollable(const LayerGeometryProvider *v) const override; |
78 | 78 |
79 virtual bool isLayerEditable() const { return true; } | 79 bool isLayerEditable() const override { return true; } |
80 | 80 |
81 virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); } | 81 int getCompletion(LayerGeometryProvider *) const override { return m_model->getCompletion(); } |
82 | 82 |
83 virtual bool getValueExtents(double &min, double &max, | 83 bool getValueExtents(double &min, double &max, |
84 bool &logarithmic, QString &unit) const; | 84 bool &logarithmic, QString &unit) const override; |
85 | 85 |
86 virtual int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const { return 0; } | 86 int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const override { return 0; } |
87 | 87 |
88 virtual void toXml(QTextStream &stream, QString indent = "", | 88 void toXml(QTextStream &stream, QString indent = "", |
89 QString extraAttributes = "") const; | 89 QString extraAttributes = "") const override; |
90 | 90 |
91 void setProperties(const QXmlAttributes &attributes); | 91 void setProperties(const QXmlAttributes &attributes) override; |
92 | 92 |
93 protected: | 93 protected: |
94 int getYForHeight(LayerGeometryProvider *v, double height) const; | 94 int getYForHeight(LayerGeometryProvider *v, double height) const; |
95 double getHeightForY(LayerGeometryProvider *v, int y) const; | 95 double getHeightForY(LayerGeometryProvider *v, int y) const; |
96 | 96 |
97 virtual int getDefaultColourHint(bool dark, bool &impose); | 97 int getDefaultColourHint(bool dark, bool &impose) override; |
98 | 98 |
99 TextModel::PointList getLocalPoints(LayerGeometryProvider *v, int x, int y) const; | 99 TextModel::PointList getLocalPoints(LayerGeometryProvider *v, int x, int y) const; |
100 | 100 |
101 bool getPointToDrag(LayerGeometryProvider *v, int x, int y, TextModel::Point &) const; | 101 bool getPointToDrag(LayerGeometryProvider *v, int x, int y, TextModel::Point &) const; |
102 | 102 |