]> git.sesse.net Git - kdenlive/blobdiff - src/onmonitoritems/onmonitorcornersitem.h
Integrate with the required MLT hooks for getting Movit to work.
[kdenlive] / src / onmonitoritems / onmonitorcornersitem.h
index c97114a3766dcf2ea0a4cbb2fca1bde90e6e0495..5701c33ca0782c22bade28c21adc4f9b33391578 100644 (file)
 #define ONMONITORCORNERSITEM_H
 
 
-#include <QtCore>
 #include <QGraphicsPolygonItem>
 
+class QGraphicsView;
+
 class OnMonitorCornersItem : public QObject, public QGraphicsPolygonItem
 {
     Q_OBJECT
@@ -33,16 +34,16 @@ public:
 
     enum cornersActions { Corner, Move, MoveSide, NoAction };
     /** @brief Gets The action mode for the area @param pos +- 4. */
-    cornersActions getMode(QPointF pos, int *corner);
+    cornersActions getMode(const QPointF &pos, int *corner);
 
     /** @brief Reimplemented to draw the handles. */
-    virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0 );
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0 );
 
 protected:
-    virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
-    virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
-    virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-    virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
+    void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+    void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
 
 private:
     /** @brief Returns the centroid (= 'center of mass') of this polygon. */
@@ -51,12 +52,17 @@ private:
     /** @brief Returns the points of this polygon but sorted clockwise. */
     QList <QPointF> sortedClockwise();
 
+    /** @brief Tries to get the view of the scene. */
+    bool getView();
+
     cornersActions m_mode;
     /** Number of the selected corner or if in MoveSide mode number of the first corner on this side */
     int m_selectedCorner;
     QPointF m_lastPoint;
     bool m_modified;
 
+    QGraphicsView *m_view;
+
 signals:
     void changed();
 };