home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-08 | 4.0 KB | 169 lines | [TEXT/CWIE] |
- //========================================================================================
- // Release Version: $ ODF 1 $
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
-
- //================================================================================
- #include "DataCopy.hpp"
-
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- #ifndef CONTENT_H
- #include "Content.h"
- #endif
-
- #ifndef BINDING_K
- #include "Binding.k"
- #endif
-
- #ifndef FRAME_H
- #include "Frame.h"
- #endif
-
- #ifndef SELECTION_H
- #include "Selection.h" // CDataCopySelection
- #endif
-
- // ----- Framework Layer -----
- #ifndef FWPRESEN_H
- #include "FWPresen.h" // FW_CPresentation
- #endif
-
- #ifndef FWUTIL_H
- #include "FWUtil.h" // FW_Beep()
- #endif
-
- #ifndef FWABOUT_H
- #include "FWAbout.h" //::FW_About()
- #endif
-
- // ----- OS Layer -----
- #ifndef FWMENU_H
- #include "FWMenu.h" // FW_CMenuBar, FW_CPullDownMenu
- #endif
-
- #ifndef FWCFMRES_H
- #include "FWCFMRes.h" // FW_CSharedLibraryResourceFile
- #endif
-
- #ifndef FWRESTYP_H
- #include "FWResTyp.h" // MULTISTRINGRES
- #endif
-
- #ifndef FWEVENT_H
- #include "FWEvent.h" // FW_CMenuEvent
- #endif
-
- #ifndef FWSUSINK_H
- #include "FWSUSink.h" // FW_CStorageUnitSink
- #endif
-
- #ifndef FWBARRAY_H
- #include "FWBArray.h" // FW_CByteArray
- #endif
-
- // ----- Foundation Layer -----
- #ifndef FWSTREAM_H
- #include <FWStream.h> // FW_InitializeArchiving
- #endif
-
- #ifndef FWMEMMGR_H
- #include "FWMemMgr.h" // FW_CMemoryManager
- #endif
-
- #ifndef FWSUSINK_H
- #include "FWSUSink.h" // FW_CStorageUnitSink
- #endif
-
- //--- OpenDoc ------------------------------------------------------------------
- #ifndef SOM_Module_OpenDoc_StdProps_defined
- #include <StdProps.xh> // kODPropContents
- #endif
-
- //==============================================================================
- #ifdef FW_BUILD_MAC
- #pragma segment DataCopy
- #endif
-
- FW_DEFINE_AUTO(CDataCopyPart)
-
- //==============================================================================
- CDataCopyPart::CDataCopyPart(ODPart* odPart)
- : FW_CPart(odPart, FW_gInstance, kPartInfoID),
- fPresentation(NULL),
- fPartContent(NULL)
- {
- FW_END_CONSTRUCTOR
- }
-
- //--------------------------------------------------------------------------------
- CDataCopyPart::~CDataCopyPart()
- {
- FW_START_DESTRUCTOR
- }
-
- //--------------------------------------------------------------------------------
- void
- CDataCopyPart::Initialize(Environment* ev) // Override
- {
- FW_CPart::Initialize(ev);
- CDataCopySelection* selection = FW_NEW(CDataCopySelection, (ev, fPartContent));
- const ODType kMainPresentation = "Apple:Presentation:DataCopy";
- const FW_Boolean kDefaultPresentation = true;
- fPresentation = RegisterPresentation(ev, kMainPresentation,
- kDefaultPresentation, selection);
- }
-
- //--------------------------------------------------------------------------------
- FW_Boolean
- CDataCopyPart::DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent) // Override
- {
- FW_Boolean menuHandled = TRUE;
- ODCommandID commandID = theMenuEvent.GetCommandID(ev);
-
- switch (commandID)
- {
- case kODCommandAbout:
- ::FW_About(ev, this, kAbout);
- break;
-
- default:
- menuHandled = FALSE;
- }
-
- return menuHandled;
- }
-
- //--------------------------------------------------------------------------------
- FW_CFrame*
- CDataCopyPart::NewFrame(Environment* ev, ODFrame* odFrame,
- FW_CPresentation* presentation, FW_Boolean fromStorage) // Override
- {
- FW_UNUSED(presentation);
- FW_UNUSED(fromStorage);
- return FW_NEW(CDataCopyFrame, (ev, odFrame, presentation, fPartContent));
- }
-
- //------------------------------------------------------------------------------
- FW_CContent*
- CDataCopyPart::NewPartContent(Environment* ev)
- {
- fPartContent = FW_NEW(CDataCopyContent, (ev, this));
- return fPartContent;
- }
-
- //------------------------------------------------------------------------------
- void
- CDataCopyPart::MyInvalidatePresentation(Environment* ev, FW_CRect& rect)
- {
- fPresentation->Invalidate(ev, rect);
- }
-
- //------------------------------------------------------------------------------
- void
- CDataCopyPart::MyInvalidatePresentation(Environment* ev)
- {
- fPresentation->Invalidate(ev);
- }
-