home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Samples / SampleCode / VCDemo / Source / InitMac.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-13  |  1.1 KB  |  65 lines  |  [TEXT/MPCC]

  1. /*
  2.     InitMac.c
  3.  
  4.     Initialize application environment.
  5.  
  6.     © 1995 Apple Computer, Inc.
  7. */
  8.  
  9. #include <OSUtils.h>
  10. #include <QuickDraw.h>
  11. #include <Fonts.h>
  12. #include <Windows.h>
  13. #include <Menus.h>
  14. #include <TextEdit.h>
  15. #include <OSEvents.h>
  16. #include <Dialogs.h>
  17. #include <Memory.h>
  18.  
  19. #include "EventLoop.h"
  20.  
  21. #define    _Unimplemented 0xA89F
  22. #define    _WaitNextEvent 0xA860
  23.  
  24. Boolean TrapAvailable ( short tNum, short tType);
  25. void InitToolBox(short numberOfMasters);
  26. Boolean WNEIsImplemented( void );
  27.  
  28.  
  29. Boolean TrapAvailable ( short tNum, short tType)
  30. {
  31.     return ( NGetTrapAddress(tNum,tType) != GetToolTrapAddress(_Unimplemented) );
  32. }
  33.  
  34. Boolean WNEIsImplemented( void )
  35. {
  36.     SysEnvRec    theWorld;
  37.     
  38.     SysEnvirons(1, &theWorld);
  39.     if (theWorld.machineType < 0)
  40.         return false;
  41.     else
  42.         return TrapAvailable ( _WaitNextEvent, ToolTrap);
  43. }
  44.  
  45. void InitToolBox(short numberOfMasters)
  46. {
  47.     InitGraf(&qd.thePort);
  48.     InitFonts();
  49.     InitWindows();
  50.     InitMenus();
  51.     InitCursor();
  52.     TEInit();
  53.     FlushEvents(everyEvent, 0);
  54.     InitDialogs(0L);
  55.     
  56.     while(numberOfMasters--)
  57.         MoreMasters();
  58.         
  59.     MaxApplZone();
  60.  
  61.     WNE_available = WNEIsImplemented();
  62. }
  63.  
  64. /* EOF */
  65.