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 #include "IconBuild.h" 12 #include "TransformBox.h" 13 14 #include <Referenceable.h> 15 16 17 class CanvasView; 18 19 _BEGIN_ICON_NAMESPACE 20 class Gradient; 21 class Shape; 22 _END_ICON_NAMESPACE 23 24 _USING_ICON_NAMESPACE 25 26 27 class TransformGradientBox : public TransformBox { 28 public: 29 TransformGradientBox(CanvasView* view, 30 Gradient* gradient, 31 Shape* parent); 32 virtual ~TransformGradientBox(); 33 34 // Observer interface (Manipulator is an Observer) 35 virtual void ObjectChanged(const Observable* object); 36 37 // TransformBox interface 38 virtual void Update(bool deep = true); 39 40 virtual void TransformFromCanvas(BPoint& point) const; 41 virtual void TransformToCanvas(BPoint& point) const; 42 virtual float ZoomLevel() const; 43 virtual double ViewSpaceRotation() const; 44 45 virtual TransformCommand* MakeCommand(const char* actionName, 46 uint32 nameIndex); 47 48 // TransformGradientBox 49 Command* Perform(); 50 Command* Cancel(); 51 private: 52 CanvasView* fCanvasView; 53 54 Shape* fShape; 55 BReference<Gradient> fGradient; 56 int32 fCount; 57 58 // saves the transformable object transformation states 59 // prior to this transformation 60 double fOriginals[matrix_size]; 61 }; 62 63 #endif // TRANSFORM_GRADIENT_BOX_H 64 65