Subversion Repositories Scribus

Rev

Rev 15839 | Rev 16856 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
12770 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
 
17
 
18
#ifndef CANVAS_MODE_EDITGRADIENT_H
19
#define CANVAS_MODE_EDITGRADIENT_H
20
 
21
#include <QObject>
22
#include <QTime>
23
 
24
#include "canvasmode.h"
25
#include "fpointarray.h"
26
 
27
class PageItem;
28
class PageItem_TextFrame;
29
class ScribusMainWindow;
30
class ScribusView;
31
 
32
 
33
// This class encapsulate the old code for mouse interaction from scribusview.cpp
34
 
35
class CanvasMode_EditGradient :  public CanvasMode
36
{      
37
public:
38
        CanvasMode_EditGradient(ScribusView* view);
39
 
40
        virtual void enterEvent(QEvent *);
41
        virtual void leaveEvent(QEvent *);
42
 
43
        virtual void activate(bool);
44
        virtual void deactivate(bool);
45
        virtual void mouseDoubleClickEvent(QMouseEvent *m);
46
        virtual void mouseReleaseEvent(QMouseEvent *m);
47
        virtual void mouseMoveEvent(QMouseEvent *m);
48
        virtual void mousePressEvent(QMouseEvent *m);
49
        virtual void drawControls(QPainter* p);
15839 fschmid 50
        void drawControlsGradientVectors(QPainter* psx, PageItem *currItem);
12770 jghali 51
 
52
private:
13880 jghali 53
 
54
        typedef enum
55
        {
56
                noPointDefined,
57
                useGradientStart,
14278 fschmid 58
                useGradientEnd,
14284 fschmid 59
                useGradientFocal,
14952 fschmid 60
                useGradientSkew,
61
                useControl1,
62
                useControl2,
63
                useControl3,
14981 fschmid 64
                useControl4,
65
                useControl5
13880 jghali 66
        } eGradientPoint;
67
 
12770 jghali 68
        inline bool GetItem(PageItem** pi);
69
 
12772 jghali 70
        double Mxp, Myp;
12770 jghali 71
        ScribusMainWindow* m_ScMW;
13880 jghali 72
        eGradientPoint m_gradientPoint;
12770 jghali 73
};
74
 
75
 
76
#endif