home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
new
/
gfx
/
edit
/
tsmorph
/
tsmorph.h
< prev
next >
Wrap
C/C++ Source or Header
|
1993-12-21
|
26KB
|
953 lines
// TSMorph - Amiga Morphing program
// Copyright (C) © 1993 Topicsave Limited
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
// mpaddock@cix.compulink.co.uk
// $Author: M_J_Paddock $
// $Date: 1993/08/28 22:13:35 $
// $Revision: 1.13 $
#ifndef TSMORPH_H
#define TSMORPH_H
/* All the Amiga stuff */
#define INTUI_V36_NAMES_ONLY
#define INTUITION_IOBSOLETE_H
#include <exec/types.h>
#include <exec/memory.h>
#include <exec/execbase.h>
#include <intuition/intuition.h>
#include <intuition/classes.h>
#include <intuition/classusr.h>
#include <intuition/gadgetclass.h>
#include <intuition/imageclass.h>
#include <intuition/icclass.h>
#include <devices/input.h>
#include <workbench/workbench.h>
#include <workbench/startup.h>
#include <libraries/gadtools.h>
#include <graphics/scale.h>
#include <libraries/asl.h>
#include <libraries/amigaguide.h>
#include <libraries/reqtools.h>
#include <libraries/dctv.h>
/* Various stuff is not defined in 2.02 headers */
#ifndef PGA_NewLook
#define PGA_NewLook (PGA_Dummy + 0x000A)
#endif
#ifndef GTMN_FullMenu
#define GTMN_FullMenu GT_TagBase+62
#endif
#ifndef WA_MenuHelp
#define WA_MenuHelp (WA_Dummy + 0x2F)
#endif
#ifndef WA_NewLookMenus
#define WA_NewLookMenus (WA_Dummy + 0x30)
#endif
#ifndef GTMN_NewLookMenus
#define GTMN_NewLookMenus GT_TagBase+67
#endif
#ifndef STRINGA_ExitHelp
#define STRINGA_ExitHelp (STRINGA_Dummy + 0x0013)
#endif
#ifndef GT_Underscore
#define GT_Underscore GT_TagBase+64
#endif
#ifndef IDCMP_GADGETHELP
#define IDCMP_GADGETHELP 0x04000000
#endif
#if INCLUDE_VERSION < 39
void HelpControl(struct Window *w,ULONG flags);
#pragma libcall IntuitionBase HelpControl 33C 0802
#endif
#ifndef HC_GADGETHELP
#define HC_GADGETHELP 1
#endif
/* prototypes */
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include <clib/layers_protos.h>
#include <clib/graphics_protos.h>
#include <clib/intuition_protos.h>
#include <clib/input_protos.h>
#include <clib/gadtools_protos.h>
#include <clib/asl_protos.h>
#include <clib/utility_protos.h>
#include <clib/diskfont_protos.h>
#include <clib/icon_protos.h>
#include <clib/amigaguide_protos.h>
#include <clib/alib_protos.h>
#include <clib/reqtools_protos.h>
#include <clib/dctv_protos.h>
/* Pragmas */
#include <pragmas/exec_pragmas.h>
#include <pragmas/dos_pragmas.h>
#include <pragmas/layers_pragmas.h>
#include <pragmas/graphics_pragmas.h>
#include <pragmas/intuition_pragmas.h>
#include <pragmas/input_pragmas.h>
#include <pragmas/gadtools_pragmas.h>
#include <pragmas/asl_pragmas.h>
#include <pragmas/utility_pragmas.h>
#include <pragmas/diskfont_pragmas.h>
#include <pragmas/icon_pragmas.h>
#include <pragmas/amigaguide_pragmas.h>
#include <pragmas/reqtools.h>
#include <pragmas/dctv_pragmas.h>
#include <rexx/errors.h>
#include <pragmas/rexxsyslib_pragmas.h>
#include <clib/rexxsyslib_protos.h>
/* 2.02 Icon headers */
#if INCLUDE_VERSION < 37
BOOL DeleteDiskObject(UBYTE *name);
#pragma libcall IconBase DeleteDiskObject 8A 801
#endif
/* Below is not in the 2.02 version of clib/utility_protos.h
pragmas/utility_pragmas.h */
#if INCLUDE_VERSION < 37
LONG Stricmp(UBYTE *string1,UBYTE *string2);
#pragma libcall UtilityBase Stricmp A2 9802
#endif
/* Standard headers */
#include <stddef.h>
#include <string.h>
#include <stdio.h>
/* OpalVision */
#include <opal/opallib.h>
/* define max if not already defined */
#ifndef max
#define max(a,b) ((a)>(b)?(a):(b))
#endif
/* IFF stuff */
#include "iffp/ILBMapp.h"
/* GUI stuff from GadTools */
#include "gui.h"
/* defines for the IDs of the gadgets in the control window */
#define ONEGADGET 1
#define TWOGADGET 2
#define RELGADGET 3
#define ADDGADGET 4
#define DELGADGET 5
#define LINKGADGET 6
#define UNLINKGADGET 7
#define NONEGADGET 8
#define STGADGET 9
#define PREVGADGET 10
#define GOTOGADGET 11
#define NEXTGADGET 12
#define LASTGADGET 13
/* Defined externally */
extern struct Library *DOSBase;
extern struct Library *SysBase;
/* Structure definitions */
/* Picture structure
* This holds all information for a picture displayed in a window
*/
struct Picture { // Structure used for each picture
struct Screen *Screen; // Screen to display on
struct Window *Win; // Window
struct DrawInfo *DRI; // Draw Info
struct Gadget *BotGad; // Bottom slider gadget
struct Gadget *SideGad; // Side slider gadget
struct Gadget *Lgad; // Left arrow gadget
struct Gadget *Rgad; // Right arrow gadget
struct Gadget *Ugad; // Up arrow gadget
struct Gadget *Dgad; // Down arrow gadget
struct Image *Limage; // Left arrow
struct Image *Rimage; // Right arrow
struct Image *Uimage; // Up arrow
struct Image *Dimage; // Down arrow
UWORD Left; // Left edge
UWORD Top; // Top edge
UWORD XLeft; // Old left edge
UWORD XTop; // Old top edge
UWORD ALeft; // Left movement 10% of window
UWORD ATop; // down movement 10% of window
UWORD MLeft; // Max left edge
UWORD MTop; // Max top edge
struct ILBMInfo *ilbm; // ILBM info for iff read
UWORD currentg; // Current gadgetID
char *filename; // For Window title
ULONG JustSeconds;// Time window was activated - to ignore first click
struct BitMap BitMap; // The zoomed image bitmap
struct BitScaleArgs BitScaleArgs; // For zooming image
BOOL Opal; // Set if opened by OpalLoad
struct {
WORD Left; // Window Zoom tags - nothing to do with Zoom
WORD Top;
WORD Width;
WORD Height;
} Zoom;
};
/* Point structure
* Holds all information for each point
*/
struct MyPoint {
struct MinNode MyNode; // Node to link in a list
WORD x,y; // Coordinates in the 1st image
WORD x1,y1; // Coordinates in the 2nd image
struct MyPoint *p1,*p2,*p3,*p4; // Pointers to up to 4 linked points
};
/* Structure for size of system gadgets
* based on Screen resolution
* This enables windows to open with correct
* gadgets on lo-res screens
*/
struct gadgetsizing {
ULONG sysisize; // tag for SYSISIZE_???RES
int sizeimagew;
int sizeimageh;
int leftimagew;
int leftimageh;
int downimagew;
int downimageh;
int rightimagew;
int rightimageh;
int upimagew;
int upimageh;
int closeimagew;
int zoomimagew;
int depthimagew;
int vscrollw;
int vscrolll;
};
/* Macro for finding gadget */
#define PointInBox(x,y,mx,my,MX,MY) ((x>=mx)&&(y>=my)&&(x<=MX)&&(y<=MY))
/* Macros to access system gadget sizes */
#define SYSISIZE(n) gs[n].sysisize
#define SIZEIMAGE_W(n) gs[n].sizeimagew
#define SIZEIMAGE_H(n) gs[n].sizeimageh
#define LEFTIMAGE_W(n) gs[n].leftimagew
#define LEFTIMAGE_H(n) gs[n].leftimageh
#define DOWNIMAGE_W(n) gs[n].downimagew
#define DOWNIMAGE_H(n) gs[n].downimageh
#define UPIMAGE_W(n) gs[n].upimagew
#define UPIMAGE_H(n) gs[n].upimageh
#define RIGHTIMAGE_W(n) gs[n].rightimagew
#define RIGHTIMAGE_H(n) gs[n].rightimageh
#define CLOSEIMAGE_W(n) gs[n].closeimagew
#define ZOOMIMAGE_W(n) gs[n].zoomimagew
#define DEPTHIMAGE_W(n) gs[n].depthimagew
#define VSCROLL_W(n) gs[n].vscrollw
#define VSCROLL_L(n) gs[n].vscrolll
/* defines for resolution for index */
#define GS_LOWRES 0
#define GS_MEDRES 1
/* Pointer image structures */
extern UWORD __chip Add[];
extern UWORD __chip Del[];
extern UWORD __chip L1[];
extern UWORD __chip L2[];
extern UWORD __chip Mov[];
extern UWORD __chip One[];
extern UWORD __chip Rel[];
extern UWORD __chip Two[];
extern UWORD __chip U1[];
extern UWORD __chip U2[];
/* Defines for the help system nodes
* See "help.h" for the node text
*/
#define H_Nothing 0
#define H_Main