home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 5.7 KB | 205 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWPicShp.cpp
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include "FWOS.hpp"
-
- #ifndef FWPICSHP_H
- #include "FWPicShp.h"
- #endif
-
- #ifndef FWGC_H
- #include "FWGC.h"
- #endif
-
- #ifndef FWGRGLOB_H
- #include "FWGrGlob.h"
- #endif
-
- #ifndef FWBMPSHP_H
- #include "FWBmpShp.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWRASTER_H
- #include "FWRaster.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWSTREAM_H
- #include "FWStream.h"
- #endif
-
- #ifndef FWDEBUG_H
- #include "FWDebug.h"
- #endif
-
- #ifndef FWMEMORY_H
- #include "FWMemory.h"
- #endif
-
- //========================================================================================
- // RunTime Info
- //========================================================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- #ifdef FW_BUILD_MAC
- #pragma segment FWGraphics_PictureShape
- #endif
-
- FW_DEFINE_CLASS_M1(FW_CPictureShape, FW_CBoundedShape)
-
- FW_REGISTER_ARCHIVABLE_CLASS(FW_LPictureShape, FW_CPictureShape, FW_CPictureShape::Read, FW_CShape::Write)
-
- //========================================================================================
- // class FW_CPictureShape
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::FW_CPictureShape
- //----------------------------------------------------------------------------------------
-
- FW_CPictureShape::FW_CPictureShape(FW_PPicture picture, const FW_CRect& rect) :
- FW_CBoundedShape(rect, FW_kFill, FW_kNormalInk, FW_kNormalStyle, FW_kNormalFont),
- fPicture(picture)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::FW_CPictureShape
- //----------------------------------------------------------------------------------------
-
- FW_CPictureShape::FW_CPictureShape(const FW_CPictureShape& other) :
- FW_CBoundedShape(other),
- fPicture(other.fPicture)
- {
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::FW_CPictureShape
- //----------------------------------------------------------------------------------------
-
- FW_CPictureShape::FW_CPictureShape(FW_CReadableStream& archive) :
- FW_CBoundedShape(archive),
- fPicture()
- {
- archive >> fPicture;
-
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::~FW_CPictureShape
- //----------------------------------------------------------------------------------------
-
- FW_CPictureShape::~FW_CPictureShape()
- {
- FW_START_DESTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::operator=
- //----------------------------------------------------------------------------------------
-
- FW_CPictureShape& FW_CPictureShape::operator=(const FW_CPictureShape& other)
- {
- if (this != &other)
- {
- FW_CBoundedShape::operator=(other);
-
- fPicture = other.fPicture;
- }
-
- return *this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::Render
- //----------------------------------------------------------------------------------------
-
- void FW_CPictureShape::Render(FW_CGraphicContext& gc) const
- {
- gc.GetRasterizer()->RenderPicture(gc,
- fPicture,
- fRect,
- GetRenderVerb());
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::RenderPicture
- //----------------------------------------------------------------------------------------
-
- void FW_CPictureShape::RenderPicture(FW_CGraphicContext& gc,
- FW_PPicture picture,
- const FW_CRect& dstRect)
- {
- gc.GetRasterizer()->RenderPicture(gc,
- picture,
- dstRect,
- FW_kFill);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::GetGeometry
- //----------------------------------------------------------------------------------------
-
- void FW_CPictureShape::GetGeometry(FW_PPicture& picture, FW_CRect& dstRect) const
- {
- picture = fPicture;
- dstRect = fRect;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::SetGeometry
- //----------------------------------------------------------------------------------------
-
- void FW_CPictureShape::SetGeometry(const FW_PPicture& picture, const FW_CRect& dstRect)
- {
- fPicture = picture;
- fRect = dstRect;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::Flatten
- //----------------------------------------------------------------------------------------
-
- void FW_CPictureShape::Flatten(FW_CWritableStream& archive) const
- {
- FW_CBoundedShape::Flatten(archive);
-
- fPicture->Flatten(archive);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::Copy
- //----------------------------------------------------------------------------------------
-
- FW_CShape* FW_CPictureShape::Copy() const
- {
- return FW_NEW(FW_CPictureShape, (*this));
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CPictureShape::Read
- //----------------------------------------------------------------------------------------
-
- void* FW_CPictureShape::Read(FW_CReadableStream& archive)
- {
- return FW_NEW(FW_CPictureShape, (archive));
- }
-
-