summaryrefslogtreecommitdiff
path: root/xcbgen
diff options
context:
space:
mode:
authorLee Chang Yeon <cyeon.lee@samsung.com>2014-04-08 19:23:18 +0900
committerLee Chang Yeon <cyeon.lee@samsung.com>2014-04-08 19:23:18 +0900
commit3b08aa378f20e52aa0676223f44efbdba84fc360 (patch)
tree1d42d94e070926f996a55559df1650dbaacde3a7 /xcbgen
parent4f1a42f85bb16d006429c7ce867be939a222fc25 (diff)
downloadxcb-proto-upstream.tar.gz
xcb-proto-upstream.tar.bz2
xcb-proto-upstream.zip
Imported Upstream version 1.10upstream/1.10upstream
Diffstat (limited to 'xcbgen')
-rw-r--r--xcbgen/Makefile.in410
-rw-r--r--xcbgen/expr.py3
-rw-r--r--xcbgen/state.py2
-rw-r--r--xcbgen/xtypes.py66
4 files changed, 58 insertions, 423 deletions
diff --git a/xcbgen/Makefile.in b/xcbgen/Makefile.in
deleted file mode 100644
index 2670e92..0000000
--- a/xcbgen/Makefile.in
+++ /dev/null
@@ -1,410 +0,0 @@
-# Makefile.in generated by automake 1.11.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-VPATH = @srcdir@
-am__make_dryrun = \
- { \
- am__dry=no; \
- case $$MAKEFLAGS in \
- *\\[\ \ ]*) \
- echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
- | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
- *) \
- for am__flg in $$MAKEFLAGS; do \
- case $$am__flg in \
- *=*|--*) ;; \
- *n*) am__dry=yes; break;; \
- esac; \
- done;; \
- esac; \
- test $$am__dry = yes; \
- }
-pkgdatadir = $(datadir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-subdir = xcbgen
-DIST_COMMON = $(pkgpython_PYTHON) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_CLEAN_FILES =
-CONFIG_CLEAN_VPATH_FILES =
-SOURCES =
-DIST_SOURCES =
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__py_compile = PYTHON=$(PYTHON) $(SHELL) $(py_compile)
-am__installdirs = "$(DESTDIR)$(pkgpythondir)"
-py_compile = $(top_srcdir)/py-compile
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PYTHON = @PYTHON@
-PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
-PYTHON_PLATFORM = @PYTHON_PLATFORM@
-PYTHON_PREFIX = @PYTHON_PREFIX@
-PYTHON_VERSION = @PYTHON_VERSION@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-XMLLINT = @XMLLINT@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-am__leading_dot = @am__leading_dot@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build_alias = @build_alias@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-pkgpyexecdir = @pkgpyexecdir@
-pkgpythondir = $(pythondir)/xcbgen
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-pyexecdir = @pyexecdir@
-pythondir = @pythondir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-xcbincludedir = @xcbincludedir@
-pkgpython_PYTHON = __init__.py error.py expr.py matcher.py state.py xtypes.py
-all: all-am
-
-.SUFFIXES:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
- && { if test -f $@; then exit 0; else break; fi; }; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign xcbgen/Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign xcbgen/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(am__aclocal_m4_deps):
-install-pkgpythonPYTHON: $(pkgpython_PYTHON)
- @$(NORMAL_INSTALL)
- @list='$(pkgpython_PYTHON)'; dlist=; list2=; test -n "$(pkgpythondir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(pkgpythondir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(pkgpythondir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \
- if test -f $$b$$p; then \
- $(am__strip_dir) \
- dlist="$$dlist $$f"; \
- list2="$$list2 $$b$$p"; \
- else :; fi; \
- done; \
- for file in $$list2; do echo $$file; done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgpythondir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgpythondir)" || exit $$?; \
- done || exit $$?; \
- if test -n "$$dlist"; then \
- $(am__py_compile) --destdir "$(DESTDIR)" \
- --basedir "$(pkgpythondir)" $$dlist; \
- else :; fi
-
-uninstall-pkgpythonPYTHON:
- @$(NORMAL_UNINSTALL)
- @list='$(pkgpython_PYTHON)'; test -n "$(pkgpythondir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- test -n "$$files" || exit 0; \
- dir='$(DESTDIR)$(pkgpythondir)'; \
- filesc=`echo "$$files" | sed 's|$$|c|'`; \
- fileso=`echo "$$files" | sed 's|$$|o|'`; \
- st=0; \
- for files in "$$files" "$$filesc" "$$fileso"; do \
- $(am__uninstall_files_from_dir) || st=$$?; \
- done; \
- exit $$st
-tags: TAGS
-TAGS:
-
-ctags: CTAGS
-CTAGS:
-
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile
-installdirs:
- for dir in "$(DESTDIR)$(pkgpythondir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-generic
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-pkgpythonPYTHON
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am:
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-generic
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-pkgpythonPYTHON
-
-.MAKE: install-am install-strip
-
-.PHONY: all all-am check check-am clean clean-generic distclean \
- distclean-generic distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-pkgpythonPYTHON install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \
- uninstall-am uninstall-pkgpythonPYTHON
-
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/xcbgen/expr.py b/xcbgen/expr.py
index 4f8af6f..f9d5179 100644
--- a/xcbgen/expr.py
+++ b/xcbgen/expr.py
@@ -13,7 +13,7 @@ class Field(object):
auto is true iff the field is on the wire but not in the request API (e.g. opcode)
enum is the enum name this field refers to, if any.
'''
- def __init__(self, type, field_type, field_name, visible, wire, auto, enum=None):
+ def __init__(self, type, field_type, field_name, visible, wire, auto, enum=None, isfd=False):
self.type = type
self.field_type = field_type
self.field_name = field_name
@@ -21,6 +21,7 @@ class Field(object):
self.visible = visible
self.wire = wire
self.auto = auto
+ self.isfd = isfd
class Expression(object):
diff --git a/xcbgen/state.py b/xcbgen/state.py
index ae3d2d4..10a8722 100644
--- a/xcbgen/state.py
+++ b/xcbgen/state.py
@@ -74,9 +74,11 @@ class Module(object):
self.add_type('CARD8', '', ('uint8_t',), tcard8)
self.add_type('CARD16', '', ('uint16_t',), tcard16)
self.add_type('CARD32', '', ('uint32_t',), tcard32)
+ self.add_type('CARD64', '', ('uint64_t',), tcard64)
self.add_type('INT8', '', ('int8_t',), tint8)
self.add_type('INT16', '', ('int16_t',), tint16)
self.add_type('INT32', '', ('int32_t',), tint32)
+ self.add_type('INT64', '', ('int64_t',), tint64)
self.add_type('BYTE', '', ('uint8_t',), tcard8)
self.add_type('BOOL', '', ('uint8_t',), tcard8)
self.add_type('char', '', ('char',), tchar)
diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py
index f6d4634..5f45723 100644
--- a/xcbgen/xtypes.py
+++ b/xcbgen/xtypes.py
@@ -75,6 +75,18 @@ class Type(object):
complex_type.fields.append(new_field)
+ def make_fd_of(self, module, complex_type, fd_name):
+ '''
+ Method for making a fd member of a structure.
+ '''
+ new_fd = Field(self, module.get_type_name('INT32'), fd_name, True, False, False, None, True)
+ # We dump the _placeholder_byte if any fields are added.
+ for (idx, field) in enumerate(complex_type.fields):
+ if field == _placeholder_byte:
+ complex_type.fields[idx] = new_fd
+ return
+
+ complex_type.fields.append(new_fd)
class SimpleType(Type):
'''
@@ -103,9 +115,11 @@ class SimpleType(Type):
tcard8 = SimpleType(('uint8_t',), 1)
tcard16 = SimpleType(('uint16_t',), 2)
tcard32 = SimpleType(('uint32_t',), 4)
+tcard64 = SimpleType(('uint64_t',), 8)
tint8 = SimpleType(('int8_t',), 1)
tint16 = SimpleType(('int16_t',), 2)
tint32 = SimpleType(('int32_t',), 4)
+tint64 = SimpleType(('int64_t',), 8)
tchar = SimpleType(('char',), 1)
tfloat = SimpleType(('float',), 4)
tdouble = SimpleType(('double',), 8)
@@ -277,6 +291,7 @@ class ComplexType(Type):
self.nmemb = 1
self.size = 0
self.lenfield_parent = [self]
+ self.fds = []
def resolve(self, module):
if self.resolved:
@@ -322,9 +337,14 @@ class ComplexType(Type):
type.make_member_of(module, self, field_type, field_name, visible, True, False)
type.resolve(module)
continue
+ elif child.tag == 'fd':
+ fd_name = child.get('name')
+ type = module.get_type('INT32')
+ type.make_fd_of(module, self, fd_name)
+ continue
else:
# Hit this on Reply
- continue
+ continue
# Get the full type name for the field
field_type = module.get_type_name(fkey)
@@ -481,8 +501,14 @@ class BitcaseType(ComplexType):
'''
def __init__(self, index, name, elt, *parent):
elts = list(elt)
- self.expr = Expression(elts[0] if len(elts) else elt, self)
- ComplexType.__init__(self, name, elts[1:])
+ self.expr = []
+ fields = []
+ for elt in elts:
+ if elt.tag == 'enumref':
+ self.expr.append(Expression(elt, self))
+ else:
+ fields.append(elt)
+ ComplexType.__init__(self, name, fields)
self.has_name = True
self.index = 1
self.lenfield_parent = list(parent) + [self]
@@ -510,8 +536,9 @@ class BitcaseType(ComplexType):
def resolve(self, module):
if self.resolved:
return
-
- self.expr.resolve(module, self.parents+[self])
+
+ for e in self.expr:
+ e.resolve(module, self.parents+[self])
# Resolve the bitcase expression
ComplexType.resolve(self, module)
@@ -593,28 +620,43 @@ class Event(ComplexType):
ComplexType.__init__(self, name, elt)
self.opcodes = {}
- tmp = elt.get('no-sequence-number')
- self.has_seq = (tmp == None or tmp.lower() == 'false' or tmp == '0')
+ self.has_seq = not bool(elt.get('no-sequence-number'))
+
+ self.is_ge_event = bool(elt.get('xge'))
self.doc = None
for item in list(elt):
if item.tag == 'doc':
self.doc = Doc(name, item)
-
+
def add_opcode(self, opcode, name, main):
self.opcodes[name] = opcode
if main:
self.name = name
def resolve(self, module):
+ def add_event_header():
+ self.fields.append(Field(tcard8, tcard8.name, 'response_type', False, True, True))
+ if self.has_seq:
+ self.fields.append(_placeholder_byte)
+ self.fields.append(Field(tcard16, tcard16.name, 'sequence', False, True, True))
+
+ def add_ge_event_header():
+ self.fields.append(Field(tcard8, tcard8.name, 'response_type', False, True, True))
+ self.fields.append(Field(tcard8, tcard8.name, 'extension', False, True, True))
+ self.fields.append(Field(tcard16, tcard16.name, 'sequence', False, True, True))
+ self.fields.append(Field(tcard32, tcard32.name, 'length', False, True, True))
+ self.fields.append(Field(tcard16, tcard16.name, 'event_type', False, True, True))
+
if self.resolved:
return
# Add the automatic protocol fields
- self.fields.append(Field(tcard8, tcard8.name, 'response_type', False, True, True))
- if self.has_seq:
- self.fields.append(_placeholder_byte)
- self.fields.append(Field(tcard16, tcard16.name, 'sequence', False, True, True))
+ if self.is_ge_event:
+ add_ge_event_header()
+ else:
+ add_event_header()
+
ComplexType.resolve(self, module)
out = __main__.output['event']