Name: csapi-tizenfx
Summary: Assemblies of Tizen .NET
-Version: 4.0.0.253
+Version: 4.0.0.258
Release: 1
Group: Development/Libraries
License: Apache-2.0
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
./build.sh --full
./build.sh --dummy
-./build.sh --pack 4.0.0-preview1-00253
+./build.sh --pack 4.0.0-preview1-00258
%install
mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH}
-->
<PropertyGroup Condition="'$(OutputType)' == 'Exe'">
<NoWarn>$(NoWarn);NU1701</NoWarn>
- <AssetTargetFallback>netcoreapp2.0</AssetTargetFallback>
+ <AssetTargetFallback>$(AssetTargetFallback);netcoreapp2.0</AssetTargetFallback>
</PropertyGroup>
<ItemGroup Condition="'$(OutputType)' == 'Exe'">
{
IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle);
if (evasObj != IntPtr.Zero)
+ {
_imageObject = new EvasImage(this, evasObj);
+ _imageObject.Deleted += (s, e) => _imageObject = null;
+ }
}
return _imageObject;
}
/// Installs the package located at the given path.
/// </summary>
/// <param name="packagePath">Absolute path for the package to be installed.</param>
+ /// <param name="installMode">Optional parameter to indicate special installation mode.</param>
/// <returns>Returns true if the installation request is successful, otherwise false.</returns>
/// <remarks>
/// The 'true' means that the request for installation is successful.
internal static partial class CallManager
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void CallStatusChangedCallback(CallStatus callStatus, string number, IntPtr userData);
+ internal delegate void CallStatusChangedCallback(CallStatus callStatus, IntPtr number, IntPtr userData);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void CallMuteStatusChangedCallback(CallMuteStatus muteStatus, IntPtr userData);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
--- /dev/null
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Runtime.InteropServices;
+
+/// <summary>
+/// Interop class for GSList
+/// </summary>
+internal static partial class Interop
+{
+ internal static partial class GsList
+ {
+ [DllImport(Libraries.Glib, EntryPoint = "g_slist_length")]
+ internal static extern int GetLength(IntPtr list);
+ [DllImport(Libraries.Glib, EntryPoint = "g_slist_nth_data")]
+ internal static extern IntPtr GetDataByIndex(IntPtr list, int index);
+ }
+}
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
+using System.Linq;
namespace Tizen.CallManager
{
private void RegisterCallStatusChangedEvent()
{
- _callStatusChangedCb = (CallStatus status, string number, IntPtr userData) =>
+ _callStatusChangedCb = (CallStatus status, IntPtr number, IntPtr userData) =>
{
- _callStatusChanged?.Invoke(null, new CallStatusChangedEventArgs(status, number));
+ _callStatusChanged?.Invoke(null, new CallStatusChangedEventArgs(status, Marshal.PtrToStringAnsi(number)));
};
int ret = Interop.CallManager.SetCallStatusCallback(_handle, _callStatusChangedCb, IntPtr.Zero);
if (ret != (int)CmError.None)
{
_callEventCb = (CallEvent callEvent, IntPtr eventData, IntPtr userData) =>
{
- _callEvent?.Invoke(null, new CallEventEventArgs(callEvent, CmUtility.GetCallEventData(eventData)));
+ _callEvent?.Invoke(null, new CallEventEventArgs(callEvent, CmUtility.GetCallEventData(callEvent, eventData)));
};
int ret = Interop.CallManager.SetCallEventCb(_handle, _callEventCb, IntPtr.Zero);
if (ret != (int)CmError.None)
return null;
}
+ int length = Interop.GsList.GetLength(list);
+ if (length == 0)
+ {
+ Log.Debug(CmUtility.LogTag, "Call list is empty");
+ return Enumerable.Empty<CallData>();
+ }
+
List<CallData> callList = new List<CallData>();
- int offset = 0;
- IntPtr data = Marshal.ReadIntPtr(list, offset);
- if (data != IntPtr.Zero)
+ IntPtr callData = IntPtr.Zero;
+ for (int index = 0; index < length; index++)
{
- do
+ callData = Interop.GsList.GetDataByIndex(list, index);
+ if (callData != IntPtr.Zero)
{
- offset += Marshal.SizeOf(data);
- callList.Add(CmUtility.GetCallData(data));
- Interop.CallManager.FreeCallData(data);
- data = IntPtr.Zero;
+ callList.Add(CmUtility.GetCallData(callData));
}
-
- while ((data = Marshal.ReadIntPtr(list, offset)) != IntPtr.Zero);
}
return callList;
return null;
}
+ int length = Interop.GsList.GetLength(list);
+ if (length == 0)
+ {
+ Log.Debug(CmUtility.LogTag, "Conf call list is empty");
+ return Enumerable.Empty<ConferenceCallData>();
+ }
List<ConferenceCallData> confList = new List<ConferenceCallData>();
- int offset = 0;
- IntPtr data = Marshal.ReadIntPtr(list, offset);
- if (data != IntPtr.Zero)
+ IntPtr confData = IntPtr.Zero;
+ for (int index = 0; index < length; index++)
{
- do
+ confData = Interop.GsList.GetDataByIndex(list, index);
+ if (confData != IntPtr.Zero)
{
- offset += Marshal.SizeOf(data);
- confList.Add(CmUtility.GetConfCallData(data));
- Interop.CallManager.FreeConfCallData(data);
- data = IntPtr.Zero;
+ confList.Add(CmUtility.GetConfCallData(confData));
}
-
- while ((data = Marshal.ReadIntPtr(list, offset)) != IntPtr.Zero);
}
return confList;
internal static CallData GetCallData(IntPtr handle)
{
+ if (handle == IntPtr.Zero)
+ {
+ return null;
+ }
+
CallData data = new CallData();
int ret = Interop.CallManager.GetCallId(handle, out uint id);
if (ret != (int)CmError.None)
internal static ConferenceCallData GetConfCallData(IntPtr handle)
{
+ if (handle == IntPtr.Zero)
+ {
+ return null;
+ }
+
ConferenceCallData confData = new ConferenceCallData();
int ret = Interop.CallManager.GetConfCallId(handle, out uint callId);
if (ret != (int)CmError.None)
return confData;
}
- internal static CallEventData GetCallEventData(IntPtr handle)
+ internal static CallEventData GetCallEventData(CallEvent callEvent, IntPtr handle)
{
- CallEventData eventData = new CallEventData();
- int ret = Interop.CallManager.GetEventDataCallId(handle, out uint id);
- if (ret != (int)CmError.None)
+ if (handle == IntPtr.Zero)
{
- Log.Error(CmUtility.LogTag, "Failed to get event data call ID, Error: " + (CmError)ret);
+ return null;
}
- else
- {
- eventData.EventId = id;
- }
+ CallEventData eventData = new CallEventData();
- ret = Interop.CallManager.GetSimSlot(handle, out MultiSimSlot simSlot);
- if (ret != (int)CmError.None)
- {
- Log.Error(CmUtility.LogTag, "Failed to get event data sim slot, Error: " + (CmError)ret);
- }
+ if (callEvent == CallEvent.Active)
+ {
+ int ret = Interop.CallManager.GetEventDataCallId(handle, out uint id);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get event data call ID, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ eventData.EventId = id;
+ }
+
+ ret = Interop.CallManager.GetSimSlot(handle, out MultiSimSlot simSlot);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get event data sim slot, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ eventData.Slot = simSlot;
+ }
+
+ ret = Interop.CallManager.GetIncomingCallData(handle, out IntPtr incoming);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get incoming call data, Error: " + (CmError)ret);
+ }
+
+ else
+ {
+ CallData incomingData = GetCallData(incoming);
+ if (incomingData != null)
+ {
+ ret = Interop.CallManager.FreeCallData(incoming);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to free incoming call data, Error: " + (CmError)ret);
+ }
+ }
- else
- {
- eventData.Slot = simSlot;
- }
+ eventData.Incoming = incomingData;
+ }
- ret = Interop.CallManager.GetEndCause(handle, out CallEndCause endCause);
- if (ret != (int)CmError.None)
- {
- Log.Error(CmUtility.LogTag, "Failed to get end cause, Error: " + (CmError)ret);
- }
+ ret = Interop.CallManager.GetActiveCall(handle, out IntPtr active);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get active call data, Error: " + (CmError)ret);
+ }
- else
- {
- eventData.Cause = endCause;
- }
+ else
+ {
+ CallData activeData = GetCallData(active);
+ if (activeData != null)
+ {
+ ret = Interop.CallManager.FreeCallData(active);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to free active call data, Error: " + (CmError)ret);
+ }
+ }
- ret = Interop.CallManager.GetIncomingCallData(handle, out IntPtr incoming);
- if (ret != (int)CmError.None)
- {
- Log.Error(CmUtility.LogTag, "Failed to get incoming call data, Error: " + (CmError)ret);
- }
+ eventData.Active = activeData;
+ }
- else
- {
- eventData.Incoming = GetCallData(incoming);
- }
+ ret = Interop.CallManager.GetHeldCall(handle, out IntPtr held);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get held call data, Error: " + (CmError)ret);
+ }
- ret = Interop.CallManager.GetActiveCall(handle, out IntPtr active);
- if (ret != (int)CmError.None)
- {
- Log.Error(CmUtility.LogTag, "Failed to get active call data, Error: " + (CmError)ret);
- }
+ else
+ {
+ CallData heldData = GetCallData(held);
+ if (heldData != null)
+ {
+ ret = Interop.CallManager.FreeCallData(held);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to free held call data, Error: " + (CmError)ret);
+ }
+ }
- else
- {
- eventData.Active = GetCallData(active);
+ eventData.Held = heldData;
+ }
}
- ret = Interop.CallManager.GetHeldCall(handle, out IntPtr held);
- if (ret != (int)CmError.None)
+ else if (callEvent == CallEvent.Idle)
{
- Log.Error(CmUtility.LogTag, "Failed to get held call data, Error: " + (CmError)ret);
- }
+ int ret = Interop.CallManager.GetEndCause(handle, out CallEndCause endCause);
+ if (ret != (int)CmError.None)
+ {
+ Log.Error(CmUtility.LogTag, "Failed to get end cause, Error: " + (CmError)ret);
+ }
- else
- {
- eventData.Held = GetCallData(held);
+ else
+ {
+ eventData.Cause = endCause;
+ }
}
return eventData;
/// </summary>
/// <feature>http://tizen.org/feature/network.wifi.direct.display</feature>
/// <exception cref="NotSupportedException">The feature is not supported.</exception>
-
public ScreenMirroring()
{
if (IsSupported() == false)
/// <code>
/// Tizen.Xamarin.Forms.Extension.MediaView mediaView = ...
/// ...
- /// var display = new Display((Tizen.Multimedia.MediaView)MediaView.NativeView);
+ /// var display = new Display((Tizen.Multimedia.MediaView)mediaView.NativeView);
/// </code>
/// </example>
public class MediaView : EvasObject
{
internal static partial class Libraries
{
- public const string Mtp = "libcapi-network-mtp.so.0";
+ public const string Mtp = "libcapi-network-mtp.so.1";
public const string Glib = "libglib-2.0.so.0";
public const string Libc = "libc.so.6";
}
/// <summary>
/// Gets the list of objects.
/// </summary>
- /// <param name="parentHandle">The parent object handle. If parentHandle is 0, it means "root folder" of mtp storage.</param>
+ /// <param name="parentObject">The parent object handle. If parentHandle is 0, it means "root folder" of mtp storage.</param>
/// <param name="fileType">The file type what you want.</param>
/// <returns>List of objects.</returns>
/// <feature>http://tizen.org/feature/network.mtp</feature>
/// </summary>
//TEEC_Result TEEC_OpenSession(TEEC_Context *context, TEEC_Session *session, const TEEC_UUID *destination, uint connectionMethod, const void *connectionData, TEEC_Operation *operation, uint *returnOrigin);
[DllImport(Libraries.Libteec, EntryPoint = "TEEC_OpenSession", CallingConvention = CallingConvention.Cdecl)]
- static public extern int OpenSession(ref TEEC_Context context, ref TEEC_Session session, TEEC_UUID destination, uint connectionMethod, byte[] connectionData, ref TEEC_Operation operation, out uint returnOrigin);
+ static public extern int OpenSession(ref TEEC_Context context, ref TEEC_Session session, ref TEEC_UUID destination, uint connectionMethod, byte[] connectionData, ref TEEC_Operation operation, out uint returnOrigin);
/// <summary>
/// This function closes a session which has been opened with a trusted application.
using System;
+using System.IO;
+using System.Text;
using System.Runtime.InteropServices;
internal static partial class Interop
public UInt16 timeHiAndVersion;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] clockSeqAndNode;
+
+ internal static TEEC_UUID ToTeecUuid(Guid guid)
+ {
+ TEEC_UUID uuid = new TEEC_UUID();
+ byte[] bin = guid.ToByteArray();
+ uuid.timeLow = BitConverter.ToUInt32(bin, 0);
+ uuid.timeMid = BitConverter.ToUInt16(bin, 4);
+ uuid.timeHiAndVersion = BitConverter.ToUInt16(bin, 6);
+ uuid.clockSeqAndNode = new byte[8];
+ Array.Copy(bin, 8, uuid.clockSeqAndNode, 0, 8);
+ return uuid;
+ }
}
[StructLayout(LayoutKind.Sequential)]
using System;
using System.Collections.Generic;
+using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
public void SetData(byte[] data, int dstOffs)
{
if ((shm.flags & (uint)SharedMemoryFlags.Output) == 0) throw new InvalidOperationException("No write access");
- //TODO copy data into shared memory starting at given offset
+ Marshal.Copy(data, 0, shm.buffer + dstOffs, data.Length);
}
/// <summary>
/// This function makes a copy and is designed for convenient operations on small buffers.
public void GetData(byte[] data, int srcOffs)
{
if ((shm.flags & (uint)SharedMemoryFlags.Input) == 0) throw new InvalidOperationException("No read access");
- //TODO copy data from shared memory starting at given offset
+ Marshal.Copy(shm.buffer + srcOffs, data, 0, data.Length);
}
};
internal void Open(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist)
{
- Interop.TEEC_UUID uuid = new Interop.TEEC_UUID();
+ Interop.TEEC_UUID uuid = Interop.TEEC_UUID.ToTeecUuid(destination);
Interop.TEEC_Operation op = new Interop.TEEC_Operation();
uint ro;
- int ret = Interop.Libteec.OpenSession(ref context, ref session, uuid, loginMethod, connectionData, ref op, out ro);
+ int ret = Interop.Libteec.OpenSession(ref context, ref session, ref uuid, loginMethod, connectionData, ref op, out ro);
//MAYBE map origin of return code to specyfic Exception
Interop.CheckNThrowException(ret, string.Format("OpenSession('{0}')", destination));
}
public Context(string name)
{
context = new Interop.TEEC_Context();
+ if (name != null && name.Length == 0)
+ name = null;
int ret = Interop.Libteec.InitializeContext(name, ref context);
Interop.CheckNThrowException(ret, string.Format("InititalizeContext('{0}')", name));
}
{
SatTextInfo textInfo = new SatTextInfo();
textInfo.Length = textStruct.Length;
- Marshal.Copy(textStruct.DataString, textInfo.Data, 0, 501);
+ byte[] data = new byte[textStruct.Length];
+ Marshal.Copy(textStruct.DataString, data, 0, textInfo.Length);
+ textInfo.Data = data;
return textInfo;
}
namespace Tizen.Uix.InputMethod
{
/// <summary>
- /// This Class contains data related to DisplayLanaguageChanged Event
+ /// This Class contains data related to DisplayLanguageChanged Event
/// </summary>
- public class DisplayLanaguageChangedEventArgs
+ public class DisplayLanguageChangedEventArgs
{
- internal DisplayLanaguageChangedEventArgs(string langauage)
+ internal DisplayLanguageChangedEventArgs(string langauage)
{
Langauage = langauage;
}
private static event EventHandler<ReturnKeyStateSetEventArgs> _returnKeyStateSet;
private static ImeReturnKeyStateSetCb _imeReturnKeyStateSetDelegate;
private static ImeProcessKeyEventCb _imeProcessKeyDelegate;
- private static event EventHandler<DisplayLanaguageChangedEventArgs> _displayLanaguageChanged;
- private static ImeDisplayLanguageChangedCb _imeDisplayLanaguageChangedDelegate;
+ private static event EventHandler<DisplayLanguageChangedEventArgs> _displayLanguageChanged;
+ private static ImeDisplayLanguageChangedCb _imeDisplayLanguageChangedDelegate;
private static event EventHandler<RotationChangedEventArgs> _rotationDegreeChanged;
private static ImeRotationChangedCb _imeRotationChangedDelegate;
private static event EventHandler<AccessibilityStateChangedEventArgs> _accessibilityStateChanged;
}
/// <summary>
- /// Called when the system display language is changed.
+ /// Called when the system display Language is changed.
/// </summary>
- public static event EventHandler<DisplayLanaguageChangedEventArgs> DisplayLanaguageChanged
+ public static event EventHandler<DisplayLanguageChangedEventArgs> DisplayLanguageChanged
{
add
{
lock (thisLock)
{
- _imeDisplayLanaguageChangedDelegate = (IntPtr language, IntPtr userData) =>
+ _imeDisplayLanguageChangedDelegate = (IntPtr language, IntPtr userData) =>
{
- DisplayLanaguageChangedEventArgs args = new DisplayLanaguageChangedEventArgs(Marshal.PtrToStringAnsi(language));
- _displayLanaguageChanged?.Invoke(null, args);
+ DisplayLanguageChangedEventArgs args = new DisplayLanguageChangedEventArgs(Marshal.PtrToStringAnsi(language));
+ _displayLanguageChanged?.Invoke(null, args);
};
- ErrorCode error = ImeEventSetDisplayLanguageChangedCb(_imeDisplayLanaguageChangedDelegate, IntPtr.Zero);
+ ErrorCode error = ImeEventSetDisplayLanguageChangedCb(_imeDisplayLanguageChangedDelegate, IntPtr.Zero);
if (error != ErrorCode.None)
{
- Log.Error(LogTag, "Add DisplayLanaguageChanged Failed with error " + error);
+ Log.Error(LogTag, "Add DisplayLanguageChanged Failed with error " + error);
}
else
{
- _displayLanaguageChanged += value;
+ _displayLanguageChanged += value;
}
}
}
{
lock (thisLock)
{
- _displayLanaguageChanged -= value;
+ _displayLanguageChanged -= value;
}
}
}
/// <privilege>
/// http://tizen.org/privilege/imemanager
/// </privilege>
- /// <exception cref="InvalidOperationException">
+ /// <exception cref="T:System.InvalidOperationException">
/// This exception can occur if:
/// 1) The application does not have the privilege to call this function.
/// 2) Operation failed.
/// <privilege>
/// http://tizen.org/privilege/imemanager
/// </privilege>
- /// <exception cref="InvalidOperationException">
+ /// <exception cref="T:System.InvalidOperationException">
/// This exception can occur if:
/// 1) The application does not have the privilege to call this function.
/// 2) Operation failed.
/// </privilege>
/// <param name="appId">The application ID of the IME.</param>
/// <returns>The On (enabled) and Off (disabled) state of the IME.</returns>
- /// <exception cref="ArgumentException">
+ /// <exception cref="T:System.ArgumentException">
/// This exception can occur if an invalid parameter is provided.
/// </exception>
- /// <exception cref="InvalidOperationException">
+ /// <exception cref="T:System.InvalidOperationException">
/// This exception can occur if:
/// 1) The application does not have the privilege to call this function.
/// 2) Operation failed.
/// <returns>
/// The current activated (selected) IME.
/// </returns>
- /// <exception cref="InvalidOperationException">
+ /// <exception cref="T:System.InvalidOperationException">
/// This exception can occur if:
/// 1) The application does not have the privilege to call this function.
/// 2) Operation failed.
/// <returns>
/// The number of enabled IMEs.
/// </returns>
- /// <exception cref="InvalidOperationException">
+ /// <exception cref="T:System.InvalidOperationException">
/// This exception can occur if:
/// 1) The application does not have the privilege to call this function.
/// 2) Operation failed.