xref: /haiku/src/apps/icon-o-matic/transformable/TransformGradientBox.h (revision 239222b2369c39dc52df52b0a7cdd6cc0a91bc92)
1 /*
2  * Copyright 2006-2007, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Stephan Aßmus <superstippi@gmx.de>
7  */
8 #ifndef TRANSFORM_GRADIENT_BOX_H
9 #define TRANSFORM_GRADIENT_BOX_H
10 
11 
12 #include "TransformBox.h"
13 
14 
15 class CanvasView;
16 
17 namespace BPrivate {
18 namespace Icon {
19 	class Gradient;
20 	class Shape;
21 }
22 }
23 using namespace BPrivate::Icon;
24 
25 class TransformGradientBox : public TransformBox {
26  public:
27 								TransformGradientBox(CanvasView* view,
28 													 Gradient* gradient,
29 													 Shape* parent);
30 	virtual						~TransformGradientBox();
31 
32 	// Observer interface (Manipulator is an Observer)
33 	virtual	void				ObjectChanged(const Observable* object);
34 
35 	// TransformBox interface
36 	virtual	void				Update(bool deep = true);
37 
38 	virtual	void				TransformFromCanvas(BPoint& point) const;
39 	virtual	void				TransformToCanvas(BPoint& point) const;
40 	virtual	float				ZoomLevel() const;
41 	virtual	double				ViewSpaceRotation() const;
42 
43 	virtual	TransformCommand*	MakeCommand(const char* actionName,
44 											uint32 nameIndex);
45 
46 	// TransformGradientBox
47 			Command*			Perform();
48 			Command*			Cancel();
49  private:
50 			CanvasView*			fCanvasView;
51 
52 			Shape*				fShape;
53 			Gradient*			fGradient;
54 			int32				fCount;
55 
56 			// saves the transformable object transformation states
57 			// prior to this transformation
58 			double				fOriginals[matrix_size];
59 };
60 
61 #endif // TRANSFORM_GRADIENT_BOX_H
62 
63