1
/* $XFree86: xc/programs/xtrap/xtrapproto.c,v 1.3tsi Exp $ */
7
* Log: xtrapproto.c,v $
8
* Revision 1.1.2.2 1993/12/14 12:37:32 Kenneth_Miller
9
* ANSI-standardize code and turn client build on
10
* [1993/12/09 20:16:08 Kenneth_Miller]
14
#if !defined(lint) && 0
15
static char *rcsid = "@(#)RCSfile: xtrapproto.c,v $ Revision: 1.1.2.2 $ (DEC) Date: 1993/12/14 12:37:32 $";
17
/*****************************************************************************
18
Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993 by Digital Equipment Corp.,
21
Permission to use, copy, modify, and distribute this software and its
22
documentation for any purpose and without fee is hereby granted,
23
provided that the above copyright notice appear in all copies and that
24
both that copyright notice and this permission notice appear in
25
supporting documentation, and that the name of Digital not be
26
used in advertising or publicity pertaining to distribution of the
27
software without specific, written prior permission.
29
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
30
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
31
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
32
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
33
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
34
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
37
*****************************************************************************/
54
#include <X11/extensions/xtraplib.h>
55
#include <X11/extensions/xtraplibp.h>
59
main(int argc, char *argv[])
64
XETrapGetAvailRep ret_avail;
65
XETrapGetCurRep ret_cur;
66
XETrapGetStatsRep ret_stats;
67
XETrapGetVersRep ret_vers;
68
XETrapGetLastInpTimeRep ret_time;
72
/* Connect to Server */
73
appW = XtAppInitialize(&app,"XTrap",NULL,(Cardinal)0L,
74
(int *)&argc, (String *)argv, (String *)NULL,(ArgList)&tmp,
76
dpy = XtDisplay(appW);
77
printf("Display: %s \n", DisplayString(dpy));
78
if ((tc = XECreateTC(dpy,0L, NULL)) == False)
80
fprintf(stderr,"%s: could not initialize extension\n",argv[0]);
83
XSynchronize(dpy, True);
85
XEGetAvailableRequest(tc,&ret_avail);
86
XEPrintAvail(stdout,&ret_avail);
87
XEGetCurrentRequest(tc,&ret_cur);
88
XEPrintCurrent(stderr,&ret_cur);
89
XETrapSetStatistics(tc, True); /* trigger config and def stats */
91
XEGetStatisticsRequest(tc, &ret_stats);
92
XEPrintStatistics(stdout, &ret_stats,tc);
93
XEStartTrapRequest(tc);
94
XESimulateXEventRequest(tc, MotionNotify, 0, 10L, 20L, 0L);
95
XEStopTrapRequest(tc);
96
if (tc->protocol == 31)
97
{ /* didn't work in V3.1 */
98
printf("XEGetVersionRequest() & XEGetLastInpTimeRequest() are\n");
99
printf("broken using the V3.1 protocol!\n");
103
XEGetVersionRequest(tc,&ret_vers);
104
XEGetLastInpTimeRequest(tc, &ret_time);
107
(void)XCloseDisplay(dpy);