Beispiel #1
0
def renderAttribute(out, interface, attribute, definitions):
  assert(not attribute.inherit)

  impl = implArgument(interface)

  print >>out, "%s %s::%s {" % ( \
    emitType(attribute.type),
    interface.name,
    attributeGetterSignature(attribute))

  if not isinstance(attribute.type, pywidl.InterfaceType):
    print >>out, "  return CSSOM_%s_%s(%s);" % ( \
      interface.name,
      interfaceMemberName(interface, attribute),
      impl)
  else:
    print >>out, "  return %s(CSSOM_%s_%s(%s));" % ( \
      emitType(attribute.type),
      interface.name,
      interfaceMemberName(interface, attribute),
      impl)

  print >>out, "}"

  if not attribute.readonly:
    print >>out
    print >>out
    print >>out
    print >>out, "void %s::%s {" % ( \
      interface.name,
      attributeSetterSignature(attribute))

    print >>out, "  CSSOM_%s_%s(%s, %s);" % ( \
      interface.name,
      attributeSetterName(interfaceMemberName(interface, attribute)),
      impl,
      attribute.name)

    print >>out, "}"

  forwarded_attribute = attributeExtendedAttributes(attribute, definitions)
  if forwarded_attribute:
    print >>out
    print >>out
    print >>out
    print >>out, "void %s::%s {" % ( \
      interface.name,
      attributeSetterSignature(forwarded_attribute))

    print >>out, "  CSSOM_%s_%s(%s, %s);" % ( \
      interface.name,
      attributeSetterName(interfaceMemberName(interface, forwarded_attribute)),
      impl,
      attribute.name)

    print >>out, "}"
Beispiel #2
0
def renderAttribute(out, interface, attribute, definitions):
  assert(not attribute.inherit)

  print >>out, "    %s %s;" % ( \
    emitType(attribute.type),
    attributeGetterSignature(attribute))
  if not attribute.readonly:
    print >>out, "    void %s;" % attributeSetterSignature(attribute)

  forwarded_attribute = attributeExtendedAttributes(attribute, definitions)
  if forwarded_attribute:
    print >>out
    print >>out, "    void %s;" % attributeSetterSignature(forwarded_attribute)
Beispiel #3
0
def renderAttribute(out, interface, attribute, definitions):
    assert (not attribute.inherit)

    print >>out, "    %s %s;" % ( \
      emitType(attribute.type),
      attributeGetterSignature(attribute))
    if not attribute.readonly:
        print >> out, "    void %s;" % attributeSetterSignature(attribute)

    forwarded_attribute = attributeExtendedAttributes(attribute, definitions)
    if forwarded_attribute:
        print >> out
        print >> out, "    void %s;" % attributeSetterSignature(
            forwarded_attribute)