MacMain.c

/*
    File:       MacMain.c
 
    Contains:   Simple test shell for testing Digitizers.
 
    Written by:     
 
    Copyright:  Copyright © 1994-1999 by Apple Computer, Inc., All Rights Reserved.
 
                You may incorporate this Apple sample source code into your program(s) without
                restriction. This Apple sample source code has been provided "AS IS" and the
                responsibility for its operation is yours. You are not permitted to redistribute
                this Apple sample source code as "Apple sample source code" after having made
                changes. If you're going to re-distribute the source, we require that you make
                it clear in the source that the code was descended from Apple sample source
                code, but that you've made changes.
 
    Change History (most recent first):
                7/28/1999   Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
                
 
*/
 
// INCLUDES
#include <stdio.h>
 
#ifdef __MWERKS__
#include <sioux.h>
#endif // __MWERKS__
 
#include "DTSQTUtilities.h"
#include "MacFramework.h"
 
 
// MAIN
// ______________________________________________________________________
void main(void)
{
    OSErr anErr = noErr;
 
// This is for controlling the sioux window under Metrowerks (5.0 forward)
#ifdef USESIOUX 
    SIOUXSettings.initializeTB = false;
    SIOUXSettings.setupmenus = false;
    SIOUXSettings.standalone = false;
    SIOUXSettings.asktosaveonclose = true;
#endif // USESIOUX  
 
    InitStack(10*1024L);                        // Add 10k more to the stack, for possible QD and Sound Manager needs
    InitMacEnvironment(10L);                    // 10 * MoreMasters
    InitMenubar();
    
    if( !QTUIsQuickTimeInstalled() )
    {
        ShowWarning("\pQuickTime is not installed on this system -- we will exit!", 0);
        ExitToShell();
    }
#if powerc  
    if( !QTUIsQuickTimeCFMInstalled() )
    {
        ShowWarning("\pThe QuickTime PowerPlug file is not available -- we will exit!", 0);
        ExitToShell();                              // I could disable features as well.
    }
#endif // powerc
 
    anErr = EnterMovies(); DebugAssert(anErr == noErr);
    if(anErr != noErr)
    {
        ShowWarning("\pWe have problems initializing the QuickTime environment (exit): ", anErr);
        ExitToShell();
    }
 
    printf("Digitizer Shell -- for testing of Quicktime Digitizer functionality.\n");
 
    MainEventLoop();
}