summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/glX_XML.py
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-04-18 19:16:07 +0000
committerIan Romanick <[email protected]>2005-04-18 19:16:07 +0000
commit2510ba618d8b48819098b062fb30fec7b19c75ff (patch)
tree7dbd19ca008c8fa545e9f0a5f354060ed71f5812 /src/mesa/glapi/glX_XML.py
parentb7142567bc6badc952c1dac9b1b095c4517b2492 (diff)
Convert all Python scripts to use XML namespaces.
Diffstat (limited to 'src/mesa/glapi/glX_XML.py')
-rw-r--r--src/mesa/glapi/glX_XML.py40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/mesa/glapi/glX_XML.py b/src/mesa/glapi/glX_XML.py
index e48955e34e7..81c94a52230 100644
--- a/src/mesa/glapi/glX_XML.py
+++ b/src/mesa/glapi/glX_XML.py
@@ -230,8 +230,9 @@ class glXEnum(gl_XML.glEnum):
gl_XML.glEnum.__init__(self, context, name, attrs)
- def startElement(self, name, attrs):
- if name == "size":
+ def startElementNS(self, name, qname, attrs):
+ [uri, true_name] = name
+ if true_name == "size":
[temp_n, c, mode] = self.process_attributes(attrs)
if temp_n == "Get":
@@ -247,7 +248,7 @@ class glXEnum(gl_XML.glEnum):
self.context.glx_enum_functions[ n ].append( c, self.value, self.name )
else:
- gl_XML.glEnum.startElement(self, context, name, attrs)
+ gl_XML.glEnum.startElementNS(self, name, qname, attrs)
return
@@ -311,7 +312,7 @@ class glXFunction(gl_XML.glFunction):
can_be_large = 0
def __init__(self, context, name, attrs):
- self.vectorequiv = attrs.get('vectorequiv', None)
+ self.vectorequiv = attrs.get((None, 'vectorequiv'), None)
self.counter = None
self.output = None
self.can_be_large = 0
@@ -331,19 +332,20 @@ class glXFunction(gl_XML.glFunction):
return glXParameterIterator(self.fn_parameters, skip_output, max_order)
- def startElement(self, name, attrs):
+ def startElementNS(self, name, qname, attrs):
"""Process elements within a function that are specific to GLX."""
- if name == "glx":
- self.glx_rop = int(attrs.get('rop', "0"))
- self.glx_sop = int(attrs.get('sop', "0"))
- self.glx_vendorpriv = int(attrs.get('vendorpriv', "0"))
- self.img_reset = attrs.get('img_reset', None)
+ [uri, true_name] = name
+ if true_name == "glx":
+ self.glx_rop = int(attrs.get((None, 'rop'), "0"))
+ self.glx_sop = int(attrs.get((None, 'sop'), "0"))
+ self.glx_vendorpriv = int(attrs.get((None, 'vendorpriv'), "0"))
+ self.img_reset = attrs.get((None, 'img_reset'), None)
# The 'handcode' attribute can be one of 'true',
# 'false', 'client', or 'server'.
- handcode = attrs.get('handcode', "false")
+ handcode = attrs.get((None, 'handcode'), "false")
if handcode == "false":
self.server_handcode = 0
self.client_handcode = 0
@@ -365,11 +367,12 @@ class glXFunction(gl_XML.glFunction):
self.reply_always_array = gl_XML.is_attr_true( attrs, 'always_array' )
self.dimensions_in_reply = gl_XML.is_attr_true( attrs, 'dimensions_in_reply' )
else:
- gl_XML.glFunction.startElement(self, name, attrs)
+ gl_XML.glFunction.startElementNS(self, name, qname, attrs)
- def endElement(self, name):
- if name == "function":
+ def endElementNS(self, name, qname):
+ [uri, true_name] = name
+ if true_name == "function":
# Mark any function that does not have GLX protocol
# defined as "ignore". This prevents bad things from
# happening when people add new functions to the GL
@@ -387,7 +390,7 @@ class glXFunction(gl_XML.glFunction):
self.ignore = 1
- return gl_XML.glFunction.endElement(self, name)
+ return gl_XML.glFunction.endElementNS(self, name, qname)
def append(self, tag_name, p):
@@ -664,8 +667,9 @@ class GlxProto(gl_XML.FilterGLAPISpecBase):
self.glx_enum_functions = {}
- def endElement(self, name):
- if name == 'OpenGLAPI':
+ def endElementNS(self, name, qname):
+ [uri, true_name] = name
+ if true_name == 'OpenGLAPI':
# Once all the parsing is done, we have to go back and
# fix-up some cross references between different
# functions.
@@ -680,7 +684,7 @@ class GlxProto(gl_XML.FilterGLAPISpecBase):
else:
raise RuntimeError("Could not find the vector equiv. function %s for %s!" % (f.name, f.vectorequiv))
else:
- gl_XML.FilterGLAPISpecBase.endElement(self, name)
+ gl_XML.FilterGLAPISpecBase.endElementNS(self, name, qname)
return