home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 408.lha / StarBlankers / app.h < prev    next >
C/C++ Source or Header  |  1990-09-02  |  8KB  |  191 lines

  1.  
  2.    /***********************************************************************
  3.    *                                                                      *
  4.    *                            COPYRIGHTS                                *
  5.    *                                                                      *
  6.    *   Copyright (c) 1990  Commodore-Amiga, Inc.  All Rights Reserved.    *
  7.    *                                                                      *
  8.    ***********************************************************************/
  9.  
  10. #ifndef APP_H
  11. #define APP_H
  12. #include <clib/all_protos.h>
  13.  
  14. #ifdef LATTICE
  15. #include <clib/gadtools_protos.h>
  16. #endif
  17.  
  18. #include <utility/tagitem.h>
  19.  
  20. /**********************************************************************/
  21. /* Prototypes for functions declared in app.c and called from the     */
  22. /* standard modules.                                                  */
  23. /**********************************************************************/
  24. VOID setupCustomGadgets(struct Gadget **);
  25. VOID HandleGadget(ULONG,ULONG);
  26. VOID setupCustomMenu(VOID);
  27. VOID handleCustomMenu(UWORD);
  28. VOID refreshWindow(VOID);
  29. BOOL setupCustomCX(VOID);
  30. VOID shutdownCustomCX(VOID);
  31. VOID handleCustomCXMsg(ULONG);
  32. VOID handleCustomCXCommand(ULONG);
  33. VOID handleCustomSignal(VOID);
  34.  
  35. /**********************************************************************/
  36. /* Prototypes for functions declared in the standard modules and      */
  37. /* called by app.c                                                    */
  38. /**********************************************************************/
  39. VOID setupWindow(VOID);
  40. VOID shutdownWindow(VOID);
  41. VOID terminate(VOID);
  42.  
  43. /**********************************************************************/
  44. /* Prototypes for functions declared in application modules and       */
  45. /* called by app.c                                                    */
  46. /**********************************************************************/
  47. BOOL setupBlanker(void);
  48. VOID mysetupCustomGadgets(struct Gadget **gad);
  49. VOID myHandleGadget(ULONG gad,ULONG code);
  50. VOID MyHandleCustomSignal(VOID);
  51.  
  52. /**********************************************************************/
  53. /* definitions for global variables declared in the standard modules  */
  54. /* referenced by app.c                                                */
  55. /**********************************************************************/
  56. extern CxObj                  *broker;
  57. extern SHORT                  topborder;
  58. extern VOID                   *vi;
  59. extern struct Menu            *menu;
  60. extern struct Library         *GadToolsBase;
  61. extern struct Gadget          *glist;
  62. extern char                   **ttypes;
  63. extern struct MsgPort         *cxport;
  64. extern struct IntuitionBase   *IntuitionBase;
  65. extern struct DrawInfo        *mydi;
  66. extern ULONG                  csigflag;
  67. extern struct Task            *maintask;
  68. extern BOOL                   IDCMPRefresh;
  69.  
  70. /**********************************************************************/
  71. /* definitions for global variables declared in app.c and             */
  72. /* referenced by the standard modules.                                */
  73. /**********************************************************************/
  74. extern struct TextAttr mydesiredfont;
  75.  
  76. /**********************************************************************/
  77. /* Commodities specific definitions.                                  */
  78. /*                                                                    */
  79. /* COM_NAME  - used for the scrolling display in the Exchange program */
  80. /* COM_TITLE - used for the window title bar and the long description */
  81. /*             in the Exchange program                                */
  82. /* COM_DESC  - Commodity description used by the Exchange program     */
  83. /* CX_DEFAULT_PRIORITY - default priority for this commodities broker */
  84. /*                       can be overidden by using icon TOOL TYPES    */
  85. /**********************************************************************/
  86. #define COM_NAME  "starblanker"
  87. #define COM_TITLE "Star Blanker"
  88. #define COM_DESCR "Screen Blanker"
  89. #define CX_DEFAULT_PRIORITY 0
  90. #define CX_DEFAULT_POP_KEY ("shift f1")
  91. #define CX_DEFAULT_POP_ON_START ("YES")
  92.  
  93. /**********************************************************************/
  94. /* Custom Signal control                                                     */
  95. /*                                                                    */
  96. /* If CSIGNAL = 0 then this commodity will NOT have a custom signal   */
  97. /* If CSIGNAL = 1 this commodity will support a custom signal         */
  98. /**********************************************************************/
  99. #define CSIGNAL 1
  100.  
  101. /**********************************************************************/
  102. /* Window control                                                     */
  103. /*                                                                    */
  104. /* If WINDOW = 0 then this commodity will NOT have a popup window     */
  105. /* If WINDOW = 1 this commodity will support a popup window with the  */
  106. /*               attributes defined below.                            */
  107. /**********************************************************************/
  108. #define WINDOW 1
  109.  
  110. #if WINDOW
  111. #define W(x) x
  112. #else
  113. #define W(x) ;
  114. #endif
  115.  
  116. #if WINDOW
  117.  
  118. extern struct Window   *window; /* our window */
  119. extern struct TextFont *font;
  120.  
  121. #define WINDOW_LEFT   134
  122. #define WINDOW_TOP    64
  123. #define WINDOW_WIDTH  300
  124. #define WINDOW_HEIGHT 42
  125. #define WINDOW_INNERHEIGHT 42
  126.  
  127. #define WINDOW_SIZING 0
  128. #if WINDOW_SIZING
  129. #define WINDOW_MAX_WIDTH  -1
  130. #define WINDOW_MIN_WIDTH  50
  131. #define WINDOW_MAX_HEIGHT -1
  132. #define WINDOW_MIN_HEIGHT 30
  133. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWSIZING | WINDOWDEPTH | SIMPLE_REFRESH )
  134. #else
  135. #define WINDOW_MAX_WIDTH  WINDOW_WIDTH
  136. #define WINDOW_MIN_WIDTH  WINDOW_WIDTH
  137. #define WINDOW_MAX_HEIGHT WINDOW_HEIGHT
  138. #define WINDOW_MIN_HEIGHT WINDOW_HEIGHT
  139. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWDEPTH | SIMPLE_REFRESH )
  140. #endif  /* WINDOW_SIZING */
  141.  
  142. #define IFLAGS (MENUPICK | MOUSEBUTTONS | GADGETUP | GADGETDOWN | MOUSEMOVE | CLOSEWINDOW | REFRESHWINDOW )
  143.  
  144.                                      /* hotkey definitions                */
  145. #define POP_KEY_ID     (86L)         /* pop up identifier                 */
  146.  
  147. /**********************************************************************/
  148. /* Gadget control                                                     */
  149. /*                                                                    */
  150. /* Here are the gadget specific definitions. Note that these are      */
  151. /* included only if WINDOW=1 since gadgets make no sense without a    */
  152. /* window.                                                            */
  153. /**********************************************************************/
  154. #define GAD_HIDE     1
  155. #define GAD_DIE      2
  156. #define GAD_SECS     3
  157.  
  158. /**********************************************************************/
  159. /* Menu control                                                       */
  160. /*                                                                    */
  161. /* Here are the menu specific definitions. Note that these are        */
  162. /* included only if WINDOW=1 since menus make no sense without a      */
  163. /* window.                                                            */
  164. /**********************************************************************/
  165. #define MENU_HIDE     1
  166. #define MENU_DIE      2
  167.  
  168. #endif  /* WINDOW */
  169.  
  170. /**********************************************************************/
  171. /* Debug control                                                      */
  172. /*                                                                    */
  173. /* The first define converts any printfs that got in by mistake into  */
  174. /* kprintfs. If you are debuging to the console you can change        */
  175. /* kprintfs into printfs.                                             */
  176. /* The D1(x) define controls debugging in the standard modules. Use   */
  177. /* The D(x) macro for debugging in the app.c module.               */
  178. /**********************************************************************/
  179. void kprintf(char *,...);
  180. #define printf kprintf
  181.  
  182. #ifdef DEBUG
  183. #define D1(x) x
  184. #define D(x)  x
  185. #else
  186. #define D1(x) ;
  187. #define D(x)  ;
  188. #endif /* NO DEBUG */
  189.  
  190. #endif /* APP_H */
  191.