From: Seunghyun Choi Date: Tue, 13 Jun 2017 10:03:16 +0000 (+0900) Subject: Enhance Utility(static) X-Git-Tag: submit/trunk/20170823.075128~110^2~45^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89f10e0f84d0f21838eb955eade359ec5f22fdf4;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Enhance Utility(static) Change-Id: I71a423601dbd74415dd5dd00a2fdfa03c6dcf938 --- diff --git a/src/ElmSharp/ElmSharp/Utility.cs b/src/ElmSharp/ElmSharp/Utility.cs index 745153a..baff802 100644 --- a/src/ElmSharp/ElmSharp/Utility.cs +++ b/src/ElmSharp/ElmSharp/Utility.cs @@ -26,5 +26,135 @@ namespace ElmSharp { Interop.Evas.evas_font_path_global_append(path); } + + /// + /// Prepends a font path to the list of font paths used by the application. + /// + /// The new font path. + public static void PrependEvasGlobalFontPath(string path) + { + Interop.Evas.evas_font_path_global_prepend(path); + } + + /// + /// Removes all font paths loaded into memory by evas_font_path_app_* APIs for the application. + /// + public static void ClearEvasGlobalFontPath() + { + Interop.Evas.evas_font_path_global_clear(); + } + + /// + /// Sets Edje color class. + /// + /// Color class + /// Object Red value + /// Object Red value + /// Object Red value + /// Object Red value + /// Outline Red value + /// Outline Green value + /// Outline Blue value + /// Outline Alpha value + /// Shadow Red value + /// Shadow Green value + /// Shadow Bluevalue + /// Shadow Alpha value + /// + public static bool SetEdjeColorClass(string colorClass, int red, int green, int blue, int alpha, int outlineRed, int outlineGreen, int outlineBlue, int outlineAlpha, + int shadowRed, int shadowGreen, int shadowBlue, int shadowAlpha) + { + return Interop.Elementary.edje_color_class_set(colorClass, red, green, blue, alpha, outlineRed, outlineGreen, outlineBlue, outlineAlpha, shadowRed, shadowGreen, shadowBlue, shadowAlpha); + } + + /// + /// Gets Edje color class. + /// + /// Color class + /// Object Red value + /// Object Red value + /// Object Red value + /// Object Red value + /// Outline Red value + /// Outline Green value + /// Outline Blue value + /// Outline Alpha value + /// Shadow Red value + /// Shadow Green value + /// Shadow Bluevalue + /// Shadow Alpha value + /// + public static bool GetEdjeColorClass(string colorClass, out int red, out int green, out int blue, out int alpha, out int outlineRed, out int outlineGreen, out int outlineBlue, + out int outlineAlpha, out int shadowRed, out int shadowGreen, out int shadowBlue, out int shadowAlpha) + { + return Interop.Elementary.edje_color_class_get(colorClass, out red, out green, out blue, out alpha, out outlineRed, out outlineGreen, out outlineBlue, out outlineAlpha, + out shadowRed, out shadowGreen, out shadowBlue, out shadowAlpha); + } + + /// + /// Processes all queued up edje messages. + /// This function triggers the processing of messages addressed to any (alive) edje objects. + /// + public static void ProcessEdjeMessageSignal() + { + Interop.Elementary.edje_message_signal_process(); + } + + /// + /// Sets the Edje text class. + /// + /// The text class name + /// The font name + /// The font size + /// True, on success or false, on error + public static bool SetEdjeTextClass(string textClass, string font, int size) + { + return Interop.Elementary.edje_text_class_set(textClass, font, size); + } + + /// + /// Gets the Edje text class. + /// + /// The text class name + /// The font name + /// The font size + /// True, on success or false, on error + public static bool GetEdjeTextClass(string textClass, out string font, out int size) + { + return Interop.Elementary.edje_text_class_get(textClass, out font, out size); + } + + /// + /// Delete the text class. + /// + /// + public static void DeleteEdjeTextClass(string textClass) + { + Interop.Elementary.edje_text_class_del(textClass); + } + + /// + /// Pre-multiplies a rgb triplet by an alpha factor. + /// + /// The alpha factor + /// The Red component of the color + /// The Green component of the color + /// The Blue component of the color + public static void PremulityplyEvasColorByAlpha(int alpha, ref int red, ref int green, ref int blue) + { + Interop.Evas.evas_color_argb_premul(alpha, ref red, ref green, ref blue); + } + + /// + /// Undoes pre-multiplies a rgb triplet by an alpha factor. + /// + /// The alpha factor + /// The Red component of the color + /// The Green component of the color + /// The Blue component of the color + public static void UnPremulityplyEvasColorByAlpha(int alpha, ref int red, ref int green, ref int blue) + { + Interop.Evas.evas_color_argb_unpremul(alpha, ref red, ref green, ref blue); + } } } \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Evas.cs b/src/ElmSharp/Interop/Interop.Evas.cs index ee5d3c8..e0a19b2 100644 --- a/src/ElmSharp/Interop/Interop.Evas.cs +++ b/src/ElmSharp/Interop/Interop.Evas.cs @@ -451,7 +451,7 @@ internal static partial class Interop internal static extern void evas_object_smart_changed(IntPtr obj); [DllImport(Libraries.Evas)] - internal static extern void evas_color_argb_premul(int a, out int r, out int g, out int b); + internal static extern void evas_color_argb_premul(int a, ref int r, ref int g, ref int b); [DllImport(Libraries.Evas)] internal static extern void evas_damage_rectangle_add(IntPtr obj, int x, int y, int w, int h); @@ -676,7 +676,7 @@ internal static partial class Interop internal static extern void evas_font_path_global_prepend(string path); [DllImport(Libraries.Evas)] - internal static extern void evas_color_argb_unpremul(int a, out int r, out int g, out int b); + internal static extern void evas_color_argb_unpremul(int a, ref int r, ref int g, ref int b); [DllImport(Libraries.Evas)] internal static extern void evas_color_hsv_to_rgb(int r, int g, int b, out float h, out float s, out float v);