Permalink
Browse files

add missing gstcontext java mapping, this fixes #648

Closes #669
  • Loading branch information...
Zubnix authored and pererikb committed Feb 17, 2017
1 parent 410c7d9 commit daff06b2e8a0a390527032e77453c4b114ea8b98
Showing with 22 additions and 1 deletion.
  1. +9 −1 bindings/java/gen_jni.py
  2. +13 −0 bindings/java/java_generator.py
View
@@ -38,7 +38,7 @@
from type_registry import TypeRegistry
from type_registry import TypeTransform
from type_registry import GirMetaType
from standard_types import standard_types
from standard_types import standard_types, GObjectMetaType
from standard_types import ObjectMetaType
###### ####### ## ## ###### ########
@@ -144,6 +144,10 @@ def transform_to_c(self):
return TypeTransform()
class GstContextDummy(GObjectMetaType(gir_type='GstContext', c_type='OwrGstContext', prefix=None)):
pass
def remove_ignored_elements(xml_root):
def remove_elem(path):
parent = xml_root.find(path + '/..')
@@ -165,6 +169,7 @@ def main(argv = None):
type_registry.register(standard_types)
type_registry.register(WindowHandleType)
type_registry.register(GMainContextDummy)
type_registry.register(GstContextDummy)
xml_root = ET.parse(args.gir).getroot()
remove_ignored_elements(xml_root)
@@ -178,6 +183,9 @@ def main(argv = None):
for name, source in java_generator.standard_classes.items():
write_file(source, java_base_dir, name + '.java')
for name, source in java_generator.external_classes.items():
write_file(source, java_base_dir, name + '.java')
for namespace in namespaces:
classes = java_generator.gen_namespace(namespace)
java_namespace_dir = java_base_dir + '/' + namespace.symbol_prefix
@@ -379,6 +379,19 @@ def gen_namespace(namespace):
return {c.name: str(c) for c in all_classes}
external_classes = {
'GstContext': str(J.Class(
name='GstContext',
extends='NativeInstance',
visibility='public',
package=config.PACKAGE_ROOT,
body=[
J.Method('public', [], 'GstContext', params=['long pointer'],
body=[J.Call('super', 'new NativePointer(pointer)')],
),
]
)),
}
standard_classes = {
'NativeInstance': str(J.Class(

0 comments on commit daff06b

Please sign in to comment.