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 / FWInk.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  5.3 KB  |  172 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWInk.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWINK_H
  11. #define FWINK_H
  12.  
  13. #ifndef FWSTDDEF_H
  14. #include "FWStdDef.h"
  15. #endif
  16.  
  17. #ifndef FWGCONST_H
  18. #include "FWGConst.h"
  19. #endif
  20.  
  21. #ifndef FWCOLOR_H
  22. #include "FWColor.h"
  23. #endif
  24.  
  25. #ifndef SLSHATTR_H
  26. #include "SLShAttr.h"
  27. #endif
  28.  
  29. #ifndef FWGRREF_H
  30. #include "FWGrRef.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward class declarations
  35. //========================================================================================
  36.  
  37. class FW_CReadableStream;
  38. class FW_CWritableStream;
  39.  
  40. //========================================================================================
  41. //    CLASS FW_CInk
  42. //========================================================================================
  43.  
  44. class FW_CInk : public FW_TGrRefPtr<FW_HInk>
  45. {
  46. public:
  47.     FW_DECLARE_AUTO(FW_CInk)
  48.  
  49.     ~FW_CInk();
  50.  
  51.     FW_CInk(const FW_SColor& foreColor, 
  52.             const FW_SColor& backColor = FW_kRGBWhite, 
  53.             FW_TransferModes transferMode = FW_kCopy);
  54.     FW_CInk(FW_TransferModes transferMode);
  55.  
  56.     FW_CInk(const FW_CInk& other);
  57.     FW_CInk& operator=(const FW_CInk& other);
  58.  
  59.     FW_CInk(FW_EStandardInks std = FW_kNormalInk);
  60.     FW_CInk& operator=(FW_EStandardInks std);
  61.     
  62.     FW_CInk Copy() const;
  63.  
  64.     friend FW_CWritableStream& operator << (FW_CWritableStream& stream, const FW_CInk& ink);
  65.     friend FW_CReadableStream& operator >> (FW_CReadableStream& stream, FW_CInk& ink);
  66.  
  67.     // ----- Delegation
  68.  
  69.     long                GetRefCount() const;
  70.  
  71.     // Attributes
  72.  
  73.     FW_CColor            GetForeColor() const;
  74.     void                GetForeColor(FW_CColor& color) const;
  75.     FW_CColor            GetBackColor() const;
  76.     void                GetBackColor(FW_CColor& color) const;
  77.     FW_TransferModes    GetTransferMode() const;
  78.     FW_Boolean            IsEqual(const FW_CInk& ink) const;
  79.  
  80.     // Operations
  81.  
  82.     void                SetForeColor(FW_SColor color);
  83.     void                SetBackColor(FW_SColor color);
  84.     void                SetTransferMode(FW_TransferModes mode);
  85. };
  86.  
  87. //========================================================================================
  88. //    Inlines
  89. //========================================================================================
  90.  
  91. //----------------------------------------------------------------------------------------
  92. //    FW_CInk::GetRefCount
  93. //----------------------------------------------------------------------------------------
  94. inline long    FW_CInk::GetRefCount() const
  95. {
  96.     return FW_PrivInk_GetRefCount(fRep);
  97. }
  98.  
  99. //----------------------------------------------------------------------------------------
  100. //    FW_CInk::GetForeColor
  101. //----------------------------------------------------------------------------------------
  102. inline FW_CColor FW_CInk::GetForeColor() const
  103. {
  104.     return FW_PrivInk_GetForeColor(fRep);
  105. }
  106.  
  107. //----------------------------------------------------------------------------------------
  108. //    FW_CInk::GetForeColor
  109. //----------------------------------------------------------------------------------------
  110. inline void    FW_CInk::GetForeColor(FW_CColor& color) const
  111. {
  112.     color = FW_PrivInk_GetForeColor(fRep);
  113. }
  114.  
  115. //----------------------------------------------------------------------------------------
  116. //    FW_CInk::GetBackColor
  117. //----------------------------------------------------------------------------------------
  118. inline FW_CColor FW_CInk::GetBackColor() const
  119. {
  120.     return FW_PrivInk_GetBackColor(fRep);
  121. }
  122.  
  123. //----------------------------------------------------------------------------------------
  124. //    FW_CInk::GetBackColor
  125. //----------------------------------------------------------------------------------------
  126. inline void    FW_CInk::GetBackColor(FW_CColor& color) const
  127. {
  128.     color = FW_PrivInk_GetBackColor(fRep);
  129. }
  130.  
  131. //----------------------------------------------------------------------------------------
  132. //    FW_CInk::GetTransferMode
  133. //----------------------------------------------------------------------------------------
  134. inline FW_TransferModes    FW_CInk::GetTransferMode() const
  135. {
  136.     return FW_PrivInk_GetTransferMode(fRep);
  137. }
  138.  
  139. //----------------------------------------------------------------------------------------
  140. //    FW_CInk::IsEqual
  141. //----------------------------------------------------------------------------------------
  142. inline FW_Boolean FW_CInk::IsEqual(const FW_CInk& ink) const
  143. {
  144.     return FW_PrivInk_IsEqual(fRep, ink.fRep);
  145. }
  146.  
  147. //----------------------------------------------------------------------------------------
  148. //    FW_CInk::SetForeColor
  149. //----------------------------------------------------------------------------------------
  150. inline void    FW_CInk::SetForeColor(FW_SColor color)
  151. {
  152.     FW_PrivInk_SetForeColor(fRep, color);
  153. }
  154.  
  155. //----------------------------------------------------------------------------------------
  156. //    FW_CInk::SetBackColor
  157. //----------------------------------------------------------------------------------------
  158. inline void    FW_CInk::SetBackColor(FW_SColor color)
  159. {
  160.     FW_PrivInk_SetBackColor(fRep, color);
  161. }
  162.  
  163. //----------------------------------------------------------------------------------------
  164. //    FW_CInk::SetTransferMode
  165. //----------------------------------------------------------------------------------------
  166. inline void    FW_CInk::SetTransferMode(FW_TransferModes mode)
  167. {
  168.     FW_PrivInk_SetTransferMode(fRep, mode);
  169. }
  170.  
  171. #endif
  172.