Subversion Repositories Scribus

Rev

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

Rev Author Line No. Line
6129 fschmid 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
#ifndef CURVEWIDGET_H
8
#define CURVEWIDGET_H
9
 
10
#include <qvariant.h>
11
#include <qpixmap.h>
12
#include <qwidget.h>
13
#include "fpointarray.h"
14
#include "scribusapi.h"
15
 
16
class QVBoxLayout;
17
class QHBoxLayout;
18
class QGridLayout;
19
class QSpacerItem;
20
class QPushButton;
6193 fschmid 21
class QToolButton;
6129 fschmid 22
class QLabel;
23
 
24
class SCRIBUS_API KCurve : public QWidget
25
{
26
        Q_OBJECT
27
 
28
public:
29
        KCurve(QWidget *parent);
30
        virtual ~KCurve();
31
        void setPixmap(QPixmap pix);
32
 
33
protected:
34
        void paintEvent(QPaintEvent *);
35
        void keyPressEvent(QKeyEvent *);
36
        void mousePressEvent (QMouseEvent * e);
37
        void mouseReleaseEvent ( QMouseEvent * e );
38
        void mouseMoveEvent ( QMouseEvent * e );
39
        void leaveEvent ( QEvent * );
40
 
41
public:
42
        double getCurveValue(double x);
43
        FPointArray getCurve();
44
        void setCurve(FPointArray inlist);
6131 fschmid 45
        void resetCurve();
6193 fschmid 46
        void setLinear(bool setter);
47
        bool isLinear();
6129 fschmid 48
 
49
signals:
50
        void modified();
51
 
52
private:
53
        double m_leftmost;
54
        double m_rightmost;
55
        FPoint m_grab_point;
56
        int m_pos;
57
        bool m_dragging;
6193 fschmid 58
        bool m_linear;
6129 fschmid 59
        double m_grabOffsetX;
60
        double m_grabOffsetY;
61
        FPointArray m_points;
6131 fschmid 62
        FPointArray m_points_back;
6129 fschmid 63
        QPixmap *m_pix;
64
};
65
 
66
class SCRIBUS_API CurveWidget : public QWidget
67
{
68
        Q_OBJECT
69
 
70
public:
71
        CurveWidget(QWidget* parent);
72
        ~CurveWidget() {};
6193 fschmid 73
        void setLinear(bool setter);
6129 fschmid 74
        QPushButton* invertButton;
75
        QPushButton* resetButton;
6193 fschmid 76
        QToolButton *linearButton;
6129 fschmid 77
        QPushButton* loadButton;
78
        QPushButton* saveButton;
79
        KCurve* cDisplay;
80
 
81
private slots:
82
        void doInvert();
83
        void doReset();
6193 fschmid 84
        void doLinear();
6168 fschmid 85
        void doLoad();
86
        void doSave();
6129 fschmid 87
 
88
protected:
89
        QHBoxLayout* CurveWidgetLayout;
90
        QVBoxLayout* layout1;
91
        QSpacerItem* spacer1;
92
 
93
protected slots:
94
        virtual void languageChange();
95
};
96
 
97
#endif // CURVEWIDGET_H