home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / dev / gui / visualarts / vainstall / visualarts.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-01  |  7.1 KB  |  204 lines

  1. /*
  2. **  $Filename: VisualArts.h $
  3. **  $Includes, V2.1 $
  4. **  $Date: 94/10/02 $
  5. **
  6. **
  7. **  (C) 1994 Danny Y. Wong              
  8. **  All Rights Reserved
  9. **
  10. **  DO NOT MODIFY
  11. */
  12.  
  13. #include <exec/types.h>
  14. #include <exec/memory.h>
  15. #include <exec/lists.h>
  16. #include <exec/nodes.h>
  17. #include <exec/ports.h>
  18. #include <exec/devices.h>
  19. #include <exec/io.h>
  20. #include <devices/console.h>
  21.  
  22. #include <intuition/intuition.h>
  23. #include <intuition/intuitionbase.h>
  24. #include <intuition/gadgetclass.h>
  25. #include <intuition/imageclass.h>
  26. #include <intuition/classes.h>
  27. #include <intuition/icclass.h>
  28. #include <intuition/sghooks.h>
  29. #include <graphics/displayinfo.h>
  30. #include <graphics/gfxbase.h>
  31. #include <graphics/gfxmacros.h>
  32. #include <libraries/gadtools.h>
  33. #include <libraries/dos.h>
  34. #include <workbench/workbench.h>
  35. #include <workbench/startup.h>
  36.  
  37. #include <clib/wb_protos.h>
  38. #include <clib/exec_protos.h>
  39. #include <clib/intuition_protos.h>
  40. #include <clib/gadtools_protos.h>
  41. #include <clib/graphics_protos.h>
  42. #include <clib/utility_protos.h>
  43. #include <clib/alib_protos.h>
  44. #include <clib/dos_protos.h>
  45.  
  46. #include "string.h" 
  47. #include "stdio.h"
  48. #include "stdlib.h"
  49. #include "ctype.h"
  50.  
  51. #include "PopUpMenuClass.h" 
  52.  
  53. /* context sensitive */
  54.  
  55. #define VA_Static       0x0001
  56. #define VA_ExpandX      0x0002
  57. #define VA_MoveX        0x0004
  58. #define VA_ExpandY      0x0008
  59. #define VA_MoveY        0x0010
  60.  
  61. /* defines for scroller window with super bitmap */
  62.  
  63. #define  MAX_LEVEL     (0xFFFFL)
  64. #define LAYERXOFFSET(win)  (win->RPort->Layer->Scroll_X)  
  65. #define LAYERYOFFSET(win)  (win->RPort->Layer->Scroll_Y)  
  66.  
  67. /* define for Image */
  68.  
  69. #ifndef IM
  70. #define IM(o)    ((struct Image *) o)
  71. #endif
  72.  
  73. /* define for determining the max value */
  74.  
  75. #ifndef MAX
  76. #define MAX(x,y) ((x) > (y) ? (x) : (y))
  77. #endif
  78.  
  79. /* for new menus in V38  */
  80.  
  81. #ifndef WA_NewLookMenus
  82.   #define WA_NewLookMenus         (WA_Dummy + 0x30)
  83. #endif
  84.  
  85. #ifndef  GTMN_NewLookMenus
  86. #define GTMN_NewLookMenus    GT_TagBase+67 /* ti_Data is boolean */
  87. #endif
  88.  
  89. #ifndef WFLG_NEWLOOKMENUS
  90. #define WFLG_NEWLOOKMENUS   0x00200000    /* window has NewLook menus    */
  91. #endif
  92.  
  93. /* macros for easy access to Gadget data */
  94.  
  95. #define GetString(gad)            (((struct StringInfo *)gad->SpecialInfo)->Buffer)
  96. #define GetUndoString(gad)    (((struct StringInfo *)gad->SpecialInfo)->UndoBuffer)
  97. #define GetNumber(gad)            (((struct StringInfo *)gad->SpecialInfo)->LongInt)
  98.  
  99. /* List node name.  Each node have the following */
  100.   
  101. struct NameNode
  102. {
  103.   struct Node nn_Node;  /* linked list node to previous or next node  */
  104.   UBYTE nn_Data[255];   /* name of the node, this is the same as      */
  105.                         /* nn_Node.ln_Name                            */
  106. };
  107.  
  108. /* Visual Arts message object.  Every GADGETUP event, the object is
  109.    sent to the attached function.  For Menus, the va_Gadget field is
  110.    always NULL.
  111. */
  112.  
  113. struct VAobject {
  114.   struct Window *va_Window;           /* window the object originated     */
  115.   struct Gadget *va_Gadget;           /* the gadget that sent this object */
  116.   struct IntuiMessage *va_IntuiMsg;   /* the IntuiMessage                 */
  117.   ULONG va_Flags;                     /* user flags                       */
  118.   APTR va_UserData;                   /* user data, function pointer etc..*/
  119. };
  120.  
  121. /* Every AREXX command have the following */
  122.  
  123. struct rexxCommandList
  124. {
  125.   char *name;       /* name of the AREXX command, note its case sensitive */
  126.   APTR userdata;    /* user data, in this case it's a function pointer    */ 
  127. };
  128.  
  129. /* Structure for Multi-Processing windows.  This structure is a linked
  130.    List for every window opened as Multi-Processing
  131. */
  132.  
  133. struct WindowNode
  134. {
  135.     struct Node nn_Node;            /* linked list to prev or next window */
  136.     UBYTE nn_Data[80];              /* window name */
  137.     struct Window *nn_Window;       /* window pointer */
  138.     struct AppWindow *nn_AppWindow; /* AppWindow pointer if window is a AppWindow */
  139.     struct MsgPort *nn_AppWindPort; /* AppWindow Port */
  140.     short ID;                       /* WindowNode ID  */
  141.     APTR UserData;                  /* window Handler for this window */
  142. };
  143.  
  144. /*  Visual Arts function prototypes. All are in the VisualArts.lib 
  145. */
  146.  
  147. extern void DrawBox(struct Window *Wind, int Left, int Top, int Wid, int Hi, UBYTE APen, short Pattern );
  148. extern void DrawFBox(struct Window *Wind, int Left, int Top, int Wid, int Hi, UBYTE APen, short Pattern, UBYTE Outline, short Fill );
  149. extern void DrawLine(struct Window *Wind, int Left, int Top, int Wid, int Hi, UBYTE APen, short Pattern );
  150. extern void DrawNCircle(struct Window *Wind, int Left, int Top, int Right, int Bottom, UBYTE APen);
  151. extern void DrawFCircle(struct Window *Wind, int Left, int Top, int Right, int Bottom, UBYTE APen, short Pattern, UBYTE Outline, short Fill );
  152. extern void SetRPortFill(struct Window *Wind, short Type);
  153. extern void ButtonSelected(struct Window *wind, struct Gadget *gad);
  154. extern int AddNewNode(struct List *list, char name[255]);
  155. extern int DeleteNewNode(struct List *list, char name[255]);
  156. extern struct List *GetNewList(void);
  157. extern struct NameNode *FindNodeName(struct List *list, char name[255]);
  158. extern void FreeList(struct List *list);
  159. extern APTR   VisualInfo;
  160. extern struct Screen *Scr;
  161. extern struct WindowNode *AddWindowNode(struct List *list, char name[80], APTR handler);
  162. extern int DelWindowNode(struct List *list, char name[80]);
  163. extern struct WindowNode *FindWindowNode(struct List *list, char name[80]);
  164. extern void FreeWindowList(struct List *list);
  165. extern void ReMakeWindowID(struct List *list);
  166. extern void closeRexxPort(void);
  167. extern void handlerRexxPort(void);
  168. extern struct RexxMsg *asyncRexxCmd(char *s);
  169. extern void replyRexxCmd(register struct RexxMsg *msg, register long primary,
  170.                   register long secondary, register char *string);
  171. extern long InitRexxPort(char *s, struct rexxCommandList *rcl,
  172.                   char *exten, int (*uf)());
  173. extern int dispatchRexx(register struct RexxMsg *msg, register struct rexxCommandList *dat, char *p);
  174. extern Object *NewImageObject(ULONG which);
  175. extern struct Gadget *NewPropObject(ULONG freedom, Tag tag1, ...);
  176. extern struct Gadget *NewButtonObject(Object *image, Tag tag1, ...);
  177. extern int SysISize(void);
  178. extern int VA_GadLayout(struct Window *window, struct Gadget *glist,
  179.                   struct Gadget *projgadgets[],
  180.                   ULONG fsgads[], WORD gadtypes[],
  181.                   struct NewGadget *gadgets, ULONG tags[],
  182.                   struct List *lists[], UBYTE *projvars[]);
  183. extern int VA_GadLayoutA(struct Window *window, struct Gadget *glist,
  184.                   struct Gadget *projgadgets[],
  185.                   ULONG fsgads[], WORD gadtypes[],
  186.                   struct NewGadget *gadgets, ULONG tags[],
  187.                   struct List *lists[], UBYTE *projvars[]);
  188. void InitLayoutVars(ULONG types[], UBYTE *vars[]);
  189.  
  190. /* console functions */
  191. extern int OpenConsole( struct IOStdReq *writerequest,
  192.                         struct IOStdReq *readrequest,
  193.                         struct Window *window);
  194. extern int ConPutChar(struct IOStdReq *request, char character);
  195. extern int ConPutStr(struct IOStdReq *request, char *string);
  196. extern int QueueRead(struct IOStdReq *request, char *whereto);
  197.  
  198. /*  speech functions */
  199. extern int InitSpeech(void);
  200. extern void DeInitSpeech(void);
  201. extern int Speak(char sentence[], short vol, short rate, short sex);
  202.  
  203.  
  204.