1264fa531Smrg/*****************************************************************************
2264fa531SmrgCopyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
3264fa531Smrg
4264fa531Smrg                        All Rights Reserved
5264fa531Smrg
6dfac8f13SmrgPermission to use, copy, modify, and distribute this software and its
7dfac8f13Smrgdocumentation for any purpose and without fee is hereby granted,
8264fa531Smrgprovided that the above copyright notice appear in all copies and that
9dfac8f13Smrgboth that copyright notice and this permission notice appear in
10264fa531Smrgsupporting documentation, and that the name of Digital not be
11264fa531Smrgused in advertising or publicity pertaining to distribution of the
12dfac8f13Smrgsoftware without specific, written prior permission.
13264fa531Smrg
14264fa531SmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
15264fa531SmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
16264fa531SmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
17264fa531SmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
18264fa531SmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
19264fa531SmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
20264fa531SmrgSOFTWARE.
21264fa531Smrg
22264fa531Smrg******************************************************************************/
23264fa531Smrg
24264fa531Smrg#ifndef VMS
25264fa531Smrg#include <X11/Xatom.h>
26264fa531Smrg#else
27264fa531Smrg#include <decw$include/Xatom.h>
28264fa531Smrg#endif
29264fa531Smrg
30264fa531Smrg#include "x11perf.h"
31264fa531Smrg
32264fa531Smrgstatic Atom XA_PK_TEMP;
33264fa531Smrg
34dfac8f13Smrgvoid
35533545b5SmrgDoNoOp(XParms xp, Parms p, int64_t reps)
36264fa531Smrg{
37c9e4df9bSmrg    for (int i = 0; i != reps; i++) {
38264fa531Smrg	XNoOp(xp->d);
39264fa531Smrg	CheckAbort ();
40264fa531Smrg    }
41264fa531Smrg}
42264fa531Smrg
43264fa531Smrg
44dfac8f13Smrgvoid
45533545b5SmrgDoGetAtom(XParms xp, Parms p, int64_t reps)
46264fa531Smrg{
47c9e4df9bSmrg    for (int i = 0; i != reps; i++) {
48c9e4df9bSmrg	char    *atom = XGetAtomName (xp->d, 1);
49264fa531Smrg 	XFree(atom); /* fix XBUG 6480 */
50264fa531Smrg	CheckAbort ();
51264fa531Smrg    }
52264fa531Smrg}
53264fa531Smrg
54dfac8f13Smrgvoid
55533545b5SmrgDoQueryPointer(XParms xp, Parms p, int64_t reps)
56264fa531Smrg{
57c9e4df9bSmrg    for (int i = 0; i != reps; i++) {
58c9e4df9bSmrg	Window	w;
59c9e4df9bSmrg	int	x;
60c9e4df9bSmrg	unsigned int m;
61264fa531Smrg
62264fa531Smrg	XQueryPointer (xp->d, xp->w, &w, &w, &x, &x, &x, &x, &m);
63264fa531Smrg	CheckAbort ();
64264fa531Smrg    }
65264fa531Smrg}
66264fa531Smrg
67dfac8f13Smrgint
68533545b5SmrgInitGetProperty(XParms xp, Parms p, int64_t reps)
69264fa531Smrg{
70264fa531Smrg    long foo[4];
71264fa531Smrg
72264fa531Smrg    foo[0] = 41;
73264fa531Smrg    foo[1] = 14;
74264fa531Smrg    foo[2] = 37;
75264fa531Smrg    foo[3] = 73;
76264fa531Smrg    XA_PK_TEMP = XInternAtom (xp->d, "_PK_TEMP", False);
77264fa531Smrg    XChangeProperty (
78264fa531Smrg	    xp->d, xp->w, XA_PK_TEMP, XA_INTEGER, 32,
79264fa531Smrg	    PropModeReplace, (unsigned char *)foo, 4);
80264fa531Smrg    return reps;
81264fa531Smrg}
82264fa531Smrg
83dfac8f13Smrgvoid
84533545b5SmrgDoGetProperty(XParms xp, Parms p, int64_t reps)
85264fa531Smrg{
86c9e4df9bSmrg    for (int i = 0; i != reps; i++) {
87c9e4df9bSmrg	int		actual_format;
88c9e4df9bSmrg	unsigned long	actual_length, bytes_remaining;
89c9e4df9bSmrg	unsigned char  *prop;
90c9e4df9bSmrg	Atom		actual_type;
91c9e4df9bSmrg
92264fa531Smrg	XGetWindowProperty (
93264fa531Smrg		xp->d, xp->w, XA_PK_TEMP, 0, 4,
94264fa531Smrg		False, AnyPropertyType, &actual_type, &actual_format,
95264fa531Smrg		&actual_length, &bytes_remaining, &prop);
96264fa531Smrg	CheckAbort ();
97264fa531Smrg	XFree(prop);
98264fa531Smrg    }
99264fa531Smrg}
100