}
//
-//TIZEN_ONLY(20160926): add customization interface
+//TIZEN_ONLY(20161013): clean up elm color class feature
EAPI Eina_Bool
elm_color_class_color_set(const char *color_class, int r, int g, int b, int a)
{
elm_color_class_color_get(const char *color_class, int *r, int *g, int *b, int *a)
{
Eina_Bool int_ret = EINA_FALSE;
+ int alpha = 0;
- int_ret = edje_color_class_get(color_class, r, g, b, a, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ int_ret = edje_color_class_get(color_class, r, g, b, &alpha, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+ if (a) *a = alpha;
- _elm_color_premul(*a, r, g, b);
+ _elm_color_premul(alpha, r, g, b);
return int_ret;
}
elm_color_class_color2_get(const char *color_class, int *r, int *g, int *b, int *a)
{
Eina_Bool int_ret = EINA_FALSE;
+ int alpha = 0;
- int_ret = edje_color_class_get(color_class, NULL, NULL, NULL, NULL, r, g, b, a, NULL, NULL, NULL, NULL);
+ int_ret = edje_color_class_get(color_class, NULL, NULL, NULL, NULL, r, g, b, &alpha, NULL, NULL, NULL, NULL);
+ if (a) *a = alpha;
- _elm_color_premul(*a, r, g, b);
+ _elm_color_premul(alpha, r, g, b);
return int_ret;
}
elm_color_class_color3_get(const char *color_class, int *r, int *g, int *b, int *a)
{
Eina_Bool int_ret = EINA_FALSE;
+ int alpha = 0;
- int_ret = edje_color_class_get(color_class, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, r, g, b, a);
+ int_ret = edje_color_class_get(color_class, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, r, g, b, &alpha);
+ if (a) *a = alpha;
- _elm_color_premul(*a, r, g, b);
+ _elm_color_premul(alpha, r, g, b);
return int_ret;
}
{
Eina_Bool int_ret = EINA_FALSE;
- return eo_do_ret(obj, int_ret, elm_obj_widget_color_class_color_set(color_class, r, g, b, a));
+ return eo_do_ret(obj, int_ret, elm_obj_widget_class_color_set(color_class, r, g, b, a));
}
EAPI Eina_Bool
{
Eina_Bool int_ret = EINA_FALSE;
- return eo_do_ret(obj, int_ret, elm_obj_widget_color_class_color_get(color_class, r, g, b, a));
+ return eo_do_ret(obj, int_ret, elm_obj_widget_class_color_get(color_class, r, g, b, a));
}
EAPI Eina_Bool
{
Eina_Bool int_ret = EINA_FALSE;
- return eo_do_ret(obj, int_ret, elm_obj_widget_color_class_color2_set(color_class, r, g, b, a));
+ return eo_do_ret(obj, int_ret, elm_obj_widget_class_color2_set(color_class, r, g, b, a));
}
EAPI Eina_Bool
{
Eina_Bool int_ret = EINA_FALSE;
- return eo_do_ret(obj, int_ret, elm_obj_widget_color_class_color2_get(color_class, r, g, b, a));
+ return eo_do_ret(obj, int_ret, elm_obj_widget_class_color2_get(color_class, r, g, b, a));
}
EAPI Eina_Bool
{
Eina_Bool int_ret = EINA_FALSE;
- return eo_do_ret(obj, int_ret, elm_obj_widget_color_class_color3_set(color_class, r, g, b, a));
+ return eo_do_ret(obj, int_ret, elm_obj_widget_class_color3_set(color_class, r, g, b, a));
}
EAPI Eina_Bool
{
Eina_Bool int_ret = EINA_FALSE;
- return eo_do_ret(obj, int_ret, elm_obj_widget_color_class_color3_get(color_class, r, g, b, a));
+ return eo_do_ret(obj, int_ret, elm_obj_widget_class_color3_get(color_class, r, g, b, a));
}
//
EAPI const char* elm_object_scroll_item_valign_get(const Evas_Object *obj);
//
-//TIZEN_ONLY(20160926): add customization interface
+//TIZEN_ONLY(20161013): clean up elm color class feature
/**
* @internal
*
* @note These color values are expected to be premultiplied by @p a.
*
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
* @note These color values are expected to be premultiplied by @p a.
*
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
* @note These color values are expected to be premultiplied by @p a.
*
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
* @note These color values are expected to be premultiplied by @p a.
*
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
* @note These color values are expected to be premultiplied by @p a.
*
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
* @note These color values are expected to be premultiplied by @p a.
*
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
*
* @param[in] obj The Elementary widget.
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
*
* @param[in] obj The Elementary widget.
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
*
* @param[in] obj The Elementary widget.
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
*
* @param[in] obj The Elementary widget.
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
*
* @param[in] obj The Elementary widget.
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
*
* @param[in] obj The Elementary widget.
* @param[in] color_class The name of color class.
- * @param[in] r The red intensity of the red color.
- * @param[in] g The green intensity of the green color.
- * @param[in] b The blue intensity of the blue color.
+ * @param[in] r The intensity of the red color.
+ * @param[in] g The intensity of the green color.
+ * @param[in] b The intensity of the blue color.
* @param[in] a The alpha value.
*
* @since 1.19
}
//
+//TIZEN_ONLY(20161013): clean up elm color class feature
if (item->color_classes)
ELM_SAFE_FREE(item->color_classes, eina_hash_free);
+//
EINA_MAGIC_SET(item, EINA_MAGIC_NONE);
}
}
//
+
+ //TIZEN_ONLY(20161013): clean up elm color class feature
+ if (sd->color_classes)
+ ELM_SAFE_FREE(sd->color_classes, eina_hash_free);
+ //
eo_do_super(obj, ELM_WIDGET_CLASS, eo_destructor());
sd->on_destroy = EINA_FALSE;
}
//
-//TIZEN_ONLY(20160926): add customization interface
+
+//TIZEN_ONLY(20161013): clean up elm color class feature
+void
+_edje_color_class_free(void *data)
+{
+ Edje_Color_Class *cc = data;
+
+ if (cc->name) eina_stringshare_del(cc->name);
+ free(cc);
+}
+
Eina_Stringshare *
_elm_widget_edje_class_get(const Eo_Class *klass, const char *style, const char *part)
{
return str;
}
-#define ELM_COLOR_CLASS_SET_UPPER(klass) \
- Eina_Stringshare *buf; \
- Eina_Bool int_ret = EINA_FALSE; \
- if (eo_isa(obj, klass)) \
- { \
- buf = _elm_widget_edje_class_get(eo_class_get(obj), NULL, color_class); \
- _elm_color_unpremul(a, &r, &g, &b)
-
-#define ELM_COLOR_CLASS_SET_LOWER() \
- eina_stringshare_del(buf); \
- return int_ret; \
- } \
- else \
- { \
- ERR("%s does not support %s() API.", elm_widget_type_get(obj), __func__); \
- return EINA_FALSE; \
- }
-
-EOLIAN Eina_Bool
-_elm_widget_color_class_color_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int r, int g, int b, int a)
+Eina_Hash *
+_elm_widget_color_classes_get(Eo *obj)
{
- ELM_COLOR_CLASS_SET_UPPER(ELM_LAYOUT_CLASS);
+ Elm_Widget_Smart_Data *sd = eo_data_scope_get(obj, ELM_WIDGET_CLASS);
+
+ if ((!sd) || (!sd->color_classes)) return NULL;
- int r2 = 0, g2 = 0, b2 = 0, a2 = 0, r3 = 0, g3 = 0, b3 = 0, a3 = 0;
+ return sd->color_classes;
+}
- edje_object_color_class_get(sd->resize_obj, buf, NULL, NULL, NULL, NULL, &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3);
- int_ret = edje_object_color_class_set(sd->resize_obj, buf, r, g, b, a, r2, g2, b2, a2, r3, g3, b3, a3);
+#define ELM_COLOR_CLASS_UPDATE(obj, hash, cond) \
+ Evas_Object *edje = NULL; \
+ Eina_Iterator *itr; \
+ Edje_Color_Class *cc; \
+ Eina_Bool int_ret = EINA_TRUE; \
+ if (cond) return EINA_FALSE; \
+ if (eo_isa(obj, ELM_LAYOUT_CLASS)) \
+ edje = elm_layout_edje_get(obj); \
+ else if (eo_isa(obj, EDJE_OBJECT_CLASS)) \
+ edje = obj; \
+ if (!edje) return EINA_FALSE; \
+ itr = eina_hash_iterator_data_new(hash); \
+ EINA_ITERATOR_FOREACH(itr, cc) \
+ { \
+ int_ret &= edje_object_color_class_set(edje, cc->name, \
+ cc->r, cc->g, cc->b, cc->a, \
+ cc->r2, cc->g2, cc->b2, cc->a2, \
+ cc->r3, cc->g3, cc->b3, cc->a3); \
+ } \
+ eina_iterator_free(itr); \
+ return int_ret
- ELM_COLOR_CLASS_SET_LOWER();
+Eina_Bool
+_elm_widget_color_class_update(Eo *obj, Eina_Hash *color_classes)
+{
+ ELM_COLOR_CLASS_UPDATE(obj, color_classes, (!obj) || (!color_classes));
}
-#define ELM_COLOR_CLASS_GET_UPPER(klass) \
- Eina_Stringshare *buf; \
- Eina_Bool int_ret = EINA_FALSE; \
- if (eo_isa(obj, klass)) \
- { \
- int alpha = 0; \
- buf = _elm_widget_edje_class_get(eo_class_get(obj), NULL, color_class)
+#define CHECK_BOUND(x) \
+ if (x > 0xff) x = 0xff; \
+ else if (x < 0) x = 0
-#define ELM_COLOR_CLASS_GET_LOWER() \
- _elm_color_premul(alpha, r, g, b); \
- eina_stringshare_del(buf); \
- return int_ret; \
- } \
- else \
- { \
- ERR("%s does not support %s() API.", eo_class_name_get(eo_class_get(obj)), __func__); \
- return EINA_FALSE; \
- }
+#define ELM_COLOR_CLASS_SET_START(obj, cr, cg, cb, ca) \
+ Eina_Bool int_ret = EINA_FALSE; \
+ Edje_Color_Class *cc = NULL; \
+ Eina_Stringshare *buf; \
+ buf = _elm_widget_edje_class_get(eo_class_get(obj), NULL, color_class); \
+ CHECK_BOUND(r); \
+ CHECK_BOUND(g); \
+ CHECK_BOUND(b); \
+ CHECK_BOUND(a); \
+ _elm_color_unpremul(a, &r, &g, &b); \
+ if (!sd->color_classes) \
+ sd->color_classes = eina_hash_string_small_new(_edje_color_class_free); \
+ else \
+ cc = eina_hash_find(sd->color_classes, buf); \
+ if (!cc) \
+ { \
+ cc = calloc(1, sizeof(Edje_Color_Class)); \
+ cc->name = eina_stringshare_add(buf); \
+ if (!cc->name) \
+ { \
+ free(cc); \
+ eina_stringshare_del(buf); \
+ return EINA_FALSE; \
+ } \
+ eina_hash_direct_add(sd->color_classes, cc->name, cc); \
+ } \
+ else if ((cc->cr == r) && (cc->cg == g) && \
+ (cc->cb == b) && (cc->ca == a)) \
+ { \
+ eina_stringshare_del(buf); \
+ return EINA_TRUE; \
+ } \
+ cc->cr = r; \
+ cc->cg = g; \
+ cc->cb = b; \
+ cc->ca = a; \
+ int_ret = EINA_TRUE
+
+#define ELM_COLOR_CLASS_SET_END() \
+ eina_stringshare_del(buf); \
+ return int_ret
EOLIAN Eina_Bool
-_elm_widget_color_class_color_get(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
-{
- ELM_COLOR_CLASS_GET_UPPER(ELM_LAYOUT_CLASS);
+_elm_widget_class_color_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int r, int g, int b, int a)
+{
+ ELM_COLOR_CLASS_SET_START(obj, r, g, b, a);
+
+ int_ret &= _elm_widget_color_class_update(obj, sd->color_classes);
+
+ ELM_COLOR_CLASS_SET_END();
+}
+
+#define ELM_COLOR_CLASS_GET(obj, cr, cg, cb, ca) \
+ Eina_Bool int_ret = EINA_FALSE; \
+ Edje_Color_Class *cc; \
+ Eina_Stringshare *buf; \
+ int alpha = 0; \
+ buf = _elm_widget_edje_class_get(eo_class_get(obj), NULL, color_class); \
+ if ((!sd->color_classes) || !(cc = eina_hash_find(sd->color_classes, buf))) \
+ { \
+ if (r) *r = 0; \
+ if (g) *g = 0; \
+ if (b) *b = 0; \
+ if (a) *a = 0; \
+ int_ret = EINA_FALSE; \
+ } \
+ else \
+ { \
+ if (r) *r = cc->cr; \
+ if (g) *g = cc->cg; \
+ if (b) *b = cc->cb; \
+ if (a) *a = cc->ca; \
+ alpha = cc->ca; \
+ int_ret = EINA_TRUE; \
+ } \
+ _elm_color_premul(alpha, r, g, b); \
+ eina_stringshare_del(buf); \
+ return int_ret
- int_ret = edje_object_color_class_get(sd->resize_obj, buf, r, g, b, &alpha, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
- if (a) *a = alpha;
- ELM_COLOR_CLASS_GET_LOWER();
+EOLIAN Eina_Bool
+_elm_widget_class_color_get(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
+{
+ ELM_COLOR_CLASS_GET(obj, r, g, b, a);
}
EOLIAN Eina_Bool
-_elm_widget_color_class_color2_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int r, int g, int b, int a)
+_elm_widget_class_color2_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int r, int g, int b, int a)
{
- ELM_COLOR_CLASS_SET_UPPER(ELM_LAYOUT_CLASS);
+ ELM_COLOR_CLASS_SET_START(obj, r2, g2, b2, a2);
- int r2 = 0, g2 = 0, b2 = 0, a2 = 0, r3 = 0, g3 = 0, b3 = 0, a3 = 0;
+ int_ret &= _elm_widget_color_class_update(obj, sd->color_classes);
- edje_object_color_class_get(sd->resize_obj, buf, &r2, &g2, &b2, &a2, NULL, NULL, NULL, NULL, &r3, &g3, &b3, &a3);
- int_ret = edje_object_color_class_set(sd->resize_obj, buf, r2, g2, b2, a2, r, g, b, a, r3, g3, b3, a3);
-
- ELM_COLOR_CLASS_SET_LOWER();
+ ELM_COLOR_CLASS_SET_END();
}
EOLIAN Eina_Bool
-_elm_widget_color_class_color2_get(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
+_elm_widget_class_color2_get(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
{
- ELM_COLOR_CLASS_GET_UPPER(ELM_LAYOUT_CLASS);
-
- int_ret = edje_object_color_class_get(sd->resize_obj, buf, NULL, NULL, NULL, NULL, r, g, b, &alpha, NULL, NULL, NULL, NULL);
- if (a) *a = alpha;
-
- ELM_COLOR_CLASS_GET_LOWER();
+ ELM_COLOR_CLASS_GET(obj, r2, g2, b2, a2);
}
EOLIAN Eina_Bool
-_elm_widget_color_class_color3_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int r, int g, int b, int a)
+_elm_widget_class_color3_set(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int r, int g, int b, int a)
{
- ELM_COLOR_CLASS_SET_UPPER(ELM_LAYOUT_CLASS);
- int r2 = 0, g2 = 0, b2 = 0, a2 = 0, r3 = 0, g3 = 0, b3 = 0, a3 = 0;
+ ELM_COLOR_CLASS_SET_START(obj, r3, g3, b3, a3);
- edje_object_color_class_get(sd->resize_obj, buf, &r2, &g2, &b2, &a2, &r3, &g3, &b3, &a3, NULL, NULL, NULL, NULL);
- int_ret = edje_object_color_class_set(sd->resize_obj, buf, r2, g2, b2, a2, r3, g3, b3, a3, r, g, b, a);
+ int_ret &= _elm_widget_color_class_update(obj, sd->color_classes);
- ELM_COLOR_CLASS_SET_LOWER();
+ ELM_COLOR_CLASS_SET_END();
}
EOLIAN Eina_Bool
-_elm_widget_color_class_color3_get(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
+_elm_widget_class_color3_get(Eo *obj, Elm_Widget_Smart_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
{
- ELM_COLOR_CLASS_GET_UPPER(ELM_LAYOUT_CLASS);
-
- int_ret = edje_object_color_class_get(sd->resize_obj, buf, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, r, g, b, &alpha);
- if (a) *a = alpha;
-
- ELM_COLOR_CLASS_GET_LOWER();
+ ELM_COLOR_CLASS_GET(obj, r3, g3, b3, a3);
}
Eina_Bool
_elm_widget_item_color_class_update(Elm_Widget_Item_Data *sd)
{
- Evas_Object *edje;
- Eina_Iterator *itr;
- Edje_Color_Class *cc;
- Eina_Bool int_ret = EINA_TRUE;
-
- if (!sd->color_classes || !sd->view) return EINA_FALSE;
-
- if (eo_isa(sd->view, ELM_LAYOUT_CLASS))
- edje = elm_layout_edje_get(sd->view);
- else
- edje = sd->view;
-
- itr = eina_hash_iterator_data_new(sd->color_classes);
- EINA_ITERATOR_FOREACH(itr, cc)
- {
- int_ret &= edje_object_color_class_set(edje, cc->name,
- cc->r, cc->g, cc->b, cc->a,
- cc->r2, cc->g2, cc->b2, cc->a2,
- cc->r3, cc->g3, cc->b3, cc->a3);
- }
- eina_iterator_free(itr);
- return int_ret;
+ ELM_COLOR_CLASS_UPDATE(sd->view, sd->color_classes, (!sd) || (!sd->color_classes) || (!sd->view));
}
-#define CHECK_BOUND(x) \
- if (x > 0xFF) x = 0xff; \
- else if (x < 0) x = 0
+EOLIAN Eina_Bool
+_elm_widget_item_class_color_set(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int r, int g, int b, int a)
+{
+ ELM_COLOR_CLASS_SET_START(obj, r, g, b, a);
-#define ELM_ITEM_COLOR_CLASS_SET(cr, cg, cb, ca) \
- Edje_Color_Class *cc = NULL; \
- CHECK_BOUND(r); \
- CHECK_BOUND(g); \
- CHECK_BOUND(b); \
- CHECK_BOUND(a); \
- if (!sd->color_classes) \
- sd->color_classes = eina_hash_string_small_new(free); \
- else \
- cc = eina_hash_find(sd->color_classes, buf); \
- if (!cc) \
- { \
- cc = calloc(1, sizeof(Edje_Color_Class)); \
- cc->name = eina_stringshare_add(buf); \
- if (!cc->name) \
- { \
- free(cc); \
- eina_stringshare_del(buf); \
- return EINA_FALSE; \
- } \
- eina_hash_direct_add(sd->color_classes, cc->name, cc); \
- } \
- else if ((cc->cr == r) && (cc->cg == g) && (cc->cb == b) && (cc->ca == a)) \
- { \
- eina_stringshare_del(buf); \
- return EINA_TRUE; \
- } \
- cc->cr = r; \
- cc->cg = g; \
- cc->cb = b; \
- cc->ca = a; \
- int_ret = EINA_TRUE; \
- if (sd->view) \
- int_ret &= _elm_widget_item_color_class_update(sd)
+ int_ret &= _elm_widget_item_color_class_update(sd);
-EOLIAN Eina_Bool
-_elm_widget_item_color_class_color_set(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int r, int g, int b, int a)
-{
- ELM_COLOR_CLASS_SET_UPPER(ELM_WIDGET_ITEM_CLASS);
- ELM_ITEM_COLOR_CLASS_SET(r, g, b, a);
- ELM_COLOR_CLASS_SET_LOWER();
-}
-
-#define ELM_ITEM_COLOR_CLASS_GET(cr, cg, cb, ca) \
- Edje_Color_Class *cc; \
- if ((!sd->color_classes) || !(cc = eina_hash_find(sd->color_classes, buf))) \
- { \
- if (r) *r = 0; \
- if (g) *g = 0; \
- if (b) *b = 0; \
- if (a) *a = 0; \
- int_ret = EINA_FALSE; \
- } \
- else \
- { \
- if (r) *r = cc->cr; \
- if (g) *g = cc->cg; \
- if (b) *b = cc->cb; \
- if (a) *a = cc->ca; \
- alpha = cc->ca; \
- int_ret = EINA_TRUE; \
- }
+ ELM_COLOR_CLASS_SET_END();
+}
EOLIAN Eina_Bool
-_elm_widget_item_color_class_color_get(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
+_elm_widget_item_class_color_get(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
{
- ELM_COLOR_CLASS_GET_UPPER(ELM_WIDGET_ITEM_CLASS);
- ELM_ITEM_COLOR_CLASS_GET(r, g, b, a);
- ELM_COLOR_CLASS_GET_LOWER();
+ ELM_COLOR_CLASS_GET(obj, r, g, b, a);
}
EOLIAN Eina_Bool
-_elm_widget_item_color_class_color2_set(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int r, int g, int b, int a)
+_elm_widget_item_class_color2_set(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int r, int g, int b, int a)
{
- ELM_COLOR_CLASS_SET_UPPER(ELM_WIDGET_ITEM_CLASS);
- ELM_ITEM_COLOR_CLASS_SET(r2, g2, b2, a2);
- ELM_COLOR_CLASS_SET_LOWER();
+ ELM_COLOR_CLASS_SET_START(obj, r2, g2, b2, a2);
+
+ int_ret &= _elm_widget_item_color_class_update(sd);
+
+ ELM_COLOR_CLASS_SET_END();
}
EOLIAN Eina_Bool
-_elm_widget_item_color_class_color2_get(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
+_elm_widget_item_class_color2_get(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
{
- ELM_COLOR_CLASS_GET_UPPER(ELM_WIDGET_ITEM_CLASS);
- ELM_ITEM_COLOR_CLASS_GET(r2, g2, b2, a2);
- ELM_COLOR_CLASS_GET_LOWER();
+ ELM_COLOR_CLASS_GET(obj, r2, g2, b2, a2);
}
EOLIAN Eina_Bool
-_elm_widget_item_color_class_color3_set(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int r, int g, int b, int a)
+_elm_widget_item_class_color3_set(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int r, int g, int b, int a)
{
- ELM_COLOR_CLASS_SET_UPPER(ELM_WIDGET_ITEM_CLASS);
- ELM_ITEM_COLOR_CLASS_SET(r3, g3, b3, a3);
- ELM_COLOR_CLASS_SET_LOWER();
+ ELM_COLOR_CLASS_SET_START(obj, r3, g3, b3, a3);
+
+ int_ret &= _elm_widget_item_color_class_update(sd);
+
+ ELM_COLOR_CLASS_SET_END();
}
EOLIAN Eina_Bool
-_elm_widget_item_color_class_color3_get(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
+_elm_widget_item_class_color3_get(Eo *obj, Elm_Widget_Item_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
{
- ELM_COLOR_CLASS_GET_UPPER(ELM_WIDGET_ITEM_CLASS);
- ELM_ITEM_COLOR_CLASS_GET(r3, g3, b3, a3);
- ELM_COLOR_CLASS_GET_LOWER();
+ ELM_COLOR_CLASS_GET(obj, r3, g3, b3, a3);
}
//