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 47 // TransformGradientBox 48 Command* Perform(); 49 Command* Cancel(); 50 private: 51 CanvasView* fCanvasView; 52 53 Shape* fShape; 54 BReference<Gradient> fGradient; 55 int32 fCount; 56 57 // saves the transformable object transformation states 58 // prior to this transformation 59 double fOriginals[matrix_size]; 60 }; 61 62 #endif // TRANSFORM_GRADIENT_BOX_H 63 64