From: Hyunho Kang Date: Tue, 4 Dec 2018 07:46:08 +0000 (+0900) Subject: [Application] Add CurrentDeviceOrientation property on CoreUIApplication (#560) X-Git-Tag: submit/tizen/20181204.150744~1^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92652c66f396fcea624ca578db88dcbf59f2e5ec;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Application] Add CurrentDeviceOrientation property on CoreUIApplication (#560) * Add CurrentDeviceOrientation - app_get_device_orientation Signed-off-by: hyunho * Fix summary Signed-off-by: hyunho * Modify CurrentDeviceOrientation to static Signed-off-by: hyunho --- diff --git a/src/Tizen.Applications.UI/Interop/Interop.Application.cs b/src/Tizen.Applications.UI/Interop/Interop.Application.cs index 177bfea06..3aa879296 100755 --- a/src/Tizen.Applications.UI/Interop/Interop.Application.cs +++ b/src/Tizen.Applications.UI/Interop/Interop.Application.cs @@ -16,6 +16,7 @@ using System; using System.Runtime.InteropServices; +using Tizen.Applications; using Tizen.Applications.CoreBackend; using Tizen.Internals.Errors; @@ -35,6 +36,10 @@ internal static partial class Interop internal delegate void AppControlCallback(IntPtr appControl, IntPtr userData); + + [DllImport(Libraries.Application, EntryPoint = "app_get_device_orientation")] + internal static extern DeviceOrientation AppGetDeviceOrientation(); + [DllImport(Libraries.Application, EntryPoint = "ui_app_main")] internal static extern ErrorCode Main(int argc, string[] argv, ref UIAppLifecycleCallbacks callback, IntPtr userData); diff --git a/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs b/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs old mode 100755 new mode 100644 index ad16365ae..5fd06e6e3 --- a/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs +++ b/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs @@ -49,6 +49,18 @@ namespace Tizen.Applications { } + /// + /// Gets the current device orientation. + /// + /// 6 + static public DeviceOrientation CurrentDeviceOrientation + { + get + { + return Interop.Application.AppGetDeviceOrientation(); + } + } + /// /// Occurs whenever the application is resumed. ///