comparison layer/TextLayer.h @ 978:64c2b3a4435a 3.0-integration

Merge from branch osx-retina
author Chris Cannam
date Fri, 26 Jun 2015 14:10:40 +0100
parents 4fe7a09be0fe
children a34a2a25907c
comparison
equal deleted inserted replaced
977:f40ccbf228c2 978:64c2b3a4435a
30 Q_OBJECT 30 Q_OBJECT
31 31
32 public: 32 public:
33 TextLayer(); 33 TextLayer();
34 34
35 virtual void paint(View *v, QPainter &paint, QRect rect) const; 35 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const;
36 36
37 virtual QString getFeatureDescription(View *v, QPoint &) const; 37 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const;
38 38
39 virtual bool snapToFeatureFrame(View *v, sv_frame_t &frame, 39 virtual bool snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame,
40 int &resolution, 40 int &resolution,
41 SnapType snap) const; 41 SnapType snap) const;
42 42
43 virtual void drawStart(View *v, QMouseEvent *); 43 virtual void drawStart(LayerGeometryProvider *v, QMouseEvent *);
44 virtual void drawDrag(View *v, QMouseEvent *); 44 virtual void drawDrag(LayerGeometryProvider *v, QMouseEvent *);
45 virtual void drawEnd(View *v, QMouseEvent *); 45 virtual void drawEnd(LayerGeometryProvider *v, QMouseEvent *);
46 46
47 virtual void eraseStart(View *v, QMouseEvent *); 47 virtual void eraseStart(LayerGeometryProvider *v, QMouseEvent *);
48 virtual void eraseDrag(View *v, QMouseEvent *); 48 virtual void eraseDrag(LayerGeometryProvider *v, QMouseEvent *);
49 virtual void eraseEnd(View *v, QMouseEvent *); 49 virtual void eraseEnd(LayerGeometryProvider *v, QMouseEvent *);
50 50
51 virtual void editStart(View *v, QMouseEvent *); 51 virtual void editStart(LayerGeometryProvider *v, QMouseEvent *);
52 virtual void editDrag(View *v, QMouseEvent *); 52 virtual void editDrag(LayerGeometryProvider *v, QMouseEvent *);
53 virtual void editEnd(View *v, QMouseEvent *); 53 virtual void editEnd(LayerGeometryProvider *v, QMouseEvent *);
54 54
55 virtual void moveSelection(Selection s, sv_frame_t newStartFrame); 55 virtual void moveSelection(Selection s, sv_frame_t newStartFrame);
56 virtual void resizeSelection(Selection s, Selection newSize); 56 virtual void resizeSelection(Selection s, Selection newSize);
57 virtual void deleteSelection(Selection s); 57 virtual void deleteSelection(Selection s);
58 58
59 virtual void copy(View *v, Selection s, Clipboard &to); 59 virtual void copy(LayerGeometryProvider *v, Selection s, Clipboard &to);
60 virtual bool paste(View *v, const Clipboard &from, sv_frame_t frameOffset, 60 virtual bool paste(LayerGeometryProvider *v, const Clipboard &from, sv_frame_t frameOffset,
61 bool interactive); 61 bool interactive);
62 62
63 virtual bool editOpen(View *, QMouseEvent *); // on double-click 63 virtual bool editOpen(LayerGeometryProvider *, QMouseEvent *); // on double-click
64 64
65 virtual const Model *getModel() const { return m_model; } 65 virtual const Model *getModel() const { return m_model; }
66 void setModel(TextModel *model); 66 void setModel(TextModel *model);
67 67
68 virtual PropertyList getProperties() const; 68 virtual PropertyList getProperties() const;
72 int *min, int *max, int *deflt) const; 72 int *min, int *max, int *deflt) const;
73 virtual QString getPropertyValueLabel(const PropertyName &, 73 virtual QString getPropertyValueLabel(const PropertyName &,
74 int value) const; 74 int value) const;
75 virtual void setProperty(const PropertyName &, int value); 75 virtual void setProperty(const PropertyName &, int value);
76 76
77 virtual bool isLayerScrollable(const View *v) const; 77 virtual bool isLayerScrollable(const LayerGeometryProvider *v) const;
78 78
79 virtual bool isLayerEditable() const { return true; } 79 virtual bool isLayerEditable() const { return true; }
80 80
81 virtual int getCompletion(View *) const { return m_model->getCompletion(); } 81 virtual int getCompletion(LayerGeometryProvider *) const { return m_model->getCompletion(); }
82 82
83 virtual bool getValueExtents(double &min, double &max, 83 virtual bool getValueExtents(double &min, double &max,
84 bool &logarithmic, QString &unit) const; 84 bool &logarithmic, QString &unit) const;
85 85
86 virtual int getVerticalScaleWidth(View *, bool, QPainter &) const { return 0; } 86 virtual int getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &) const { return 0; }
87 87
88 virtual void toXml(QTextStream &stream, QString indent = "", 88 virtual void toXml(QTextStream &stream, QString indent = "",
89 QString extraAttributes = "") const; 89 QString extraAttributes = "") const;
90 90
91 void setProperties(const QXmlAttributes &attributes); 91 void setProperties(const QXmlAttributes &attributes);
92 92
93 protected: 93 protected:
94 int getYForHeight(View *v, double height) const; 94 int getYForHeight(LayerGeometryProvider *v, double height) const;
95 double getHeightForY(View *v, int y) const; 95 double getHeightForY(LayerGeometryProvider *v, int y) const;
96 96
97 virtual int getDefaultColourHint(bool dark, bool &impose); 97 virtual int getDefaultColourHint(bool dark, bool &impose);
98 98
99 TextModel::PointList getLocalPoints(View *v, int x, int y) const; 99 TextModel::PointList getLocalPoints(LayerGeometryProvider *v, int x, int y) const;
100 100
101 bool getPointToDrag(View *v, int x, int y, TextModel::Point &) const; 101 bool getPointToDrag(LayerGeometryProvider *v, int x, int y, TextModel::Point &) const;
102 102
103 TextModel *m_model; 103 TextModel *m_model;
104 bool m_editing; 104 bool m_editing;
105 QPoint m_editOrigin; 105 QPoint m_editOrigin;
106 TextModel::Point m_originalPoint; 106 TextModel::Point m_originalPoint;