home *** CD-ROM | disk | FTP | other *** search
- /*---------------------------------------------------------------
-
- CInterfaceProvider.cpp
-
- Provides the function of returning interface pointers based on
- passed in IDs.
-
- ---------------------------------------------------------------*/
-
- #include "IInterfaceProvider.h"
- #include "CInterfaceProvider.h"
-
- #include "CPluginInfo.h"
- #include "CPluginDrawing.h"
-
-
- OSErr CInterfaceProvider::GetInterfacePointer( unsigned long inID, void** outInterfacePtr )
- {
- OSErr returnValue = noErr;
-
- // create an object based on the passed in ID
- switch( inID ){
- case IPluginInfo_ID:
- {
- *outInterfacePtr = new CPluginInfo();
- } break;
-
- case IPluginDraw_ID:
- {
- *outInterfacePtr = new CPluginDrawing();
- } break;
-
- default:
- {
- returnValue = 1; // an error occured
- };
-
- }
-
- return returnValue;
- }