2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 /// This class is a static class for a utility methods.
22 public static class Utility
25 /// Appends a font path to the list of font paths used by the application.
27 /// <param name="path">The new font path.</param>
28 public static void AppendGlobalFontPath(string path)
30 Interop.Evas.evas_font_path_global_append(path);
34 /// Prepends a font path to the list of font paths used by the application.
36 /// <param name="path">The new font path.</param>
37 public static void PrependEvasGlobalFontPath(string path)
39 Interop.Evas.evas_font_path_global_prepend(path);
43 /// Removes all font paths loaded into memory by evas_font_path_app_* APIs for the application.
45 public static void ClearEvasGlobalFontPath()
47 Interop.Evas.evas_font_path_global_clear();
51 /// Sets Edje color class.
53 /// <param name="colorClass">Color class</param>
54 /// <param name="red">Object Red value</param>
55 /// <param name="green">Object Red value</param>
56 /// <param name="blue">Object Red value</param>
57 /// <param name="alpha">Object Red value</param>
58 /// <param name="outlineRed">Outline Red value</param>
59 /// <param name="outlineGreen">Outline Green value</param>
60 /// <param name="outlineBlue">Outline Blue value</param>
61 /// <param name="outlineAlpha">Outline Alpha value</param>
62 /// <param name="shadowRed">Shadow Red value</param>
63 /// <param name="shadowGreen">Shadow Green value</param>
64 /// <param name="shadowBlue">Shadow Bluevalue</param>
65 /// <param name="shadowAlpha">Shadow Alpha value</param>
66 /// <returns></returns>
67 public static bool SetEdjeColorClass(string colorClass, int red, int green, int blue, int alpha, int outlineRed, int outlineGreen, int outlineBlue, int outlineAlpha,
68 int shadowRed, int shadowGreen, int shadowBlue, int shadowAlpha)
70 return Interop.Elementary.edje_color_class_set(colorClass, red, green, blue, alpha, outlineRed, outlineGreen, outlineBlue, outlineAlpha, shadowRed, shadowGreen, shadowBlue, shadowAlpha);
74 /// Gets Edje color class.
76 /// <param name="colorClass">Color class</param>
77 /// <param name="red">Object Red value</param>
78 /// <param name="green">Object Red value</param>
79 /// <param name="blue">Object Red value</param>
80 /// <param name="alpha">Object Red value</param>
81 /// <param name="outlineRed">Outline Red value</param>
82 /// <param name="outlineGreen">Outline Green value</param>
83 /// <param name="outlineBlue">Outline Blue value</param>
84 /// <param name="outlineAlpha">Outline Alpha value</param>
85 /// <param name="shadowRed">Shadow Red value</param>
86 /// <param name="shadowGreen">Shadow Green value</param>
87 /// <param name="shadowBlue">Shadow Bluevalue</param>
88 /// <param name="shadowAlpha">Shadow Alpha value</param>
89 /// <returns></returns>
90 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,
91 out int outlineAlpha, out int shadowRed, out int shadowGreen, out int shadowBlue, out int shadowAlpha)
93 return Interop.Elementary.edje_color_class_get(colorClass, out red, out green, out blue, out alpha, out outlineRed, out outlineGreen, out outlineBlue, out outlineAlpha,
94 out shadowRed, out shadowGreen, out shadowBlue, out shadowAlpha);
98 /// Processes all queued up edje messages.
99 /// This function triggers the processing of messages addressed to any (alive) edje objects.
101 public static void ProcessEdjeMessageSignal()
103 Interop.Elementary.edje_message_signal_process();
107 /// Sets the Edje text class.
109 /// <param name="textClass">The text class name</param>
110 /// <param name="font">The font name</param>
111 /// <param name="size">The font size</param>
112 /// <returns>True, on success or false, on error</returns>
113 public static bool SetEdjeTextClass(string textClass, string font, int size)
115 return Interop.Elementary.edje_text_class_set(textClass, font, size);
119 /// Gets the Edje text class.
121 /// <param name="textClass">The text class name</param>
122 /// <param name="font">The font name</param>
123 /// <param name="size">The font size</param>
124 /// <returns>True, on success or false, on error</returns>
125 public static bool GetEdjeTextClass(string textClass, out string font, out int size)
127 return Interop.Elementary.edje_text_class_get(textClass, out font, out size);
131 /// Delete the text class.
133 /// <param name="textClass"></param>
134 public static void DeleteEdjeTextClass(string textClass)
136 Interop.Elementary.edje_text_class_del(textClass);
140 /// Pre-multiplies a rgb triplet by an alpha factor.
142 /// <param name="alpha">The alpha factor</param>
143 /// <param name="red">The Red component of the color</param>
144 /// <param name="green">The Green component of the color</param>
145 /// <param name="blue">The Blue component of the color</param>
146 public static void PremulityplyEvasColorByAlpha(int alpha, ref int red, ref int green, ref int blue)
148 Interop.Evas.evas_color_argb_premul(alpha, ref red, ref green, ref blue);
152 /// Undoes pre-multiplies a rgb triplet by an alpha factor.
154 /// <param name="alpha">The alpha factor</param>
155 /// <param name="red">The Red component of the color</param>
156 /// <param name="green">The Green component of the color</param>
157 /// <param name="blue">The Blue component of the color</param>
158 public static void UnPremulityplyEvasColorByAlpha(int alpha, ref int red, ref int green, ref int blue)
160 Interop.Evas.evas_color_argb_unpremul(alpha, ref red, ref green, ref blue);