예제 #1
0
	def __init__(self, element, context):
		self.name = element.nsProp( "name", None )

		ts = element.nsProp( "type", None )
		self.type_expr = typeexpr.type_expression( ts, context )

		temp = element.nsProp( "variable_param", None )
		if temp:
			self.count_parameter_list = temp.split( ' ' )
		else:
			self.count_parameter_list = []

		# The count tag can be either a numeric string or the name of
		# a variable.  If it is the name of a variable, the int(c)
		# statement will throw an exception, and the except block will
		# take over.

		c = element.nsProp( "count", None )
		try: 
			count = int(c)
			self.count = count
			self.counter = None
		except Exception,e:
			count = 1
			self.count = 0
			self.counter = c
예제 #2
0
    def __init__(self, element, context):
        self.name = element.get("name")

        ts = element.get("type")
        self.type_expr = typeexpr.type_expression(ts, context)

        temp = element.get("variable_param")
        if temp:
            self.count_parameter_list = temp.split(' ')
        else:
            self.count_parameter_list = []

        # The count tag can be either a numeric string or the name of
        # a variable.  If it is the name of a variable, the int(c)
        # statement will throw an exception, and the except block will
        # take over.

        c = element.get("count")
        try:
            count = int(c)
            self.count = count
            self.counter = None
        except Exception, e:
            count = 1
            self.count = 0
            self.counter = c
예제 #3
0
	def __init__(self, element, context):
		gl_item.__init__(self, element, context)
		self.size = int( element.nsProp( "size", None ), 0 )

		te = typeexpr.type_expression( None )
		tn = typeexpr.type_node()
		tn.size = int( element.nsProp( "size", None ), 0 )
		tn.integer = not is_attr_true( element, "float" )
		tn.unsigned = is_attr_true( element, "unsigned" )
		tn.name = "GL" + self.name
		te.set_base_type_node( tn )

		self.type_expr = te
		return
예제 #4
0
    def __init__(self, element, context):
        gl_item.__init__(self, element, context)
        self.size = int(element.nsProp("size", None), 0)

        te = typeexpr.type_expression(None)
        tn = typeexpr.type_node()
        tn.size = int(element.nsProp("size", None), 0)
        tn.integer = not is_attr_true(element, "float")
        tn.unsigned = is_attr_true(element, "unsigned")
        tn.name = "GL" + self.name
        te.set_base_type_node(tn)

        self.type_expr = te
        return
    def __init__(self, element, context):
        self.name = element.get("name")

        ts = element.get("type")
        self.type_expr = typeexpr.type_expression(ts, context)

        temp = element.get("variable_param")
        if temp:
            self.count_parameter_list = temp.split(' ')
        else:
            self.count_parameter_list = []

        # The count tag can be either a numeric string or the name of
        # a variable.  If it is the name of a variable, the int(c)
        # statement will throw an exception, and the except block will
        # take over.

        c = element.get("count")
        try:
            count = int(c)
            self.count = count
            self.counter = None
        except Exception:
            count = 1
            self.count = 0
            self.counter = c

        self.marshal_count = element.get("marshal_count")
        self.count_scale = int(element.get("count_scale", "1"))

        elements = (count * self.count_scale)
        if elements == 1:
            elements = 0

        #if ts == "GLdouble":
        #	print '/* stack size -> %s = %u (before)*/' % (self.name, self.type_expr.get_stack_size())
        #	print '/* # elements = %u */' % (elements)
        self.type_expr.set_elements(elements)
        #if ts == "GLdouble":
        #	print '/* stack size -> %s = %u (after) */' % (self.name, self.type_expr.get_stack_size())

        self.is_client_only = is_attr_true(element, 'client_only')
        self.is_counter = is_attr_true(element, 'counter')
        self.is_output = is_attr_true(element, 'output')

        # Pixel data has special parameters.

        self.width = element.get('img_width')
        self.height = element.get('img_height')
        self.depth = element.get('img_depth')
        self.extent = element.get('img_extent')

        self.img_xoff = element.get('img_xoff')
        self.img_yoff = element.get('img_yoff')
        self.img_zoff = element.get('img_zoff')
        self.img_woff = element.get('img_woff')

        self.img_format = element.get('img_format')
        self.img_type = element.get('img_type')
        self.img_target = element.get('img_target')

        self.img_pad_dimensions = is_attr_true(element, 'img_pad_dimensions')
        self.img_null_flag = is_attr_true(element, 'img_null_flag')
        self.img_send_null = is_attr_true(element, 'img_send_null')

        self.is_padding = is_attr_true(element, 'padding')
        return
예제 #6
0
    def __init__(self, element, context):
        self.name = element.get( "name" )

        ts = element.get( "type" )
        self.type_expr = typeexpr.type_expression( ts, context )

        temp = element.get( "variable_param" )
        if temp:
            self.count_parameter_list = temp.split( ' ' )
        else:
            self.count_parameter_list = []

        # The count tag can be either a numeric string or the name of
        # a variable.  If it is the name of a variable, the int(c)
        # statement will throw an exception, and the except block will
        # take over.

        c = element.get( "count" )
        try: 
            count = int(c)
            self.count = count
            self.counter = None
        except Exception:
            count = 1
            self.count = 0
            self.counter = c

        self.count_scale = int(element.get( "count_scale", "1" ))

        elements = (count * self.count_scale)
        if elements == 1:
            elements = 0

        #if ts == "GLdouble":
        #	print '/* stack size -> %s = %u (before)*/' % (self.name, self.type_expr.get_stack_size())
        #	print '/* # elements = %u */' % (elements)
        self.type_expr.set_elements( elements )
        #if ts == "GLdouble":
        #	print '/* stack size -> %s = %u (after) */' % (self.name, self.type_expr.get_stack_size())

        self.is_client_only = is_attr_true( element, 'client_only' )
        self.is_counter     = is_attr_true( element, 'counter' )
        self.is_output      = is_attr_true( element, 'output' )


        # Pixel data has special parameters.

        self.width      = element.get('img_width')
        self.height     = element.get('img_height')
        self.depth      = element.get('img_depth')
        self.extent     = element.get('img_extent')

        self.img_xoff   = element.get('img_xoff')
        self.img_yoff   = element.get('img_yoff')
        self.img_zoff   = element.get('img_zoff')
        self.img_woff   = element.get('img_woff')

        self.img_format = element.get('img_format')
        self.img_type   = element.get('img_type')
        self.img_target = element.get('img_target')

        self.img_pad_dimensions = is_attr_true( element, 'img_pad_dimensions' )
        self.img_null_flag      = is_attr_true( element, 'img_null_flag' )
        self.img_send_null      = is_attr_true( element, 'img_send_null' )

        self.is_padding = is_attr_true( element, 'padding' )
        return