home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / FWBndShp.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.2 KB  |  111 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWBndShp.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWBNDSHP_H
  11. #define FWBNDSHP_H
  12.  
  13. #ifndef FWSHAPE_H
  14. #include "FWShape.h"
  15. #endif
  16.  
  17. #ifndef FWRECT_H
  18. #include "FWRect.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. //    Forward Declarations
  23. //========================================================================================
  24.  
  25. class ODTransform;
  26.  
  27. //========================================================================================
  28. //    class FW_CBoundedShape
  29. //========================================================================================
  30.  
  31. class FW_CBoundedShape : public FW_CShape
  32. {
  33. public:
  34.     FW_DECLARE_CLASS
  35.     FW_DECLARE_AUTO(FW_CBoundedShape)
  36.     virtual ~ FW_CBoundedShape();        // autodest destructors must be public
  37.  
  38. //----------------------------------------------------------------------------------------
  39. //    Constructors/Destructors
  40. //
  41. protected:
  42.     FW_CBoundedShape(const FW_CRect& rect, 
  43.                      FW_ERenderVerbs renderVerb,
  44.                      const FW_CInk& ink,
  45.                      const FW_CStyle& style,
  46.                      const FW_CFont& font);
  47.  
  48.     FW_CBoundedShape(const FW_CBoundedShape& other);
  49.     FW_CBoundedShape(FW_CReadableStream& stream);
  50.     
  51. //----------------------------------------------------------------------------------------
  52. //    Operators
  53. //
  54. public:
  55.     FW_CBoundedShape&     operator=(const FW_CBoundedShape& other);
  56.     
  57. //----------------------------------------------------------------------------------------
  58. //    Inherited API
  59. //
  60. public:
  61.     //----- Hit Test -----
  62.     FW_Boolean            HitTest(FW_CGraphicContext& gc,
  63.                                 const FW_CPoint& test,
  64.                                 FW_Fixed tolerance) const;
  65.  
  66.     // ----- Transform -----
  67.     virtual void        Transform(Environment *ev, ODTransform* transform);
  68.     virtual void        InverseTransform(Environment *ev, ODTransform* transform);
  69.  
  70.     virtual void        MoveShape(FW_Fixed deltaX, FW_Fixed deltaY);
  71.     virtual void        MoveShapeTo(FW_Fixed x, FW_Fixed y);
  72.  
  73.     virtual void        Inset(FW_Fixed h, FW_Fixed v);
  74.  
  75.     // ----- Bounds -----
  76.     virtual void         GetBounds(FW_CGraphicContext& gc, FW_CRect& rect) const;
  77.  
  78.     // ----- Anchor Point -----
  79.     virtual FW_CPoint    GetAnchorPoint() const;
  80.     
  81.     // ----- Persistence -----
  82.     virtual void        Flatten(FW_CWritableStream& stream) const;
  83.  
  84. //----------------------------------------------------------------------------------------
  85. //    New API
  86. //
  87. public:
  88.     void                GetRectangle(FW_CRect& rect) const
  89.                             {rect = fRect;}    
  90.                             
  91.     void                SetRectangle(const FW_CRect& rect)
  92.                             {fRect = rect;}
  93.                             
  94.     void                SetRectangle(FW_Fixed left, FW_Fixed top, FW_Fixed right, FW_Fixed bottom)
  95.                             {fRect.Set(left, top, right, bottom);}
  96.                             
  97.     void                SetRectangle(const FW_CPoint& topLeft, const FW_CPoint& botRight)
  98.                             {fRect.Set(topLeft.x, topLeft.y, botRight.x, botRight.y);}
  99.                             
  100.     void                SetRectangle(const FW_CPoint& topLeft, FW_Fixed width, FW_Fixed height)
  101.                             {fRect.Set(topLeft, width, height);}
  102.     
  103. //----------------------------------------------------------------------------------------
  104. //    Data Members
  105. //
  106. protected:
  107.     FW_CRect            fRect;    
  108. };
  109.  
  110. #endif
  111.