summaryrefslogtreecommitdiff
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
parentc3e322be28e8a6dabd95c6fec22b1908bf04f786 (diff)
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)
117 return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a); 117 return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a);
118} 118}
119 119
120#include "interfaces/efl_gfx_color.eo.c" \ No newline at end of file 120EOLIAN static void
121_efl_gfx_color_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *color_class,
122 Efl_Gfx_Color_Class_Layer layer, const char *colorcode)
123{
124 int len;
125 unsigned char r, g, b, a;
126
127 len = _format_clean_param(colorcode);
128
129 _format_color_parse(colorcode, len, &r, &g, &b, &a);
130 efl_gfx_color_class_set(obj, color_class, layer, r, g, b, a);
131}
132
133EOLIAN static const char *
134_efl_gfx_color_color_class_code_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
135 const char *color_class, Efl_Gfx_Color_Class_Layer layer)
136{
137 int r, g, b, a;
138
139 efl_gfx_color_class_get(obj, color_class, layer, &r, &g, &b, &a);
140 return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a);
141}
142
143#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 @@
1import efl_gfx_types;
2
1mixin Efl.Gfx.Color 3mixin Efl.Gfx.Color
2{ 4{
3 [[Efl Gfx Color mixin class]] 5 [[Efl Gfx Color mixin class]]
@@ -58,5 +60,24 @@ mixin Efl.Gfx.Color
58 colorcode: string; [[the hex color code.]] 60 colorcode: string; [[the hex color code.]]
59 } 61 }
60 } 62 }
63 @property color_class_code {
64 set {
65 [[Set the color class color of given Evas Object to the given hex color code(#RRGGBBAA).
66 e.g. efl_gfx_color_class_code_set(obj, "color_class_name", layer, "#FFCCAACC");
67 ]]
68 }
69 get {
70 [[Get hex color class code of given Evas Object.
71 This returns a short lived hex color class code string.
72 ]]
73 }
74 keys {
75 color_class: string; [[The name of color class]]
76 layer: Efl.Gfx.Color_Class.Layer @optional; [[The layer to set the color]]
77 }
78 values {
79 colorcode: string; [[the hex color code.]]
80 }
81 }
61 } 82 }
62} 83}