home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 4.6 KB | 153 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWBndShp.cpp
- // Release Version: $ 1.0d1 $
- //
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWBNDSHP_H
- #include "FWBndShp.h"
- #endif
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- #ifndef FWGC_H
- #include "FWGC.h"
- #endif
-
- #ifndef FWDFAULT_H
- #include "FWDFault.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef _TRNSFORM_
- #include <Trnsform.h>
- #endif
-
- //==============================================================================
- // •• RunTime Info
- //==============================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwgraphx
- #endif
-
- //==============================================================================
- // •• class FW_CBoundedShapeRep
- //==============================================================================
-
- //------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::FW_CBoundedShapeRep
- //------------------------------------------------------------------------------
-
- FW_CBoundedShapeRep::FW_CBoundedShapeRep() :
- fRect(0, 0, 0, 0)
- {
- }
-
- //------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::FW_CBoundedShapeRep
- //------------------------------------------------------------------------------
-
- FW_CBoundedShapeRep::FW_CBoundedShapeRep(const FW_SDefaultProperties& defaultProperties,
- const FW_CRect& rect) :
- FW_CShapeRep(defaultProperties),
- fRect(rect)
- {
- }
-
- //------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::~FW_CBoundedShapeRep
- //------------------------------------------------------------------------------
-
- FW_CBoundedShapeRep::~FW_CBoundedShapeRep()
- {
- }
-
- //------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::Transform
- //------------------------------------------------------------------------------
-
- void FW_CBoundedShapeRep::Transform(XMPTransform* transform)
- {
- fRect[FW_kTopLeft] = transform->TransformPoint(fRect[FW_kTopLeft]);
- fRect[FW_kBotRight] = transform->TransformPoint(fRect[FW_kBotRight]);
- }
-
- //------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::GetShapeBounds
- //------------------------------------------------------------------------------
-
- FW_CRect FW_CBoundedShapeRep::GetShapeBounds() const
- {
- return fRect;
- }
-
- //------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::InverseTransform
- //------------------------------------------------------------------------------
-
- void FW_CBoundedShapeRep::InverseTransform(XMPTransform* transform)
- {
- fRect[FW_kTopLeft] = transform->InvertPoint(fRect[FW_kTopLeft]);
- fRect[FW_kBotRight] = transform->InvertPoint(fRect[FW_kBotRight]);
- }
-
- //------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::MoveShape
- //------------------------------------------------------------------------------
-
- void FW_CBoundedShapeRep::MoveShape(XMPCoordinate deltaX, XMPCoordinate deltaY)
- {
- fRect.left += deltaX;
- fRect.top += deltaY;
- fRect.right += deltaX;
- fRect.bottom += deltaY;
- }
-
- //------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::MoveShapeTo
- //------------------------------------------------------------------------------
-
- void FW_CBoundedShapeRep::MoveShapeTo(XMPCoordinate x, XMPCoordinate y)
- {
- fRect.right += x - fRect.left;
- fRect.bottom += y - fRect.top;
- fRect.left = x;
- fRect.top = y;
- }
-
- //------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::HitTest
- //------------------------------------------------------------------------------
-
- FW_HitTestPart FW_CBoundedShapeRep::HitTest(const FW_CPoint& test) const
- {
- return FW_kOutside;
- }
-
- //----------------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::Flatten
- //----------------------------------------------------------------------------------------
-
- void FW_CBoundedShapeRep::Flatten(FW_CWritableStream& stream)
- {
- fRect.Flatten(stream);
- }
-
- //----------------------------------------------------------------------------------------
- // • FW_CBoundedShapeRep::Unflatten
- //----------------------------------------------------------------------------------------
-
- void FW_CBoundedShapeRep::Unflatten(FW_CReadableStream& stream)
- {
- fRect.Unflatten(stream);
- }
-