
/*** classusr.h **************************************************************
 *
 *  For application users of Intuition object classes
 *
 *  $Header: /home/amiga/V36/src/kickstart/intuition/RCS/classusr.h,v 1.5 90/04/06 22:24:01 jimm Exp $
 *
 *  Confidential Information: Commodore-Amiga, Inc.
 *  Copyright (C) 1989, Commodore-Amiga, Inc.
 *  All Rights Reserved
 *
 ****************************************************************************/


#ifndef	INTUITION_CLASSUSR_H
#define INTUITION_CLASSUSR_H	1


#ifndef UTILITY_HOOKS_H
#include <utility/hooks.h>
#endif

/*** User visible handles on objects, classes, messages ***/
typedef ULONG	Object;		/* abstract handle */

typedef	UBYTE	*ClassID;

typedef struct { 
    ULONG MethodID;
    /* method-specific data follows, some examples below */
}		*Msg;

/* class id's for Intuition basic classes */
#define ROOTCLASS	"rootclass"		/* classusr.h	*/

#define IMAGECLASS	"imageclass"		/* imageclass.h	*/

#define GADGETCLASS	"gadgetclass"		/* gadgetclass.h */
#define PROPGCLASS	"propgclass"
#define STRGCLASS	"strgclass"
#define GROUPGCLASS	"groupgclass"

#define ICCLASS		"icclass"		/* icclass.h	*/
#define MODELCLASS	"modelclass"


/* dispatched method ID's		*/
/* NOTE: Applications should use Intuition entry points, not these */


enum { OM_Dummy = 0x100,
    OM_NEW,		/* 'o' parameter is "true class"	*/
    OM_DISPOSE,		/* delete self (no parameters)		*/
    OM_SET,		/* set attribute (list)			*/
    OM_GET,		/* return single attribute value	*/
    OM_ADDTAIL,		/* add self to a List			*/
    OM_REMOVE,		/* remove self from list (no parameters)*/
    OM_NOTIFY,		/* send to self: notify dependents	*/
    OM_UPDATE,		/* notification message from someone	*/
    OM_ADDMEMBER,	/* used by various classes with lists	*/
    OM_REMMEMBER,	/* used by various classes with lists	*/
};

/* Parameter Fardels	*/

/* OM_NEW and OM_SET	*/
struct opSet {
    ULONG		MethodID;
    struct TagItem	*ops_AttrList;	/* new attributes	*/
    struct GadgetInfo	*ops_GInfo;	/* always there for gadgets,
					 * but will be NULL for OM_NEW
					 */
};

/* OM_NOTIFY, and OM_UPDATE	*/
struct opUpdate {
    ULONG		MethodID;
    struct TagItem	*opu_AttrList;	/* new attributes	*/
    struct GadgetInfo	*opu_GInfo;	/* always there for gadgets,
					 * but will be NULL for OM_NEW
					 */
    ULONG		opu_Flags;	/* defined below	*/
};

/* this flag means that the update message is being issued from
 * something like an active gadget, ala FOLLOWMOUSE.  When
 * the gadget goes inactive, it will issue a final update
 * message with this bit cleared.  Examples of use are for
 * FOLLOWMOUSE equivalents for propgadclass, and repeat strobes
 * for buttons.
 */
#define OPUF_INTERIM	(1<<	0)

/* OM_GET	*/
struct opGet {
    ULONG		MethodID;
    ULONG		opg_AttrID;
    ULONG		*opg_Storage;	/* may be other types, but "int"
					 * types are all ULONG
					 */
};

/* OM_ADDTAIL	*/
struct opAddTail {
    ULONG		MethodID;
    struct List		*opat_List;
};

/* OM_ADDMEMBER, OM_REMMEMBER	*/
#define  opAddMember opMember
struct opMember {
    ULONG		MethodID;
    Object		*opam_Object;
};


#endif
