_cursor_handler_mouse_up_cb, obj);
evas_object_layer_set(handle, EVAS_LAYER_MAX - 1);
edje_object_signal_emit(handle, "edje,cursor,handle,show", "edje"); // FOR 2.3 theme
+ /* TIZEN_ONLY(20161025): Apply color_class parent-child relationship */
+ _elm_widget_color_class_parent_set(handle, sd->entry_edje);
+ /* END */
}
static void
sd->mgf_bg = edje_object_add(e);
_elm_theme_object_set(data, sd->mgf_bg, "entry", "magnifier", "default");
evas_object_show(sd->mgf_bg);
+ /* TIZEN_ONLY(20161025): Apply color_class parent-child relationship */
+ _elm_widget_color_class_parent_set(sd->mgf_bg, sd->entry_edje);
+ /* END */
//Proxy
sd->mgf_proxy = evas_object_image_add(e);
_start_handler_mouse_up_cb, obj);
evas_object_show(handle);
+ /* TIZEN_ONLY(20161025): Apply color_class parent-child relationship */
+ _elm_widget_color_class_parent_set(handle, sd->entry_edje);
+ /* END */
+
handle = edje_object_add(evas_object_evas_get(obj));
sd->end_handler = handle;
_elm_theme_object_set(obj, handle, "entry", "handler/end", style);
evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_UP,
_end_handler_mouse_up_cb, obj);
evas_object_show(handle);
+
+ /* TIZEN_ONLY(20161025): Apply color_class parent-child relationship */
+ _elm_widget_color_class_parent_set(handle, sd->entry_edje);
+ /* END */
}
EOLIAN static void
(sd->scr_edje, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_propagate_events_set(sd->scr_edje, EINA_TRUE);
+
+ /* TIZEN_ONLY(20161025): Apply color_class parent-child relationship */
+ _elm_widget_color_class_parent_set(sd->scr_edje, sd->entry_edje);
+ /* END */
}
elm_widget_resize_object_set(obj, sd->scr_edje, EINA_TRUE);
}
//
+/* TIZEN_ONLY(20161025): Apply color_class parent-child relationship
+ * The resize object of elm_entry could be switch entry_edje into scr_edje
+ * when only elm_entry is scrollable.
+ * So, we need to update color_class only for entry_edje. */
+EOLIAN static Eina_Bool
+_elm_entry_elm_widget_class_color_set(Eo *obj, Elm_Entry_Data *sd, const char *color_class, int r, int g, int b, int a)
+{
+ Eina_Bool int_ret = EINA_TRUE;
+
+ int_ret &= _elm_widget_color_class_set_internal(obj, sd->entry_edje, color_class,
+ r, g, b, a,
+ -1, -1, -1, -1,
+ -1, -1, -1, -1);
+
+ return int_ret;
+}
+
+EOLIAN static Eina_Bool
+_elm_entry_elm_widget_class_color_get(Eo *obj, Elm_Entry_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
+{
+ Eina_Bool int_ret = EINA_TRUE;
+
+ int_ret &= _elm_widget_color_class_get_internal(obj, sd->entry_edje, color_class,
+ r, g, b, a,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL);
+
+ return int_ret;
+}
+
+EOLIAN static Eina_Bool
+_elm_entry_elm_widget_class_color2_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char *color_class, int r, int g, int b, int a)
+{
+ Eina_Bool int_ret = EINA_TRUE;
+
+ int_ret &= _elm_widget_color_class_set_internal(obj, sd->entry_edje, color_class,
+ -1, -1, -1, -1,
+ r, g, b, a,
+ -1, -1, -1, -1);
+
+ return int_ret;
+}
+
+EOLIAN static Eina_Bool
+_elm_entry_elm_widget_class_color2_get(Eo *obj, Elm_Entry_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
+{
+ Eina_Bool int_ret = EINA_TRUE;
+
+ int_ret &= _elm_widget_color_class_get_internal(obj, sd->entry_edje, color_class,
+ NULL, NULL, NULL, NULL,
+ r, g, b, a,
+ NULL, NULL, NULL, NULL);
+
+ return int_ret;
+}
+
+EOLIAN static Eina_Bool
+_elm_entry_elm_widget_class_color3_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char *color_class, int r, int g, int b, int a)
+{
+ Eina_Bool int_ret = EINA_TRUE;
+
+ int_ret &= _elm_widget_color_class_set_internal(obj, sd->entry_edje, color_class,
+ -1, -1, -1, -1,
+ -1, -1, -1, -1,
+ r, g, b, a);
+
+ return int_ret;
+}
+
+EOLIAN static Eina_Bool
+_elm_entry_elm_widget_class_color3_get(Eo *obj, Elm_Entry_Data *sd, const char *color_class, int *r, int *g, int *b, int *a)
+{
+ Eina_Bool int_ret = EINA_TRUE;
+
+ int_ret &= _elm_widget_color_class_get_internal(obj, sd->entry_edje, color_class,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ r, g, b, a);
+
+ return int_ret;
+}
+/* END */
+
#include "elm_entry.eo.c"
}
//
- //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;
return str;
}
-Eina_Hash *
-_elm_widget_color_classes_get(Eo *obj)
+/* TIZEN_ONLY(20161025): Apply color_class parent-child relationship */
+Eina_Bool
+_elm_widget_color_class_set_internal(Evas_Object *obj, Evas_Object *edje, const char *color_class,
+ int r, int g, int b, int a,
+ int r2, int g2, int b2, int a2,
+ int r3, int g3, int b3, int a3)
+{
+ Eina_Bool int_ret = EINA_TRUE;
+ Eina_Stringshare *buf;
+ int temp_color[3][4] = { { r, g, b, a },
+ { r2, g2, b2, a2 },
+ { r3, g3, b3, a3 } };
+
+ buf = _elm_widget_edje_class_get(eo_class_get(obj), NULL, color_class);
+
+#define TEMP_COLOR(x, y) \
+ ((temp_color[x][y] == -1) ? &temp_color[x][y] : NULL)
+
+ edje_object_color_class_get(edje, buf,
+ TEMP_COLOR(0, 0), TEMP_COLOR(0, 1), TEMP_COLOR(0, 2), TEMP_COLOR(0, 3),
+ TEMP_COLOR(1, 0), TEMP_COLOR(1, 1), TEMP_COLOR(1, 2), TEMP_COLOR(1, 3),
+ TEMP_COLOR(2, 0), TEMP_COLOR(2, 1), TEMP_COLOR(2, 2), TEMP_COLOR(2, 3));
+
+#undef TEMP_COLOR
+
+#define TEMP_COLOR(x, y) \
+ ((temp_color[x][y] == -1) ? 0 : temp_color[x][y])
+
+ int_ret &= edje_object_color_class_set(edje, buf,
+ TEMP_COLOR(0, 0), TEMP_COLOR(0, 1), TEMP_COLOR(0, 2), TEMP_COLOR(0, 3),
+ TEMP_COLOR(1, 0), TEMP_COLOR(1, 1), TEMP_COLOR(1, 2), TEMP_COLOR(1, 3),
+ TEMP_COLOR(2, 0), TEMP_COLOR(2, 1), TEMP_COLOR(2, 2), TEMP_COLOR(2, 3));
+
+#undef TEMP_COLOR
+
+ eina_stringshare_del(buf);
+
+ return int_ret;
+}
+
+Eina_Bool
+_elm_widget_color_class_get_internal(Evas_Object *obj, Evas_Object *edje, const char *color_class,
+ int *r, int *g, int *b, int *a,
+ int *r2, int *g2, int *b2, int *a2,
+ int *r3, int *g3, int *b3, int *a3)
+{
+ Eina_Bool int_ret = EINA_TRUE;
+ Eina_Stringshare *buf;
+
+ buf = _elm_widget_edje_class_get(eo_class_get(obj), NULL, color_class);
+
+ int_ret &= edje_object_color_class_get(edje, buf,
+ r, g, b, a,
+ r2, g2, b2, a2,
+ r3, g3, b3, a3);
+
+ eina_stringshare_del(buf);
+
+ return int_ret;
+}
+/* END */
+
+EOLIAN Eina_Bool
+_elm_widget_class_color_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, const char *color_class, int r, int g, int b, int a)
+{
+ Evas_Object *edje;
+ Eina_Bool int_ret = EINA_TRUE;
+
+ if (!eo_isa(obj, ELM_LAYOUT_CLASS)) return EINA_FALSE;
+
+ edje = elm_layout_edje_get(obj);
+ int_ret &= _elm_widget_color_class_set_internal(obj, edje, color_class,
+ r, g, b, a,
+ -1, -1, -1, -1,
+ -1, -1, -1, -1);
+
+ return int_ret;
+}
+
+EOLIAN Eina_Bool
+_elm_widget_class_color_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, const char *color_class, int *r, int *g, int *b, int *a)
+{
+ Evas_Object *edje;
+ Eina_Bool int_ret = EINA_TRUE;
+
+ if (!eo_isa(obj, ELM_LAYOUT_CLASS)) return EINA_FALSE;
+
+ edje = elm_layout_edje_get(obj);
+ int_ret &= _elm_widget_color_class_get_internal(obj, edje, color_class,
+ r, g, b, a,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL);
+
+ return int_ret;
+}
+
+EOLIAN Eina_Bool
+_elm_widget_class_color2_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, const char *color_class, int r, int g, int b, int a)
+{
+ Evas_Object *edje;
+ Eina_Bool int_ret = EINA_TRUE;
+
+ if (!eo_isa(obj, ELM_LAYOUT_CLASS)) return EINA_FALSE;
+
+ edje = elm_layout_edje_get(obj);
+ int_ret &= _elm_widget_color_class_set_internal(obj, edje, color_class,
+ -1, -1, -1, -1,
+ r, g, b, a,
+ -1, -1, -1, -1);
+
+ return int_ret;
+}
+
+EOLIAN Eina_Bool
+_elm_widget_class_color2_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, const char *color_class, int *r, int *g, int *b, int *a)
{
- Elm_Widget_Smart_Data *sd = eo_data_scope_get(obj, ELM_WIDGET_CLASS);
+ Evas_Object *edje;
+ Eina_Bool int_ret = EINA_TRUE;
- if ((!sd) || (!sd->color_classes)) return NULL;
+ if (!eo_isa(obj, ELM_LAYOUT_CLASS)) return EINA_FALSE;
- return sd->color_classes;
+ edje = elm_layout_edje_get(obj);
+ int_ret &= _elm_widget_color_class_get_internal(obj, edje, color_class,
+ NULL, NULL, NULL, NULL,
+ r, g, b, a,
+ NULL, NULL, NULL, NULL);
+
+ return int_ret;
+}
+
+EOLIAN Eina_Bool
+_elm_widget_class_color3_set(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, const char *color_class, int r, int g, int b, int a)
+{
+ Evas_Object *edje;
+ Eina_Bool int_ret = EINA_TRUE;
+
+ if (!eo_isa(obj, ELM_LAYOUT_CLASS)) return EINA_FALSE;
+
+ edje = elm_layout_edje_get(obj);
+ int_ret &= _elm_widget_color_class_set_internal(obj, edje, color_class,
+ -1, -1, -1, -1,
+ -1, -1, -1, -1,
+ r, g, b, a);
+
+ return int_ret;
+}
+
+EOLIAN Eina_Bool
+_elm_widget_class_color3_get(Eo *obj, Elm_Widget_Smart_Data *sd EINA_UNUSED, const char *color_class, int *r, int *g, int *b, int *a)
+{
+ Evas_Object *edje;
+ Eina_Bool int_ret = EINA_TRUE;
+
+ if (!eo_isa(obj, ELM_LAYOUT_CLASS)) return EINA_FALSE;
+
+ edje = elm_layout_edje_get(obj);
+ int_ret &= _elm_widget_color_class_get_internal(obj, edje, color_class,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ r, g, b, a);
+
+ return int_ret;
}
#define ELM_COLOR_CLASS_UPDATE(obj, hash, cond) \
eina_iterator_free(itr); \
return int_ret
-Eina_Bool
-_elm_widget_color_class_update(Eo *obj, Eina_Hash *color_classes)
-{
- ELM_COLOR_CLASS_UPDATE(obj, color_classes, (!obj) || (!color_classes));
-}
#define CHECK_BOUND(x) \
if (x > 0xff) x = 0xff; \
eina_stringshare_del(buf); \
return int_ret
-EOLIAN Eina_Bool
-_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_del(buf); \
return int_ret
-
-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_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_START(obj, r2, g2, b2, a2);
-
- int_ret &= _elm_widget_color_class_update(obj, sd->color_classes);
-
- ELM_COLOR_CLASS_SET_END();
-}
-
-EOLIAN Eina_Bool
-_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(obj, r2, g2, b2, a2);
-}
-
-EOLIAN Eina_Bool
-_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_START(obj, r3, g3, b3, a3);
-
- int_ret &= _elm_widget_color_class_update(obj, sd->color_classes);
-
- ELM_COLOR_CLASS_SET_END();
-}
-
-EOLIAN Eina_Bool
-_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(obj, r3, g3, b3, a3);
-}
-
Eina_Bool
_elm_widget_item_color_class_update(Elm_Widget_Item_Data *sd)
{
}
//
+/* TIZEN_ONLY(20161025): Apply color_class parent-child relationship */
+void
+_elm_widget_color_class_parent_set(Evas_Object *obj, Evas_Object *parent)
+{
+ Evas_Object *edje = NULL, *parent_edje = NULL;
+
+ if (!obj || !parent) return;
+
+ if (eo_isa(obj, ELM_LAYOUT_CLASS))
+ edje = elm_layout_edje_get(obj);
+ else if (eo_isa(obj, EDJE_OBJECT_CLASS))
+ edje = obj;
+
+ if (eo_isa(parent, ELM_LAYOUT_CLASS))
+ parent_edje = elm_layout_edje_get(parent);
+ else if (eo_isa(parent, EDJE_OBJECT_CLASS))
+ parent_edje = parent;
+
+ if (!edje || !parent_edje) return;
+
+ edje_object_color_class_parent_set(edje, parent_edje);
+}
+
+void
+_elm_widget_color_class_parent_unset(Evas_Object *obj)
+{
+ Evas_Object *edje = NULL;
+
+ if (!obj) return;
+
+ 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;
+
+ edje_object_color_class_parent_unset(edje);
+}
+/* END */
+
//TIZEN_ONLY(20160527): widget: add AtspiAction interface to all widgets and widget_items, add handlers for reading stopped/cancelled
EOLIAN const Elm_Atspi_Action *
_elm_widget_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd EINA_UNUSED)