home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Atlanta_1990 / Atlanta-Devcon.1 / Libraries / Commodities / Blank / app.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-26  |  7.9 KB  |  186 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.  
  13. #ifdef LATTICE
  14. #include <clib/all_protos.h>
  15. #include <pragmas/gadtools_pragmas.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.  
  48. /**********************************************************************/
  49. /* definitions for global variables declared in the standard modules  */
  50. /* referenced by app.c                                                */
  51. /**********************************************************************/
  52. extern CxObj                  *broker;
  53. extern SHORT                  topborder;
  54. extern VOID                   *vi;
  55. extern struct Menu            *menu;
  56. extern struct Library         *GadToolsBase;
  57. extern struct Gadget          *glist;
  58. extern char                   **ttypes;
  59. extern struct MsgPort         *cxport;
  60. extern struct IntuitionBase   *IntuitionBase;
  61. extern struct DrawInfo        *mydi;
  62. extern ULONG                  csigflag;
  63. extern struct Task            *maintask;
  64. extern BOOL                   IDCMPRefresh;
  65.  
  66. /**********************************************************************/
  67. /* definitions for global variables declared in app.c and             */
  68. /* referenced by the standard modules.                                */
  69. /**********************************************************************/
  70. extern struct TextAttr mydesiredfont;
  71.  
  72. /**********************************************************************/
  73. /* Commodities specific definitions.                                  */
  74. /*                                                                    */
  75. /* COM_NAME  - used for the scrolling display in the Exchange program */
  76. /* COM_TITLE - used for the window title bar and the long description */
  77. /*             in the Exchange program                                */
  78. /* COM_DESC  - Commodity description used by the Exchange program     */
  79. /* CX_DEFAULT_PRIORITY - default priority for this commodities broker */
  80. /*                       can be overidden by using icon TOOL TYPES    */
  81. /**********************************************************************/
  82. #define COM_NAME  "Blank"
  83. #define COM_TITLE "Blank"
  84. #define COM_DESCR "Commodities Application Skeleton"
  85. #define CX_DEFAULT_PRIORITY 0
  86. #define CX_DEFAULT_POP_KEY ("shift f1")
  87. #define CX_DEFAULT_POP_ON_START ("YES")
  88.  
  89. /**********************************************************************/
  90. /* Custom Signal control                                              */
  91. /*                                                                    */
  92. /* If CSIGNAL = 0 then this commodity will NOT have a custom signal   */
  93. /* If CSIGNAL = 1 this commodity will support a custom signal         */
  94. /**********************************************************************/
  95. #define CSIGNAL 0
  96.  
  97. /**********************************************************************/
  98. /* Window control                                                     */
  99. /*                                                                    */
  100. /* If WINDOW = 0 then this commodity will NOT have a popup window     */
  101. /* If WINDOW = 1 this commodity will support a popup window with the  */
  102. /*               attributes defined below.                            */
  103. /**********************************************************************/
  104. #define WINDOW 1
  105.  
  106. #if WINDOW
  107. #define W(x) x
  108. #else
  109. #define W(x) ;
  110. #endif
  111.  
  112. #if WINDOW
  113.  
  114. extern struct Window   *window; /* our window */
  115. extern struct TextFont *font;
  116.  
  117. #define WINDOW_LEFT        134
  118. #define WINDOW_TOP         64
  119. #define WINDOW_WIDTH       362
  120. #define WINDOW_HEIGHT      68
  121. #define WINDOW_INNERHEIGHT 70
  122.  
  123. #define WINDOW_SIZING 0
  124. #if WINDOW_SIZING
  125. #define WINDOW_MAX_WIDTH   -1
  126. #define WINDOW_MIN_WIDTH   50
  127. #define WINDOW_MAX_HEIGHT  -1
  128. #define WINDOW_MIN_HEIGHT  30
  129. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWSIZING | WINDOWDEPTH | SIMPLE_REFRESH )
  130. #else
  131. #define WINDOW_MAX_WIDTH  WINDOW_WIDTH
  132. #define WINDOW_MIN_WIDTH  WINDOW_WIDTH
  133. #define WINDOW_MAX_HEIGHT WINDOW_HEIGHT
  134. #define WINDOW_MIN_HEIGHT WINDOW_HEIGHT
  135. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWDEPTH | SIMPLE_REFRESH )
  136. #endif  /* WINDOW_SIZING */
  137.  
  138. #define IFLAGS (MENUPICK | MOUSEBUTTONS | GADGETUP | GADGETDOWN | MOUSEMOVE | CLOSEWINDOW | REFRESHWINDOW )
  139.  
  140.                                      /* hotkey definitions            */
  141. #define POP_KEY_ID     (86L)         /* pop up identifier             */
  142.  
  143. /**********************************************************************/
  144. /* Gadget control                                                     */
  145. /*                                                                    */
  146. /* Here are the gadget specific definitions. Note that these are      */
  147. /* included only if WINDOW=1 since gadgets make no sense without a    */
  148. /* window.                                                            */
  149. /**********************************************************************/
  150. #define GAD_HIDE     1
  151. #define GAD_DIE      2
  152.  
  153. /**********************************************************************/
  154. /* Menu control                                                       */
  155. /*                                                                    */
  156. /* Here are the menu specific definitions. Note that these are        */
  157. /* included only if WINDOW=1 since menus make no sense without a      */
  158. /* window.                                                            */
  159. /**********************************************************************/
  160. #define MENU_HIDE     1
  161. #define MENU_DIE      2
  162.  
  163. #endif  /* WINDOW */
  164.  
  165. /**********************************************************************/
  166. /* Debug control                                                      */
  167. /*                                                                    */
  168. /* The first define converts any printfs that got in by mistake into  */
  169. /* kprintfs. If you are debuging to the console you can change        */
  170. /* kprintfs into printfs.                                             */
  171. /* The D1(x) define controls debugging in the standard modules. Use   */
  172. /* The D(x) macro for debugging in the app.c and application modules. */
  173. /**********************************************************************/
  174. void kprintf(char *,...);
  175. #define printf kprintf
  176.  
  177. #ifdef DEBUG
  178. #define D1(x) x
  179. #define D(x)  x
  180. #else
  181. #define D1(x) ;
  182. #define D(x)  ;
  183. #endif /* NO DEBUG */
  184.  
  185. #endif /* APP_H */
  186.