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 / Framewrk / FWPart / FWFrame.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  33.2 KB  |  908 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWFrame.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWFRAME_H
  11. #define FWFRAME_H
  12.  
  13. #ifndef FWEVENT_H
  14. #include "FWEvent.h"
  15. #endif
  16.  
  17. #ifndef FWPRTDEF_H
  18. #include "FWPrtDef.h"
  19. #endif
  20.  
  21. #ifndef FWSVIEW_H
  22. #include "FWSView.h"
  23. #endif
  24.  
  25. #ifndef FWUTIL_H
  26. #include "FWUtil.h"
  27. #endif
  28.  
  29. #ifndef FWDRGDRP_H
  30. #include "FWDrgDrp.h"
  31. #endif
  32.  
  33. #ifndef FWSCROLR_H
  34. #include "FWScrolr.h"
  35. #endif
  36.  
  37. // ----- OS Includes -----
  38.  
  39. #ifndef FWRECT_H
  40. #include "FWRect.h"
  41. #endif
  42.  
  43. #ifndef FWFCTINF_H
  44. #include "FWFctInf.h"
  45. #endif
  46.  
  47. #ifndef FWACQUIR_H
  48. #include "FWAcquir.h"
  49. #endif
  50.  
  51. #ifndef FWICON_H
  52. #include "FWIcon.h"
  53. #endif
  54.  
  55. // ----- Foundation Includes -----
  56.  
  57. #ifndef FWRUNTYP_H
  58. #include "FWRunTyp.h"
  59. #endif
  60.  
  61. #ifndef FWSTDDEF_H
  62. #include "FWStdDef.h"
  63. #endif
  64.  
  65. #ifndef FWSTRING_H
  66. #include "FWString.h"
  67. #endif
  68.  
  69. // ----- OpenDoc Includes -----
  70.  
  71. #ifndef SOM_ODFrame_xh
  72. #include <Frame.xh>
  73. #endif
  74.  
  75. #ifndef FWODTYPS_H
  76. #include "FWODTyps.h"
  77. #endif
  78.  
  79. #ifndef SOM_ODStorageUnit_xh
  80. #include <StorageU.xh>
  81. #endif
  82.  
  83. //========================================================================================
  84. //    Forward Declaration
  85. //========================================================================================
  86.  
  87. class ODFacet;
  88. class ODWindow;
  89. class ODShape;
  90. class ODFocusSet;
  91. class ODStorageUnitView;
  92.  
  93. class FW_CPart;
  94. class FW_CMenuBar;
  95. class FW_CMenuEvent;
  96. class FW_CWindow;
  97. class FW_CGraphicDevice;
  98. class FW_CMouseEvent;
  99. class FW_CActivateEvent;
  100. class FW_CClipboardCommand;
  101. class FW_CPresentation;
  102. class FW_CResumeSuspendEvent;
  103. class FW_CCloneInfo;
  104. class FW_CViewAs;
  105. class FW_CInterest;
  106. class FW_CPrintHandler;
  107. class FW_CScrollingViewIterator;
  108. class FW_CIdler;
  109. class FW_CScroller;
  110. class FW_CPrivBaseScroller;
  111. class FW_MDraggableFrame;
  112. class FW_MDroppableFrame;
  113. class FW_CButton;
  114. class FW_CSelection;
  115.  
  116. //========================================================================================
  117. //    class FW_CFrame
  118. //========================================================================================
  119.  
  120. class FW_CFrame : public FW_CSuperView
  121. {
  122. public:
  123.     FW_DECLARE_CLASS
  124.     FW_DECLARE_AUTO(FW_CFrame)
  125.  
  126.     friend class FW_CPart;
  127.     friend class FW_CIdler;
  128.  
  129. //----------------------------------------------------------------------------------------
  130. //    Constructors/Destructors
  131. //
  132. public:
  133.     FW_CFrame(Environment*            ev,
  134.                 ODFrame*             frame, 
  135.                 FW_CPresentation*     presentation,
  136.                 FW_CPart*             part);            
  137.     virtual ~ FW_CFrame();
  138.  
  139. //----------------------------------------------------------------------------------------
  140. //    API from ODFrame (some are just inlines)
  141. //
  142. public:
  143.     ODID                        GetFrameGroup(Environment* ev) const;
  144.     ODID                        GetSequenceNumber(Environment* ev) const;
  145.  
  146.     FW_Boolean                    IsPersistent(Environment* ev) const;
  147.                         
  148.     FW_Boolean                    IsRoot(Environment* ev) const;
  149.  
  150.     FW_Boolean                    IsSubframe(Environment* ev) const;
  151.     void                        SetSubframe(Environment* ev, 
  152.                                     FW_Boolean isSubframe);
  153.  
  154.     FW_Boolean                    IsOverlaid(Environment* ev) const;
  155.  
  156.     FW_Boolean                    IsInLimbo(Environment* ev) const;
  157.     
  158.     FW_Boolean                    IsFrozen(Environment* ev) const;
  159.     void                        SetFrozen(Environment* ev, 
  160.                                     FW_Boolean isFrozen);
  161.  
  162.     FW_Boolean                    DoesPropagateEvents(Environment* ev) const;
  163.     void                        SetPropagateEvents(Environment* ev, 
  164.                                     FW_Boolean doesPropagateEvents);
  165.  
  166.     FW_CPresentation*            GetPresentation(Environment* ev) const;
  167.     ODTypeToken                    GetViewType(Environment* ev) const;
  168.  
  169.     void                        ChangeUsedShape(Environment* ev, 
  170.                                     ODShape* newUsedShape, 
  171.                                     ODCanvas* biasCanvas = NULL);
  172.     FW_Boolean                    RequestFrameShape(Environment* ev, 
  173.                                     ODShape* shape,
  174.                                     ODCanvas* biasCanvas = NULL);
  175.  
  176.     ODShape*                    AcquireUsedShape(Environment* ev, 
  177.                                     ODCanvas* biasCanvas = NULL) const;    
  178.     ODTransform*                AcquireInternalTransform(Environment* ev, 
  179.                                     ODCanvas* biasCanvas = NULL) const;    
  180.     ODShape*                    AcquireFrameShape(Environment* ev, 
  181.                                     ODCanvas* biasCanvas = NULL) const;
  182.  
  183.     ODFrame*                    AcquireContainingFrame(Environment* ev) const;
  184.     
  185.     ODWindow*                    AcquireODWindow(Environment* ev) const;
  186.  
  187.     ODID                        GetID(Environment* ev) const;
  188.     
  189. //----------------------------------------------------------------------------------------
  190. //    Inherited from FW_MEventHandler
  191. //
  192. public:
  193.     // ----- Events -----
  194.     virtual FW_MEventHandler*    GetTarget(Environment* ev) const;
  195.     virtual void                SetTarget(Environment* ev, FW_MEventHandler* newTarget, FW_Boolean tabSelection = FALSE);
  196.     virtual FW_Boolean            WantsToBeTarget(Environment* ev);
  197.     virtual FW_Handled            HandleIdle(Environment* ev, const FW_CNullEvent& theNullEvent);
  198.  
  199.     // ----- Menus -----
  200.     virtual FW_Handled            HandleAdjustMenus(Environment* ev, FW_CMenuBar* menuBar, FW_Boolean hasMenuFocus, FW_Boolean isRoot);
  201.     virtual FW_Handled            HandleMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  202.  
  203. //----------------------------------------------------------------------------------------
  204. //    Inherited from FW_CSuperView
  205. //
  206. public:
  207.     virtual void                SetLocation(Environment* ev, const FW_CPoint& location, FW_ERedrawVerb redraw = FW_kInvalidate);
  208.     virtual void                HandleActivateEvent(Environment* ev, const FW_CActivateEvent& theActivateEvent);    
  209.  
  210.     virtual void                SubViewWasRemoved(Environment* ev, FW_CView* subView);
  211.     
  212.     virtual FW_CFrame*            GetFrame(Environment* ev) const;
  213.     virtual FW_Boolean            IsFrame(Environment* ev) const;
  214.     
  215. //----------------------------------------------------------------------------------------
  216. //    New API
  217. //
  218. public:
  219.     // ----- Drag and Drop -----
  220.     FW_MDraggableFrame*            GetDraggable(Environment* ev) const;
  221.     FW_MDroppableFrame*            GetDroppable(Environment* ev) const;
  222.  
  223.     FW_Boolean                    IsTopFrame(Environment* ev) const;
  224.     
  225.     static FW_CFrame*             ODtoFWFrame(Environment* ev, ODFrame* odFrame);
  226.     ODFrame*                    GetODFrame(Environment *ev) const;
  227.  
  228.     FW_Boolean                    IsSiblingFrameOf(Environment *ev, ODFrame* otherODFrame) const;
  229.     FW_Boolean                    HasSamePartEditorAs(Environment *ev, ODFrame* otherODFrame) const;
  230.     FW_Boolean                    HasSameDraftAs(Environment* ev, ODFrame* otherODFrame) const;
  231.  
  232.     // ----- Mouse Tracking -----
  233.     virtual FW_Handled            AdjustCursor(Environment* ev, ODFacet* odFacet, const FW_CPoint& theMousePoint, ODEventInfo* eventInfo);
  234.     
  235.     virtual FW_Handled            HandleMouseEnter(Environment* ev, ODFacet* odFacet, const FW_CPoint& where, ODEventInfo* eventInfo);
  236.     virtual FW_Handled            HandleMouseLeave(Environment* ev, ODFacet* odFacet, ODEventInfo* eventInfo);
  237.     virtual FW_Handled            HandleMouseWithin(Environment* ev, ODFacet* odFacet, const FW_CPoint& theMousePoint, ODEventInfo* eventInfo);
  238.         
  239.     // ----- Events ------
  240.     virtual FW_Handled            HandleSuspendResumeEvent(Environment* ev, const FW_CSuspendResumeEvent& theResumeSuspendEvent);
  241. #ifdef FW_BUILD_MAC
  242.     virtual FW_Handled            HandleWindowEvent(Environment* ev, const FW_CMacWindowEvent& windowEvent);
  243. #endif
  244.     
  245.     virtual FW_Handled            HandleVirtualKey(Environment* ev, const FW_CVirtualKeyEvent& theVirtualKeyEvent);
  246.  
  247.     // ----- Facet Management -----        
  248.     virtual void                 FacetAdded(Environment* ev, ODFacet* odFacet, unsigned short facetCount);
  249.     virtual void                 FacetRemoved(Environment* ev, ODFacet* odFacet, unsigned short facetCount);
  250.  
  251.     virtual void                CanvasChanged(Environment* ev, ODFacet* facet);
  252.  
  253.     unsigned short                GetFacetCount(Environment* ev) const;
  254.     
  255.     // ----- Containing Part Properties -----
  256.     FW_Boolean                    GetAdoptsContainerProperties(Environment* ev) const;
  257.     void                        SetAdoptsContainerProperties(Environment* ev, FW_Boolean adoptsProperties);
  258.     
  259.     virtual void                SynchContainingPartProperties(Environment* ev);
  260.     virtual void                AdoptContainingPartProperties(Environment* ev, ODStorageUnit* propertyUnit);
  261.  
  262.     // ----- Add/Remove frame notification -----
  263.     virtual void                FrameAdded(Environment* ev, ODFrame* odFrame, FW_Boolean fromStorage);
  264.     virtual void                FrameRemoved(Environment* ev, FW_Boolean toStorage);
  265.         
  266.     // ----- Focus Management -----
  267.     virtual void                 FocusStateChanged(Environment* ev, ODTypeToken focus, FW_Boolean newState, ODFrame* newOwner);    
  268.     virtual FW_Boolean            BeginRelinquishFocus(Environment *ev, ODTypeToken focus, ODFrame* proposedFrame);
  269.     virtual void                AbortRelinquishFocus(Environment *ev, ODTypeToken focus, ODFrame* proposedFrame);
  270.     virtual ODFocusSet*            GetFocusSet(Environment* ev) const;    
  271.     
  272.     virtual    void                RelinquishFocusSet(Environment *ev);
  273.     virtual FW_Boolean            RequestFocusSet(Environment *ev);
  274.         
  275.     // ----- Window Geometry -----
  276.     virtual void                AdjustZoomedWindowSize(Environment *ev, FW_CPoint& proposedSize);
  277.     virtual void                AdjustWindowGrowLimits(Environment *ev, FW_CPoint& minSize, FW_CPoint& maxSize);
  278.  
  279.     // ----- Menus -----
  280.     virtual void                InstallMenus(Environment* ev);
  281.     
  282.     // ----- ViewType/Presentation/Sequence -----
  283.     virtual void                 ViewTypeChanged(Environment* ev, ODTypeToken newViewType, ODTypeToken oldViewType);
  284.     virtual void                 SequenceChanged(Environment* ev);
  285.     
  286.     void                        ChangePresentation(Environment* ev, FW_CPresentation* presentation);
  287.     virtual void                 PresentationChanged(Environment* ev);
  288.     
  289.     // ----- Frame Geometry -----
  290.     virtual void                 FrameShapeChanged(Environment* ev);
  291.     virtual void                GeometryChanged(Environment *ev,
  292.                                             ODFacet* odFacet,
  293.                                             FW_Boolean clipShapeChanged,
  294.                                             FW_Boolean transformChanged);
  295.     
  296.     // ----- Requested Frame -----
  297.     FW_Boolean                    IsRequestedFrame(Environment* ev) const;
  298.                                  
  299.     // ----- Used and Update Shape -----
  300.     void                         UpdateUsedAndActiveShapes(Environment* ev);
  301.     void                        UpdateUsedShape(Environment* ev);
  302.     void                        UpdateActiveShape(Environment* ev, ODFacet* facet);
  303.  
  304.     virtual ODShape*             AdjustUsedShape(Environment* ev, ODShape* suggestedUsedShape);
  305.     virtual ODShape*             AdjustActiveShape(Environment* ev, ODFacet* facet, ODShape* suggestedActiveShape);
  306.     
  307.     // ----- Window -----
  308.     FW_CWindow*                    GetWindow(Environment* ev) const;
  309.     virtual FW_CWindow*         NewPartWindow(Environment* ev, 
  310.                                             const FW_CRect& suggestedWindowRect, 
  311.                                             const FW_CString& suggestedWindowTitle);
  312.     
  313.     // ----- Focus -----
  314.     FW_Boolean                    HasSelectionFocus(Environment* ev) const;
  315.     FW_Boolean                    HasModalFocus(Environment* ev) const;
  316.     
  317.     // ----- Frame Activation -----
  318.     void                         ActivateFrame(Environment* ev, ODFacet* activatedFacet);
  319.     FW_Boolean                    ActivateWindow(Environment* ev, ODFacet* facet, FW_Boolean activateFrame);
  320.  
  321.     // ----- Getter/Setter -----
  322.     FW_CPart*                     GetPart(Environment* ev) const;
  323.     ODPart*                     GetODPart(Environment* ev) const;
  324.  
  325.     FW_CSuperView*                GetContentView(Environment* ev) const;
  326.     void                         SetContentView(Environment* ev, FW_CSuperView* view);
  327.     
  328.     FW_Boolean                    GetFrontClicks(Environment* ev) const;
  329.     void                        SetFrontClicks(Environment* ev, FW_Boolean getFrontClicks);
  330.  
  331.     ODFacet*                     GetActiveFacet(Environment* ev) const;
  332.     virtual void                SetActiveFacet(Environment* ev, ODFacet* activeFacet);
  333.         
  334.     virtual FW_Boolean            CanBeActiveFrame(Environment* ev) const;
  335.     void                        SetCanBeActiveFrame(Environment* ev, FW_Boolean beActive);
  336.     
  337.     FW_CFrame*                    GetSourceFrame(Environment* ev);
  338.  
  339.     // ----- Cloning -----
  340.     virtual void                ClonePartInfo(Environment* ev, 
  341.                                     ODDraftKey key,
  342.                                     ODInfoType partInfo,
  343.                                     ODStorageUnitView* storageUnitView,
  344.                                     ODFrame* scope);
  345.  
  346.     // ----- Scrolling -----
  347.     FW_CScroller*                GetScroller(Environment* ev) const;
  348.     void                        AdoptScroller(Environment* ev, FW_CScroller* scroller);
  349.  
  350.       FW_Boolean                    Reveal(Environment* ev, ODShape* shapeToReveal = NULL);
  351.      
  352.     // ----- Clipboard -----
  353.     FW_Boolean                    HasPropertyOnClipboard(Environment* ev, 
  354.                                     ODPropertyName propertyName, 
  355.                                     ODValueType type) const;
  356.     FW_Boolean                    HasSupportedKindOnClipboard(Environment* ev) const;
  357.  
  358.     // ----- Linking -----
  359.     FW_Boolean                    IsFrameInLinkDestination(Environment* ev);
  360.         
  361.     // ----- Rendering -----
  362.     virtual FW_Handled            HandleDraw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);    
  363.     virtual void                 Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  364.     
  365.     // ----- Highlight -----
  366.     virtual void                HighlightChanged(Environment* ev, ODFacet* odFacet, ODHighlight from, ODHighlight to);
  367.     virtual void                DrawFullHighlight(Environment *ev, ODFacet* facet, ODShape* invalidShape);
  368.     
  369.     // ----- View As -----
  370.     virtual void                BuildThumbnail(Environment* ev, FW_CGraphicContext& gc, FW_CRect& usedRect);
  371.     virtual FW_CIcon            GetIcon(Environment* ev, short iconSize) const;
  372.     virtual FW_CViewAs*            NewViewAs(Environment* ev, ODTypeToken viewAs);
  373.     
  374.     // ----- Content -----
  375.     void                        GetContentExtent(Environment* ev, FW_CPoint& extent) const;
  376.     ODShape*                     AcquireContentShape(Environment *ev);
  377.     
  378.     // ----- Commands/Undo -----
  379.     virtual FW_CClipboardCommand*    NewClipboardCommand(Environment* ev, ODCommandID commandID);
  380.         // Override to return a subclass of FW_CClipboardCommand
  381.     
  382.     virtual FW_Handled            ShowPartInfo(Environment* ev);
  383.  
  384.     // ----- Printing ------
  385.     virtual FW_CPrintHandler*    NewPrintHandler(Environment* ev);
  386.  
  387.     // ----- Persistence -----
  388.     virtual void                InternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  389.     virtual void                ExternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  390.  
  391.     // ----- View Editing -----
  392.     virtual void                DeleteAndResetViews(Environment* ev);
  393.     
  394. private:
  395. #ifdef FW_BUILD_WIN
  396.     void                        CreateShadowWindow(Environment* ev);
  397.     static LRESULT CALLBACK     ShadowWindowProc(HWND hWnd, UINT msg,
  398.                                              WPARAM wParam, LPARAM lParam);
  399.     void                        MoveSizeShadowWindow(Environment* ev);
  400.     
  401. public:
  402.     ODPlatformWindow            GetShadowWindow(Environment* ev) const;
  403. #endif
  404.  
  405. //----------------------------------------------------------------------------------------
  406. //    Internal API
  407. //
  408. protected:
  409.     virtual void                PrivCreateSubViewsFromStream(Environment* ev, FW_CReadableStream& stream);
  410.     void                        PrivInstantiateViews(Environment* ev);
  411.     
  412.     void                        PrivGetFrameShapeBounds(Environment* ev, FW_CRect& rect) const;
  413.         
  414. #ifdef FW_BUILD_MAC
  415.      void                         PrivMacInGrowBox(Environment* ev, const FW_CMacWindowEvent& windowEvent);
  416. #endif
  417.  
  418. public:    
  419.     virtual void                PrivStartStopDragging(Environment *ev, FW_EPrivDraggingFlags dragFlags);
  420.  
  421.     virtual void                PrivAttachSourceFrame(Environment* ev, FW_CFrame* sourceFrame);
  422.  
  423.     FW_CWindow*                    PrivCreateWindow(Environment* ev, ODWindow* odWindow);
  424.  
  425.     ODTypeToken                    PrivGetPreviousViewType(Environment *ev) const;
  426.     void                        PrivSetPreviousViewType(Environment *ev, ODTypeToken viewType);
  427.  
  428.     void                        PrivCreateViewAs(Environment* ev);
  429.  
  430.     void                        PrivContentViewLocationChanged(Environment* ev, const FW_CPoint& newLocation);
  431.     void                        PrivRealignInternalTransform(Environment* ev);
  432.     
  433.     FW_Boolean                    PrivInSharedWindow(Environment *ev) const;
  434.     
  435.     void                        PrivFacetAdded(Environment *ev, ODFacet* facet);
  436.     void                        PrivFacetRemoved(Environment *ev, ODFacet* facet);
  437.     
  438.     void                        PrivSetDraggable(Environment *ev, FW_MDraggableFrame* draggable);
  439.     void                        PrivSetDroppable(Environment *ev, FW_MDroppableFrame* droppable, FW_Boolean isDroppable);
  440.     
  441.     void                        PrivUpdateScrollParameters(Environment *ev);
  442.     FW_CPoint                    PrivGetContentViewOffset(Environment* ev) const;
  443.  
  444.     void                        PrivSetRequestedFrame(Environment *ev);
  445.     
  446.     FW_DroppableState            PrivGetDroppableState() const;
  447.     void                        PrivSetDroppableState(FW_DroppableState droppableState);
  448.     
  449.     FW_Boolean                     PrivSubViewsCreated(Environment*);
  450.     
  451.     virtual void                PrivButtonAttached(Environment *ev, FW_CButton* button);
  452.  
  453.     void                        PrivSetInfoCommandAdjusted(Environment*, FW_Boolean value);
  454.  
  455.     virtual void                PrivContentShapeChanged(Environment *ev);
  456.  
  457.     void                        PrivChangeInternalTransform(Environment* ev, 
  458.                                     ODTransform* internalTransform,
  459.                                     ODCanvas* biasCanvas = NULL);
  460.     
  461.     void                        PrivRequestScrollingFocus(Environment *ev);
  462.  
  463.     void                        PrivExternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  464.     void                        PrivInternalizeFrame(Environment* ev, ODStorageUnitView* storageUnitView);
  465.  
  466.     FW_Boolean                    PrivGetInfoString(Environment* ev, FW_CSelection* selection, FW_CString& infoString);
  467.  
  468. //----------------------------------------------------------------------------------------
  469. //    Data Members
  470. //
  471. private:
  472.     ODStorageUnitID             fFrameID;                // ID for this display frame
  473.     ODFrame*                    fODFrame;                // OpenDoc frame
  474.     FW_CPart*                    fPart;
  475.  
  476.     FW_MEventHandler*            fTarget;                // For key/menu/idle events, never NULL
  477.       FW_CSuperView*                fContentView;              // View displaying the content (or frame itself)
  478.     FW_Boolean                    fGetFrontClicks;
  479.     FW_Boolean                    fNeedsFoci;                // To remember active frame during activate/deactivate events
  480.     FW_Boolean                    fNeedsScrollingFocus;    // To remember scrolling focus frame during activate/deactivate events
  481.     FW_Boolean                    fHasSelectionFocus;        // TRUE when frame has the selection focus
  482.     FW_Boolean                    fHasScrollingFocus;        // TRUE when frame has the scrolling focus
  483.     ODFacet*                    fActiveFacet;            // Active facet for this frame
  484.     FW_Boolean                    fCanBeActiveFrame;        // FALSE for floating window frames
  485.     FW_CPresentation*            fPresentation;
  486.     FW_CWindow*                    fWindow;
  487.     unsigned short                fFacetCount;
  488.     ODTypeToken                    fPreviousViewType;
  489.     FW_CViewAs*                    fViewAs;
  490.     FW_CIdler*                    fIdler;
  491.     
  492.     FW_MDraggableFrame*            fDraggable;
  493.     FW_MDroppableFrame*            fDroppable;
  494.     FW_DroppableState            fDroppableState;
  495.     
  496.     FW_CPrivBaseScroller*        fScroller;
  497.     
  498.     FW_CView*                    fViewUnderCursor;        // To handle MouseEnter/Within/Leave events
  499.     FW_Boolean                    fRequestedFrame;        // TRUE if the frame has been gotton thru RequestEmbeddedFrame
  500.     FW_Boolean                    fInSharedWindow;        // [HLX] hack for shared window
  501. #ifdef FW_BUILD_WIN
  502.     ODPlatformWindow            fShadowWindow;
  503. #endif
  504.     FW_Boolean                    fInternalTransformRealigmentNeeded;
  505.     FW_CPoint                    fContentViewOffset;        // content view location in frame coordinates
  506.     FW_Boolean                    fSubViewsCreated;        // FALSE initialy. TRUE if the subviews are created.
  507.     FW_CFrame*                    fSourceFrame;            
  508.     FW_Boolean                    fInfoCommandAdjusted;    // true if PartInfo menu item was already set up
  509.     FW_Boolean                    fShowPaletteOnMouseUp;    // Set to TRUE in FocusStateChanged    
  510.     ODShape*                    fContentShape;            // cached content shape
  511.     FW_Boolean                    fAdoptsContainerProperties;    // true if adopts ContainerPartProperties
  512. };
  513.  
  514.  
  515. //========================================================================================
  516. //    Inlines
  517. //========================================================================================
  518.  
  519. //----------------------------------------------------------------------------------------
  520. // FW_CFrame::PrivSetInfoCommandAdjusted
  521. //----------------------------------------------------------------------------------------
  522. inline void FW_CFrame::PrivSetInfoCommandAdjusted(Environment*, FW_Boolean value)
  523. {
  524.     fInfoCommandAdjusted = value;
  525. }
  526.  
  527. //----------------------------------------------------------------------------------------
  528. // FW_CFrame::PrivGetContentViewOffset
  529. //----------------------------------------------------------------------------------------
  530. inline FW_CPoint FW_CFrame::PrivGetContentViewOffset(Environment*) const
  531. {
  532.     return fContentViewOffset;
  533. }
  534.  
  535. //----------------------------------------------------------------------------------------
  536. //    FW_CFrame::GetDraggable
  537. //----------------------------------------------------------------------------------------
  538. inline FW_MDraggableFrame* FW_CFrame::GetDraggable(Environment*) const
  539. {
  540.     return fDraggable;
  541. }
  542.  
  543. //----------------------------------------------------------------------------------------
  544. //    FW_CFrame::GetDroppable
  545. //----------------------------------------------------------------------------------------
  546. inline FW_MDroppableFrame* FW_CFrame::GetDroppable(Environment*) const
  547. {
  548.     return fDroppable;
  549. }
  550.  
  551. //----------------------------------------------------------------------------------------
  552. //    FW_CFrame::PrivSetDraggable
  553. //----------------------------------------------------------------------------------------
  554. inline void FW_CFrame::PrivSetDraggable(Environment*, FW_MDraggableFrame* draggable)
  555. {
  556.     fDraggable = draggable;
  557. }
  558.     
  559. //----------------------------------------------------------------------------------------
  560. //    FW_CFrame::GetFacetCount
  561. //----------------------------------------------------------------------------------------
  562. inline unsigned short FW_CFrame::GetFacetCount(Environment*) const
  563. {
  564.     return fFacetCount;
  565. }
  566.  
  567. //----------------------------------------------------------------------------------------
  568. //    FW_CFrame::PrivInSharedWindow
  569. //----------------------------------------------------------------------------------------
  570. inline FW_Boolean FW_CFrame::PrivInSharedWindow(Environment*) const
  571. {
  572.     return fInSharedWindow;
  573. }
  574.  
  575. //----------------------------------------------------------------------------------------
  576. //    FW_CFrame::GetFrontClicks
  577. //----------------------------------------------------------------------------------------
  578. inline FW_Boolean FW_CFrame::GetFrontClicks(Environment*) const
  579. {
  580.     return fGetFrontClicks;
  581. }
  582.  
  583. //----------------------------------------------------------------------------------------
  584. //    FW_CFrame::SetFrontClicks
  585. //----------------------------------------------------------------------------------------
  586. inline void FW_CFrame::SetFrontClicks(Environment*, FW_Boolean getFrontClicks)
  587. {
  588.     fGetFrontClicks = getFrontClicks;
  589. }
  590.  
  591. //----------------------------------------------------------------------------------------
  592. //    FW_CFrame::GetPart
  593. //----------------------------------------------------------------------------------------
  594. inline FW_CPart* FW_CFrame::GetPart(Environment*) const
  595. {
  596.     return fPart;
  597. }
  598.  
  599. //----------------------------------------------------------------------------------------
  600. //    FW_CFrame::GetScroller
  601. //----------------------------------------------------------------------------------------
  602. inline FW_CScroller* FW_CFrame::GetScroller(Environment*) const
  603. {
  604.     return (FW_CScroller*)fScroller;
  605. }
  606.  
  607. //----------------------------------------------------------------------------------------
  608. //    FW_CFrame::GetContentView
  609. //----------------------------------------------------------------------------------------
  610. inline FW_CSuperView* FW_CFrame::GetContentView(Environment*) const
  611. {
  612.         // cast away const
  613.     return (fContentView == NULL) ? (FW_CSuperView*)this : fContentView;
  614. }
  615.  
  616. //----------------------------------------------------------------------------------------
  617. //    FW_CFrame::GetActiveFacet
  618. //----------------------------------------------------------------------------------------
  619. inline ODFacet* FW_CFrame::GetActiveFacet(Environment*) const
  620. {
  621.     return fActiveFacet;
  622. }
  623.  
  624. //----------------------------------------------------------------------------------------
  625. //    FW_CFrame::SetCanBeActiveFrame
  626. //----------------------------------------------------------------------------------------
  627. inline void FW_CFrame::SetCanBeActiveFrame(Environment*, FW_Boolean beActive)
  628. {
  629.     fCanBeActiveFrame = beActive;
  630. }
  631.  
  632. //----------------------------------------------------------------------------------------
  633. //    FW_CFrame::ChangeUsedShape
  634. //----------------------------------------------------------------------------------------
  635. inline void FW_CFrame::ChangeUsedShape(Environment* ev, ODShape* newUsedShape, ODCanvas* biasCanvas)
  636. {
  637.     fODFrame->ChangeUsedShape(ev, newUsedShape, biasCanvas);
  638. }
  639.  
  640. //----------------------------------------------------------------------------------------
  641. //    FW_CFrame::GetODFrame
  642. //----------------------------------------------------------------------------------------
  643. inline ODFrame* FW_CFrame::GetODFrame(Environment*) const
  644. {
  645.     return fODFrame;
  646. }
  647.  
  648. //----------------------------------------------------------------------------------------
  649. //    FW_CFrame::PrivGetPreviousViewType
  650. //----------------------------------------------------------------------------------------
  651. inline ODTypeToken FW_CFrame::PrivGetPreviousViewType(Environment*) const
  652. {
  653.     return fPreviousViewType;
  654. }
  655.  
  656. //----------------------------------------------------------------------------------------
  657. //    FW_CFrame::PrivSetPreviousViewType
  658. //----------------------------------------------------------------------------------------
  659. inline void FW_CFrame::PrivSetPreviousViewType(Environment*, ODTypeToken viewType)
  660. {
  661.     fPreviousViewType = viewType;
  662. }
  663.  
  664. //----------------------------------------------------------------------------------------
  665. //    FW_CFrame::GetFrameGroup
  666. //----------------------------------------------------------------------------------------
  667. inline ODID FW_CFrame::GetFrameGroup(Environment* ev) const
  668. {
  669.     return fODFrame->GetFrameGroup(ev);
  670. }
  671.  
  672. //----------------------------------------------------------------------------------------
  673. //    FW_CFrame::GetSequenceNumber
  674. //----------------------------------------------------------------------------------------
  675. inline ODID FW_CFrame::GetSequenceNumber(Environment* ev) const
  676. {
  677.     return fODFrame->GetSequenceNumber(ev);
  678. }
  679.  
  680. //----------------------------------------------------------------------------------------
  681. //    FW_CFrame::IsRoot
  682. //----------------------------------------------------------------------------------------
  683. inline FW_Boolean FW_CFrame::IsRoot(Environment* ev) const
  684. {
  685.     return fODFrame->IsRoot(ev);
  686. }
  687.  
  688. //----------------------------------------------------------------------------------------
  689. //    FW_CFrame::HasSelectionFocus
  690. //----------------------------------------------------------------------------------------
  691. inline FW_Boolean FW_CFrame::HasSelectionFocus(Environment*) const
  692. {
  693.     return fHasSelectionFocus;
  694. }
  695.  
  696. //----------------------------------------------------------------------------------------
  697. //    FW_CFrame::IsPersistent
  698. //----------------------------------------------------------------------------------------
  699. inline FW_Boolean FW_CFrame::IsPersistent(Environment* ev) const
  700. {
  701.     return fODFrame->GetStorageUnit(ev) != NULL;
  702. }
  703.  
  704. //----------------------------------------------------------------------------------------
  705. //    FW_CFrame::IsOverlaid
  706. //----------------------------------------------------------------------------------------
  707. inline FW_Boolean FW_CFrame::IsOverlaid(Environment* ev) const
  708. {
  709.     return fODFrame->IsOverlaid(ev);
  710. }
  711.  
  712. //----------------------------------------------------------------------------------------
  713. //    FW_CFrame::IsInLimbo
  714. //----------------------------------------------------------------------------------------
  715. inline FW_Boolean FW_CFrame::IsInLimbo(Environment* ev) const
  716. {
  717.     return FW_IsInLimbo(ev, fODFrame);
  718. }
  719.  
  720. //----------------------------------------------------------------------------------------
  721. //    FW_CFrame::IsFrozen
  722. //----------------------------------------------------------------------------------------
  723. inline FW_Boolean FW_CFrame::IsFrozen(Environment* ev) const
  724. {
  725.     return fODFrame->IsFrozen(ev);
  726. }
  727.  
  728. //----------------------------------------------------------------------------------------
  729. //    FW_CFrame::SetFrozen
  730. //----------------------------------------------------------------------------------------
  731. inline void FW_CFrame::SetFrozen(Environment* ev, FW_Boolean isFrozen)
  732. {
  733.     fODFrame->SetFrozen(ev, isFrozen);
  734. }
  735.  
  736. //----------------------------------------------------------------------------------------
  737. //    FW_CFrame::DoesPropagateEvents
  738. //----------------------------------------------------------------------------------------
  739. inline FW_Boolean FW_CFrame::DoesPropagateEvents(Environment* ev) const
  740. {
  741.     return fODFrame->DoesPropagateEvents(ev);
  742. }
  743.  
  744. //----------------------------------------------------------------------------------------
  745. //    FW_CFrame::SetPropagateEvents
  746. //----------------------------------------------------------------------------------------
  747. inline void FW_CFrame::SetPropagateEvents(Environment* ev, FW_Boolean doesPropagateEvents)
  748. {
  749.     fODFrame->SetPropagateEvents(ev, doesPropagateEvents);
  750. }
  751.  
  752. //----------------------------------------------------------------------------------------
  753. //    FW_CFrame::GetViewType
  754. //----------------------------------------------------------------------------------------
  755. inline ODTypeToken FW_CFrame::GetViewType(Environment* ev) const
  756. {
  757.     return fODFrame->GetViewType(ev);
  758. }
  759.  
  760. //----------------------------------------------------------------------------------------
  761. //    FW_CFrame::GetPresentation
  762. //----------------------------------------------------------------------------------------
  763. inline FW_CPresentation* FW_CFrame::GetPresentation(Environment*) const
  764. {
  765.     return fPresentation;
  766. }
  767.  
  768. //----------------------------------------------------------------------------------------
  769. //    FW_CFrame::IsSubframe
  770. //----------------------------------------------------------------------------------------
  771. inline FW_Boolean FW_CFrame::IsSubframe(Environment* ev) const
  772. {
  773.     return fODFrame->IsSubframe(ev);
  774. }
  775.  
  776. //----------------------------------------------------------------------------------------
  777. //    FW_CFrame::SetSubframe
  778. //----------------------------------------------------------------------------------------
  779. inline void FW_CFrame::SetSubframe(Environment* ev, FW_Boolean isSubframe)
  780. {
  781.     fODFrame->SetSubframe(ev, isSubframe);
  782. }
  783.  
  784. //----------------------------------------------------------------------------------------
  785. //    FW_CFrame::AcquireUsedShape
  786. //----------------------------------------------------------------------------------------
  787. inline ODShape* FW_CFrame::AcquireUsedShape(Environment* ev, ODCanvas* biasCanvas) const
  788. {
  789.     return fODFrame->AcquireUsedShape(ev, biasCanvas);
  790. }
  791.  
  792. //----------------------------------------------------------------------------------------
  793. //    FW_CFrame::AcquireFrameShape
  794. //----------------------------------------------------------------------------------------
  795. inline ODShape* FW_CFrame::AcquireFrameShape(Environment* ev, ODCanvas* biasCanvas) const
  796. {
  797.     return fODFrame->AcquireFrameShape(ev, biasCanvas);
  798. }
  799.  
  800. //----------------------------------------------------------------------------------------
  801. //    FW_CFrame::AcquireContainingFrame
  802. //----------------------------------------------------------------------------------------
  803. inline ODFrame* FW_CFrame::AcquireContainingFrame(Environment* ev) const
  804. {
  805.     return fODFrame->AcquireContainingFrame(ev);
  806. }
  807.  
  808. //----------------------------------------------------------------------------------------
  809. //    FW_CFrame::AcquireInternalTransform
  810. //----------------------------------------------------------------------------------------
  811. inline ODTransform* FW_CFrame::AcquireInternalTransform(Environment* ev, ODCanvas* biasCanvas) const
  812. {
  813.     return fODFrame->AcquireInternalTransform(ev, biasCanvas);
  814. }
  815.  
  816. //----------------------------------------------------------------------------------------
  817. //    FW_CFrame::AcquireODWindow
  818. //----------------------------------------------------------------------------------------
  819. inline ODWindow* FW_CFrame::AcquireODWindow(Environment* ev) const
  820. {
  821.     return fODFrame->AcquireWindow(ev);
  822. }
  823.  
  824. //----------------------------------------------------------------------------------------
  825. //    FW_CFrame::GetID
  826. //----------------------------------------------------------------------------------------
  827. inline ODID FW_CFrame::GetID(Environment*) const
  828. {
  829.     return fFrameID;
  830. }
  831.  
  832. #ifdef FW_BUILD_WIN
  833. //----------------------------------------------------------------------------------------
  834. //    FW_CFrame::GetShadowWindow
  835. //----------------------------------------------------------------------------------------
  836. inline ODPlatformWindow FW_CFrame::GetShadowWindow(Environment*) const
  837. {
  838.     return fShadowWindow;
  839. }
  840. #endif
  841.  
  842. //----------------------------------------------------------------------------------------
  843. //    FW_CFrame::GetAdoptsContainerProperties
  844. //----------------------------------------------------------------------------------------
  845. inline FW_Boolean FW_CFrame::GetAdoptsContainerProperties(Environment*) const
  846. {
  847.     return fAdoptsContainerProperties;
  848. }
  849.  
  850. //----------------------------------------------------------------------------------------
  851. //    FW_CFrame::SetAdoptsContainerProperties
  852. //----------------------------------------------------------------------------------------
  853. inline void FW_CFrame::SetAdoptsContainerProperties(Environment*, FW_Boolean adoptsProperties)
  854. {
  855.     fAdoptsContainerProperties = adoptsProperties;
  856. }
  857.  
  858. //----------------------------------------------------------------------------------------
  859. // FW_CFrame::PrivSetRequestedFrame
  860. //----------------------------------------------------------------------------------------
  861. inline void FW_CFrame::PrivSetRequestedFrame(Environment*)
  862. {
  863.     fRequestedFrame = TRUE;
  864. }
  865.  
  866. //----------------------------------------------------------------------------------------
  867. // FW_CFrame::IsRequestedFrame
  868. //----------------------------------------------------------------------------------------
  869. inline FW_Boolean FW_CFrame::IsRequestedFrame(Environment*) const
  870. {
  871.     return fRequestedFrame;
  872. }
  873.  
  874. //----------------------------------------------------------------------------------------
  875. // FW_CFrame::GetSourceFrame
  876. //----------------------------------------------------------------------------------------
  877. inline FW_CFrame* FW_CFrame::GetSourceFrame(Environment*)
  878. {
  879.     return fSourceFrame;
  880. }
  881.  
  882. //----------------------------------------------------------------------------------------
  883. // FW_CFrame::PrivGetDroppableState
  884. //----------------------------------------------------------------------------------------
  885. inline FW_DroppableState FW_CFrame::PrivGetDroppableState() const
  886. {
  887.     return fDroppableState;
  888. }
  889.  
  890. //----------------------------------------------------------------------------------------
  891. // FW_CFrame::PrivSetDroppableState
  892. //----------------------------------------------------------------------------------------
  893. inline void FW_CFrame::PrivSetDroppableState(FW_DroppableState droppableState)
  894. {
  895.     fDroppableState = droppableState;
  896. }
  897.  
  898. //----------------------------------------------------------------------------------------
  899. // FW_CFrame::PrivSubViewsCreated
  900. //----------------------------------------------------------------------------------------
  901. inline FW_Boolean FW_CFrame::PrivSubViewsCreated(Environment*)
  902. {
  903.     return fSubViewsCreated;
  904. }
  905.  
  906. #endif
  907.  
  908.