}
)
}
-}
+ }
+
+// ------------------------------------------------Drawing ---------------------------------------------//
+ styles{
+ style {
+ name: "list_text_drawing_normal";
+ base: "font=Tizen:style=Regular font_size=36 align=left color=#FFFFFF color_class=AT021 wrap=word text_class=AT021";
+ }
+ }
+
+ images {
+ image, "./fadeout_masking.#.png" COMP;
+ }
+
+ group {
+ name: "elm/genlist/item/drawing/default";
+ data.item: "treesize" 0;
+ data.item: "flips" "elm.flip.icon elm.flip.content";
+ data.item: "texts" "elm.text";
+ data.item: "contents" "base elm.icon";
+ data.item: "vi_effect" "on";
+ data.item: "dim" "off";
+ data.item: "focus_bg" "off";
+
+ parts {
+ PART_LIST_BG
+ PART_LIST_PADDINGS(
+ 0, 0,
+ LIST_BUTTON_PADDING_2BUTTON_TOP_SIZE_INC, LIST_BUTTON_PADDING_BOTTOM_SIZE_INC
+ )
+
+ PART(SWALLOW, "base",DESC_LRTB("elm.padding.left", "elm.padding.right", "elm.padding.top", "elm.padding.bottom", min: 360 0; fixed: 1 0; visible: 1;))
+
+ part {
+ name: "elm.padding.text.left_a";
+ type: SPACER;
+ scale: 1;
+ mouse_events: 0;
+ repeat_events: 0;
+ description {
+ state: "default" 0.0;
+ min: (30+76+24) 0;
+ max: (30+76+24) 51;
+ fixed: 1 0;
+ align: 0.0 0.5;
+ rel1 { relative: 1.0 1.0; to_x: "elm.padding.left"; to_y: "elm.padding.top"; }
+ rel2 { relative: 1.0 0.0; to_x: "elm.padding.left"; to_y: "elm.padding.bottom"; }
+ }
+ }
+ part {
+ name: "elm.padding.text.left_b";
+ type: SPACER;
+ scale: 1;
+ mouse_events: 0;
+ repeat_events: 0;
+ description {
+ state: "default" 0.0;
+ min: (360-30) 0;
+ max: (360-30) 51;
+ fixed: 1 0;
+ align: 0.0 0.5;
+ rel1 { relative: 1.0 1.0; to_x: "elm.padding.left"; to_y: "elm.padding.top"; }
+ rel2 { relative: 1.0 0.0; to_x: "elm.padding.left"; to_y: "elm.padding.bottom"; }
+ }
+ }
+
+ part {
+ name: "elm.text";
+ type: TEXTBLOCK;
+ scale: 1;
+ mouse_events: 0;
+ repeat_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 0 48;
+ max: -1 48;
+ fixed: 0 1;
+ align: 0.5 0.5;
+ text {
+ min: 0 1;
+ max: 1 1;
+ ellipsis: -1.0;
+ fade_ellipsis: 1.0;
+ style: "list_text_drawing_normal";
+ }
+ rel1 { relative: 1.0 1.0; to_x: "elm.padding.text.left_a"; to_y: "elm.padding.top"; }
+ rel2 { relative: 1.0 0.0; to_x: "elm.padding.text.left_b"; to_y: "elm.padding.bottom"; }
+ }
+ }
+
+ part {
+ name: "fadeout";
+ type: IMAGE;
+ scale: 1;
+ mouse_events: 0;
+ repeat_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.5;
+ min: 49 44;
+ max: 49 44;
+ fixed: 1 1;
+ rel1 { relative: 1.0 1.0; to_x: "elm.padding.text.left_b"; to_y: "elm.padding.top"; }
+ rel2 { relative: 1.0 0.0; to_x: "elm.padding.text.left_b"; to_y: "elm.padding.bottom"; }
+ image.normal: "./fadeout_masking.#.png";
+ color: 0 0 0 10;
+ }
+ }
+
+ part {
+ name: "elm.padding.icon.left";
+ type: SPACER;
+ scale: 1;
+ mouse_events: 0;
+ repeat_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 24 0;
+ max: 24 51;
+ fixed: 1 1;
+ align: 1.0 0.5;
+ rel1 { relative: 0.0 1.0; to_x: "elm.text"; to_y: "elm.padding.top"; }
+ rel2 { relative: 0.0 0.0; to_x: "elm.text"; to_y: "elm.padding.bottom"; }
+ }
+ }
+
+ part {
+ name: "elm.icon";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ align: 1.0 0.5;
+ fixed: 1 1;
+ min: 76 76;
+ max: 76 76;
+ rel1 { relative: 0.0 1.0; to_x: "elm.padding.icon.left"; to_y: "elm.padding.top"; }
+ rel2 { relative: 0.0 0.0; to_x: "elm.padding.icon.left"; to_y: "elm.padding.bottom"; }
+ }
+ }
+ }
+ }
static Elm_Object_Item *it_emoticon_empty = NULL;
static Elm_Object_Item *it_emoticon_recent_group = NULL;
static Elm_Object_Item *it_emoticon_emoji_group = NULL;
+static Elm_Object_Item* it_drawing = NULL;
static Elm_Object_Item *it_last = NULL;
static Elm_Genlist_Item_Class *itc_emoticon = NULL;
} emoticon_content_s;
static emoticon_content_s emoticon_contents_pool[EMOTICON_CNT] = { 0, };
+static emoticon_content_s emoticon_drawing_pool = { 0, };
static emoticon_content_s emoticon_recents_pool[RECENT_CNT] = { 0, };
lazy_loading_timer_for_contents = NULL;
}
+ if(emoticon_drawing_pool.used == 0){
+ evas_object_del(emoticon_drawing_pool.content);
+ }
+ emoticon_drawing_pool.content = NULL;
+
//Recent EMOTICONS : the recent emoiton need to be updated whenever emoticon view is generated, so deleted here.
for (i=0;i< RECENT_CNT;i++)
{
if (PREFERENCE_ERROR_NONE != ret) {
PRINTFUNC(DLOG_ERROR, "preference_set_string error!(%d)", ret);
}
+
+}
+
+static void _drawing_app_control_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data)
+{
+ char* path = NULL;
+ app_control_get_extra_data(reply, APP_CONTROL_DATA_PATH, &path);
+
+ if(path){
+ PRINTFUNC(DLOG_DEBUG, "path=%s", path);
+ free(path);
+ reply_to_sender_by_callback((const char*)path, "image", NULL);
+ }
+ ui_app_exit();
+}
+
+static void _drawing_item_clicked_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ PRINTFUNC(DLOG_DEBUG, "%s", __func__);
+ App_Data* ad = (App_Data*) data;
+ if (!ad)
+ return;
+
+ Elm_Object_Item *item = (Elm_Object_Item *) event_info;
+ if (item)
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+
+ /* launch */
+ app_control_h request = NULL;
+ app_control_create(&request);
+ app_control_set_app_id(request, "com.samsung.sketch");
+ //app_control_set_app_id(request, "wearable-input.sketch");
+
+ int ret = app_control_send_launch_request(request, _drawing_app_control_reply_cb, NULL);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ PRINTFUNC(DLOG_DEBUG, "error code = 0x%x", ret);
+ }
+ app_control_destroy(request);
}
static void _emoticon_item_clicked_cb(void *data, Evas_Object * obj, void *event_info)
static char * __emoticon_gl_text_get(void *data, Evas_Object *obj, const char *part)
{
//PRINTFUNC(DLOG_DEBUG,"part = %s", part);
-
const char* str = (const char*) data;
if (!str)
return NULL;
const Elm_Genlist_Item_Class *itc = elm_genlist_item_item_class_get(it);
-// PRINTFUNC(DLOG_DEBUG,"%s - stype[%s]", __func__, itc->item_style);
+ //PRINTFUNC(DLOG_DEBUG,"%s - stype[%s]", __func__, itc->item_style);
if (!strcmp(itc->item_style, "3button_flat")) {
int index = (uintptr_t)elm_object_item_data_get(it);
//PRINTFUNC(DLOG_DEBUG,"it = %p", it);
if (index + 2 < recent_emoji_list.size()) {
emoticon_recents_pool[index+2].used = 0;
}
+ } else if (it_drawing == it) {
+ //PRINTFUNC(DLOG_DEBUG,"it_drawing = %p", it_drawing);
+ emoticon_drawing_pool.used = 0;
}
}
+static Evas_Object * __emoticon_gl_1_content_get(void *data, Evas_Object *obj, const char *part)
+{
+ if (!strcmp(part, "elm.icon")) {
+ Evas_Object* btn = elm_button_add(obj);
+ evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ Evas_Object* ic = elm_image_add(btn);
+ elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE);
+
+ string path = get_resource_path();
+ if (_WEARABLE)
+ path = path + "wearable/";
+ else if (_TV)
+ path = path + "tv/";
+ else
+ path = path + "mobile/";
+
+ elm_object_style_set(btn, "ime_button_drawing");
+ string path_ic = path + "images/wi_drawing_icon.png";
+ PRINTFUNC(DLOG_DEBUG, "path_ic = %s", path_ic.c_str());
+ elm_image_file_set(ic, path_ic.c_str(), NULL);
+ elm_object_content_set(btn, ic);
+ evas_object_layer_set(btn, 32000);
+
+ emoticon_drawing_pool.index = 0;
+ emoticon_drawing_pool.content = btn;
+ emoticon_drawing_pool.used = 0;
+ return btn;
+ } else if(!strcmp(part, "base")){
+ Evas_Object* btn = elm_button_add(obj);
+ elm_object_style_set(btn, "ime/transparent");
+ return btn;
+ }
+ return NULL;
+}
+
static Evas_Object * __emoticon_gl_recent_content_get(void *data, Evas_Object *obj, const char *part)
{
if (is_content_reuse_on) {
unsigned int index = (uintptr_t)data;
int new_index = 0;
- //PRINTFUNC(DLOG_DEBUG,"%s %d", part, index);
+ //PRINTFUNC(DLOG_DEBUG,"%s %d", part, index);
if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) {
if (!strcmp(part, "elm.icon.1")) {
if (index >= recent_emoji_list.size()) return NULL;
unsigned int index = (uintptr_t)data;
int new_index = 0;
- // PRINTFUNC(DLOG_DEBUG,"%s %d", part, index);
+ //PRINTFUNC(DLOG_DEBUG,"%s %d", part, index);
if (!strcmp(part, "elm.icon.1") || (!strcmp(part, "elm.icon.2")) || (!strcmp(part, "elm.icon.3"))) {
if (!strcmp(part, "elm.icon.1")) {
if (index >= recent_emoji_list.size()) return NULL;
static Evas_Object * __emoticon_gl_emoticon_content_get(void *data, Evas_Object *obj, const char *part)
{
//PRINTFUNC(DLOG_DEBUG,"%s", __func__);
-
if (is_content_reuse_on) {
int index = (uintptr_t)data;
int new_index = 0;
return NULL;
}
-
void _create_reusable_recents(Evas_Object *parent)
{
if (!parent) {
itc_dummy->func.state_get = NULL;
itc_dummy->func.del = NULL;
- Elm_Genlist_Item_Class *itc_group = elm_genlist_item_class_new();
+ Elm_Genlist_Item_Class *itc_1text_1icon = elm_genlist_item_class_new();
+ itc_1text_1icon->item_style = "drawing";
+ itc_1text_1icon->func.text_get = __emoticon_gl_text_get;
+ itc_1text_1icon->func.content_get = __emoticon_gl_1_content_get;
+ itc_1text_1icon->func.state_get = NULL;
+ itc_1text_1icon->func.del = NULL;
+ Elm_Genlist_Item_Class *itc_group = elm_genlist_item_class_new();
itc_group->item_style = "groupindex";
itc_group->func.text_get = __emoticon_gl_text_get;
itc_group->func.content_get = NULL;
itc_group->func.del = NULL;
Elm_Genlist_Item_Class *itc_recent = elm_genlist_item_class_new();
- if (is_content_reuse_on) {
-// itc_recent->content_reusable = EINA_TRUE;
- }
itc_recent->item_style = "3button_flat_recent";
itc_recent->func.text_get = NULL;
itc_recent->func.content_get = __emoticon_gl_recent_content_get;
itc_recent->func.del = NULL;
itc_emoticon = elm_genlist_item_class_new();
- if (is_content_reuse_on) {
-// itc_emoticon->content_reusable = EINA_TRUE;
- }
itc_emoticon->item_style = "3button_flat";
itc_emoticon->func.text_get = NULL;
itc_emoticon->func.content_get = __emoticon_gl_emoticon_content_get;
// dummy title for empty space
it_emoticon_empty = elm_genlist_item_append(gl, itc_dummy, NULL, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ // Drawing
+ it_drawing = elm_genlist_item_append(gl, itc_1text_1icon, "Doodle", NULL, ELM_GENLIST_ITEM_NONE, _drawing_item_clicked_cb, (void *)app_data);
+ first_it = it_drawing;
+
if (recent_emoji_list.size() > 0) {
if (is_content_reuse_on) {
_create_reusable_recents(gl);
elm_genlist_item_class_free(itc_recent);
elm_genlist_item_class_free(itc_group);
+ elm_genlist_item_class_free(itc_1text_1icon);
elm_genlist_item_class_free(itc_dummy);
}
it_emoticon_empty = NULL;
it_emoticon_recent_group = NULL;
it_emoticon_emoji_group = NULL;
+ it_drawing = NULL;
it_last = NULL;
get_recent_emoticons(recent_emoji_list);