home *** CD-ROM | disk | FTP | other *** search
- #include "FD Interface.h"
-
- /*****
- * This is the module's main entrypoint.
- *****/
- Boolean ModuleMain( short message, ModuleDataRec *moduleData)
- {
- switch (message)
- {
- case eStartup :
- // The application just started. Set up any custom stuff you want.
- SetStatusParams( TRUE, TRUE, "\pMoof!");
- break;
-
- case eSFInitialize :
- // The SFGetFile is about to be brought up - you can install your own at this point
- // if you want to.
- // If the user chooses a file, you will receive one each of eValidate and eProcessFile
- // messages. If s/he chooses a folder, you will receive an eValidate and eProcessFile
- // message for each file in the folder, and each file in each folder on down the line.
- // NOTE: you only get one of these for each time the SFGetFile dialog comes up. If
- // you want to initialize something before each file, do it in the eProcessFile case.
- break;
-
- case eAEInitialize :
- // An 'odoc' AppleEvent has been received - you are about to be flooded with
- // eValidateFile and eProcessFile messages (a set for each file you need to process)
- // NOTE, you only get one eAEInitialize for the whole batch of files. If you want to
- // initialize something before each file, do it in the eProcessFile case.
- break;
-
- case eValidateFile :
- // return TRUE if theFile in moduleData is one that you want to process, FALSE otherwise
- break;
-
- case eProcessFile :
- // Do your stuff - theFile in moduleData is the file you need to process
- // Here, I simply am showing off the progress bar stuff.
- {
- short i;
-
- for ( i=0; i <= 50; i++) SetStatusPercentage( i);
-
- for ( ; i >= 25; i--) SetStatusPercentage( i);
-
- for ( ; i <= 100; i++) SetStatusPercentage( i);
- }
- break;
-
- case eDispose :
- // If you allocated any storage in eSFInitialize or eAEInitialize, dispose of it here.
- break;
-
- case eDoAboutBox :
- // Give yourself some credit.
- break;
-
- case eQuitting :
- // The application is about to quit, save anything that needs to be saved.
- break;
- }
-
- return TRUE; // This is actually ignored except as a result of the eValidateFile message.
- }
-
-
-
-
-
-
-
-