summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeunghyun Choi <sh4682.choi@samsung.com>2017-06-13 19:03:16 +0900
committerSeunghyun Choi <sh4682.choi@samsung.com>2017-06-20 10:44:02 +0900
commit7f2bbf7f802215c505894d3d67e7e70e96a297de (patch)
treeed390e7bbd824274ff5d0307bb40e466a72a38e1
parentd1f42ae4de98bb31abf005ab8e03dc1caa6c78a4 (diff)
downloadelm-sharp-7f2bbf7f802215c505894d3d67e7e70e96a297de.tar.gz
elm-sharp-7f2bbf7f802215c505894d3d67e7e70e96a297de.tar.bz2
elm-sharp-7f2bbf7f802215c505894d3d67e7e70e96a297de.zip
Enhance Utility(static)
Change-Id: I71a423601dbd74415dd5dd00a2fdfa03c6dcf938
-rw-r--r--ElmSharp/ElmSharp/Utility.cs130
-rw-r--r--ElmSharp/Interop/Interop.Evas.cs4
2 files changed, 132 insertions, 2 deletions
diff --git a/ElmSharp/ElmSharp/Utility.cs b/ElmSharp/ElmSharp/Utility.cs
index 745153a..baff802 100644
--- a/ElmSharp/ElmSharp/Utility.cs
+++ b/ElmSharp/ElmSharp/Utility.cs
@@ -26,5 +26,135 @@ namespace ElmSharp
{
Interop.Evas.evas_font_path_global_append(path);
}
+
+ /// <summary>
+ /// Prepends a font path to the list of font paths used by the application.
+ /// </summary>
+ /// <param name="path">The new font path.</param>
+ public static void PrependEvasGlobalFontPath(string path)
+ {
+ Interop.Evas.evas_font_path_global_prepend(path);
+ }
+
+ /// <summary>
+ /// Removes all font paths loaded into memory by evas_font_path_app_* APIs for the application.
+ /// </summary>
+ public static void ClearEvasGlobalFontPath()
+ {
+ Interop.Evas.evas_font_path_global_clear();
+ }
+
+ /// <summary>
+ /// Sets Edje color class.
+ /// </summary>
+ /// <param name="colorClass">Color class</param>
+ /// <param name="red">Object Red value</param>
+ /// <param name="green">Object Red value</param>
+ /// <param name="blue">Object Red value</param>
+ /// <param name="alpha">Object Red value</param>
+ /// <param name="outlineRed">Outline Red value</param>
+ /// <param name="outlineGreen">Outline Green value</param>
+ /// <param name="outlineBlue">Outline Blue value</param>
+ /// <param name="outlineAlpha">Outline Alpha value</param>
+ /// <param name="shadowRed">Shadow Red value</param>
+ /// <param name="shadowGreen">Shadow Green value</param>
+ /// <param name="shadowBlue">Shadow Bluevalue</param>
+ /// <param name="shadowAlpha">Shadow Alpha value</param>
+ /// <returns></returns>
+ 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);
+ }
+
+ /// <summary>
+ /// Gets Edje color class.
+ /// </summary>
+ /// <param name="colorClass">Color class</param>
+ /// <param name="red">Object Red value</param>
+ /// <param name="green">Object Red value</param>
+ /// <param name="blue">Object Red value</param>
+ /// <param name="alpha">Object Red value</param>
+ /// <param name="outlineRed">Outline Red value</param>
+ /// <param name="outlineGreen">Outline Green value</param>
+ /// <param name="outlineBlue">Outline Blue value</param>
+ /// <param name="outlineAlpha">Outline Alpha value</param>
+ /// <param name="shadowRed">Shadow Red value</param>
+ /// <param name="shadowGreen">Shadow Green value</param>
+ /// <param name="shadowBlue">Shadow Bluevalue</param>
+ /// <param name="shadowAlpha">Shadow Alpha value</param>
+ /// <returns></returns>
+ 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);
+ }
+
+ /// <summary>
+ /// Processes all queued up edje messages.
+ /// This function triggers the processing of messages addressed to any (alive) edje objects.
+ /// </summary>
+ public static void ProcessEdjeMessageSignal()
+ {
+ Interop.Elementary.edje_message_signal_process();
+ }
+
+ /// <summary>
+ /// Sets the Edje text class.
+ /// </summary>
+ /// <param name="textClass">The text class name</param>
+ /// <param name="font">The font name</param>
+ /// <param name="size">The font size</param>
+ /// <returns>True, on success or false, on error</returns>
+ public static bool SetEdjeTextClass(string textClass, string font, int size)
+ {
+ return Interop.Elementary.edje_text_class_set(textClass, font, size);
+ }
+
+ /// <summary>
+ /// Gets the Edje text class.
+ /// </summary>
+ /// <param name="textClass">The text class name</param>
+ /// <param name="font">The font name</param>
+ /// <param name="size">The font size</param>
+ /// <returns>True, on success or false, on error</returns>
+ public static bool GetEdjeTextClass(string textClass, out string font, out int size)
+ {
+ return Interop.Elementary.edje_text_class_get(textClass, out font, out size);
+ }
+
+ /// <summary>
+ /// Delete the text class.
+ /// </summary>
+ /// <param name="textClass"></param>
+ public static void DeleteEdjeTextClass(string textClass)
+ {
+ Interop.Elementary.edje_text_class_del(textClass);
+ }
+
+ /// <summary>
+ /// Pre-multiplies a rgb triplet by an alpha factor.
+ /// </summary>
+ /// <param name="alpha">The alpha factor</param>
+ /// <param name="red">The Red component of the color</param>
+ /// <param name="green">The Green component of the color</param>
+ /// <param name="blue">The Blue component of the color</param>
+ 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);
+ }
+
+ /// <summary>
+ /// Undoes pre-multiplies a rgb triplet by an alpha factor.
+ /// </summary>
+ /// <param name="alpha">The alpha factor</param>
+ /// <param name="red">The Red component of the color</param>
+ /// <param name="green">The Green component of the color</param>
+ /// <param name="blue">The Blue component of the color</param>
+ 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/ElmSharp/Interop/Interop.Evas.cs b/ElmSharp/Interop/Interop.Evas.cs
index ee5d3c8..e0a19b2 100644
--- a/ElmSharp/Interop/Interop.Evas.cs
+++ b/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);