~ubuntu-branches/ubuntu/karmic/x11-xserver-utils/karmic

« back to all changes in this revision

Viewing changes to xtrap/xtrapproto.c

  • Committer: Bazaar Package Importer
  • Author(s): Brice Goglin, Julien Cristau, Brice Goglin
  • Date: 2007-08-17 09:58:34 UTC
  • Revision ID: james.westby@ubuntu.com-20070817095834-ywge2nyzj1s3rqnd
Tags: 7.3+1
[ Julien Cristau ]
* iceauth 1.0.2.
  + removes blank line in the manpage (closes: #25285).
* xmodmap 1.0.3.
  + manpage updated to state that -pm is the default (closes: #236198)
* xgamma 1.0.2.
  + the manpage now explains how to print the gamma value more clearly
    (closes: #296021).
* xsetroot 1.0.2.
* xrdb 1.0.4.
  + fixes manpage typo (closes: #276286).
* Add upstream URL to debian/copyright, and update it from xgamma's COPYING
  file.

[ Brice Goglin ]
* Add menu entries for xrefresh and xvidtune.
* sessreg 1.0.3.
* xset 1.0.3.
* Add myself to Uploaders, and remove Branden with his permission.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XFree86: xc/programs/xtrap/xtrapproto.c,v 1.3tsi Exp $ */
 
2
/*
 
3
 * @DEC_COPYRIGHT@
 
4
 */
 
5
/*
 
6
 * HISTORY
 
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]
 
11
 *
 
12
 * EndLog$
 
13
 */
 
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 $";
 
16
#endif
 
17
/*****************************************************************************
 
18
Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993 by Digital Equipment Corp., 
 
19
Maynard, MA
 
20
 
 
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.  
 
28
 
 
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
 
35
SOFTWARE.
 
36
 
 
37
*****************************************************************************/
 
38
/*
 
39
 *
 
40
 *  CONTRIBUTORS:
 
41
 *
 
42
 *      Dick Annicchiarico
 
43
 *      Robert Chesler
 
44
 *      Dan Coutu
 
45
 *      Gene Durso
 
46
 *      Marc Evans
 
47
 *      Alan Jamison
 
48
 *      Mark Henry
 
49
 *      Ken Miller
 
50
 *
 
51
 */
 
52
#include <stdio.h>
 
53
#include <stdlib.h>
 
54
#include <X11/extensions/xtraplib.h>
 
55
#include <X11/extensions/xtraplibp.h>
 
56
 
 
57
 
 
58
int
 
59
main(int argc, char *argv[])
 
60
{
 
61
    static Widget appW;
 
62
    XtAppContext app;
 
63
    char *tmp = NULL;
 
64
    XETrapGetAvailRep     ret_avail;
 
65
    XETrapGetCurRep       ret_cur;
 
66
    XETrapGetStatsRep     ret_stats;
 
67
    XETrapGetVersRep      ret_vers;
 
68
    XETrapGetLastInpTimeRep ret_time;
 
69
    XETC    *tc;
 
70
    Display *dpy;
 
71
 
 
72
    /* Connect to Server */
 
73
    appW = XtAppInitialize(&app,"XTrap",NULL,(Cardinal)0L,
 
74
        (int *)&argc, (String *)argv, (String *)NULL,(ArgList)&tmp,
 
75
        (Cardinal)NULL);
 
76
    dpy = XtDisplay(appW);
 
77
    printf("Display:  %s \n", DisplayString(dpy));
 
78
    if ((tc = XECreateTC(dpy,0L, NULL)) == False)
 
79
    {
 
80
        fprintf(stderr,"%s: could not initialize extension\n",argv[0]);
 
81
        exit(1L);
 
82
    }
 
83
    XSynchronize(dpy, True);
 
84
    XEResetRequest(tc);
 
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 */
 
90
    XEFlushConfig(tc);
 
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");
 
100
    }
 
101
    else
 
102
    {
 
103
        XEGetVersionRequest(tc,&ret_vers);
 
104
        XEGetLastInpTimeRequest(tc, &ret_time);
 
105
    }
 
106
    XEFreeTC(tc);
 
107
    (void)XCloseDisplay(dpy);
 
108
    exit(0L);
 
109
}