home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 4.6 KB | 185 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWStyle.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWSTYLE_H
- #define FWSTYLE_H
-
- #ifndef FWGRDEF_H
- #include "FWGrDef.h"
- #endif
-
- #ifndef FWGROBJ_H
- #include "FWGrObj.h"
- #endif
-
- #ifndef FWGConst_H
- #include "FWGConst.h"
- #endif
-
- #ifndef FWPAT_H
- #include "FWPat.h"
- #endif
-
- #ifndef FWGRGLOB_H
- #include "FWGrGlob.h"
- #endif
-
- #ifndef FWFXMATH_H
- #include "FWFxMath.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWSTDDEF_H
- #include <FWStdDef.h>
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef _ODTYPES_
- #include <ODTypes.h>
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Class Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CStyleRep;
- class FW_CLASS_ATTR ODTransform;
- class FW_CLASS_ATTR FW_CGraphicDevice;
-
- //========================================================================================
- // CLASS FW_PStyle
- //========================================================================================
-
- class FW_CLASS_ATTR FW_PStyle : public FW_CGraphicCountedPtr
- {
- public:
- FW_DECLARE_CLASS
-
- public:
- FW_PStyle();
- virtual ~ FW_PStyle();
-
- FW_PStyle(FW_CFixed penSize, FW_EStyleDash dash = FW_kSolidLine);
- FW_PStyle(FW_CFixed penSize, const FW_PPattern& pattern);
-
- FW_PStyle(const FW_PStyle& other);
- FW_PStyle& operator=(const FW_PStyle& other);
-
- FW_PStyle(FW_EStandardStyles std);
- FW_PStyle& operator=(FW_EStandardStyles std);
-
- FW_CStyleRep* operator->();
- const FW_CStyleRep* operator->() const;
-
- };
-
- //----------------------------------------------------------------------------------------
- // FW_PStyle::operator->
- //----------------------------------------------------------------------------------------
- inline FW_CStyleRep* FW_PStyle::operator->()
- {
- return (FW_CStyleRep*)GetRep();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PStyle::operator->
- //----------------------------------------------------------------------------------------
- inline const FW_CStyleRep* FW_PStyle::operator->() const
- {
- return (const FW_CStyleRep*)GetRep();
- }
-
- //========================================================================================
- // class FW_CStyleRep
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CStyleRep : public FW_CGraphicCountedPtrRep
- {
- friend class FW_CLASS_ATTR FW_PStyle;
-
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CStyleRep(FW_CFixed penSize, FW_EStyleDash dash, const FW_PPattern& pattern);
-
- FW_CStyleRep& operator=(const FW_CStyleRep& otherRep);
-
- virtual ~FW_CStyleRep();
-
- //----------------------------------------------------------------------------------------
- // Memory management
- //
- public:
- void* operator new(size_t size);
- void operator delete(void* p);
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Flatten -----
- virtual void Flatten(FW_CWritableStream& archive) const;
-
- // ----- Equal -----
- virtual FW_Boolean IsEqual(const FW_CGraphicCountedPtrRep* other) const;
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Copying -----
- FW_PStyle Copy() const;
-
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& archive);
-
- // ----- Accessors -----
- void SetPenSize(FW_CFixed penSize)
- {fPenSize = penSize;}
- FW_CFixed GetPenSize() const
- {return fPenSize;}
-
- void SetPattern(const FW_PPattern& pattern)
- {fPattern = pattern;}
- FW_PPattern& GetPattern()
- {return fPattern;}
- const FW_PPattern& GetPattern() const
- {return fPattern;}
- FW_PPattern& GetUnSharedPattern();
-
- void SetDashStyle(FW_EStyleDash dash)
- { fDash = dash; }
- FW_EStyleDash GetDashStyle() const
- { return fDash; }
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CFixed fPenSize;
- FW_EStyleDash fDash;
- FW_PPattern fPattern;
- };
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-