home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / new / gfx / edit / tsmorph / tsmorph.h < prev    next >
C/C++ Source or Header  |  1993-12-21  |  26KB  |  953 lines

  1. // TSMorph - Amiga Morphing program
  2. // Copyright (C) © 1993  Topicsave Limited
  3.  
  4. // This program is free software; you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation; either version 2 of the License, or
  7. // any later version.
  8.  
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. // GNU General Public License for more details.
  13.  
  14. // You should have received a copy of the GNU General Public License
  15. // along with this program; if not, write to the Free Software
  16. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. // mpaddock@cix.compulink.co.uk
  19.  
  20. //    $Author: M_J_Paddock $
  21. //    $Date: 1993/08/28 22:13:35 $
  22. //    $Revision: 1.13 $
  23.  
  24. #ifndef TSMORPH_H
  25. #define TSMORPH_H
  26.  
  27. /* All the Amiga stuff    */
  28. #define INTUI_V36_NAMES_ONLY
  29. #define INTUITION_IOBSOLETE_H
  30. #include <exec/types.h>
  31. #include <exec/memory.h>
  32. #include <exec/execbase.h>
  33. #include <intuition/intuition.h>
  34. #include <intuition/classes.h>
  35. #include <intuition/classusr.h>
  36. #include <intuition/gadgetclass.h>
  37. #include <intuition/imageclass.h>
  38. #include <intuition/icclass.h>
  39. #include <devices/input.h>
  40. #include <workbench/workbench.h>
  41. #include <workbench/startup.h>
  42. #include <libraries/gadtools.h>
  43. #include <graphics/scale.h>
  44. #include <libraries/asl.h>
  45. #include <libraries/amigaguide.h>
  46. #include <libraries/reqtools.h>
  47. #include <libraries/dctv.h>
  48.  
  49. /* Various stuff is not defined in 2.02 headers    */
  50. #ifndef PGA_NewLook
  51. #define PGA_NewLook (PGA_Dummy + 0x000A)
  52. #endif
  53.  
  54. #ifndef GTMN_FullMenu
  55. #define GTMN_FullMenu GT_TagBase+62
  56. #endif
  57.  
  58. #ifndef WA_MenuHelp
  59. #define WA_MenuHelp (WA_Dummy + 0x2F)
  60. #endif    
  61.  
  62. #ifndef WA_NewLookMenus
  63. #define WA_NewLookMenus (WA_Dummy + 0x30)
  64. #endif
  65.  
  66. #ifndef GTMN_NewLookMenus
  67. #define GTMN_NewLookMenus GT_TagBase+67
  68. #endif
  69.  
  70. #ifndef STRINGA_ExitHelp
  71. #define STRINGA_ExitHelp (STRINGA_Dummy + 0x0013)
  72. #endif
  73.  
  74. #ifndef GT_Underscore
  75. #define GT_Underscore GT_TagBase+64
  76. #endif
  77.  
  78. #ifndef IDCMP_GADGETHELP
  79. #define IDCMP_GADGETHELP 0x04000000
  80. #endif
  81.  
  82. #if INCLUDE_VERSION < 39
  83. void HelpControl(struct Window *w,ULONG flags);
  84. #pragma libcall IntuitionBase HelpControl 33C 0802
  85. #endif
  86.  
  87. #ifndef HC_GADGETHELP
  88. #define HC_GADGETHELP 1
  89. #endif
  90.  
  91. /* prototypes    */
  92. #include <clib/exec_protos.h>
  93. #include <clib/dos_protos.h>
  94. #include <clib/layers_protos.h>
  95. #include <clib/graphics_protos.h>
  96. #include <clib/intuition_protos.h>
  97. #include <clib/input_protos.h>
  98. #include <clib/gadtools_protos.h>
  99. #include <clib/asl_protos.h>
  100. #include <clib/utility_protos.h>
  101. #include <clib/diskfont_protos.h>
  102. #include <clib/icon_protos.h>
  103. #include <clib/amigaguide_protos.h>
  104. #include <clib/alib_protos.h>
  105. #include <clib/reqtools_protos.h>
  106. #include <clib/dctv_protos.h>
  107.  
  108. /* Pragmas    */
  109. #include <pragmas/exec_pragmas.h>
  110. #include <pragmas/dos_pragmas.h>
  111. #include <pragmas/layers_pragmas.h>
  112. #include <pragmas/graphics_pragmas.h>
  113. #include <pragmas/intuition_pragmas.h>
  114. #include <pragmas/input_pragmas.h>
  115. #include <pragmas/gadtools_pragmas.h>
  116. #include <pragmas/asl_pragmas.h>
  117. #include <pragmas/utility_pragmas.h>
  118. #include <pragmas/diskfont_pragmas.h>
  119. #include <pragmas/icon_pragmas.h>
  120. #include <pragmas/amigaguide_pragmas.h>
  121. #include <pragmas/reqtools.h>
  122. #include <pragmas/dctv_pragmas.h>
  123.  
  124. #include <rexx/errors.h>
  125. #include <pragmas/rexxsyslib_pragmas.h>
  126. #include <clib/rexxsyslib_protos.h>
  127.  
  128. /* 2.02 Icon headers    */
  129. #if INCLUDE_VERSION < 37
  130. BOOL DeleteDiskObject(UBYTE *name);
  131. #pragma libcall IconBase DeleteDiskObject 8A 801
  132. #endif
  133.  
  134. /* Below is not in the 2.02 version of clib/utility_protos.h
  135.                                        pragmas/utility_pragmas.h */
  136. #if INCLUDE_VERSION < 37
  137. LONG Stricmp(UBYTE *string1,UBYTE *string2);
  138. #pragma libcall UtilityBase Stricmp A2 9802
  139. #endif
  140.  
  141. /* Standard headers    */
  142. #include <stddef.h>
  143. #include <string.h>
  144. #include <stdio.h>
  145.  
  146. /* OpalVision            */
  147. #include <opal/opallib.h>
  148.  
  149. /* define max if not already defined    */
  150. #ifndef max
  151. #define max(a,b) ((a)>(b)?(a):(b))
  152. #endif
  153.  
  154. /* IFF stuff                    */
  155. #include "iffp/ILBMapp.h"
  156.  
  157. /* GUI stuff from GadTools    */
  158. #include "gui.h"
  159.  
  160. /* defines for the IDs of the gadgets in the control window    */
  161. #define ONEGADGET        1
  162. #define TWOGADGET        2
  163. #define RELGADGET        3
  164. #define ADDGADGET        4
  165. #define DELGADGET        5
  166. #define LINKGADGET    6
  167. #define UNLINKGADGET    7
  168. #define NONEGADGET    8
  169. #define STGADGET        9
  170. #define PREVGADGET    10
  171. #define GOTOGADGET    11
  172. #define NEXTGADGET    12
  173. #define LASTGADGET    13
  174.  
  175. /* Defined externally    */
  176. extern struct Library *DOSBase;
  177. extern struct Library *SysBase;
  178.  
  179. /*    Structure definitions    */
  180.  
  181. /* Picture structure
  182.  * This holds all information for a picture displayed in a window
  183.  */
  184. struct Picture {                        // Structure used for each picture
  185.     struct Screen        *Screen;        // Screen to display on
  186.     struct Window        *Win;            // Window
  187.     struct DrawInfo    *DRI;            // Draw Info
  188.     struct Gadget        *BotGad;        // Bottom slider gadget
  189.     struct Gadget        *SideGad;    // Side slider gadget
  190.     struct Gadget        *Lgad;        // Left arrow gadget
  191.     struct Gadget        *Rgad;        // Right arrow gadget
  192.     struct Gadget        *Ugad;        // Up arrow gadget
  193.     struct Gadget        *Dgad;        // Down arrow gadget
  194.     struct Image        *Limage;        // Left arrow
  195.     struct Image        *Rimage;        // Right arrow
  196.     struct Image        *Uimage;        // Up arrow
  197.     struct Image        *Dimage;        // Down arrow
  198.     UWORD                    Left;            // Left edge
  199.     UWORD                    Top;            // Top edge
  200.     UWORD                    XLeft;        // Old left edge
  201.     UWORD                    XTop;            // Old top edge
  202.     UWORD                    ALeft;        // Left movement 10% of window
  203.     UWORD                    ATop;            // down movement 10% of window
  204.     UWORD                    MLeft;        // Max left edge
  205.     UWORD                    MTop;            // Max top edge
  206.     struct ILBMInfo    *ilbm;        // ILBM info for iff read
  207.     UWORD                    currentg;    // Current gadgetID
  208.     char                    *filename;    // For Window title
  209.     ULONG                    JustSeconds;//    Time window was activated - to ignore first click
  210.     struct BitMap        BitMap;        // The zoomed image bitmap
  211.     struct BitScaleArgs BitScaleArgs;    // For zooming image
  212.     BOOL                    Opal;            // Set if opened by OpalLoad
  213.     struct {
  214.         WORD                Left;            // Window Zoom tags - nothing to do with Zoom
  215.         WORD                Top;
  216.         WORD                Width;
  217.         WORD                Height;
  218.     } Zoom;
  219. };
  220.  
  221. /* Point structure
  222.  * Holds all information for each point
  223.  */
  224. struct MyPoint {
  225.     struct MinNode MyNode;                // Node to link in a list
  226.     WORD x,y;                                // Coordinates in the 1st image
  227.     WORD x1,y1;                                // Coordinates in the 2nd image
  228.     struct MyPoint *p1,*p2,*p3,*p4;    // Pointers to up to 4 linked points
  229. };
  230.  
  231. /* Structure for size of system gadgets
  232.  * based on Screen resolution
  233.  * This enables windows to open with correct
  234.  * gadgets on lo-res screens
  235.  */
  236. struct gadgetsizing {
  237.     ULONG sysisize;        // tag for SYSISIZE_???RES
  238.     int sizeimagew;
  239.     int sizeimageh;
  240.     int leftimagew;
  241.     int leftimageh;
  242.     int downimagew;
  243.     int downimageh;
  244.     int rightimagew;
  245.     int rightimageh;
  246.     int upimagew;
  247.     int upimageh;
  248.     int closeimagew;
  249.     int zoomimagew;
  250.     int depthimagew;
  251.     int vscrollw;
  252.     int vscrolll;
  253. };
  254.  
  255. /* Macro for finding gadget    */
  256. #define PointInBox(x,y,mx,my,MX,MY) ((x>=mx)&&(y>=my)&&(x<=MX)&&(y<=MY))
  257.  
  258. /* Macros to access system gadget sizes    */
  259. #define SYSISIZE(n)        gs[n].sysisize
  260. #define SIZEIMAGE_W(n)    gs[n].sizeimagew
  261. #define SIZEIMAGE_H(n)    gs[n].sizeimageh
  262. #define LEFTIMAGE_W(n)    gs[n].leftimagew
  263. #define LEFTIMAGE_H(n)    gs[n].leftimageh
  264. #define DOWNIMAGE_W(n)    gs[n].downimagew
  265. #define DOWNIMAGE_H(n)    gs[n].downimageh
  266. #define UPIMAGE_W(n)        gs[n].upimagew
  267. #define UPIMAGE_H(n)        gs[n].upimageh
  268. #define RIGHTIMAGE_W(n)    gs[n].rightimagew
  269. #define RIGHTIMAGE_H(n)    gs[n].rightimageh
  270. #define CLOSEIMAGE_W(n)    gs[n].closeimagew
  271. #define ZOOMIMAGE_W(n)    gs[n].zoomimagew
  272. #define DEPTHIMAGE_W(n)    gs[n].depthimagew
  273. #define VSCROLL_W(n)        gs[n].vscrollw
  274. #define VSCROLL_L(n)        gs[n].vscrolll
  275.  
  276. /* defines for resolution for index    */
  277. #define GS_LOWRES            0
  278. #define GS_MEDRES            1
  279.  
  280. /* Pointer image structures */
  281. extern UWORD __chip Add[];
  282. extern UWORD __chip Del[];
  283. extern UWORD __chip L1[];
  284. extern UWORD __chip L2[];
  285. extern UWORD __chip Mov[];
  286. extern UWORD __chip One[];
  287. extern UWORD __chip Rel[];
  288. extern UWORD __chip Two[];
  289. extern UWORD __chip U1[];
  290. extern UWORD __chip U2[];
  291.  
  292. /* Defines for the help system nodes
  293.  * See "help.h" for the node text
  294.  */
  295. #define H_Nothing        0
  296. #define H_Main