[Applications.ThemeManager] Fix return type of theme loader add event callback for...
authorilho159kim <dlfgh951@naver.com>
Tue, 25 Oct 2022 06:42:24 +0000 (15:42 +0900)
committerGitHub <noreply@github.com>
Tue, 25 Oct 2022 06:42:24 +0000 (15:42 +0900)
* Fix return type of ThemeLoaderChangedCallback

Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
* Fix internal callback function's return type

Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
Co-authored-by: Ilho Kim <ilho159.kim@samsung.com>
Co-authored-by: hjhun <36876573+hjhun@users.noreply.github.com>
src/Tizen.Applications.ThemeManager/Interop/Interop.ThemeManager.cs
src/Tizen.Applications.ThemeManager/Tizen.Applications.ThemeManager/ThemeLoader.cs

index 2b5d756..5751a12 100755 (executable)
@@ -61,7 +61,7 @@ internal static partial class Interop
         }
 
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void ThemeLoaderChangedCallback(IntPtr handle, IntPtr userData);
+        internal delegate int ThemeLoaderChangedCallback(IntPtr handle, IntPtr userData);
 
         [DllImport(Libraries.ThemeManager, EntryPoint = "theme_get_id")]
         internal static extern ErrorCode GetId(IntPtr handle, out string id);
index 808fb81..14bcae7 100755 (executable)
@@ -22,7 +22,7 @@ using System.Runtime.InteropServices;
 namespace Tizen.Applications.ThemeManager
 {
     /// <summary>
-    /// 
+    ///
     /// </summary>
     /// <since_tizen> 8 </since_tizen>
     [EditorBrowsable(EditorBrowsableState.Never)]
@@ -51,10 +51,14 @@ namespace Tizen.Applications.ThemeManager
             }
         }
 
-        private void OnThemeChanged(IntPtr handle, IntPtr userData)
+        private int OnThemeChanged(IntPtr handle, IntPtr userData)
         {
-            Interop.ThemeManager.ThemeClone(handle, out IntPtr cloned);
+            Interop.ThemeManager.ErrorCode err = Interop.ThemeManager.ThemeClone(handle, out IntPtr cloned);
+            if (err != Interop.ThemeManager.ErrorCode.None)
+                return -1;
+
             _changedEventHandler?.Invoke(this, new ThemeEventArgs(new Theme(cloned)));
+            return 0;
         }
 
         /// <summary>