home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-07-21 | 2.5 KB | 118 lines | [TEXT/CWIE] |
- // WASTE Object Archive intialization code
- // by Michael F. Kamprath, kamprath@kagi.com
- // maintenance by John C. Daub, hsoi@eden.com
- //
- // v1.0.1, 6 April 1995
- //
- // History
- //
- // v1.0.1: Updated the handler installer calls to be compatible with v1.1a6
- // of WASTE (CWATE v1.1r10 or later).
- // v1.0.2: Updated the handler installer calls to be compatible with v1.1a8
- // of WASTE (CWASTE v1.1r12 or later). Basically, they now use UPPs.
- // Code update actually done by Dan Crevier.
- // v1.1: Changed code to use individual object installers.
- //
- // v1.2: Updated calls to be compatabile with WASTE v1.2a5.
- // - Added precompiler directives
- // - InstallAllWASTEObjectHandlers() now takes a WEReference as an argument
- // - Added Init/ExitWASTEObjectHandlers() to perform any startup/shutdown tasks
- // from within the library
- // - Added DoObjectTasks() to facilitate handling of periodic object tasks
- // - Added WEObjectPaste()
-
- #ifndef __DRAG__
- #include <Drag.h>
- #endif
-
- #ifndef _WASTE_
- #include "WASTE.h"
- #endif
-
- #include "WE_hfs_Handler.h"
- #include "WE_PICT_Handler.h"
- #include "WE_snd_Handler.h"
-
- #ifndef _WASTEOBJECTS_
- #include "WASTE_Objects.h"
- #endif
-
- #ifndef true
- #define true 1
- #endif
-
- #ifndef false
- #define false 0
- #endif
-
-
- //
- // Installs ALL the object handlers in the given WASTE instance
- // (or install all object handlers globally if passed nil)
- //
- OSErr InstallAllWASTEObjHandlers( WEReference theWE )
- {
- OSErr iErr;
-
- iErr = InstallPICTObject( theWE );
- if (iErr) return(iErr);
-
- iErr = InstallSoundObject( theWE );
- if (iErr) return(iErr);
-
- iErr = InstallHFSObject( theWE );
- if (iErr) return(iErr);
-
- return(noErr);
- }
-
- //
- // InitWASTEObjectHandlers()
- // Handles internal initializations (if any)
-
- void InitWASTEObjectHandlers( void )
- {
- InitSoundObjectHandler();
- }
-
- //
- // ExitWASTEObjectHandlers()
- // Handlers internal exit/clean-up (if any)
-
- void ExitWASTEObjectHandlers( void )
- {
- // nothing now...here for future expansion
- }
-
-
- //
- // DoObjectTasks()
- // MUST be called periodically by your application (ideally in the main event loop)
- // to handle object-related tasks
-
- OSErr DoObjectTasks( WEReference theWE )
- {
- #pragma unused (theWE)
-
- CheckSoundStatus();
-
- return noErr;
- }
-
-
- //
- // WEObjectsPaste()
- // Used in place of WEPaste to allow for handling of special object types
- // (falls through to WEPaste then if needed)
-
- pascal OSErr WEObjectsPaste( WEReference hWE )
- {
- // long scrapOffset;
- // OSErr iErr;
-
- // check for object types that need special handling
-
- // (none currently)
-
- return WEPaste( hWE );
- }