home *** CD-ROM | disk | FTP | other *** search
/ The Best of Mecomp Multimedia 1 / Mecomp-CD.iso / amiga / grafic / cyberblanker / source-code / app.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-05  |  8.6 KB  |  203 lines

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