home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #4
/
amigamamagazinepolishissue1998.iso
/
datatypes
/
gifanimdtc201.lha
/
gifanim_datatype
/
classbase.h
< prev
next >
Wrap
C/C++ Source or Header
|
1998-03-23
|
6KB
|
182 lines
#ifndef CLASSBASE_H
#define CLASSBASE_H 1
/*
**
** $VER: classbase.h 2.1 (23.3.98)
** gifanim.datatype 2.1
**
** Header file for DataTypes class
**
** Written 1997/1998 by Roland 'Gizzy' Mainz
** Original example source from David N. Junod
**
*/
/* amiga includes */
#include <exec/types.h>
#include <exec/ports.h>
#include <exec/memory.h>
#include <exec/lists.h>
#include <exec/semaphores.h>
#include <exec/execbase.h>
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <dos/stdio.h>
#include <dos/rdargs.h>
#include <dos/dostags.h>
#include <graphics/gfx.h>
#include <graphics/text.h>
#include <graphics/scale.h>
#include <cybergraphics/cybergraphics.h>
#include <intuition/classes.h> /* must be $Id: classes.h,v 40.0 94/02/15 17:46:35 davidj Exp Locker: davidj $ */
#include <intuition/classusr.h>
#include <intuition/cghooks.h>
#include <intuition/icclass.h>
#include <intuition/gadgetclass.h>
#include <datatypes/datatypes.h>
#include <datatypes/datatypesclass.h>
#include <datatypes/animationclass.h>
#include <datatypes/animationclassext.h> /* animation.datatype V41 extensions */
/* amiga prototypes */
#include <clib/macros.h>
#include <clib/exec_protos.h>
#include <clib/utility_protos.h>
#include <clib/dos_protos.h>
#include <clib/graphics_protos.h>
#include <clib/cybergraphics_protos.h>
#include <clib/intuition_protos.h>
#include <clib/datatypes_protos.h>
#include <clib/dtclass_protos.h>
#ifdef PARAMETERS_STACK
#include <clib/alib_protos.h>
#include <clib/alib_stdio_protos.h>
#endif /* PARAMETERS_STACK */
/* amiga pragmas */
#include <pragmas/exec_pragmas.h>
#include <pragmas/utility_pragmas.h>
#include <pragmas/dos_pragmas.h>
#include <pragmas/graphics_pragmas.h>
#include <pragmas/cybergraphics_pragmas.h>
#include <pragmas/intuition_pragmas.h>
#include <pragmas/datatypes_pragmas.h>
#include <pragmas/dtclass_pragmas.h>
#include <pragmas/alib_pragmas.h> /* amiga.lib stubs (tagcall pragmas) */
/* ANSI includes */
#include <string.h>
/*****************************************************************************/
struct ClassBase
{
struct ClassLibrary cb_Lib;
struct ExecBase *cb_SysBase;
struct Library *cb_UtilityBase;
struct Library *cb_DOSBase;
struct Library *cb_GfxBase;
struct Library *cb_CyberGfxBase;
struct Library *cb_IntuitionBase;
struct Library *cb_DataTypesBase;
struct Library *cb_SuperClassBase;
BPTR cb_SegList;
struct SignalSemaphore cb_Lock; /* Access lock */
};
/*****************************************************************************/
/* SASC specific defines */
#define DISPATCHERFLAGS __saveds __asm
#define ASM __asm
#define REGD0 register __d0
/* ... */
#define REGA0 register __a0
#define REGA1 register __a1
#define REGA2 register __a2
/* ... */
#define REGA6 register __a6
/*****************************************************************************/
#define SysBase (cb -> cb_SysBase)
#define UtilityBase (cb -> cb_UtilityBase)
#define DOSBase (cb -> cb_DOSBase)
#define GfxBase (cb -> cb_GfxBase)
#define CyberGfxBase (cb -> cb_CyberGfxBase)
#define IntuitionBase (cb -> cb_IntuitionBase)
#define DataTypesBase (cb -> cb_DataTypesBase)
/*****************************************************************************/
/* integer division, rounded */
#define INTDIVR( x, y ) (((x) + ((y) / 2)) / (y))
/* Align memory on 4 byte boundary */
#define ALIGN_LONG( mem ) ((APTR)((((ULONG)(mem)) + 3UL) & ~3UL))
/* Align memory on 16 byte boundary */
#define ALIGN_QUADLONG( mem ) ((APTR)((((ULONG)(mem)) + 15UL) & ~15UL))
/* Following ptr */
#define MEMORY_FOLLOWING( ptr ) ((void *)((ptr) + 1))
/* Memory after n bytes */
#define MEMORY_N_FOLLOWING( ptr, n ) ((void *)(((UBYTE *)ptr) + n ))
/* Memory after n bytes, longword aligned (Don't forget the 4 bytes in size for rounding !!) */
#define MEMORY_NAL_FOLLOWING( ptr, n ) (ALIGN_LONG( ((void *)(((UBYTE *)ptr) + n )) ))
/* casts */
#define V( x ) ((VOID *)(x))
#define G( o ) ((struct Gadget *)(o))
#define EXTG( o ) ((struct ExtGadget *)(o))
/* Exclude tag item */
#define XTAG( expr, tagid ) ((Tag)((expr)?(tagid):(TAG_IGNORE)))
/* Get data from pointer only if it is NOT NULL (and cast data to ULONG) */
#define XPTRDATA( x ) ((ULONG)((x)?(*(x)):(0UL)))
/* Boolean conversion */
#define MAKEBOOL( x ) ((BOOL)((x) != NULL))
/*****************************************************************************/
/* CyberGFX related stuff */
/* This one is missing in the CyberGFX includes (thanks to Niels Froehling for this) */
#ifndef BMB_SPECIALFMT
#define BMB_SPECIALFMT (7UL)
#define BMF_SPECIALFMT (1UL << BMB_SPECIALFMT)
#endif /* BMB_SPECIALFMT */
#define SHIFT_PIXFMT( fmt ) (((ULONG)(fmt)) << 24UL)
#define CYBERGFXNAME "cybergraphics.library"
#define CYBERGFXVERSION (40UL)
/*****************************************************************************/
#ifndef PARAMETERS_STACK
#define PARAMETERS_STACK 1
#define CLIB_ALIB_PROTOS_H
__stdargs void NewList( struct List *list );
__stdargs ULONG DoMethodA( Object *obj, Msg message );
__stdargs ULONG DoMethod( Object *obj, unsigned long MethodID, ... );
__stdargs ULONG DoSuperMethodA( struct IClass *cl, Object *obj, Msg message );
__stdargs ULONG DoSuperMethod( struct IClass *cl, Object *obj, unsigned long MethodID, ... );
__stdargs ULONG CoerceMethodA( struct IClass *cl, Object *obj, Msg message );
__stdargs ULONG CoerceMethod( struct IClass *cl, Object *obj, unsigned long MethodID, ... );
__stdargs ULONG SetSuperAttrs( struct IClass *cl, Object *obj, unsigned long Tag1, ... );
#endif /* !PARAMETERS_STACK */
/*****************************************************************************/
#include "class_iprotos.h"
#endif /* !CLASSBASE_H */