home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.2 KB | 107 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWRecShp.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWRECSHP_H
- #define FWRECSHP_H
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- #ifndef FWBNDSHP_H
- #include "FWBndShp.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CGraphicContext;
-
- //=======================================================================================
- // class FW_CRectShape
- //=======================================================================================
-
- class FW_CRectShape : public FW_CBoundedShape
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(FW_CRectShape)
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CRectShape();
- FW_CRectShape(const FW_CRect& rect,
- FW_ERenderVerbs renderVerb,
- const FW_CInk& ink = FW_kNormalInk,
- const FW_CStyle& style = FW_kNormalStyle);
-
- FW_CRectShape(const FW_CRectShape& other);
- FW_CRectShape(FW_CReadableStream& stream);
-
- virtual ~ FW_CRectShape();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Hit Testing -----
- virtual FW_Boolean HitTest(FW_CGraphicContext& gc,
- const FW_CPoint& test,
- FW_Fixed tolerance) const;
-
- // ----- Copying -----
- virtual FW_CShape* Copy() const;
-
- // ----- Rendering -----
- virtual void Render(FW_CGraphicContext& gc) const;
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Geometry -----
- void SetGeometry(const FW_CRect& rect);
- void GetGeometry(FW_CRect& rect) const;
-
- // ----- Static rendering method -----
- static void RenderRect(FW_CGraphicContext& gc,
- const FW_CRect& rect,
- FW_ERenderVerbs renderVerb,
- const FW_CInk& ink = FW_kNormalInk,
- const FW_CStyle& style = FW_kNormalStyle);
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
-
- };
-
- //=======================================================================================
- // Inlines
- //=======================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CRectShape::GetGeometry
- //----------------------------------------------------------------------------------------
- inline void FW_CRectShape::GetGeometry(FW_CRect& rect) const
- {
- rect = fRect;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CRectShape::SetGeometry
- //----------------------------------------------------------------------------------------
- inline void FW_CRectShape::SetGeometry(const FW_CRect& rect)
- {
- fRect = rect;
- }
-
- #endif
-