#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include "wafe.h"                             

void
XtPopdown
        in: Widget

void
XtPopupSpringLoaded
        in: Widget

void
XtPopup
        in: Widget
        in: XtGrabKind

void
XtDestroyWidget
	callmultiple
		in: freeGarbageMM(Widget)


void
XtUnrealizeWidget
	callmultiple
		in: Widget

void
XtManageChild
	callmultiple
		in: Widget

void
XtSetKeyboardFocus
	in: Widget
	in: Widget

(int) GrabReturns
XtGrabPointer
	in: Widget
	in: Boolean
        const: NoEventMask
	in: (int) SyncAsync
	in: (int) SyncAsync
	in: XtWindow(Widget)
	const: None
	const: CurrentTime

void
XtUngrabPointer
	in: Widget
	const: CurrentTime

(int) GrabReturns
XtGrabKeyboard
	in: Widget
	in: Boolean
	in: (int) SyncAsync
	in: (int) SyncAsync
	const: CurrentTime

void
XtUngrabKeyboard
	in: Widget
	const: CurrentTime

void
XtRealizeWidget vulgo realize
	const: topLevel

char *
getTypeOfAttribute
	in: XtClass(Widget)
	const: ParentWidget(localVar1)
	in: char *

#include <X11/IntrinsicP.h>
#define getClass(widget) (XtClass(widget)->core_class.class_name)

char *
getClass
	in: Widget


#####   terminate wafe  #####

#include <signal.h>

void 
kill vulgo quit 
	const: pid
	const: SIGTERM
	pre: if (pid)
	post: exit(0);

#####  selection handling #####

#include <X11/Xatom.h>
#include <X11/StringDefs.h>

void
XtDisownSelection
	const: topLevel
	const: XA_PRIMARY
	const: CurrentTime

extern void getSelectionValueProc();

void
XtGetSelectionValue
	const: topLevel
	const: XA_PRIMARY
	const: XA_STRING
	const: getSelectionValueProc
	in: XtNewString(char *)
	const: CurrentTime

#####  callbacks and such  #####

#define installAccelerators(destination,source,table) \
	{ XtVaSetValues(source, XtNaccelerators, table, NULL); \
          XtInstallAccelerators(destination, source);}

void
installAccelerators
	in: Widget
	in: Widget
	in: XtAccelerators

# die folgende Function hatte einen anderen Namen! (removeCallbacks)

void
XtRemoveAllCallbacks
	in: Widget
	in: char *

hint: prototype
void
action
	in: Widget
	in: (int)TranslationModifier
        in: XtTranslations

extern execCallbackProc();
extern positionCallbackProc();
extern positionCursorCallbackProc();

hint: prototype
void
callback
	in: Widget
	in: char *
        in: XtCallbackProc
        in: XtNewString(char *)

#define echo(x) {write(toClient,x,strlen(x)); if (count+1 != argc) write(toClient," ",1);}

void
echo
	callmultiple
	in: char *
	post: write(toClient, "\n",1);


##### some additional selection commands #####


# get the PRIMARY selection, put it into Cut Buffer 0 and fetch it ...

char *
XFetchBytes
	pre: { int bytes; \
		XConvertSelection(XtDisplay(topLevel), XA_PRIMARY, \
			XA_STRING, XA_CUT_BUFFER0, \
			DefaultRootWindow(XtDisplay(topLevel)), \
			CurrentTime); 
	const: XtDisplay(topLevel)
        const:  &bytes
	post: }
	end: XtFree(returnVar);

void
XConvertSelection
	const: XtDisplay(topLevel)
	const: XA_PRIMARY
	const: XA_STRING
	in: Atom
	const: DefaultRootWindow(XtDisplay(topLevel))
	const: CurrentTime

void
XStoreBuffer
	const: XtDisplay(topLevel)
	in: char *
	const: strlen(argv[1])
	in: int


char *
XFetchBuffer
	const: XtDisplay(topLevel)
	const: &nbytes
	in: int
	pre: {int nbytes;
	post: }
	end: XtFree(returnVar);

void
XtTranslateCoords
	in: Widget
	in: Position    # x
	in: Position    # y
	out: Position   # root x
	out: Position   # root y




