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 "IconBuild.h" 13#include "TransformBox.h" 14 15 16class CanvasView; 17 18_BEGIN_ICON_NAMESPACE 19 class Gradient; 20 class Shape; 21_END_ICON_NAMESPACE 22 23_USING_ICON_NAMESPACE 24 25 26class TransformGradientBox : public TransformBox { 27 public: 28 TransformGradientBox(CanvasView* view, 29 Gradient* gradient, 30 Shape* parent); 31 virtual ~TransformGradientBox(); 32 33 // Observer interface (Manipulator is an Observer) 34 virtual void ObjectChanged(const Observable* object); 35 36 // TransformBox interface 37 virtual void Update(bool deep = true); 38 39 virtual void TransformFromCanvas(BPoint& point) const; 40 virtual void TransformToCanvas(BPoint& point) const; 41 virtual float ZoomLevel() const; 42 virtual double ViewSpaceRotation() const; 43 44 virtual TransformCommand* MakeCommand(const char* actionName, 45 uint32 nameIndex); 46 47 // TransformGradientBox 48 Command* Perform(); 49 Command* Cancel(); 50 private: 51 CanvasView* fCanvasView; 52 53 Shape* fShape; 54 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