home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 January / macformat46.iso / Shareware Plus / Developers / Library / Grant's CGI Framework / Grant's CGI Framework / grantscgi / Interface / SplashScreen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-20  |  1.8 KB  |  83 lines

  1. /*****
  2.  *
  3.  *    SplashScreen.c
  4.  *
  5.  *    If you don't want a splash screen for your CGI, remove this file and the two
  6.  *    SplashScreen calls made in the function 'StartupApplication' in "Startup.c".
  7.  *    Also remove the resources: cicn #128, ICON #128, dctb #401, DITL #401, DLOG #401
  8.  *
  9.  *    This is a support file for "Grant's CGI Framework".
  10.  *    Please see the license agreement that accompanies the distribution package
  11.  *    for licensing details.
  12.  *
  13.  *    Copyright ©1995,1996 by Grant Neufeld
  14.  *    grant@acm.com
  15.  *    http://arpp.carleton.ca/cgi/framework/
  16.  *
  17.  *****/
  18.  
  19. #include "MyConfiguration.h"
  20. #if kCompileWithForeground && kCompileWithSplashScreen
  21.  
  22. #include "globals.h"
  23.  
  24. #include "DebugUtil.h"
  25.  
  26. #include "SplashScreen.h"
  27.  
  28.  
  29. /***  LOCAL VARIABLES ***/
  30.  
  31. static    DialogPtr    vSplashScreenDlog;
  32. static    GrafPtr        vSplashScreenSavePort;
  33.  
  34.  
  35. /***  LOCAL CONSTANTS ***/
  36.  
  37. #define kSplashScreenDLOG    401
  38.  
  39.  
  40. /***  FUNCTIONS  ***/
  41.  
  42. /*  */
  43. void
  44. SplashScreenCreate ( void )
  45. {
  46.     ParamText ( gVersionStr, NULL, NULL, NULL );
  47.     
  48.     /* get dialog ptr from resource file */
  49.     vSplashScreenDlog = GetNewDialog ( kSplashScreenDLOG, NULL, (WindowPtr)-1L );
  50.     if ( vSplashScreenDlog != NULL )
  51.     {
  52.         /* dialog load successful */
  53.         SetWRefCon ( vSplashScreenDlog, (long)kSplashScreenDLOG );
  54.         
  55.         /* save the current port, whatever it is */
  56.         GetPort ( &vSplashScreenSavePort );
  57.         
  58.         /* now make it visible */
  59.         ShowWindow        ( vSplashScreenDlog );
  60.         SelectWindow    ( vSplashScreenDlog );
  61.         DrawDialog        ( vSplashScreenDlog );
  62.     }
  63. } /* SplashScreenCreate */
  64.  
  65.  
  66. /*  */
  67. void
  68. SplashScreenDispose ( void )
  69. {
  70.     if ( vSplashScreenDlog != NULL )
  71.     {
  72.         my_assert ( vSplashScreenSavePort != NULL, "\pSplashScreenDispose: vSplashScreenSavePort is nil" );
  73.         
  74.         DisposeDialog    ( vSplashScreenDlog );
  75.         SetPort            ( vSplashScreenSavePort );
  76.     }
  77. } /* SplashScreenDispose */
  78.  
  79.  
  80. #endif    /* kCompileWithForeground && kCompileWithSplashScreen */
  81.  
  82. /*****  EOF  *****/
  83.