#define NEED_RESOURCES
#define NEED_EVENTS

#include "sao.XmuX.h"
#include "Xlibint.h"
#include "XmuXlibint.h"
#include "Xutil.h"
#include <X11/Xatom.h>
#include "resources.h"
#include "ApplCtx.h"
#include "build.h"
#include "map.h"
#include "sao.h"

#include "macros.h"

/*
#include "sao.XmuX.h"
#include "Xlibint.h"
#include "XmuXlibint.h"
#include "Xutil.h"
#include <X11/Xatom.h>
#include <Xlib.h>
#include "resources.h"
#include "ApplCtx.h"
#include "build.h"
#include "map.h"
#include "sao.h"
#include "macros.h"
*/

/*
** At the moment, we don't maintain a queue, and honor all requests
** immediately.  So there's no locking whatsoever...This is basically
** a stub function. -sao
*/

int	foo;
XEvent	*event;
int	bar;

XmuXQueueLockRequest (dpy, event)
Display	*dpy;
XEvent	*event;
{
	long	propertyatom;
	Window	windowid;
/*
	XmuXHints       mux_hints;
*/
	char            reply[50];
	Atom atom;

	atom = XInternAtom (dpy, XMUX_CPORT_NAME, True);
	if (!atom) {
		return (BadAtom);
	}
/*
** Send message granting the window ownership of requested property.
*/
	sprintf (	reply, "%c,%d,%d", 
			MuxGrant, 
			event->xclient.data.l[XMUXDetail2], 
			event->xclient.data.l[XMUXDetail]);
/*
	mux_hints.type = XMUXProperty;
	mux_hints.u.strings[0] = XMUX_CPORT_NAME;
	mux_hints.u.strings[1] = reply;
*/

	XChangeProperty (	dpy, event->xclient.window, 
				atom, XA_STRING, 8,
				PropModeReplace, 
				reply, strlen (reply) + 1);
}

/*
** Now, this _is_ a stub function!
*/

XmuXReleaseLockRequest(dpy, event)
Display	*dpy;
XEvent	*event;
{
	fprintf (stderr, "Stub of XmuXReleaseLockRequest\n");
}

