/* PROJECT: ppt MODULE : ppt.h $Revision: 6.3 $ $Date: 2000-01-04 21:38:26 $ $Author: jj $ Main definitions for PPT. This file is (C) Janne Jalkanen 1994-2000. Please note that those fields marked PRIVATE in structures truly are so. So keep your hands off them, because they will probably change between releases. !!PRIVATE $Id: ppt_real.h,v 6.3 2000-01-04 21:38:26 jj Exp $ This file contains also the PRIVATE fields in the structs. !!PUBLIC */ #ifndef PPT_H #define PPT_H #if defined(_POWERPC) #pragma options align=m68k #endif #ifndef INTUITION_INTUITION_H #include #endif #ifndef EXEC_NODES_H #include #endif #ifndef EXEC_EXECBASE_H #include #endif #ifndef EXEC_TYPES_H #include #endif #ifndef EXEC_LIBRARIES_H #include #endif #ifndef DOS_DOS_H #include #endif #ifndef LIBRARIES_IFFPARSE_H #include #endif #ifndef LIBRARIES_BGUI_H #include #endif #ifndef LIBRARIES_LOCALE_H #include #endif #ifndef ASKREQ_H #include "askreq.h" #endif /*------------------------------------------------------------------*/ /* Types we will use everywhere */ typedef UBYTE * ROWPTR; /* Sample row pointer */ typedef void * FPTR; /* Function pointer */ typedef LONG PERROR; /* Error code */ typedef ULONG ID; /* Identification code */ typedef struct RGBPixel_T { UBYTE r,g,b; } RGBPixel; typedef struct ARGBPixel_T { UBYTE a,r,g,b; } ARGBPixel; typedef struct GrayPixel_T { UBYTE g; } GrayPixel; typedef void Pixel; /* Use only as Pixel * */ /* * These macros can be used to extract an ULONG-cast * ARGB pixels components. */ #define ARGB_A(x) (UBYTE)((x) >> 24) #define ARGB_R(x) (UBYTE)((x) >> 16) #define ARGB_G(x) (UBYTE)((x) >> 8) #define ARGB_B(x) (UBYTE)(x) /* Useful macros and definitions */ #define NEGNUL ((void *) ~0) #define POKE(s,v) ( (*(s)) = (v) ) #define PEEKL(x) (*( (LONG *) (x) )) #define MIN(a,b) ( ((a) < (b)) ? (a) : (b) ) #define MAX(a,b) ( ((a) > (b)) ? (a) : (b) ) #define SYSBASE() (struct Library *)(* ((ULONG *)4L)) #define MULU16(x,y) ( (UWORD)(x) * (UWORD)(y) ) /* To get DCC compile fast code */ #define MULS16(x,y) ( (WORD)(x) * (WORD)(y) ) #define MULUW(x,y) MULU16(x,y) #define MULSW(x,y) MULS16(x,y) /* Clamps x between a and b (inclusive) */ #define CLAMP(x,min,max) if( (x) < (min) ) { (x) = (min); } \ else if( (x) > (max) ) { (x) = (max); } /* This macro calculates picture size in bytes. Requires pointer to a pixinfo structure.*/ #define PICSIZE(a) \ (ULONG)( (a)->height * (a)->bytes_per_row ) /* This macro gives the row length. OBSOLETE */ #define ROWLEN(a) \ ( ((PIXINFO *)(a))->bytes_per_row ) /*------------------------------------------------------------------*/ /* Definitions */ #define MAXPATHLEN 256 /* Std AmigaDOS path len */ #define NAMELEN 40 /* Maximum length of frame name */ #define MAXPATTERNLEN 80 /* The maximum length for PPTX_PostFixPattern */ /* * Maximum image dimensions - current internal limit. * Do not rely on these. They may grow bigger, but not * smaller. */ #define MAX_WIDTH 16383 #define MAX_HEIGHT 16383 /*!!PRIVATE*/ #define WINTITLELEN 80 /* Length of a window title buffer in DISPLAY */ #define SCRTITLELEN 180 /* Length of the screen title buffer in DISPLAY */ #define MAXSCRTITLENAMELEN 40 /* Max length of file name when shown on screen title */ #define MAXPIXELSIZE 4 /* Maximum size of a pizel in bytes */ /*!!PUBLIC*/ /*------------------------------------------------------------------*/ /* This must be in the beginning of each external module. NB: Does not concern you! Just make a shared library and be happy. */ struct ModuleInfo { ULONG code[2]; /* moveq.l #-1,d0; rts */ ULONG id; /* Identification string. See below.*/ struct TagItem *tagarray; }; /* The ID's for the id-field. */ #define ID_LOADER MAKE_ID('P','P','T','L') #define ID_EFFECT MAKE_ID('P','P','T','F') /*------------------------------------------------------------------*/ /*!!PRIVATE*/ /* A common structure to ease handling of external modules. The main point is to save information that does not have to be fetched each time. */ typedef struct { struct Node nd; /* ln_Type is type of module. See below */ BPTR seglist; /* Actual code */ void *elfobject; /* ELF object for powerup */ struct TagItem *tags; ULONG usecount; BOOL islibrary; /* If != 0, this is a newstyle library */ UBYTE diskname[MAXPATHLEN+NAMELEN+1];/* The real name on disk, including path. */ UBYTE realname[NAMELEN+1];/* The name by which this is known */ } EXTERNAL; /* External types. Also double as Node types. Type is UBYTE */ #define NT_LOADER (NT_USER - 0) #define NT_EFFECT (NT_USER - 1) #define NT_SCRIPT (NT_USER - 2) /* Values reserved from NT_USER - 2 downwards. */ /*------------------------------------------------------------------*/ /* Loader stuff */ typedef struct { EXTERNAL info; ULONG saveformats; /* Result of PPTX_SaveFormats query cached here upon startup. */ BOOL canload; /* Result of PPTX_Load query cached here */ UBYTE prefpostfix[NAMELEN+1]; UBYTE postfixpat[MAXPATTERNLEN+1]; } LOADER; /*------------------------------------------------------------------*/ /* Filters... */ typedef struct { EXTERNAL info; } EFFECT; /*------------------------------------------------------------------*/ /* Scripts... */ typedef struct { EXTERNAL info; } SCRIPT; /*------------------------------------------------------------------*/ /* A virtual memory handle. PRIVATE to the bones. */ typedef struct { BPTR vm_fh; ULONG vm_id; ULONG begin,end; ULONG last; APTR data; BOOL chflag; /* TRUE, if the memory has been changed. */ } VMHANDLE; /*!!PUBLIC*/ /* This structure contains information on the picture data itself. Your loader should fill out any necessary fields. */ typedef struct { UWORD height, /* Picture height and width */ width; UBYTE colorspace; /* See below. */ UBYTE components; /* Amount of components: 4 for ARGB, 3 for fullcolor, 1 for grayscale */ UBYTE origdepth; /* Original depth information. */ UBYTE bits_per_component; /* Currently 8 */ UWORD DPIX, DPIY; /* Dots per inch. Use these to signify the aspect ratio of the image. If you do not know the DPI values, use 72 as the base value, as this is a common guess for an image to be shown on a computer screen. It is safe to put zero in either of the locations (which signifies 1:1 aspect ratio.) */ ULONG private1; /* Private data. */ ULONG bytes_per_row; /* Amount of bytes / pixel row. */ ULONG origmodeid; /* Original display mode id */ /* The fields beyond this point are PRIVATE! */ /*!!PRIVATE*/ VMHANDLE *vmh; /* For virtual memory */ ULONG vm_mode; /* Virtual memory mode. See below */ ROWPTR tmpbuf; /* This contains a temporary area into which the image data is copied when processing. */ UBYTE transparentpixel[MAXPIXELSIZE]; /*!!PUBLIC*/ } PIXINFO; /* Possible color spaces. */ #define CS_UNKNOWN 0 /* Not known at this time */ #define CS_GRAYLEVEL 1 /* 8bit graylevel data */ #define CS_RGB 2 /* 24 bit RGB data */ #define CS_LUT 3 /* Color lookup table. DO NOT USE! */ #define CS_ARGB 4 /* 32 bit ARGB data */ /* Flag definitions for PPTX_ColorSpaces. Please note that CSF_LUT is used ONLY on savers. PPT processes only in real color, but a color- reduced image can be saved. */ #define CSF_NONE 0x00 /* Use this to signify nothing is understood*/ #define CSF_UNKNOWN (1<