MCPcopy Create free account
hub / github.com/defold/defold / gen_jni_struct

Function gen_jni_struct

engine/jni/scripts/gen_java.py:529–543  ·  view source on GitHub ↗
(decl, namespace, header=False)

Source from the content-addressed store, hash-verified

527 return s
528
529def gen_jni_struct(decl, namespace, header=False):
530 global struct_jni_types
531 struct_name = check_override(decl['name']) + 'JNI'
532 struct_jni_types.append(decl)
533 if header:
534 l(f"struct {struct_name} {{")
535 l(f" jclass cls;")
536 for field in decl['fields']:
537 field_name = check_override(field['name'])
538 if field_name.endswith('Count') and has_array(decl['fields'], namespace, field_name.replace('Count', '')):
539 continue
540
541 jni_field_name = to_jni_camel_case(field_name, 'm_')
542 l(f" jfieldID {jni_field_name};")
543 l("};")
544
545def gen_jni_typeinfos(header=False):
546 global struct_jni_types

Callers 1

gen_jni_namespace_sourceFunction · 0.85

Calls 6

check_overrideFunction · 0.85
has_arrayFunction · 0.85
to_jni_camel_caseFunction · 0.85
appendMethod · 0.80
replaceMethod · 0.80
lFunction · 0.70

Tested by

no test coverage detected