home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Commodities / ClipTool / src / cliptool.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-27  |  5.9 KB  |  209 lines

  1. /*
  2.  *  ClipTool (Udklipsværktøj) - A Commodities Exchange Application
  3.  *  Copyright (C) 1994 Torsten Poulin
  4.  *
  5.  *  cliptool.h - include file for ClipTool.
  6.  *
  7.  *  This program is free software; you can redistribute it and/or modify
  8.  *  it under the terms of the GNU General Public License as published by
  9.  *  the Free Software Foundation; either version 2 of the License, or
  10.  *  (at your option) any later version.
  11.  *
  12.  *  This program is distributed in the hope that it will be useful,
  13.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *  GNU General Public License for more details.
  16.  *
  17.  *  You should have received a copy of the GNU General Public License
  18.  *  along with this program; if not, write to the Free Software
  19.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  *             The author can be contacted by mail at
  22.  *               Torsten Poulin
  23.  *               Banebrinken 99, 2, 77
  24.  *               DK-2400 Copenhagen NV
  25.  *               Denmark
  26.  *             or via email: torsten@diku.dk
  27.  *
  28.  * $Log:    cliptool.h,v $
  29.  * Revision 1.1  94/02/20  21:33:01  Torsten
  30.  * Initial revision
  31.  * 
  32.  */
  33.  
  34. #define INTUI_V36_NAMES_ONLY
  35.  
  36. #include <exec/types.h>
  37. #include <intuition/intuition.h>
  38. #include <intuition/gadgetclass.h>
  39. #include <graphics/text.h>
  40. #include <graphics/regions.h>
  41. #include <graphics/gfx.h>
  42. #include <libraries/commodities.h>
  43. #include <libraries/gadtools.h>
  44. #include <libraries/iffparse.h>
  45. #include <libraries/asl.h>
  46. #include <workbench/workbench.h>
  47. #include <dos/dos.h>
  48. #include <dos/rdargs.h>
  49. #include <rexx/rxslib.h>
  50. #include <rexx/storage.h>
  51. #include <libraries/locale.h>
  52.  
  53. #include <clib/exec_protos.h>
  54. #include <clib/intuition_protos.h>
  55. #include <clib/commodities_protos.h>
  56. #include <clib/gadtools_protos.h>
  57. #include <clib/graphics_protos.h>
  58. #include <clib/iffparse_protos.h>
  59. #include <clib/asl_protos.h>
  60. #include <clib/layers_protos.h>
  61. #include <clib/dos_protos.h>
  62. #include <clib/icon_protos.h>
  63. #include <clib/wb_protos.h>
  64. #include <clib/alib_protos.h>
  65. #include <clib/rexxsyslib_protos.h>
  66. #include <clib/locale_protos.h>
  67.  
  68. #if defined(LATTICE_50) | defined(__SASC_510) | defined (__SASC_60)
  69. #include <pragmas/exec_pragmas.h>
  70. #include <pragmas/intuition_pragmas.h>
  71. #include <pragmas/commodities_pragmas.h>
  72. #include <pragmas/gadtools_pragmas.h>
  73. #include <pragmas/graphics_pragmas.h>
  74. #include <pragmas/iffparse_pragmas.h>
  75. #include <pragmas/asl_pragmas.h>
  76. #include <pragmas/layers_pragmas.h>
  77. #include <pragmas/dos_pragmas.h>
  78. #include <pragmas/icon_pragmas.h>
  79. #include <pragmas/wb_pragmas.h>
  80. #include <pragmas/rexxsyslib_pragmas.h>
  81. #include <pragmas/locale_pragmas.h>
  82. #endif
  83.  
  84. #include <string.h>
  85. #include <stdio.h>
  86. #include <stdlib.h>
  87. #include <ctype.h>
  88.  
  89. #define GUI_WIDTH  8*39+3*4+2*2+22
  90. #define GUI_HEIGHT 18+30
  91.  
  92. #define EVENT_HOTKEY 1L
  93.  
  94. #define BBGD_OPEN  (0)
  95. #define BBGD_SAVE  (1)
  96. #define BBGD_CUT   (2)
  97. #define BBGD_COPY  (3)
  98. #define BBGD_PASTE (4)
  99. #define BBGD_PREV  (5)
  100. #define BBGD_NEXT  (6)
  101. #define BBGD_KILL  (7)
  102.  
  103. #define CTM_OPENTEXT    (1)
  104. #define CTM_OPENFTXT    (2)
  105. #define CTM_SAVE    (-1) /* so we can find it for enabling/disabling */
  106. #define CTM_SAVETEXT    (3)
  107. #define CTM_SAVEFTXT    (4)
  108. #define CTM_ABOUT    (5)
  109. #define CTM_HIDE    (6)
  110. #define CTM_QUIT    (7)
  111. #define CTM_CUT        (8)
  112. #define CTM_COPY    (9)
  113. #define CTM_PASTE    (10)
  114. #define CTM_KILL    (11)
  115. #define CTM_PREV    (12)
  116. #define CTM_NEXT    (13)
  117. #define CTM_ICONS    (14)
  118. #define CTM_APPICON    (15)
  119. #define CTM_AUTO    (16)
  120. #define CTM_UNIT    (17)
  121.  
  122. #define RBUFSZ 512            /* Buffer size when reading clips */
  123.  
  124. extern UBYTE *verstring, *portname, *hotkey;
  125.  
  126. extern struct Library *DOSBase;
  127. extern struct Library *IntuitionBase;
  128. extern struct Library *CxBase;
  129. extern struct Library *IconBase;
  130. extern struct Library *WorkbenchBase;
  131. extern struct Library *GadToolsBase;
  132. extern struct Library *GfxBase;
  133. extern struct Library *IFFParseBase;
  134. extern struct Library *LayersBase;
  135. extern struct Library *AslBase;
  136. extern struct Library *RexxSysBase;
  137. extern struct Library *LocaleBase;
  138.  
  139. extern struct Window *guiwin;        /* The GUI window */
  140. extern struct AppWindow *appwin;    /* ... as an AppWin */
  141. extern struct AppIcon *appicon;
  142. extern long xoffset, yoffset;        /* Size of left and top borders */
  143. extern struct MsgPort *broker_mp;
  144. extern struct MsgPort *appwin_mp;
  145. extern struct MsgPort *appicon_mp;
  146. extern struct MsgPort *arexx_mp;
  147. extern CxObj *broker;
  148. extern ULONG cxsigflag, awsigflag, aisigflag, rxsigflag;
  149. extern struct FileRequester *filereq;    /* ASL requester */
  150.  
  151. /* Text is stored in linked lists of buffers
  152.  */
  153. struct textbuffer {
  154.   struct textbuffer *next;
  155.   ULONG length;
  156.   UBYTE data[1];
  157. };
  158.  
  159. /* The text buffer list are stored in a doubly linked list.
  160.  */
  161. struct bufferlisthead {
  162.   struct bufferlisthead *next;
  163.   struct bufferlisthead *prev;
  164.   struct textbuffer *tb;
  165. };
  166.  
  167. /* Global pointer to the current text buffer list header.
  168.  */
  169. extern struct bufferlisthead *currentbuffer;
  170. extern long ntotal, ncurrent;
  171.  
  172. extern BOOL nothidden;            /* Do not open GUI if FALSE */ 
  173. extern BOOL guiminimized;        /* not used */
  174. extern BOOL simplebuttons;        /* Force use of simple imagery */
  175. extern BOOL createicons;        /* Create icon when saving a file */
  176. extern BOOL usedropicon;        /* Use AppIcon */
  177. extern long unitnumber;            /* Clipboard unit number (0-255) */
  178.  
  179. extern struct Menu *ctmenustrip;
  180.  
  181. void handleevents(void);
  182. void loadtext(BOOL);
  183. void loaddropped(UBYTE *, BPTR);
  184. void rxload(UBYTE *, UBYTE *);
  185. void rxsave(UBYTE *, UBYTE *, BOOL);
  186. void savetext(BOOL);
  187. void about(void);
  188. void cut(void);
  189. void copy(void);
  190. void paste(void);
  191. void freetext(void);
  192. void prevtext(void);
  193. void nexttext(void);
  194. void getunitnumber(void);
  195. BOOL opengui(void);
  196. void closegui(void);
  197. void opendropicon(void);
  198. void closedropicon(void);
  199. void ghosting(void);
  200. struct Gadget *createbuttonbar(struct Gadget **, void *, BOOL);
  201. BOOL newsize(void);
  202. void showtext(void);
  203. void updatetitlebar(void);
  204. struct MenuItem *findmenuitem(struct Menu *, long);
  205. void synchronizechecked(void);
  206. void msgreq(UBYTE *, UBYTE *);
  207. STRPTR ls(LONG);
  208. void initnewmenustruct(void);
  209.