Commit 8a95dba1 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed abstractApi and Java wrapper use of RefCountable attribute

parent be2e2b22
...@@ -357,7 +357,7 @@ class Class(DocumentableObject): ...@@ -357,7 +357,7 @@ class Class(DocumentableObject):
self.classMethods = [] self.classMethods = []
self._listenerInterface = None self._listenerInterface = None
self.multilistener = False self.multilistener = False
self.refcountable = True self.refcountable = False
def add_property(self, property): def add_property(self, property):
self.properties.append(property) self.properties.append(property)
...@@ -644,6 +644,7 @@ class CParser(object): ...@@ -644,6 +644,7 @@ class CParser(object):
_class = Class(name) _class = Class(name)
_class.briefDescription = cclass.briefDoc _class.briefDescription = cclass.briefDoc
_class.detailedDescription = cclass.detailedDoc _class.detailedDescription = cclass.detailedDoc
_class.refcountable = self._class_is_refcountable(cclass)
for cproperty in cclass.properties.values(): for cproperty in cclass.properties.values():
try: try:
......
...@@ -439,7 +439,7 @@ class JavaTranslator(object): ...@@ -439,7 +439,7 @@ class JavaTranslator(object):
classCName = 'Linphone' + arg.type.desc.name.to_camel_case() classCName = 'Linphone' + arg.type.desc.name.to_camel_case()
if classCName[-8:] == 'Listener': if classCName[-8:] == 'Listener':
classCName = 'Linphone' + arg.type.desc.name.to_camel_case()[:-8] + 'Cbs' classCName = 'Linphone' + arg.type.desc.name.to_camel_case()[:-8] + 'Cbs'
methodDict['objects'].append({'object': argname, 'objectClassCName': classCName, 'refCountable': arg.type.desc.refcountable}) methodDict['objects'].append({'object': argname, 'objectClassCName': classCName})
methodDict['params_impl'] += 'c_' + argname methodDict['params_impl'] += 'c_' + argname
elif type(arg.type) is AbsApi.ListType: elif type(arg.type) is AbsApi.ListType:
...@@ -477,6 +477,7 @@ class JavaTranslator(object): ...@@ -477,6 +477,7 @@ class JavaTranslator(object):
hasCoreAccessor = _class.name.to_camel_case() in CORE_ACCESSOR_LIST hasCoreAccessor = _class.name.to_camel_case() in CORE_ACCESSOR_LIST
classDict['hasCoreAccessor'] = hasCoreAccessor classDict['hasCoreAccessor'] = hasCoreAccessor
classDict['doc'] = _class.briefDescription.translate(self.docTranslator) if _class.briefDescription is not None else None classDict['doc'] = _class.briefDescription.translate(self.docTranslator) if _class.briefDescription is not None else None
classDict['refCountable'] = _class.refcountable
for _property in _class.properties: for _property in _class.properties:
try: try:
...@@ -717,6 +718,7 @@ class JavaClass(object): ...@@ -717,6 +718,7 @@ class JavaClass(object):
self.packageName = package self.packageName = package
self.className = _class.name.to_camel_case() self.className = _class.name.to_camel_case()
self.classImplName = self.className + "Impl" self.classImplName = self.className + "Impl"
self.refCountable = self._class['refCountable']
self.factoryName = _class.name.to_snake_case() self.factoryName = _class.name.to_snake_case()
self.filename = self.className + ".java" self.filename = self.className + ".java"
self.imports = [] self.imports = []
...@@ -768,6 +770,7 @@ class Jni(object): ...@@ -768,6 +770,7 @@ class Jni(object):
'className': javaClass.className, 'className': javaClass.className,
'classCName': javaClass.cName, 'classCName': javaClass.cName,
'classImplName': javaClass.classImplName, 'classImplName': javaClass.classImplName,
'refCountable': javaClass.refCountable
} }
self.objects.append(obj) self.objects.append(obj)
...@@ -785,7 +788,6 @@ class Jni(object): ...@@ -785,7 +788,6 @@ class Jni(object):
} }
for callback in jniInterface.callbacks: for callback in jniInterface.callbacks:
interface['callbacksList'].append(callback) interface['callbacksList'].append(callback)
print(obj['className'])
if obj['className'] == 'Core': if obj['className'] == 'Core':
self.coreListener.append(callback) self.coreListener.append(callback)
self.interfaces.append(interface) self.interfaces.append(interface)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment