home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-08-16 | 1.9 KB | 78 lines | [TEXT/CWIE] |
- // Copyright © 1995-96 Apple Computer, Inc. All rights reserved.
- // Release Version: $ ODF 1 $
-
- //==========================================================================
- #ifndef PIZZA_H
- #include "Pizza.h" // CPizza
- #endif
-
- #ifndef FWBARRAY_H
- #include "FWBArray.h"
- #endif
-
- // ----- OSLayer Includes -----
- #ifndef FWOVLSHP_H
- #include "FWOvlShp.h" // FW_COvalShape
- #endif
-
- //=== RunTime Info ========================================================
- FW_DEFINE_CLASS_M0(CPizza)
-
- const FW_ClassTypeConstant LPizza = FW_TYPE_CONSTANT('p','i','z','a');
- FW_REGISTER_ARCHIVABLE_CLASS(LPizza, CPizza, CPizza::Read, 0, 0, CPizza::Write)
-
- //==========================================================================
- CPizza::CPizza(FW_CRect bounds)
- : fBounds(bounds)
- {
- }
-
- //--------------------------------------------------------------------------
- CPizza::~CPizza()
- {
- }
-
- //--------------------------------------------------------------------------
- void
- CPizza::Draw(FW_CGraphicContext& gc)
- {
- FW_COvalShape::RenderOval(gc, fBounds, FW_kFill, FW_kRGBYellow);
- FW_COvalShape::RenderOval(gc, fBounds, FW_kFrame);
- }
-
- //--------------------------------------------------------------------------
- FW_CRect
- CPizza::GetBounds()
- {
- return fBounds;
- }
-
- //--------------------------------------------------------------------------
- void
- CPizza::Write(FW_CWritableStream& stream, FW_ClassTypeConstant type, const void *object)
- {
- FW_UNUSED(type);
- ((CPizza*)object)->Flatten(stream);
- }
-
- //--------------------------------------------------------------------------
- void
- CPizza::Flatten(FW_CWritableStream& stream)
- {
- stream << fBounds;
- }
-
- //--------------------------------------------------------------------------
- void*
- CPizza::Read(FW_CReadableStream& stream, FW_ClassTypeConstant type)
- {
- FW_UNUSED(type);
- return new CPizza(stream);
- }
-
- //--------------------------------------------------------------------------
- CPizza::CPizza(FW_CReadableStream& stream)
- {
- stream >> fBounds;
- }
-