/* ********************************************************************** *\
 *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
	$Disclaimer: 
Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose is hereby granted without fee, 
provided that the above copyright notice appear in all copies and that 
both that copyright notice, this permission notice, and the following 
disclaimer appear in supporting documentation, and that the names of 
IBM, Carnegie Mellon University, and other copyright holders, not be 
used in advertising or publicity pertaining to distribution of the software 
without specific, written prior permission.

IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 
DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 
SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 
BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
OF THIS SOFTWARE.
 $
\* ********************************************************************** */

/* $Header: /afs/cs.cmu.edu/project/atk-dist/auis-6.3/atk/ness/objects/RCS/nevent.hn,v 1.17 1994/02/01 22:08:25 wjh Exp $ */

/* nevent.hn  -  definitions for support of events: mouse, keys, menu

	THIS FILE IS PROCESSED BY nodeclass.n TO PRODUCE nevent.h
	DO NOT EDIT nevent.h

	A source file which imports nevent.h should also import nodeclass.h
*/

#ifndef _ness_nevent_h_
#define _ness_nevent_h_

#if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
static char *rcsid = "$Header: /afs/cs.cmu.edu/project/atk-dist/auis-6.3/atk/ness/objects/RCS/nevent.hn,v 1.17 1994/02/01 22:08:25 wjh Exp $";
#endif

#include "nesssym.ih"
#include "envt.h"	/* for TSysMarkRef */


nodeclass objnode {
	struct nesssym *attrs;
	nesssym_scopeType scope;
	long loc;
	long len;
	struct celview* obj;  /* the object extended (or classinfo for view:xyz) */
	struct proctable_Entry *menupe, *keype;
	struct keymap *keymap;
	struct menulist *menulist;
	boolean MouseEnabled;
	boolean ExtendAView;
};

/* KLUDGE: note that first 5 fields are the same order and position
	as the fields in a struct funcnode in compdefs.hn */
nodeclass eventnode {
	TSysMarkRef SysMarkOffset;
	nesssym_scopeType outerscope, ownscope;
	struct mark *where;
	struct nesssym *locallist;
	struct nesssym *varsym;
	unsigned char *spec;
	struct ness *parentness;
	struct observable *TriggerHolder;
	boolean enabled;
	char *rock;
	struct eventnode *next, **meptr;
};

/* one-time initialization */
void neventInit(/* */);

/* code generation routines - compile time 
	these do initial and final processing for the EXTEND ... END
	and ON ... END constructs  */
struct nesssym *neventStartExtend(/* struct nesssym *currobj, struct nesssym *name */);
struct nesssym *neventFinishExtend(/* struct nesssym *obj, struct nesssym *attrs */);
struct nesssym *neventStartEvent(/* struct nesssym *currobj, enum eventvariety e, struct nesssym *name */);
struct nesssym *neventFinishEvent(/* struct nesssym *event, 
		struct nesssym *locals, enum eventvariety e */);

/* post-time routines 
	these remove and post event handling to celviews */
void neventPost (/* struct ness *ness, boolean debug */);
void neventUnpost (/* struct ness *ness, boolean debug */);

/* run time routines */
void DestroyEventNode(/* struct eventnode * */); /* cleanly destroys an eventnode and removes it from the list of all eventnodes. */
struct basicobject *ProperPtr(/* struct basicobject *ptr, 
	struct classinfo *type */);  /* finds "nearby" ptr of desired type */
void neventInfo(/* char op, union stackelement *NSP, 
	char *iar*/);  /* dispatches for many event related routines */

#endif

