| 1312 | } |
| 1313 | |
| 1314 | func (g *JavaGen) GenH() error { |
| 1315 | pkgPath := "" |
| 1316 | if g.Pkg != nil { |
| 1317 | pkgPath = g.Pkg.Path() |
| 1318 | } |
| 1319 | g.Printf(hPreamble, g.gobindOpts(), pkgPath, g.className()) |
| 1320 | for _, iface := range g.interfaces { |
| 1321 | g.Printf("extern jclass proxy_class_%s_%s;\n", g.pkgPrefix, iface.obj.Name()) |
| 1322 | g.Printf("extern jmethodID proxy_class_%s_%s_cons;\n", g.pkgPrefix, iface.obj.Name()) |
| 1323 | g.Printf("\n") |
| 1324 | for _, m := range iface.summary.callable { |
| 1325 | if !g.isSigSupported(m.Type()) { |
| 1326 | g.Printf("// skipped method %s.%s with unsupported parameter or return types\n\n", iface.obj.Name(), m.Name()) |
| 1327 | continue |
| 1328 | } |
| 1329 | g.genInterfaceMethodSignature(m, iface.obj.Name(), true, g.paramName) |
| 1330 | g.Printf("\n") |
| 1331 | } |
| 1332 | } |
| 1333 | for _, s := range g.structs { |
| 1334 | g.Printf("extern jclass proxy_class_%s_%s;\n", g.pkgPrefix, s.obj.Name()) |
| 1335 | g.Printf("extern jmethodID proxy_class_%s_%s_cons;\n", g.pkgPrefix, s.obj.Name()) |
| 1336 | } |
| 1337 | g.Printf("#endif\n") |
| 1338 | if len(g.err) > 0 { |
| 1339 | return g.err |
| 1340 | } |
| 1341 | return nil |
| 1342 | } |
| 1343 | |
| 1344 | func (g *JavaGen) jniCallType(t types.Type) string { |
| 1345 | switch t := types.Unalias(t).(type) { |