diff --git a/wrappers/csharp/genwrapper.py b/wrappers/csharp/genwrapper.py index 68232f4b6..af1366467 100644 --- a/wrappers/csharp/genwrapper.py +++ b/wrappers/csharp/genwrapper.py @@ -460,6 +460,7 @@ class CsharpTranslator(object): classDict = {} classDict['className'] = _class.name.to_camel_case() classDict['isLinphoneFactory'] = _class.name.to_camel_case() == "Factory" + classDict['doc'] = self.docTranslator.translate(_class.briefDescription) if _class.briefDescription is not None else None classDict['dllImports'] = [] islistenable = _class.listenerInterface is not None diff --git a/wrappers/csharp/wrapper_impl.mustache b/wrappers/csharp/wrapper_impl.mustache index 9d3f4ae88..4b12dfb7b 100644 --- a/wrappers/csharp/wrapper_impl.mustache +++ b/wrappers/csharp/wrapper_impl.mustache @@ -24,11 +24,17 @@ using System.Collections.Generic; namespace Linphone { #region Wrapper specifics + /// + /// Only contains the LIB_NAME value that represents the library in which all DllImport are made + /// public class LinphoneWrapper { public const string LIB_NAME = "linphone"; // With this, it automatically finds liblinphone.so } + /// + /// All methods that returns a LinphoneStatus with a value != 0 as an error code in C are translated in C# by throwing a LinphoneException + /// [Serializable()] public class LinphoneException : System.Exception { @@ -39,6 +45,9 @@ namespace Linphone } [StructLayout(LayoutKind.Sequential)] + /// + /// Parent class for a Linphone public objects + /// public class LinphoneObject { internal IntPtr nativePtr; @@ -69,9 +78,9 @@ namespace Linphone ~LinphoneObject() { - Console.WriteLine("Destroying" + this.ToString()); + //Console.WriteLine("Destroying" + this.ToString()); if (nativePtr != IntPtr.Zero) { - Console.WriteLine("Unreffing" + this.ToString()); + //Console.WriteLine("Unreffing" + this.ToString()); belle_sip_object_unref(nativePtr); } } @@ -83,11 +92,11 @@ namespace Linphone if (objPtr == IntPtr.Zero) { T obj = new T(); - Console.WriteLine("Creating" + obj.ToString()); + //Console.WriteLine("Creating" + obj.ToString()); if (takeRef) { ptr = belle_sip_object_ref(ptr); - Console.WriteLine("Reffing" + obj.ToString()); + //Console.WriteLine("Reffing" + obj.ToString()); } obj.nativePtr = ptr; objPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(T))); @@ -101,7 +110,7 @@ namespace Linphone if (takeRef) { obj.nativePtr = belle_sip_object_ref(obj.nativePtr); - Console.WriteLine("Reffing" + obj.ToString()); + //Console.WriteLine("Reffing" + obj.ToString()); } return obj; } @@ -163,6 +172,9 @@ namespace Linphone } #if ANDROID + /// + /// Methods that are only found in Android version of Linphone libraries and related to JNI + /// public class LinphoneAndroid { [DllImport(LinphoneWrapper.LIB_NAME)] @@ -174,11 +186,18 @@ namespace Linphone [DllImport(LinphoneWrapper.LIB_NAME)] static extern void setMediastreamerAndroidContext(IntPtr jnienv, IntPtr context); + /// + /// Registers the Android log handler (adb logcat) in Linphone. + /// public static void setNativeLogHandler() { setAndroidLogHandler(); } + /// + /// Sets the JVM and JNI pointers in Linphone, required to be able to make JAVA upcalls. + /// Calling this method is mandatory and must be done as soon as possible ! + /// public static void setAndroidContext(IntPtr jnienv, IntPtr context) { ms_set_jvm_from_env(jnienv); @@ -256,6 +275,11 @@ namespace Linphone #region Classes {{#classes}} {{#_class}} + {{#doc}} + {{#lines}} + /// {{{line}}} + {{/lines}} + {{/doc}} [StructLayout(LayoutKind.Sequential)] public class {{className}} : LinphoneObject {