|
|
1.1 root 1: /* $Header: Debug.c,v 1.1 87/09/11 07:57:29 toddb Exp $ */
2: /*
3: * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
4: *
5: * All Rights Reserved
6: *
7: * Permission to use, copy, modify, and distribute this software and its
8: * documentation for any purpose and without fee is hereby granted,
9: * provided that the above copyright notice appear in all copies and that
10: * both that copyright notice and this permission notice appear in
11: * supporting documentation, and that the name of Digital Equipment
12: * Corporation not be used in advertising or publicity pertaining to
13: * distribution of the software without specific, written prior permission.
14: *
15: *
16: * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
17: * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
18: * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
19: * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20: * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21: * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
22: * SOFTWARE.
23: */
24:
25: #include <stdio.h>
26: #include "Xlib.h"
27: #include "Intrinsic.h"
28:
29: char *DBEventTypeToString(type)
30: int type;
31: {
32: static char *types[] = {
33: "Event 0",
34: "Event 1 (Toolkit message event)",
35: "KeyPress",
36: "KeyRelease",
37: "ButtonPress",
38: "ButtonRelease",
39: "MotionNotify",
40: "EnterNotify",
41: "LeaveNotify",
42: "FocusIn",
43: "FocusOut",
44: "KeymapNotify",
45: "Expose",
46: "GraphicsExpose",
47: "NoExpose",
48: "VisibilityNotify",
49: "CreateNotify",
50: "DestroyNotify",
51: "UnmapNotify",
52: "MapNotify",
53: "MapRequest",
54: "ReparentNotify",
55: "ConfigureNotify",
56: "ConfigureRequest",
57: "GravityNotify",
58: "ResizeRequest",
59: "CirculateNotify",
60: "CirculateRequest",
61: "PropertyNotify",
62: "SelectionClear",
63: "SelectionRequest",
64: "SelectionNotify",
65: "ColormapNotify",
66: "ClientMessage",
67: "LASTEvent"
68: };
69: return types[type];
70: }
71:
72: DBPrintEvent(event)
73: XEvent *event;
74: {
75: (void) fprintf(stderr, "Event: %8x %s\t",
76: event->xany.window, DBEventTypeToString(event->type));
77: switch (event->type) {
78: case ConfigureNotify:
79: (void) fprintf(stderr, "(x, y, w, h) = (%d, %d, %d, %d)",
80: event->xconfigure.x, event->xconfigure.y,
81: event->xconfigure.width, event->xconfigure.height);
82: break;
83: case Expose:
84: (void) fprintf(stderr, "(x, y, w, h) = (%d, %d, %d, %d)",
85: event->xexpose.x, event->xexpose.y,
86: event->xexpose.width, event->xexpose.height);
87: if (event->xexpose.count > 0)
88: (void) fprintf(stderr, "(%d more)", event->xexpose.count);
89: break;
90: }
91: (void) fprintf(stderr, "\n");
92: }
93:
94: DBSyncOn(dpy)
95: Display *dpy;
96: {
97: (void) XSynchronize(dpy, TRUE);
98: }
99:
100:
101: DBSyncOff(dpy)
102: Display *dpy;
103: {
104: (void) XSynchronize(dpy, FALSE);
105: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.