Scribus
Open source desktop publishing at your fingertips
canvasmode_editgradient.h
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 
36 {
37 public:
38  explicit CanvasMode_EditGradient(ScribusView* view);
39  virtual ~CanvasMode_EditGradient() {}
40 
41  virtual void enterEvent(QEvent *);
42  virtual void leaveEvent(QEvent *);
43 
44  virtual void activate(bool);
45  virtual void deactivate(bool);
46  virtual void mouseDoubleClickEvent(QMouseEvent *m);
47  virtual void mouseReleaseEvent(QMouseEvent *m);
48  virtual void mouseMoveEvent(QMouseEvent *m);
49  virtual void mousePressEvent(QMouseEvent *m);
50  virtual void drawControls(QPainter* p);
51  void drawControlsGradientVectors(QPainter* psx, PageItem *currItem);
52 
53 private:
54 
55  typedef enum
56  {
57  noPointDefined,
58  useGradientStart,
59  useGradientEnd,
60  useGradientFocal,
61  useGradientSkew,
62  useControl1,
63  useControl2,
64  useControl3,
65  useControl4,
66  useControl5
67  } eGradientPoint;
68 
69  inline bool GetItem(PageItem** pi);
70 
71  double Mxp, Myp;
72  ScribusMainWindow* m_ScMW;
73  eGradientPoint m_gradientPoint;
74 
75  //save of previous state
76  double OldGrStartX;
77  double OldGrStartY;
78  double OldGrEndX;
79  double OldGrEndY;
80  double OldGrFocalX;
81  double OldGrFocalY;
82  double OldGrScale;
83  double OldGrSkew;
84  FPoint OldGrControl1;
85  FPoint OldGrControl2;
86  FPoint OldGrControl3;
87  FPoint OldGrControl4;
88  FPoint OldGrControl5;
89  double OldGrStrokeStartX;
90  double OldGrStrokeStartY;
91  double OldGrStrokeEndX;
92  double OldGrStrokeEndY;
93  double OldGrStrokeFocalX;
94  double OldGrStrokeFocalY;
95  double OldGrStrokeScale;
96  double OldGrStrokeSkew;
97  double OldGrMaskStartX;
98  double OldGrMaskStartY;
99  double OldGrMaskEndX;
100  double OldGrMaskEndY;
101  double OldGrMaskFocalX;
102  double OldGrMaskFocalY;
103  double OldGrMaskScale;
104  double OldGrMaskSkew;
105 };
106 
107 
108 #endif
Definition: pageitem_textframe.h:45
virtual void activate(bool)
Definition: canvasmode_editgradient.cpp:245
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
Definition: canvasmode_editgradient.h:35
A point with floating point precision.
Definition: fpoint.h:43
virtual void drawControls(QPainter *p)
Definition: canvasmode_editgradient.cpp:69
Definition: canvasmode.h:72
virtual void deactivate(bool)
Definition: canvasmode_editgradient.cpp:263
Definition: pageitem.h:92
Definition: scribusview.h:87