Subversion Repositories Scribus

Rev

Rev 23662 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20593 jghali 1
/*
2
 For general Scribus (>=1.3.2) copyright and licensing information please refer
3
 to the COPYING file provided with the program. Following this notice may exist
4
 a copyright and/or license notice that predates the release of Scribus 1.3.2
5
 for which a new license (GPL+exception) is in place.
6
 */
7
/***************************************************************************
8
*                                                                         *
9
*   This program is free software; you can redistribute it and/or modify  *
10
*   it under the terms of the GNU General Public License as published by  *
11
*   the Free Software Foundation; either version 2 of the License, or     *
12
*   (at your option) any later version.                                   *
13
*                                                                         *
14
***************************************************************************/
15
/***************************************************************************
16
                 canvasmode_editmeshgradient.h  -  description
17
                             -------------------
18
    begin                : Sat Apr 24 2010
19
    copyright            : (C) 2010 by Franz Schmid
20
    email                : Franz.Schmid@altmuehlnet.de
21
 ***************************************************************************/
22
 
23
#ifndef CANVAS_MODE_EDITMESHGRADIENT_H
24
#define CANVAS_MODE_EDITMESHGRADIENT_H
25
 
26
#include <QObject>
27
#include <QTime>
28
 
29
#include "canvasmode.h"
30
#include "fpointarray.h"
31
 
32
class PageItem;
33
class PageItem_TextFrame;
34
class ScribusMainWindow;
35
class ScribusView;
22296 craig 36
class MeshPoint;
20593 jghali 37
 
38
 
39
// This class encapsulate the old code for mouse interaction from scribusview.cpp
40
 
41
class CanvasMode_EditMeshGradient :  public CanvasMode
23662 craig 42
{
43
        public:
44
                explicit CanvasMode_EditMeshGradient(ScribusView* view);
45
                ~CanvasMode_EditMeshGradient() override;
20593 jghali 46
 
23662 craig 47
                void enterEvent(QEvent *) override;
48
                void leaveEvent(QEvent *) override;
20593 jghali 49
 
23662 craig 50
                void activate(bool) override;
51
                void deactivate(bool) override;
24003 jghali 52
                void keyPressEvent(QKeyEvent *e) override;
23662 craig 53
                void mouseDoubleClickEvent(QMouseEvent *m) override;
54
                void mouseReleaseEvent(QMouseEvent *m) override;
55
                void mouseMoveEvent(QMouseEvent *m) override;
56
                void mousePressEvent(QMouseEvent *m) override;
57
                void drawControls(QPainter* p) override;
58
                void drawControlsMeshGradient(QPainter* psx, PageItem* currItem);
20593 jghali 59
 
23662 craig 60
        private:
20593 jghali 61
 
23662 craig 62
                typedef enum
63
                {
64
                        noPointDefined,
65
                        useControlT,
66
                        useControlB,
67
                        useControlL,
68
                        useControlR
69
                } eMGradientPoint;
20593 jghali 70
 
23662 craig 71
                inline bool GetItem(PageItem** pi);
72
 
73
                MeshPoint *m_old_mesh {nullptr};
74
                QList<QPair<int, int> > m_selectedMeshPoints;
75
                ScribusMainWindow* m_ScMW {nullptr};
76
                bool m_keyRepeat {false};
77
                double m_Mxp {-1.0};
78
                double m_Myp {-1.0};
79
                eMGradientPoint m_gradientPoint {noPointDefined};
20593 jghali 80
};
81
 
82
 
83
#endif