aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2017-12-29 13:06:44 +0900
committerAmitesh Singh <amitesh.sh@samsung.com>2018-01-02 15:41:34 +0900
commit44b6aa16c1054b545583408c31c4243144852960 (patch)
tree30ab47885f4ba544a5246ddfd638187d4001847b
parentefl loop - make param as unused to remove warning (diff)
downloadefl-44b6aa16c1054b545583408c31c4243144852960.tar.gz
Efl.Gfx.Color: add color_class_code.set/get{} method
-rw-r--r--src/lib/efl/interfaces/efl_gfx_color.c25
-rw-r--r--src/lib/efl/interfaces/efl_gfx_color.eo21
2 files changed, 45 insertions, 1 deletions
diff --git a/src/lib/efl/interfaces/efl_gfx_color.c b/src/lib/efl/interfaces/efl_gfx_color.c
index 1e65f62977..91f8a4fd32 100644
--- a/src/lib/efl/interfaces/efl_gfx_color.c
+++ b/src/lib/efl/interfaces/efl_gfx_color.c
@@ -117,4 +117,27 @@ _efl_gfx_color_color_code_get(Eo *obj, void *_pd EINA_UNUSED)
return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a);
}
-#include "interfaces/efl_gfx_color.eo.c" \ No newline at end of file
+EOLIAN static void
+_efl_gfx_color_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *color_class,
+ Efl_Gfx_Color_Class_Layer layer, const char *colorcode)
+{
+ int len;
+ unsigned char r, g, b, a;
+
+ len = _format_clean_param(colorcode);
+
+ _format_color_parse(colorcode, len, &r, &g, &b, &a);
+ efl_gfx_color_class_set(obj, color_class, layer, r, g, b, a);
+}
+
+EOLIAN static const char *
+_efl_gfx_color_color_class_code_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
+ const char *color_class, Efl_Gfx_Color_Class_Layer layer)
+{
+ int r, g, b, a;
+
+ efl_gfx_color_class_get(obj, color_class, layer, &r, &g, &b, &a);
+ return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a);
+}
+
+#include "interfaces/efl_gfx_color.eo.c"
diff --git a/src/lib/efl/interfaces/efl_gfx_color.eo b/src/lib/efl/interfaces/efl_gfx_color.eo
index 2c2dd4d858..61f5e76f1e 100644
--- a/src/lib/efl/interfaces/efl_gfx_color.eo
+++ b/src/lib/efl/interfaces/efl_gfx_color.eo
@@ -1,3 +1,5 @@
+import efl_gfx_types;
+
mixin Efl.Gfx.Color
{
[[Efl Gfx Color mixin class]]
@@ -58,5 +60,24 @@ mixin Efl.Gfx.Color
colorcode: string; [[the hex color code.]]
}
}
+ @property color_class_code {
+ set {
+ [[Set the color class color of given Evas Object to the given hex color code(#RRGGBBAA).
+ e.g. efl_gfx_color_class_code_set(obj, "color_class_name", layer, "#FFCCAACC");
+ ]]
+ }
+ get {
+ [[Get hex color class code of given Evas Object.
+ This returns a short lived hex color class code string.
+ ]]
+ }
+ keys {
+ color_class: string; [[The name of color class]]
+ layer: Efl.Gfx.Color_Class.Layer @optional; [[The layer to set the color]]
+ }
+ values {
+ colorcode: string; [[the hex color code.]]
+ }
+ }
}
}