Add EcoreMainLoop.IsMainThread to check the main loop thread
authorWonYoung Choi <wy80.choi@samsung.com>
Fri, 28 Oct 2016 04:56:53 +0000 (13:56 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Fri, 28 Oct 2016 05:39:35 +0000 (14:39 +0900)
EcoreMainLoop.IsMainThread returns true when the main loop is running
in current thread.

Change-Id: I1a189c6fa233fc7be4f14b8a2c4091852ddbe172

ElmSharp/ElmSharp.Net45.csproj
ElmSharp/ElmSharp.csproj
ElmSharp/ElmSharp/EcoreMainloop.cs
ElmSharp/Interop/Interop.Eina.cs [new file with mode: 0644]
packaging/elm-sharp.spec

index 4da7745..6bc1650 100644 (file)
     <Compile Include="ElmSharp\Window.cs" />
     <Compile Include="ElmSharp\WrapType.cs" />
     <Compile Include="Interop\Interop.Ecore.cs" />
+    <Compile Include="Interop\Interop.Eina.cs" />
     <Compile Include="Interop\Interop.Elementary.Bg.cs" />
     <Compile Include="Interop\Interop.Elementary.Box.cs" />
     <Compile Include="Interop\Interop.Elementary.Button.cs" />
index 848a2e1..df61891 100644 (file)
     <Compile Include="ElmSharp\Widget.cs" />
     <Compile Include="ElmSharp\Window.cs" />
     <Compile Include="ElmSharp\WrapType.cs" />
+    <Compile Include="Interop\Interop.Eina.cs" />
     <Compile Include="Interop\Interop.Eo.cs" />
     <Compile Include="Interop\Interop.Ecore.cs" />
     <Compile Include="Interop\Interop.Elementary.Bg.cs" />
index 048442d..1aabdcb 100644 (file)
@@ -9,7 +9,6 @@ namespace ElmSharp
         static readonly Object _taskLock = new Object();
         static int _newTaskId = 0;
 
-
         static Interop.Ecore.EcoreTaskCallback _nativeHandler;
 
         static EcoreMainloop()
@@ -19,6 +18,8 @@ namespace ElmSharp
             _nativeHandler = NativeHandler;
         }
 
+        public static bool IsMainThread => Interop.Eina.eina_main_loop_is();
+
         public static void Begin()
         {
             Interop.Ecore.ecore_main_loop_begin();
diff --git a/ElmSharp/Interop/Interop.Eina.cs b/ElmSharp/Interop/Interop.Eina.cs
new file mode 100644 (file)
index 0000000..107d4c3
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2016 by Samsung Electronics, Inc.,
+//
+// This software is the confidential and proprietary information
+// of Samsung Electronics, Inc. ("Confidential Information"). You
+// shall not disclose such Confidential Information and shall use
+// it only in accordance with the terms of the license agreement
+// you entered into with Samsung.
+
+using System;
+using System.Runtime.InteropServices;
+
+internal static partial class Interop
+{
+    internal static partial class Eina
+    {
+        [DllImport(Libraries.Eina)]
+        internal static extern bool eina_main_loop_is();
+    }
+}
index 34587e6..e05a391 100644 (file)
@@ -8,7 +8,7 @@
 
 Name:       elm-sharp
 Summary:    C# Binding for Elementary
-Version:    1.0.9
+Version:    1.0.10
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0