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 / Util / CustomHandlers.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-07  |  5.6 KB  |  191 lines

  1. #pragma once
  2. /*****
  3.  *
  4.  *    CustomHeaders.h
  5.  *
  6.  *    Function definitions for custom functions defined in user modified files.
  7.  *
  8.  *    This is a support file for "Grant's CGI Framework".
  9.  *    Please see the license agreement that accompanies the distribution package
  10.  *    for licensing details.
  11.  *
  12.  *    Copyright ©1996 by Grant Neufeld
  13.  *    grant@acm.com
  14.  *    http://arpp.carleton.ca/cgi/framework/
  15.  *
  16.  *****/
  17.  
  18. #include "MyConfiguration.h"
  19.  
  20. #if kCompilingForWSAPI
  21. #include <WSAPI.h>
  22. #endif
  23.  
  24. #include "CGI.h"
  25.  
  26.  
  27. /***  FUNCTION PROTOTYPES  ***/
  28.  
  29. /* Process a document.
  30.     Called in AEHandlers.c */
  31. p_export OSErr    CustomOpenDocument    ( FSSpec * );
  32. #if !(kCompileWithout_MY_Names)
  33. #define MyOpenDocument    CustomOpenDocument
  34. #endif
  35.  
  36.  
  37. /**  CGI HANDLERS  **/
  38. #if    kCompileWithCGICode
  39.  
  40. /* this function is where you do the actual CGI processing */
  41. p_export void        CustomCGIProcess        ( CGIHdl );
  42.     
  43. /* this function will be called after the cgi result has been returned.
  44.     It will contain the same CGIHdl that was used for the CustomCGIProcess */
  45. p_export void        CustomCGIPostProcess    ( CGIHdl );
  46.  
  47. //••• WARNING: THIS FUNCTION WILL BE REMOVED IN THE FINAL RELEASE
  48. //•••            YOU SHOULD MOVE THE HEADER TO YOUR OWN HEADER FILE
  49. //•••            IF YOU WISH TO CONTINUE USING THIS FUNCTION IN YOUR SOURCE
  50. //•••            All of it's functionality will be moved to
  51. //•••            'CustomStartup' in "MyHandlers.c"
  52. /* this function is called once at startup time.
  53.     Put any CGI specific initialization you need to do in it. */
  54. p_export Boolean    CustomCGIStartup        ( void );
  55.  
  56. /* this function is called at quitting time.
  57.     Put any CGI specific cleanup you need to do in it.
  58.     The Boolean will indicate true if you are allowed to make
  59.     user interface calls. */
  60. p_export Boolean    CustomCGIQuit            ( Boolean );
  61.  
  62. #if kCompilingForWSAPI
  63. /* this function is called when the plug-in recieves a register command
  64.     from the WebSTAR server */
  65. WSAPI_ErrorCode        CustomCGIWSAPIRegister    ( WSAPI_CommandPBPtr );
  66. #endif
  67.  
  68. #if !(kCompileWithout_MY_Names)
  69. #define MyCGIProcess    CustomCGIProcess
  70. #define MyCGIStartup    CustomCGIStartup
  71. #define MyCGIQuit        CustomCGIQuit
  72. #endif
  73.  
  74. #else    /* if not kCompileWithCGICode */
  75.  
  76.     /* these are defined like this here so the StartupApplication function
  77.         doesn't have to be messed with when compiling without the CGI module */
  78. //    #define CustomCGIStartup()    (true)
  79.     #define CustomCGIQuit()        (true)
  80.  
  81. #endif    /* kCompileWithCGICode */
  82.  
  83.  
  84. /**  LISTSTAR HANDLERS  **/
  85. #if kCompileWithListSTARCode
  86.  
  87. /* this is the function which you must define for your particular application */
  88. p_export void        CustomListSTARProcess    ( LStarHdl );
  89.  
  90. //••• WARNING: THIS FUNCTION WILL BE REMOVED IN THE FINAL RELEASE
  91. //•••            YOU SHOULD MOVE THE HEADER TO YOUR OWN HEADER FILE
  92. //•••            IF YOU WISH TO CONTINUE USING THIS FUNCTION IN YOUR SOURCE
  93. //•••            All of it's functionality will be moved to
  94. //•••            'CustomStartup' in "MyHandlers.c"
  95. /* this function is called once at startup time.
  96.     Put any initialization you need to do in it. */
  97. p_export Boolean    CustomListSTARStartup    ( void );
  98.  
  99. #if !(kCompileWithout_MY_Names)
  100. #define MyListSTARProcess    CustomListSTARProcess
  101. #define MyListSTARStartup    CustomListSTARStartup
  102. #endif
  103.  
  104. #else    /* if not kCompileWithListSTARCode */
  105.     
  106. //    #define CustomListSTARStartup()    (true)
  107.  
  108. #endif    /* kCompileWithListSTARCode */
  109.  
  110.  
  111. /**  USER INTERFACE  **/
  112.  
  113. /* Called in EventUtil.c */
  114. p_export void    CustomKeyPress        ( EventRecord * );
  115. p_export OSErr    CustomDoStartDrag    ( EventRecord *, WindowPtr );
  116. p_export void    CustomWindowIdle    ( WindowPtr );
  117.  
  118. /* Called in WindowUtil.c */
  119. p_export OSErr    CustomCloseWindow        ( WindowPtr );
  120. p_export void    CustomActivateWindow    ( WindowPtr, Boolean );
  121. p_export void    CustomUpdateWindow        ( WindowPtr );
  122. p_export void    CustomClickInWindow        ( WindowPtr, Point, Boolean * );
  123. p_export void    CustomGrowWindow        ( WindowPtr, Point );
  124.  
  125. /* called in EventuUtil.c */
  126. p_export void    CustomDialogMouseDown    ( EventRecord *, DialogPtr, short );
  127.  
  128. #if !(kCompileWithout_MY_Names)
  129. #define MyKeyPress            CustomKeyPress
  130. #define MyDoStartDrag        CustomDoStartDrag
  131. #define MyCloseWindow        CustomCloseWindow
  132. #define MyActivateWindow    CustomActivateWindow
  133. #define MyUpdateWindow        CustomUpdateWindow
  134. #define MyClickInWindow        CustomClickInWindow
  135. #endif
  136.  
  137.  
  138. /**  PROCESS & THREADS  **/
  139.  
  140. #if kCompileWithPeriodicTask
  141. p_export void    CustomPeriodicTask    ( void );
  142. #endif
  143.  
  144. /* this function will be called periodically from the deferred tasks
  145.     thread when the application is not busy, (or at idle time if the
  146.     thread can't be created).
  147.     It should not use much time since events may come in while it is
  148.     processing. This can be otherwise if you require the Thread Manager
  149.     and use 'ProcessGiveTime' frequently.
  150.     Note that it is possible for the deferred task thread to not be
  151.     called at all if the application is continually busy (IE. new CGI
  152.     events come in before old ones are finished so that there is no
  153.     non-busy time). This is highly unlikely, but should be taken into
  154.     account. I may provide a 'timer' mechanism in the future whereby
  155.     you could set a time by which the deferred task must be called,
  156.     even if the application is busy. */
  157. #if kCompileWithDeferredTask
  158. p_export void    CustomDeferredTask    ( void );
  159. #endif
  160.  
  161.  
  162. /**  STARTUP & QUIT  **/
  163.  
  164. p_export SInt32    CustomStartup    (
  165.     #if kCompilingForWSAPI
  166.         WSAPI_CommandPBPtr
  167.     #else
  168.         void
  169.     #endif
  170.     );
  171. #if !(kCompileWithout_MY_Names)
  172. #define MyStartup    CustomStartup
  173. #endif
  174.  
  175. p_export Boolean    CustomQuit    ( Boolean );
  176. #if !(kCompileWithout_MY_Names)
  177. #define MyQuit    CustomQuit
  178. #endif
  179.  
  180.  
  181. /**  MISCELLANEOUS  **/
  182.  
  183. /* this function is called if some sort of emergency has arisen.
  184.     What you're basically being asked to do is release any memory,
  185.     resources, files, etc. that you can.
  186.     Called in CGI.c */
  187. p_export void        CustomEmergencyHandler    ( void );
  188.  
  189.  
  190. /***** EOF *****/
  191.