From: Seunghyun Choi Date: Fri, 16 Jun 2017 05:44:31 +0000 (+0900) Subject: Enhance Elementary(static) X-Git-Tag: submit/trunk/20170823.075128~110^2~44^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=546df70ea33344fa3a3f3b04c6f92f472b1cb7d3;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Enhance Elementary(static) Change-Id: I526280bc1d7ce37472fb5bf56337b572b173e5e2 --- diff --git a/src/ElmSharp/ElmSharp/Elementary.cs b/src/ElmSharp/ElmSharp/Elementary.cs old mode 100755 new mode 100644 index 0e71f90..cf26c57 --- a/src/ElmSharp/ElmSharp/Elementary.cs +++ b/src/ElmSharp/ElmSharp/Elementary.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; using System.IO; namespace ElmSharp @@ -27,6 +28,112 @@ namespace ElmSharp private static readonly string _themeFilePath = "/usr/share/elm-sharp/elm-sharp-theme.edj"; /// + /// Gets or sets the configured finger size. + /// + public static int FingerSize + { + get + { + return Interop.Elementary.elm_config_finger_size_get(); + } + set + { + Interop.Elementary.elm_config_finger_size_set(value); + } + } + + /// + /// Gets or sets the enable status of the focus highlight animation + /// + public static bool IsFocusHighlightAnimation + { + get + { + return Interop.Elementary.elm_config_focus_highlight_animate_get(); + } + set + { + Interop.Elementary.elm_config_focus_highlight_animate_set(value); + } + } + + /// + /// Gets or sets the system mirrored mode. + /// This determines the default mirrored mode of widgets. + /// + public static bool IsMirrored + { + get + { + return Interop.Elementary.elm_config_mirrored_get(); + } + set + { + Interop.Elementary.elm_config_mirrored_set(value); + } + } + + /// + /// Gets or sets the enable status of the focus highlight. + /// + public static bool CanFocusHighlight + { + get + { + return Interop.Elementary.elm_config_focus_highlight_enabled_get(); + } + set + { + Interop.Elementary.elm_config_focus_highlight_enabled_set(value); + } + } + + /// + /// Gets or sets the base scale of the application. + /// + public static double AppBaseScale + { + get + { + return Interop.Elementary.elm_app_base_scale_get(); + } + set + { + Interop.Elementary.elm_app_base_scale_set(value); + } + } + + /// + /// Gets or sets the global scaling factor. + /// + public static double Scale + { + get + { + return Interop.Elementary.elm_config_scale_get(); + } + set + { + Interop.Elementary.elm_config_scale_set(value); + } + } + + /// + /// Gets or sets the amount of inertia a scroller imposes during region bring animations. + /// + public static double BringInScrollFriction + { + get + { + return Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_get(); + } + set + { + Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_set(value); + } + } + + /// /// Initializes Elementary. /// public static void Initialize() @@ -53,36 +160,101 @@ namespace ElmSharp /// /// Prepends a theme overlay to the list of overlays. /// + [EditorBrowsable(EditorBrowsableState.Never)] public static void ThemeOverlay() { if (File.Exists(_themeFilePath)) { - Interop.Elementary.elm_theme_overlay_add(IntPtr.Zero, _themeFilePath); + AddThemeOverlay(_themeFilePath); } } /// + /// Prepends a theme overlay to the list of overlays + /// + /// The Edje file path to be used. + public static void AddThemeOverlay(string filePath) + { + Interop.Elementary.elm_theme_overlay_add(IntPtr.Zero, filePath); + } + + /// + /// Delete a theme overlay from the list of overlays + /// + /// The name of the theme overlay. + public static void DeleteThemeOverlay(string filePath) + { + Interop.Elementary.elm_theme_overlay_del(IntPtr.Zero, filePath); + } + + /// + /// Free a theme + /// + public static void FreeTheme() + { + Interop.Elementary.elm_theme_free(IntPtr.Zero); + } + + /// + /// Set the theme search order for the given theme + /// + /// Theme search string + /// This sets the search string for the theme in path-notation from first theme to search, to last, delimited by the : character. Example:"shiny:/path/to/file.edj:default" + public static void SetTheme(string theme) + { + Interop.Elementary.elm_theme_set(IntPtr.Zero, theme); + } + + /// + /// Flush the current theme. + /// + public static void FlushTheme() + { + Interop.Elementary.elm_theme_flush(IntPtr.Zero); + } + + /// + /// This flushes all themes (default and specific ones). + /// + public static void FlushAllThemes() + { + Interop.Elementary.elm_theme_full_flush(); + } + + /// + /// Deletes a theme extension from the list of extensions. + /// + /// The name of the theme extension. + public static void DeleteThemeExtention(string item) + { + Interop.Elementary.elm_theme_extension_del(IntPtr.Zero, item); + } + + /// /// Gets the amount of inertia a scroller imposes during region bring animations. /// /// The bring in scroll friction + [EditorBrowsable(EditorBrowsableState.Never)] public static double GetSystemScrollFriction() { - return Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_get(); + return BringInScrollFriction; } /// /// Sets the amount of inertia a scroller imposes during region bring animations. /// /// The bring in scroll friction + [EditorBrowsable(EditorBrowsableState.Never)] public static void SetSystemScrollFriction(double timeSet) { - Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_set(timeSet); + BringInScrollFriction = timeSet; } /// /// Gets Elementary's profile in use. /// /// The profile name + [EditorBrowsable(EditorBrowsableState.Never)] public static string GetProfile() { return Interop.Elementary.elm_config_profile_get(); @@ -93,9 +265,10 @@ namespace ElmSharp /// This sets the globally configured scaling factor that is applied to all objects. /// /// The scaling factor to set + [EditorBrowsable(EditorBrowsableState.Never)] public static void SetScale(double scale) { - Interop.Elementary.elm_config_scale_set(scale); + Scale = scale; } /// @@ -103,9 +276,55 @@ namespace ElmSharp /// This gets the globally configured scaling factor that is applied to all objects. /// /// The scaling factor + [EditorBrowsable(EditorBrowsableState.Never)] public static double GetScale() { - return Interop.Elementary.elm_config_scale_get(); + return Scale; + } + + /// + /// Flush all caches. + /// Frees all data that was in cache and is not currently being used to reduce memory usage. This frees Edje's, Evas' and Eet's cache. + /// + public static void FlushAllCashe() + { + Interop.Elementary.elm_cache_all_flush(); + } + + /// + /// Changes the language of the current application. + /// + /// The language to set, must be the full name of the locale. + public static void SetLanguage(string language) + { + Interop.Elementary.elm_language_set(language); + } + + /// + /// Sets a new policy's value (for a given policy group/identifier). + /// + /// The policy identifier + /// The policy value, which depends on the identifier + /// + public static bool SetPolicy(uint policy, int value) + { + return Interop.Elementary.elm_policy_set(policy, value); + } + + /// + /// Reloads Elementary's configuration, bounded to the current selected profile. + /// + public static void ReloadConfig() + { + Interop.Elementary.elm_config_reload(); + } + + /// + /// Flushes all config settings and then applies those settings to all applications using elementary on the current display. + /// + public static void FlushAllConfig() + { + Interop.Elementary.elm_config_all_flush(); } } -} +} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/ElmScrollConfig.cs b/src/ElmSharp/ElmSharp/ElmScrollConfig.cs old mode 100755 new mode 100644 index be36d41..c3079e2 --- a/src/ElmSharp/ElmSharp/ElmScrollConfig.cs +++ b/src/ElmSharp/ElmSharp/ElmScrollConfig.cs @@ -15,6 +15,7 @@ */ using System; +using System.ComponentModel; namespace ElmSharp { @@ -26,16 +27,17 @@ namespace ElmSharp /// /// Gets or sets the amount of inertia a scroller imposes during region bring animations. /// + [EditorBrowsable(EditorBrowsableState.Never)] public static double BringInScrollFriction { get { - return Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_get(); + return Elementary.BringInScrollFriction; } set { - Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_set(value); + Elementary.BringInScrollFriction = value; } } } -} +} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.cs b/src/ElmSharp/Interop/Interop.Elementary.cs index e592713..2c0680e 100644 --- a/src/ElmSharp/Interop/Interop.Elementary.cs +++ b/src/ElmSharp/Interop/Interop.Elementary.cs @@ -153,7 +153,7 @@ internal static partial class Interop internal static extern void elm_app_base_scale_set(double base_scale); [DllImport(Libraries.Elementary)] - internal static extern double elm_app_base_scale_set(); + internal static extern double elm_app_base_scale_get(); [DllImport(Libraries.Elementary)] internal static extern IntPtr elm_conformant_add(IntPtr obj); diff --git a/test/ElmSharp.Test/TC/PerformanceTest.cs b/test/ElmSharp.Test/TC/PerformanceTest.cs old mode 100755 new mode 100644 index 1bbb5b4..2640b33 --- a/test/ElmSharp.Test/TC/PerformanceTest.cs +++ b/test/ElmSharp.Test/TC/PerformanceTest.cs @@ -40,6 +40,7 @@ namespace ElmSharp.Test "Vodafone (Satellite)", "Sample Text" }; + GenList list; Box box; Box box2; @@ -126,7 +127,7 @@ namespace ElmSharp.Test list.ScrollAnimationStopped -= List_ScrollAnimationStopped; EcoreAnimator.RemoveAnimator(_anim); - ElmScrollConfig.BringInScrollFriction = _frameSet; + Elementary.BringInScrollFriction = _frameSet; FrameFPS = _frameCount / TimeSet; AnimatorFPS = _ecoreCount / TimeSet; @@ -170,8 +171,8 @@ namespace ElmSharp.Test list.RenderPost -= List_RenderPost; _enteringSpeed = (EcoreAnimator.GetCurrentTime() - _enteringSpeed) * 1000; - _frameSet = ElmScrollConfig.BringInScrollFriction; - ElmScrollConfig.BringInScrollFriction = TimeSet; + _frameSet = Elementary.BringInScrollFriction; + Elementary.BringInScrollFriction = TimeSet; list.ScrollTo(ItemTarget, ScrollToPosition.In, true); } @@ -200,4 +201,4 @@ namespace ElmSharp.Test list.RenderPost += List_RenderPost; } } -} +} \ No newline at end of file