home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / FWPat.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.4 KB  |  120 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPat.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWPAT_H
  11. #define FWPAT_H
  12.  
  13. #ifndef FWSTDDEF_H
  14. #include "FWStdDef.h"
  15. #endif
  16.  
  17. #ifndef FWCOLOR_H
  18. #include "FWColor.h"
  19. #endif
  20.  
  21. #ifndef SLSHATTR_H
  22. #include "SLShAttr.h"
  23. #endif
  24.  
  25. #ifndef FWGRREF_H
  26. #include "FWGrRef.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. //    Forward Declarations
  31. //========================================================================================
  32.  
  33. class FW_CReadableStream;
  34. class FW_CWritableStream;
  35.  
  36. //========================================================================================
  37. //    CLASS FW_CPattern
  38. //========================================================================================
  39.  
  40. class FW_CPattern : public FW_TGrRefPtr<FW_HPattern>
  41. {
  42. public:
  43.  
  44.     FW_DECLARE_AUTO(FW_CPattern)
  45.         
  46.     FW_CPattern();
  47.     FW_CPattern(const FW_CPattern& other);
  48.     FW_CPattern(FW_HPattern rep);
  49.     FW_CPattern(const FW_BitPattern& bits);
  50.     FW_CPattern(const FW_PixelPattern& pixels, short nbColors, const FW_CColor* colorTable);
  51.     FW_CPattern(FW_PlatformColorPattern pattern);
  52.  
  53.     ~FW_CPattern();
  54.  
  55.     FW_CPattern& operator=(const FW_CPattern& other);        
  56.     FW_CPattern& operator=(const FW_BitPattern& bits);
  57.     
  58.     FW_Boolean operator==(const FW_CPattern& pattern) const;
  59.     FW_Boolean operator!=(const FW_CPattern& pattern) const;
  60.     
  61.     // ----- Delegation
  62.     FW_CPattern                Copy() const;
  63.     
  64.     FW_Boolean                IsEqual(const FW_CPattern& pattern) const;
  65.         
  66.     long                    GetRefCount() const;
  67.  
  68.     void                    Invert();
  69.  
  70.     void                    FlipHorizontally();
  71.     void                    FlipVertically();
  72.     
  73.     void                    ShiftUp();
  74.     void                    ShiftDown();
  75.     void                    ShiftLeft();
  76.     void                    ShiftRight();
  77.  
  78.     friend FW_CReadableStream& operator>>(FW_CReadableStream& stream, FW_CPattern& pattern);
  79.     friend FW_CWritableStream& operator<<(FW_CWritableStream& stream, const FW_CPattern& pattern);
  80. };
  81.  
  82. //----------------------------------------------------------------------------------------
  83. //    FW_CPattern::operator==
  84. //----------------------------------------------------------------------------------------
  85.  
  86. inline FW_Boolean FW_CPattern::operator==(const FW_CPattern& pattern) const
  87. {
  88.     return FW_PrivPattern_IsEqual(fRep, pattern.fRep);
  89. }
  90.         
  91. //----------------------------------------------------------------------------------------
  92. //    FW_CPattern::operator!=
  93. //----------------------------------------------------------------------------------------
  94.  
  95. inline FW_Boolean FW_CPattern::operator!=(const FW_CPattern& pattern) const
  96. {
  97.     return !FW_PrivPattern_IsEqual(fRep, pattern.fRep);
  98. }
  99.  
  100. //----------------------------------------------------------------------------------------
  101. //    FW_CPattern::IsEqual
  102. //----------------------------------------------------------------------------------------
  103.  
  104. inline FW_Boolean FW_CPattern::IsEqual(const FW_CPattern& pattern) const
  105. {
  106.     return FW_PrivPattern_IsEqual(fRep, pattern.fRep);
  107. }
  108.         
  109. //----------------------------------------------------------------------------------------
  110. //    FW_CPattern::GetRefCount
  111. //----------------------------------------------------------------------------------------
  112.  
  113. inline long FW_CPattern::GetRefCount() const
  114. {
  115.     return FW_PrivPattern_GetRefCount(fRep);
  116. }
  117.  
  118.  
  119. #endif
  120.