home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.7 KB | 130 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: PatFrame.h
- // Release Version: $ ODF 2 $
- //
- // Author: Henri Lamiraux
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef PATFRAME_H
- #define PATFRAME_H
-
- #ifndef UTILS_H
- #include "Utils.h"
- #endif
-
- #ifndef FLOATFRM_H
- #include "FloatFrm.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWNOTIFR_H
- #include "FWNotifr.h"
- #endif
-
- #ifndef FWINTERE_H
- #include "FWIntere.h"
- #endif
-
- //========================================================================================
- // Forward Declaration
- //========================================================================================
-
- class FW_CColor;
- class FW_CMouseEvent;
- class CPatternFrame;
-
- //========================================================================================
- // Constants
- //========================================================================================
-
- const FW_Fixed kPatternCellSize = FW_IntToFixed(24);
-
- //========================================================================================
- // CPatternChangedInterest
- //========================================================================================
-
- class CPatternChangedInterest: public FW_CInterest
- {
- public:
- CPatternChangedInterest(FW_MNotifier* notifier);
- virtual ~CPatternChangedInterest();
- };
-
- //========================================================================================
- // CPatternChangedNotification
- //========================================================================================
-
- class CPatternChangedNotification : public FW_CNotification
- {
- //----------------------------------------------------------------------------------------
- // Initialization/destruction
- //
- public:
- CPatternChangedNotification(const FW_CInterest& interest,
- short patternIndex,
- FW_ERenderVerbs renderVerb);
- virtual ~CPatternChangedNotification();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- short GetPattern() const
- {return fPatternIndex;}
- FW_ERenderVerbs GetRenderVerb() const
- {return fRenderVerb;}
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- short fPatternIndex;
- FW_ERenderVerbs fRenderVerb;
- };
-
- //========================================================================================
- // Class CPatternFrame
- //========================================================================================
-
- class CPatternFrame : public CFloatingWindowFrame, public FW_MNotifier
- {
- //----------------------------------------------------------------------------------------
- // Initialization/destruction
- //
- public:
-
- FW_DECLARE_AUTO(CPatternFrame)
-
- CPatternFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CDrawPart* drawPart);
- virtual ~ CPatternFrame();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual void Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
- virtual FW_Handled DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
-
- virtual void FacetAdded(Environment* ev, ODFacet* facet, unsigned short facetCount);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- private:
- FW_CPattern GetPattern(short patIndex) const;
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CGrid fGrid;
- CDrawPart* fDrawPart;
- };
-
- #endif
-