Commit 182f5ee0 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed typo + missing enums in C# wrapper

parent d0232344
......@@ -450,6 +450,10 @@ class ClassImpl(object):
namespace = _class.find_first_ancestor_by_type(AbsApi.Namespace)
self.namespace = namespace.name.concatenate(fullName=True) if namespace is not None else None
self._class = translator.translate_class(_class)
self._class_enums = []
for enum in _class.enums:
parsed_enum = EnumImpl(enum, translator)
self._class_enums.append(parsed_enum)
class InterfaceImpl(object):
def __init__(self, interface, translator):
......
......@@ -47,11 +47,11 @@ namespace Linphone
#endif
#if ANDROID
[DllImport(LinphoneWrapper.LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern void setAndroidLogHandler();
#endif
#if __IOS__
[DllImport(LinphoneWrapper.LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern void linphone_iphone_enable_logs();
#endif
......@@ -102,35 +102,35 @@ namespace Linphone
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void OnLinphoneObjectDataDestroyed(IntPtr data);
[DllImport(LinphoneWrapper.BELLE_SIP_LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.BELLE_SIP_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
#if WINDOWS_UWP
static extern int belle_sip_object_data_set(IntPtr ptr, string name, IntPtr data, IntPtr cb);
#else
static extern int belle_sip_object_data_set(IntPtr ptr, string name, IntPtr data, OnLinphoneObjectDataDestroyed cb);
#endif
[DllImport(LinphoneWrapper.BELLE_SIP_LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.BELLE_SIP_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr belle_sip_object_data_get(IntPtr ptr, string name);
[DllImport(LinphoneWrapper.BELLE_SIP_LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.BELLE_SIP_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr belle_sip_object_ref(IntPtr ptr);
[DllImport(LinphoneWrapper.BELLE_SIP_LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.BELLE_SIP_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern void belle_sip_object_unref(IntPtr ptr);
[DllImport(LinphoneWrapper.BELLE_SIP_LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.BELLE_SIP_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern void belle_sip_object_data_remove(IntPtr ptr, string data);
[DllImport(LinphoneWrapper.BCTOOLBOX_LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.BCTOOLBOX_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr bctbx_list_next(IntPtr ptr);
[DllImport(LinphoneWrapper.BCTOOLBOX_LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.BCTOOLBOX_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr bctbx_list_get_data(IntPtr ptr);
[DllImport(LinphoneWrapper.BCTOOLBOX_LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.BCTOOLBOX_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr bctbx_list_append(IntPtr elem, string data);
[DllImport(LinphoneWrapper.BCTOOLBOX_LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.BCTOOLBOX_LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr bctbx_list_append(IntPtr elem, IntPtr data);
#if __IOS__
......@@ -255,10 +255,10 @@ namespace Linphone
/// </summary>
public class LinphoneAndroid
{
[DllImport(LinphoneWrapper.LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern void ms_set_jvm_from_env(IntPtr jnienv);
[DllImport(LinphoneWrapper.LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern void setMediastreamerAndroidContext(IntPtr jnienv, IntPtr context);
/// <summary>
......@@ -305,7 +305,7 @@ namespace Linphone
public class {{interfaceName}} : LinphoneObject
{
{{#methods}}
[DllImport(LinphoneWrapper.LIB_NAME)]
[DllImport(LinphoneWrapper.LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
{{#cb_setter}}
#if WINDOWS_UWP
static extern void {{name}}(IntPtr thiz, IntPtr cb);
......@@ -367,11 +367,34 @@ namespace Linphone
/// {{{line}}}
{{/lines}}
{{/doc}}
[StructLayout(LayoutKind.Sequential)]
public class {{className}} : LinphoneObject
{
{{#_class_enums}}
{{#enum}}
{{#doc}}
{{#lines}}
/// {{{line}}}
{{/lines}}
{{/doc}}
public enum {{enumName}}
{
{{#values}}
{{#doc}}
{{#lines}}
/// {{{line}}}
{{/lines}}
{{/doc}}
{{name}} = {{value}},
{{/values}}
}
{{/enum}}
{{/_class_enums}}
{{#isLinphoneFactory}}
[DllImport(LinphoneWrapper.LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr linphone_factory_create_core_cbs(IntPtr factory);
public CoreListener CreateCoreListener()
......@@ -424,10 +447,10 @@ namespace Linphone
}
{{/isLinphoneCore}}
{{#dllImports}}
[DllImport(LinphoneWrapper.LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
{{{prototype}}}
{{#has_second_prototype}}
[DllImport(LinphoneWrapper.LIB_NAME), CallingConvention = CallingConvention.Cdecl)]
[DllImport(LinphoneWrapper.LIB_NAME, CallingConvention = CallingConvention.Cdecl)]
{{second_prototype}}
{{/has_second_prototype}}
......
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