Commit ded6ed70 authored by Bernhard Link's avatar Bernhard Link

add run-time parser for a new protocol description language (currently as new...

add run-time parser for a new protocol description language (currently as new binary xtraceng, things like search-path are still to be added to be useable outside the source directory
parent 7fcb9fe8
bin_PROGRAMS = xtrace
# decodexnumbers
bin_PROGRAMS = xtrace xtraceng
CFLAGS ?= -g -O2
AM_CPPFLAGS = @CPPFLAGS@ -Wall
# for authdata.c: -I/usr/X11R6/include -DNeedFunctionPrototypes
xtrace_CPPFLAGS = $(AM_CPPFLAGS) -DOLDSTYLE=1
xtrace_SOURCES = main.c x11common.c x11client.c x11server.c parse.c copyauth.c atoms.c
# authdata.c
xtrace_LDFLAGS = -Wl,-z,defs
# for authdata.c add: -L/usr/X11R6/lib -lX11 -lXext
# decodexnumbers_SOURCES = masktosymbols.c
# decodexnumbers_LDFLAGS = -Wl,-z,syms
xtraceng_SOURCES = main.c x11common.c x11client.c x11server.c parse.c copyauth.c atoms.c translate.c stringlist.c
xtraceng_LDFLAGS = -Wl,-z,defs
noinst_HEADERS = xtrace.h xinput.inc xkb.inc xinerama.inc requests.inc events.inc shape.inc bigrequest.inc render.inc randr.inc mitshm.inc xf86vidmode.inc xf86bigfont.inc dpms.inc saver.inc fixes.inc damage.inc glx.inc
noinst_HEADERS = xtrace.h xinput.inc xkb.inc xinerama.inc requests.inc events.inc shape.inc bigrequest.inc render.inc randr.inc mitshm.inc xf86vidmode.inc xf86bigfont.inc dpms.inc saver.inc fixes.inc damage.inc glx.inc parse.h stringlist.h translate.h
man_MANS = xtrace.1
dist_man_MANS = xtrace.1
MAINTAINERCLEANFILES = Makefile.in configure install-sh stamp-h.in aclocal.m4 mkinstalldirs missing config.h.in autom4te.cache config.guess config.sub depcomp
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/install-sh $(srcdir)/stamp-h.in $(srcdir)/aclocal.m4 $(srcdir)/mkinstalldirs $(srcdir)/missing $(srcdir)/config.h.in $(srcdir)/depcomp
EXTRA_DIST = autogen.sh config.h.in xtrace.1
dist_pkgdata_DATA = all.proto bigfont.proto bigrequest.proto damage.proto dpms.proto errors.proto events.proto fixes.proto glx.proto mitshm.proto randr.proto render.proto requests.proto saver.proto shape.proto vidmode.proto xinerama.proto xinput.proto xkb.proto
EXTRA_DIST = autogen.sh config.h.in
distclean-local:
-rm -rf autom4te.cache
-rm -rf $(srcdir)/autom4te.cache
maintainer-clean-local:
-rm -rf $(srcdir)/ac
NEEDS "requests.proto"
NEEDS "events.proto"
NEEDS "errors.proto"
NEEDS "bigfont.proto"
NEEDS "bigrequest.proto"
NEEDS "damage.proto"
NEEDS "dpms.proto"
NEEDS "fixes.proto"
NEEDS "glx.proto"
NEEDS "mitshm.proto"
NEEDS "randr.proto"
NEEDS "render.proto"
NEEDS "saver.proto"
NEEDS "shape.proto"
NEEDS "vidmode.proto"
NEEDS "xinerama.proto"
NEEDS "xinput.proto"
NEEDS "xkb.proto"
EOF
......@@ -8,10 +8,7 @@ if [ "x$1" = "x--chdir" ] ; then
shift
fi
aclocal
autoheader
automake -a -c
autoconf
autoreconf -i
curdir="$(pwd)"
mkdir -p -- "$configindir"
......
# This file is part of "xtrace"
# Copyright (C) 2007 Bernhard R. Link
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# This file is based on /usr/include/X11/extensions/xf86bigf{ont,str}.h, which is:
## Copyright (c) 1999-2000 Bruno Haible
## Copyright (c) 1999-2000 The XFree86 Project, Inc.
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentation files (the "Software"), to deal
## in the Software without restriction, including without limitation the rights
## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
## copies of the Software, and to permit persons to whom the Software is
## furnished to do so, subject to the following conditions:
##
## The above copyright notice and this permission notice shall be included in all
## copies or substantial portions of the Software.
##
## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
## XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
## IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
## CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
##
## Except as contained in this notice, the name of the XFree86 Project shall not
## be used in advertising or otherwise to promote the sale, use or other dealings
## in this Software without prior written authorization from the XFree86 Project.
EXTENSION "XFree86-Bigfont" bigfont
USE core
REQUESTS
QueryVersion RESPONDS
QueryFont RESPONDS
END
EVENTS
END
ERRORS
END
BITMASK xf86bigfont_capabilities
1 LocalShm
END
TYPE xf86bigfont_capabilities BITMASK32 xf86bigfont_capabilities
BITMASK xf86bigfont_flags
1 Shm
END
TYPE xf86bigfont_flags BITMASK32 xf86bigfont_flags
REQUEST QueryVersion
END
RESPONSE QueryVersion
8 major-version UINT16
10 minor-version UINT16
1 capabilities xf86bigfont_capabilities
12 uid UINT32
16 gid UINT32
20 signature UINT32
END
REQUEST QueryFont
4 id UINT32
8 flags xf86bigfont_flags
END
RESPONSE QueryFont
8 min-bounds CHARINFO
24 max-bounds CHARINFO
40 min-char-or-byte2 CARD16
42 max-char-or-byte2 CARD16
44 default-char CARD16
48 draw-direction ENUM8 direction
49 min-byte1 CARD8
50 max-byte1 CARD8
51 all-chars-exists BOOL
52 font-ascent INT16
54 font-descent INT16
64 shmid COUNT32
68 shmsegoffset COUNT32
46 nFontProps COUNT16
72 properties LISTofFONTPROP
60 nUniqCharInfos COUNT32
LATER uniq-char-infos LISTofCHARINFO
56 nCharInfos COUNT32
LATER char-info-offsets LISTofCARD16
END
EOF
# This file is part of "xtrace"
# Copyright (C) 2009 Bernhard R. Link
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
EXTENSION "BIG-REQUESTS" BigRequest
USE core
REQUESTS
Enable RESPONDS
END
EVENTS
END
ERRORS
END
REQUEST Enable ALIASES Empty
RESPONSE Enable
8 maximum-request-length UINT32
END
EOF
......@@ -2,16 +2,20 @@ dnl
dnl Process this file with autoconf to produce a configure script
dnl
AC_INIT(main.c)
AC_INIT(xtrace, 1.0.0~alpha1, brlink@debian.org)
AC_CONFIG_SRCDIR(main.c)
AC_CONFIG_AUX_DIR(ac)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(xtrace,0.11.0)
AM_INIT_AUTOMAKE([-Wall -Werror])
AM_MAINTAINER_MODE
AC_GNU_SOURCE
AC_PROG_CC
AC_PROG_INSTALL
dnl remove again once xtraceng becomes xtrace:
AM_PROG_CC_C_O
AC_DEFINE([_GNU_SOURCE],[1],[To tell glibc to make strndup visible])
AC_CHECK_FUNCS([strndup])
AC_CHECK_FUNCS([asprintf])
......
# This file is part of "xtrace"
# Copyright (C) 2008 Bernhard R. Link
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
EXTENSION "DAMAGE" Damage
USE core
REQUESTS
QueryVersion RESPONDS
Create
Destroy
Subtract
END
EVENTS
Notify
END
ERRORS
BadDamage
END
CONSTANTS damage_level
0 "report raw rectangles"
1 "report delta rectangles"
2 "report bounding box"
3 "report non-empty"
END
TYPE DAMAGE_LEVEL ENUM8 damage_level
CONSTANTS damage_state
0 off
1 on
2 cycle
3 disable
END
TYPE DAMAGE_STATE ENUM8 damage_state
CONSTANTS damage_kind
0 blanked
1 internal
2 external
END
TYPE DAMAGE_KIND ENUM8 damage_kind
BITMASK damage_mask
0x00000001 notify
0x00000002 cycle
END
TYPE DAMAGE_MASK BITMASK32 damage_mask
REQUEST QueryVersion
4 "major version" UINT32
8 "minor version" UINT32
END
RESPONSE QueryVersion
8 "major version" UINT32
12 "minor version" UINT32
END
REQUEST Create
4 damage CARD32
8 drawable DRAWABLE
12 level DAMAGE_LEVEL
END
REQUEST Destroy
4 damage CARD32
END
REQUEST Subtract
4 damage CARD32
8 repair-region CARD32
12 parts-region CARD32
END
EVENT Notify
1 level DAMAGE_LEVEL
4 drawable DRAWABLE
8 damage CARD32
12 timestamp TIMESTAMP
16 area RECTANGLE
24 geometry RECTANGLE
END
EOF
# This file is part of "xtrace"
# Copyright (C) 2008 Bernhard R. Link
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
EXTENSION "DPMS" Dpms
USE core
REQUESTS
GetVersion RESPONDS
Capable RESPONDS
GetTimeouts RESPONDS
SetTimeouts
Enable
Disable
ForceLevel
Info RESPONDS
END
EVENTS
END
ERRORS
END
CONSTANTS dpms_level
0 on
1 standby
2 suspend
3 off
END
TYPE DPMS_LEVEL ENUM16 dpms_level
REQUEST GetVersion
4 "major version" UINT16
6 "minor version" UINT16
END
RESPONSE GetVersion
8 "major version" UINT16
10 "minor version" UINT16
END
REQUEST Capable ALIASES Empty
RESPONSE Capable
8 capable BOOL
END
REQUEST GetTimeouts ALIASES Empty
RESPONSE GetTimeouts
8 standby UINT16
10 suspend UINT16
12 off UINT16
END
REQUEST SetTimeouts
4 standby UINT16
6 suspend UINT16
8 off UINT16
END
REQUEST Enable ALIASES Empty
REQUEST Disable ALIASES Empty
REQUEST ForceLevel
4 level DPMS_LEVEL
END
REQUEST Info ALIASES Empty
RESPONSE Info
8 power_level DPMS_LEVEL
10 state BOOL
END
EOF
NAMESPACE core
ERRORS
"no error"
Request
Value
Window
Pixmap
Atom
Cursor
Font
Match
Drawable
Access
Alloc
Colormap
GContext
IDChoice
Name
Length
Implementation
END
EOF
# This file is part of "xtrace"
# Copyright (C) 2005 Bernhard R. Link
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# This file is based on the
# X Window System Protocol
# X Consortium Standard
# X Version 11, Release 6.4
#
# Robert W. Scheifler
# X Consortium, Inc.
#
# with the following trademark and copyright notices and acknowlegdgments:
##
## X Window System is a trademark of X Consortium, Inc.
##
## Copyright (C) 1986, 1987, 1988, 1994 X Consortium
##
## Permission is hereby granted, free of charge, to any person
## obtaining a copy of this software and associated documenta-
## tion files (the ``Software''), to deal in the Software with-
## out restriction, including without limitation the rights to
## use, copy, modify, merge, publish, distribute, sublicense,
## and/or sell copies of the Software, and to permit persons to
## whom the Software is furnished to do so, subject to the fol-
## lowing conditions:
##
## The above copyright notice and this permission notice shall
## be included in all copies or substantial portions of the
## Software.
##
## THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY
## KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
## WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PUR-
## POSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSOR-
## TIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
## WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
## FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
## OR OTHER DEALINGS IN THE SOFTWARE.
##
## Except as contained in this notice, the name of the X Con-
## sortium shall not be used in advertising or otherwise to
## promote the sale, use or other dealings in this Software
## without prior written authorization from the X Consortium.
##
## Acknowledgments
##
## The primary contributers to the X11 protocol are:
##
## Dave Carver (Digital HPW)
## Branko Gerovac (Digital HPW)
## Jim Gettys (MIT/Project Athena, Digital)
## Phil Karlton (Digital WSL)
## Scott McGregor (Digital SSG)
## Ram Rao (Digital UEG)
## David Rosenthal (Sun)
## Dave Winchell (Digital UEG)
##
## The implementors of initial server who provided useful input
## are:
##
## Susan Angebranndt (Digital)
## Raymond Drewry (Digital)
## Todd Newman (Digital)
##
## The invited reviewers who provided useful input are:
##
## Andrew Cherenson (Berkeley)
## Burns Fisher (Digital)
## Dan Garfinkel (HP)
## Leo Hourvitz (Next)
## Brock Krizan (HP)
## David Laidlaw (Stellar)
## Dave Mellinger (Interleaf)
## Ron Newman (MIT)
## John Ousterhout (Berkeley)
## Andrew Palay (ITC CMU)
## Ralph Swick (MIT)
## Craig Taylor (Sun)
## Jeffery Vroom (Stellar)
##
NEEDS "requests.proto"
NAMESPACE core
EVENTS
UNKNOWN
UNKNOWN
KeyPress
KeyRelease
ButtonPress
ButtonRelease
MotionNotify
EnterNotify
LeaveNotify
FocusIn
FocusOut
KeymapNotify
Expose
GraphicsExposure
NoExposure
VisibilityNotify
CreateNotify
DestroyNotify
UnmapNotify
MapNotify
MapRequest
ReparentNotify
ConfigureNotify
ConfigureRequest
GravityNotify
ResizeRequest
CirculateNotify
CirculateRequest
PropertyNotify
SelectionClear
SelectionRequest
SelectionNotify
ColormapNotify
ClientMessage
MappingNotify
END
templateEVENT Key
1 keycode KEYCODE
4 time TIMESTAMP
8 root WINDOW
12 event WINDOW
16 child WINDOW constants none
20 root-x INT16
22 root-y INT16
24 event-x INT16
26 event-y INT16
28 state SETofKEYBUTMASK
30 same-screen BOOL
END
EVENT KeyPress ALIASES Key
EVENT KeyRelease ALIASES Key
templateEVENT Button
1 button BUTTON
4 time TIMESTAMP
8 root WINDOW
12 event WINDOW
16 child WINDOW constants none
20 root-x INT16
22 root-y INT16
24 event-x INT16
26 event-y INT16
28 state SETofKEYBUTMASK
30 same-screen BOOL
END
EVENT ButtonPress ALIASES Button
EVENT ButtonRelease ALIASES Button
CONSTANTS normalhint
0 Normal
1 Hint
END
EVENT MotionNotify
1 detail ENUM8 normalhint
4 time TIMESTAMP
8 root WINDOW
12 event WINDOW
16 child WINDOW constants none
20 root-x INT16
22 root-y INT16
24 event-x INT16
26 event-y INT16
28 state SETofKEYBUTMASK
30 same-screen BOOL
END
CONSTANTS enterdetail
0 Ancestor
1 Virtual
2 Inferior
3 Nonlinear
4 NonlinearVirtual
5 Pointer
6 PointerRoot
7 None
END
CONSTANTS grabmode
0 Normal
1 Grab
2 Ungrab
3 WhileGrabbed
END
BITMASK focusscreen
0x01 focus
0x02 same-screen
0xFC unused
END
EVENT EnterNotify
1 detail ENUM8 enterdetail
30 mode ENUM8 grabmode
31 flags BITMASK8 focusscreen
4 time TIMESTAMP
8 root WINDOW
12 event WINDOW
16 child WINDOW constants none
20 root-x INT16
22 root-y INT16
24 event-x INT16
26 event-y INT16
28 state SETofKEYBUTMASK
END
EVENT LeaveNotify ALIASES EnterNotify
EVENT FocusIn
1 detail ENUM8 enterdetail
4 event WINDOW
8 mode ENUM8 grabmode
END
EVENT FocusOut ALIASES FocusIn
EVENT KeymapNotify
1 "keys(0-7 omitted)" LISTofCARD8
END
EVENT Expose
4 window WINDOW
8 x UINT16
10 y UINT16
12 width UINT16
14 height UINT16
16 count CARD16
END
EVENT GraphicsExposure
4 drawable DRAWABLE
8 x UINT16
10 y UINT16
12 width UINT16
13 height UINT16
14 minor-opcode CARD16
18 count CARD16
20 major-opcode CARD8
END
EVENT NoExposure
4 drawable DRAWABLE
8 minor-opcode CARD16
10 major-opcode CARD8
END
CONSTANTS obscure
0 Unobscured
1 PartiallyObscured
2 FullyObscured
END
EVENT VisibilityNotify
4 window WINDOW
8 state ENUM8 obscure
END
EVENT CreateNotify
4 parent WINDOW
8 window WINDOW
12 x INT16
14 y INT16
16 width UINT16
18 height UINT16
20 border-width UINT16
22 override-redirect BOOL
END
EVENT DestroyNotify
4 event WINDOW
8 window WINDOW
END
EVENT UnmapNotify
4 event WINDOW
8 window WINDOW
12 from-configure BOOL
END
EVENT MapNotify
4 event WINDOW
8 window WINDOW
12 override-redirect BOOL
END
EVENT MapRequest
4 parent WINDOW
8 window WINDOW
END