- def wrapIid(self, interface, method, riid, out):
- print ' if (%s && *%s) {' % (out.name, out.name)
- print ' if (*%s == m_pInstance) {' % (out.name,)
- print ' *%s = this;' % (out.name,)
- print ' }'
- for iface in self.api.getAllInterfaces():
- print r' else if (%s == IID_%s) {' % (riid.name, iface.name)
- print r' *%s = new Wrap%s((%s *) *%s);' % (out.name, iface.name, iface.name, out.name)
- print r' }'
- print r' else {'
- print r' os::log("apitrace: warning: %s::%s: unknown IID {0x%08lX,0x%04X,0x%04X,{0x%02X,0x%02X,0x%02X,0x%02X,0x%02X,0x%02X,0x%02X,0x%02X}}\n",'
- print r' "%s", "%s",' % (interface.name, method.name)
- print r' %s.Data1, %s.Data2, %s.Data3,' % (riid.name, riid.name, riid.name)
- print r' %s.Data4[0],' % (riid.name,)
- print r' %s.Data4[1],' % (riid.name,)
- print r' %s.Data4[2],' % (riid.name,)
- print r' %s.Data4[3],' % (riid.name,)
- print r' %s.Data4[4],' % (riid.name,)
- print r' %s.Data4[5],' % (riid.name,)
- print r' %s.Data4[6],' % (riid.name,)
- print r' %s.Data4[7]);' % (riid.name,)
+ def wrapIid(self, function, riid, out):
+ print r' if (%s && *%s) {' % (out.name, out.name)
+ function_name = function.name
+ else_ = ''
+ if self.interface is not None:
+ function_name = self.interface.name + '::' + function_name
+ print r' %sif (*%s == m_pInstance) {' % (else_, out.name,)
+ print r' *%s = this;' % (out.name,)