1 /* 2 * Copyright 2006-2007, 2023, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 * Zardshard 8 */ 9 #ifndef PATH_SOURCE_SHAPE_H 10 #define PATH_SOURCE_SHAPE_H 11 12 13 #include "IconBuild.h" 14 #include "Shape.h" 15 16 17 class BMessage; 18 19 20 _BEGIN_ICON_NAMESPACE 21 22 23 class PathContainer; 24 class PropertyObject; 25 class Style; 26 27 28 class PathSourceShape : public _ICON_NAMESPACE Shape { 29 public: 30 enum { 31 archive_code = 'shps' 32 }; 33 34 PathSourceShape(::Style* style); 35 PathSourceShape(const PathSourceShape& other); 36 virtual ~PathSourceShape(); 37 38 // IconObject interface 39 virtual status_t Unarchive(BMessage* archive); 40 #ifdef ICON_O_MATIC 41 virtual status_t Archive(BMessage* into, 42 bool deep = true) const; 43 44 virtual PropertyObject* MakePropertyObject() const; 45 virtual bool SetToPropertyObject( 46 const PropertyObject* object); 47 #else 48 inline void Notify() {} 49 #endif // ICON_O_MATIC 50 51 // PathSourceShape 52 virtual status_t InitCheck() const; 53 virtual PathSourceShape* Clone() const 54 { return new PathSourceShape(*this); } 55 56 void SetStyle(::Style* style) 57 { Shape::SetStyle(style); } 58 inline ::Style* Style() const 59 { return Shape::Style(); } 60 61 void SetMinVisibilityScale(float scale); 62 float MinVisibilityScale() const 63 { return fMinVisibilityScale; } 64 void SetMaxVisibilityScale(float scale); 65 float MaxVisibilityScale() const 66 { return fMaxVisibilityScale; } 67 68 virtual bool Visible(float scale) const; 69 70 private: 71 float fMinVisibilityScale; 72 float fMaxVisibilityScale; 73 }; 74 75 76 _END_ICON_NAMESPACE 77 78 79 #endif // PATH_SOURCE_SHAPE_H 80