home *** CD-ROM | disk | FTP | other *** search
- #ifndef FWICONSH_H
- #define FWICONSH_H
-
- //========================================================================================
- //
- // File: FWIconSh.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWBNDSHP_H
- #include "FWBndShp.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWICON_H
- #include "FWIcon.h"
- #endif
-
- #ifndef FWGCONST_H
- #include "FWGConst.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CGraphicContext;
-
- //========================================================================================
- // class FW_CIconShape
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CIconShape : public FW_CBoundedShape
- {
- public:
- FW_DECLARE_CLASS
-
- //---------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
-
- enum
- {
- kDefaultOptions = FW_kIconAlignLeft | FW_kIconAlignTop
- };
-
- FW_CIconShape(const FW_PIcon& icon,
- const FW_CRect& rect,
- FW_RenderIconOptions options = kDefaultOptions);
-
- FW_CIconShape(const FW_CIconShape& other);
- FW_CIconShape(FW_CReadableStream& archive);
-
- virtual ~FW_CIconShape();
-
- //----------------------------------------------------------------------------------------
- // Operators
- //
- public:
- FW_CIconShape& operator=(const FW_CIconShape& other);
-
- //---------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Rendering -----
- virtual void Render(FW_CGraphicContext& gc) const;
-
- // ----- Copying -----
- virtual FW_CShape* Copy() const;
-
- // ----- Flatten -----
- virtual void Flatten(FW_CWritableStream& archive) const;
-
- //---------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Rendering -----
- static void RenderIcon(FW_CGraphicContext& gc,
- const FW_PIcon& icon,
- const FW_CRect& rect,
- FW_RenderIconOptions options = kDefaultOptions);
-
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& archive);
-
- // ----- Geometry -----
- void GetGeometry(FW_PIcon& icon,
- FW_RenderIconOptions options,
- FW_CRect& bounds) const;
- void SetGeometry(const FW_PIcon& icon,
- FW_RenderIconOptions options,
- const FW_CRect& bounds);
-
- //---------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_PIcon fIcon;
- FW_RenderIconOptions fOptions;
- };
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif // FWICONSH_H
-