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 / Draw / Sources / PatFrame.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.7 KB  |  130 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                PatFrame.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef PATFRAME_H
  13. #define PATFRAME_H
  14.  
  15. #ifndef UTILS_H
  16. #include "Utils.h"
  17. #endif
  18.  
  19. #ifndef FLOATFRM_H
  20. #include "FloatFrm.h"
  21. #endif
  22.  
  23. // ----- OS Layer -----
  24.  
  25. #ifndef FWNOTIFR_H
  26. #include "FWNotifr.h"
  27. #endif
  28.  
  29. #ifndef FWINTERE_H
  30. #include "FWIntere.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. // Forward Declaration
  35. //========================================================================================
  36.  
  37. class FW_CColor;
  38. class FW_CMouseEvent;
  39. class CPatternFrame;
  40.  
  41. //========================================================================================
  42. // Constants
  43. //========================================================================================
  44.  
  45. const FW_Fixed kPatternCellSize = FW_IntToFixed(24);
  46.  
  47. //========================================================================================
  48. // CPatternChangedInterest
  49. //========================================================================================
  50.  
  51. class CPatternChangedInterest: public FW_CInterest
  52. {
  53. public:        
  54.     CPatternChangedInterest(FW_MNotifier* notifier);
  55.     virtual ~CPatternChangedInterest();
  56. };
  57.  
  58. //========================================================================================
  59. // CPatternChangedNotification
  60. //========================================================================================
  61.  
  62. class CPatternChangedNotification : public FW_CNotification
  63. {
  64. //----------------------------------------------------------------------------------------
  65. // Initialization/destruction
  66. //
  67. public:        
  68.     CPatternChangedNotification(const FW_CInterest& interest, 
  69.                                 short patternIndex, 
  70.                                 FW_ERenderVerbs renderVerb);
  71.     virtual ~CPatternChangedNotification();
  72.  
  73. //----------------------------------------------------------------------------------------
  74. // New API
  75. //
  76. public:
  77.     short                    GetPattern() const
  78.                                 {return fPatternIndex;}
  79.     FW_ERenderVerbs            GetRenderVerb() const
  80.                                 {return fRenderVerb;}
  81.     
  82. //----------------------------------------------------------------------------------------
  83. // Data Members
  84. //
  85. private:
  86.     short                    fPatternIndex;
  87.     FW_ERenderVerbs            fRenderVerb;
  88. };
  89.  
  90. //========================================================================================
  91. // Class CPatternFrame
  92. //========================================================================================
  93.  
  94. class CPatternFrame : public CFloatingWindowFrame, public FW_MNotifier
  95. {
  96. //----------------------------------------------------------------------------------------
  97. // Initialization/destruction
  98. //
  99. public:        
  100.  
  101.     FW_DECLARE_AUTO(CPatternFrame)
  102.     
  103.     CPatternFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CDrawPart* drawPart);
  104.     virtual ~ CPatternFrame();
  105.  
  106. //----------------------------------------------------------------------------------------
  107. // Inherited API
  108. //
  109. public:    
  110.     virtual void                 Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  111.     virtual FW_Handled            DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  112.  
  113.     virtual void                FacetAdded(Environment* ev, ODFacet* facet, unsigned short facetCount);
  114.     
  115. //----------------------------------------------------------------------------------------
  116. // New API
  117. //
  118. private:    
  119.     FW_CPattern                    GetPattern(short patIndex) const;
  120.     
  121. //----------------------------------------------------------------------------------------
  122. // Data Members
  123. //
  124. private:
  125.     CGrid                        fGrid;
  126.     CDrawPart*                    fDrawPart;
  127. };
  128.  
  129. #endif
  130.