summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_gfx_color.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-11 12:11:39 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-02-11 12:34:12 +0100
commit1b568327c4feca6ac79863551abf1507bb090c55 (patch)
tree76d2ed617f688e12a956c55d511d874296dab014 /src/lib/efl/interfaces/efl_gfx_color.c
parentb805f11c89ae5a43b6e74bfe2856beb35483a182 (diff)
efl_gfx_color_class: make this a mixin and move color_class_code here
Summary: color_class_code seems to only have been added to efl_gfx_color in order to share the hex conversion code, but this is trivial to do when it's in another class and makes the api more sensible ref T7559 Reviewers: segfaultxavi, bu5hm4n, cedric Reviewed By: segfaultxavi Subscribers: #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7559 Differential Revision: https://phab.enlightenment.org/D7898
Diffstat (limited to 'src/lib/efl/interfaces/efl_gfx_color.c')
-rw-r--r--src/lib/efl/interfaces/efl_gfx_color.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/efl/interfaces/efl_gfx_color.c b/src/lib/efl/interfaces/efl_gfx_color.c
index 54c4df8..92c1f07 100644
--- a/src/lib/efl/interfaces/efl_gfx_color.c
+++ b/src/lib/efl/interfaces/efl_gfx_color.c
@@ -117,8 +117,8 @@ _efl_gfx_color_color_code_get(const 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
120EOLIAN static void 120EOLIAN static Eina_Bool
121_efl_gfx_color_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *color_class, 121_efl_gfx_color_class_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *color_class,
122 Efl_Gfx_Color_Class_Layer layer, const char *colorcode) 122 Efl_Gfx_Color_Class_Layer layer, const char *colorcode)
123{ 123{
124 int len; 124 int len;
@@ -127,17 +127,19 @@ _efl_gfx_color_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *
127 len = _format_clean_param(colorcode); 127 len = _format_clean_param(colorcode);
128 128
129 _format_color_parse(colorcode, len, &r, &g, &b, &a); 129 _format_color_parse(colorcode, len, &r, &g, &b, &a);
130 efl_gfx_color_class_set(obj, color_class, layer, r, g, b, a); 130 return efl_gfx_color_class_set(obj, color_class, layer, r, g, b, a);
131} 131}
132 132
133EOLIAN static const char * 133EOLIAN static const char *
134_efl_gfx_color_color_class_code_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, 134_efl_gfx_color_class_color_class_code_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
135 const char *color_class, Efl_Gfx_Color_Class_Layer layer) 135 const char *color_class, Efl_Gfx_Color_Class_Layer layer)
136{ 136{
137 int r, g, b, a; 137 int r, g, b, a;
138 138
139 efl_gfx_color_class_get(obj, color_class, layer, &r, &g, &b, &a); 139 if (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); 140 return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a);
141 return NULL;
141} 142}
142 143
143#include "interfaces/efl_gfx_color.eo.c" 144#include "interfaces/efl_gfx_color.eo.c"
145#include "interfaces/efl_gfx_color_class.eo.c"