4 #include "xcnphandler.h"
5 #include "clipdrawer.h"
7 #define DELETE_ICON_PATH "/usr/share/cbhm/icons/05_delete.png"
8 #define IM "/usr/share/cbhm/icons/"
9 static const char *g_images_path[] = {
10 IM"cbhm_default_img.png",
14 #define GRID_ITEM_SPACE_W 6
15 #define GRID_ITEM_SINGLE_W 185
16 #define GRID_ITEM_SINGLE_H 161
17 #define GRID_ITEM_W (GRID_ITEM_SINGLE_W+(GRID_ITEM_SPACE_W*2))
18 #define GRID_ITEM_H (GRID_ITEM_SINGLE_H)
19 #define GRID_IMAGE_LIMIT_W 91
20 #define GRID_IMAGE_LIMIT_H 113
22 #define ANIM_DURATION 30 // 1 seconds
23 #define ANIM_FLOPS (0.5/30)
25 // gic should live at gengrid callback functions
26 Elm_Gengrid_Item_Class gic;
29 typedef struct tag_griditem
32 Elm_Gengrid_Item *item;
33 const char *ipathdata;
34 Eina_Strbuf *istrdata;
40 int clipdrawer_update_contents(void *data)
42 struct appdata *ad = data;
46 for (i = 0; i < HISTORY_QUEUE_MAX_ITEMS; i++)
48 pos = get_current_history_position() - i;
50 pos = pos+HISTORY_QUEUE_MAX_ITEMS;
52 if (clipdrawer_get_item_data(ad, pos) != NULL && strlen(clipdrawer_get_item_data(ad, pos)) > 0)
54 unesc = clipdrawer_get_plain_string_from_escaped(clipdrawer_get_item_data(ad, pos));
55 unesc = unesc ? unesc : "";
56 elm_list_item_append(ad->txtlist, unesc, NULL, NULL, NULL, ad);
61 /* FIXME : sometimes when list update, screen isn't updated */
66 const char* clipdrawer_get_plain_string_from_escaped(char *escstr)
68 /* TODO : is it should be here? besides, remove dependency for entry */
69 /* NOTE : return string should be freed */
70 return elm_entry_markup_to_utf8(escstr);
73 static void _grid_del_response_cb(void *data, Evas_Object *obj, void *event_info)
75 Elm_Gengrid_Item *it = (Elm_Gengrid_Item *)data;
78 if((int)event_info == ELM_POPUP_RESPONSE_OK)
79 elm_gengrid_item_del(it);
82 static void _grid_click_delete(void *data, Evas_Object *obj, void *event_info)
84 struct appdata *ad = data;
88 _grid_item_ly_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
90 struct appdata *ad = g_get_main_appdata();
92 if (ad->anim_status != STATUS_NONE)
95 Elm_Gengrid_Item *sgobj = NULL;
96 sgobj = elm_gengrid_selected_item_get(ad->hig);
97 griditem_t *ti = NULL;
98 ti = elm_gengrid_item_data_get(sgobj);
100 #define EDJE_DELBTN_PART_PREFIX "delbtn"
101 if (strncmp(source, EDJE_DELBTN_PART_PREFIX, strlen(EDJE_DELBTN_PART_PREFIX)))
105 DTRACE("ERR: cbhm can't get the selected image\n");
109 elm_gengrid_item_selected_set(sgobj, EINA_FALSE);
111 if (ti->itype == GI_TEXT)
113 char *p = strdup(eina_strbuf_string_get(ti->istrdata));
115 elm_selection_set(1, obj, /*ELM_SEL_FORMAT_TEXT*/1, p);
117 else //if (ti->itype == GI_IMAGE)
119 if (!clipdrawer_paste_textonly_get(ad))
121 int len = strlen(ti->ipathdata);
122 char *p = malloc(len + 10);
123 snprintf(p,len+10, "file:///%s", ti->ipathdata);
125 elm_selection_set(/*secondary*/1,obj,/*ELM_SEL_FORMAT_IMAGE*/4,p);
129 DTRACE("ERR: cbhm image paste mode is false\n");
138 DTRACE("ERR: cbhm can't get the selected item\n");
142 elm_gengrid_item_selected_set(sgobj, EINA_FALSE);
144 Evas_Object *popup = elm_popup_add(ad->win_main);
145 elm_popup_timeout_set(popup, 5);
146 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
147 elm_popup_desc_set(popup, "Are you sure delete this?");
148 elm_popup_buttons_add(popup, 2,
149 "Yes", ELM_POPUP_RESPONSE_OK,
150 "No", ELM_POPUP_RESPONSE_CANCEL,
152 evas_object_smart_callback_add(popup, "response", _grid_del_response_cb, sgobj);
153 evas_object_show(popup);
156 Evas_Object* _grid_icon_get(const void *data, Evas_Object *obj, const char *part)
158 griditem_t *ti = (griditem_t *)data;
160 if (!strcmp(part, "elm.swallow.icon"))
162 if (ti->itype == GI_TEXT)
164 Evas_Object *layout = elm_layout_add (obj);
165 elm_layout_theme_set(layout, "gengrid", "widestyle", "horizontal_layout");
166 edje_object_signal_callback_add(elm_layout_edje_get(layout),
167 "mouse,up,1", "*", _grid_item_ly_clicked, data);
168 Evas_Object *rect = evas_object_rectangle_add(evas_object_evas_get(obj));
169 evas_object_resize(rect, GRID_ITEM_W, GRID_ITEM_H);
170 evas_object_color_set(rect, 242, 233, 183, 255);
171 evas_object_show(rect);
172 elm_layout_content_set(layout, "elm.swallow.icon", rect);
174 // FIXME: add string length check
175 Evas_Object *ientry = elm_scrolled_entry_add(obj);
176 evas_object_size_hint_weight_set(ientry, 0, 0);
177 Eina_Strbuf *strent = NULL;
178 char *strdata = eina_strbuf_string_get(ti->istrdata);
179 int i, skipflag, strcnt;
181 strent = eina_strbuf_new();
184 for (i = 0; i < eina_strbuf_length_get(ti->istrdata); i++)
202 eina_strbuf_append_n(strent, strdata, i);
203 // eina_strbuf_append(strent, strdata);
204 eina_strbuf_replace_all(strent, " absize=240x180 ", " absize=52x39 ");
206 eina_strbuf_append(strent, "...");
207 eina_strbuf_prepend(strent, "<font_size=18>");
209 elm_scrolled_entry_entry_set(ientry, eina_strbuf_string_get(strent));
210 elm_scrolled_entry_editable_set(ientry, EINA_FALSE);
211 elm_scrolled_entry_context_menu_disabled_set(ientry, EINA_TRUE);
212 evas_object_show(ientry);
213 elm_layout_content_set(layout, "elm.swallow.inner", ientry);
215 eina_strbuf_free(strent);
219 else// if (ti->itype == GI_IMAGE)
221 Evas_Object *layout = elm_layout_add (obj);
222 elm_layout_theme_set(layout, "gengrid", "widestyle", "horizontal_layout");
223 edje_object_signal_callback_add(elm_layout_edje_get(layout),
224 "mouse,up,1", "*", _grid_item_ly_clicked, data);
227 sicon = evas_object_image_add(evas_object_evas_get(obj));
228 evas_object_image_load_size_set(sicon, GRID_ITEM_SINGLE_W, GRID_ITEM_SINGLE_H);
229 evas_object_image_file_set(sicon, ti->ipathdata, NULL);
230 evas_object_image_fill_set(sicon, 0, 0, GRID_ITEM_SINGLE_W, GRID_ITEM_SINGLE_H);
231 evas_object_resize(sicon, GRID_ITEM_SINGLE_W, GRID_ITEM_SINGLE_H);
232 elm_layout_content_set(layout, "elm.swallow.icon", sicon);
234 struct appdata *ad = g_get_main_appdata();
236 if (!clipdrawer_paste_textonly_get(ad))
238 edje_object_signal_emit(elm_layout_edje_get(layout), "elm,state,hide,delbtn", "elm");
239 Evas_Object *rect = evas_object_rectangle_add(evas_object_evas_get(obj));
240 evas_object_color_set(rect, 0, 0, 0, 200);
241 evas_object_show(rect);
242 elm_layout_content_set(layout, "elm.swallow.cover", rect);
245 ti->ilayout = layout;
249 Evas_Object *icon = elm_icon_add(obj);
250 elm_icon_file_set(icon, ti->ipathdata, NULL);
251 evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
252 evas_object_show(icon);
262 my_ee = ecore_evas_buffer_new(GRID_ITEM_SINGLE_W, GRID_ITEM_SINGLE_H);
263 my_e = ecore_evas_get(my_ee);
265 bgrect = evas_object_rectangle_add(my_e);
266 evas_object_color_set(bgrect, 255, 255, 255, 255);
267 evas_object_resize(bgrect, GRID_ITEM_SINGLE_W, GRID_ITEM_SINGLE_H);
268 evas_object_move(bgrect, 0, 0);
269 evas_object_show(bgrect);
271 #define BORDER_SIZE 1
272 fgimg = evas_object_image_add(my_e);
273 evas_object_image_load_size_set(fgimg, GRID_ITEM_SINGLE_W-BORDER_SIZE*2, GRID_ITEM_SINGLE_H-BORDER_SIZE*2);
274 evas_object_image_file_set(fgimg, ti->ipathdata, NULL);
275 evas_object_image_fill_set(fgimg, 0, 0, GRID_ITEM_SINGLE_W-BORDER_SIZE*2, GRID_ITEM_SINGLE_H-BORDER_SIZE*2);
276 evas_object_image_filled_set(fgimg, 1);
278 evas_object_image_size_get(fgimg, &x, &y);
279 //fprintf(stderr, "## img x = %d, y = %d\n", x, y);
280 evas_object_resize(fgimg, GRID_ITEM_SINGLE_W-BORDER_SIZE*2, GRID_ITEM_SINGLE_H-BORDER_SIZE*2);
281 evas_object_move(fgimg, BORDER_SIZE, BORDER_SIZE);
282 evas_object_show(fgimg);
284 icon = evas_object_image_add(evas_object_evas_get(obj));
286 evas_object_image_data_set(icon, NULL);
287 evas_object_image_size_set(icon, GRID_ITEM_SINGLE_W, GRID_ITEM_SINGLE_H);
288 evas_object_image_fill_set(icon, 0, 0, GRID_ITEM_SINGLE_W, GRID_ITEM_SINGLE_H);
289 evas_object_image_filled_set(icon, EINA_TRUE);
290 evas_object_image_data_copy_set(icon, (int *)ecore_evas_buffer_pixels_get(my_ee));
291 evas_object_image_data_update_add(icon, 0, 0, GRID_ITEM_SINGLE_W, GRID_ITEM_SINGLE_H);
293 evas_object_del(bgrect);
294 evas_object_del(fgimg);
295 ecore_evas_free(my_ee);
304 else if (!strcmp(part, "elm.swallow.end"))
306 ti->delbtn = elm_check_add(obj);
307 elm_object_style_set(ti->delbtn, "extended/itemcheck");
308 //evas_object_propagate_events_set(ti->delbtn, 0);
309 elm_check_state_set(ti->delbtn, tcm);
310 evas_object_smart_callback_add(ti->delbtn, "changed", _grid_item_check_changed, data);
311 evas_object_show(ti->delbtn);
318 static void _grid_longpress(void *data, Evas_Object *obj, void *event_info)
320 struct appdata *ad = data;
323 static void _grid_click_paste(void *data, Evas_Object *obj, void *event_info)
325 struct appdata *ad = data;
326 if (ad->anim_status != STATUS_NONE)
329 Elm_Gengrid_Item *sgobj = NULL;
330 sgobj = elm_gengrid_selected_item_get(ad->hig);
331 griditem_t *ti = NULL;
332 ti = elm_gengrid_item_data_get(sgobj);
335 void _grid_del(const void *data, Evas_Object *obj)
337 griditem_t *ti = (griditem_t *)data;
338 if (ti->itype == GI_TEXT)
339 eina_strbuf_free(ti->istrdata);
341 eina_stringshare_del(ti->ipathdata);
345 char* clipdrawer_get_item_data(void *data, int pos)
347 struct appdata *ad = data;
348 griditem_t *ti = NULL;
349 griditem_t *newgi = NULL;
352 if (pos < 0 || pos > ad->hicount)
355 Elm_Gengrid_Item *item = elm_gengrid_first_item_get(ad->hig);
358 ti = elm_gengrid_item_data_get(item);
363 if (ti->itype == GI_TEXT)
364 return (char*)eina_strbuf_string_get(ti->istrdata);
366 return ti->ipathdata;
369 item = elm_gengrid_item_next_get(item);
375 // FIXME: how to remove calling g_get_main_appdata()?
376 // it's mainly used at 'clipdrawer_image_item'
377 int clipdrawer_add_item(char *idata, int type)
379 struct appdata *ad = g_get_main_appdata();
380 griditem_t *newgi = NULL;
382 newgi = malloc(sizeof(griditem_t));
385 fprintf(stderr, "## add - %d : %s\n", newgi->itype, idata);
388 newgi->istrdata = eina_strbuf_new();
389 eina_strbuf_append(newgi->istrdata, idata);
391 else //if (type == GI_IMAGE)
393 Elm_Gengrid_Item *item = elm_gengrid_first_item_get(ad->hig);
394 griditem_t *ti = NULL;
396 if (!check_regular_file(idata))
398 DTRACE("Error : it isn't normal file = %s\n", idata);
404 ti = elm_gengrid_item_data_get(item);
405 if ((ti->itype == type) && !strcmp(ti->ipathdata, idata))
407 DTRACE("Error : duplicated file path = %s\n", idata);
410 item = elm_gengrid_item_next_get(item);
412 newgi->ipathdata = eina_stringshare_add(idata);
415 if (ad->hicount >= HISTORY_QUEUE_MAX_ITEMS)
418 // FIXME: add routine that is removing its elements
419 elm_gengrid_item_del(elm_gengrid_last_item_get(ad->hig));
423 newgi->item = elm_gengrid_item_prepend(ad->hig, &gic, newgi, NULL, NULL);
429 clipdrawer_ly_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
431 struct appdata *ad = data;
433 if (ad->anim_status != STATUS_NONE)
436 #define EDJE_CLOSE_PART_PREFIX "background/close"
437 if (!strncmp(source, EDJE_CLOSE_PART_PREFIX, strlen(EDJE_CLOSE_PART_PREFIX)))
439 clipdrawer_lower_view(ad);
443 void set_rotation_to_clipdrawer(void *data, int angle)
445 struct appdata *ad = data;
449 if (angle == 180) // reverse
451 wh = (1.0*CLIPDRAWER_HEIGHT/SCREEN_HEIGHT)*ad->root_h;
454 wposx = CLIPDRAWER_POS_X;
456 else if (angle == 90) // right rotate
458 wh = (1.0*CLIPDRAWER_HEIGHT_LANDSCAPE/SCREEN_WIDTH)*ad->root_w;
459 wy = (1.0*CLIPDRAWER_POS_X/SCREEN_WIDTH)*ad->root_w;
461 wposx = CLIPDRAWER_WIDTH-CLIPDRAWER_HEIGHT_LANDSCAPE;
463 else if (angle == -90) // left rotate
465 wh = (1.0*CLIPDRAWER_HEIGHT_LANDSCAPE/SCREEN_WIDTH)*ad->root_w;
466 wy = (1.0*CLIPDRAWER_POS_X/SCREEN_WIDTH)*ad->root_w;
468 wposx = CLIPDRAWER_POS_X;
472 wh = (1.0*CLIPDRAWER_HEIGHT/SCREEN_HEIGHT)*ad->root_h;
473 wy = (1.0*CLIPDRAWER_POS_Y/SCREEN_HEIGHT)*ad->root_h;
475 wposx = CLIPDRAWER_POS_X;
478 evas_object_resize(ad->win_main, wwidth, (int)wh);
479 evas_object_move(ad->win_main, wposx, (int)wy);
480 evas_object_resize(ad->ly_main, wwidth, (int)wh);
481 evas_object_move(ad->ly_main, wposx, (int)wy);
484 int clipdrawer_init(void *data)
486 struct appdata *ad = data;
489 ad->windowshow = EINA_FALSE;
491 ad->pastetextonly = EINA_TRUE;
492 ad->anim_status = STATUS_NONE;
495 elm_theme_extension_add(NULL, APP_EDJ_FILE);
497 set_rotation_to_clipdrawer(ad, get_rotation_degree());
499 edje_object_signal_callback_add(elm_layout_edje_get(ad->ly_main),
500 "mouse,up,1", "*", clipdrawer_ly_clicked, ad);
503 ad->hig = elm_gengrid_add(ad->win_main);
504 elm_layout_content_set(ad->ly_main, "historyitems", ad->hig);
505 elm_gengrid_item_size_set(ad->hig, GRID_ITEM_W+2, GRID_ITEM_H);
506 elm_gengrid_align_set(ad->hig, 0.5, 0.5);
507 elm_gengrid_horizontal_set(ad->hig, EINA_TRUE);
508 elm_gengrid_bounce_set(ad->hig, EINA_TRUE, EINA_FALSE);
509 elm_gengrid_multi_select_set(ad->hig, EINA_FALSE);
510 evas_object_smart_callback_add(ad->hig, "selected", _grid_click_paste, ad);
511 // evas_object_smart_callback_add(ad->hig, "longpressed", _grid_longpress, ad);
512 evas_object_size_hint_weight_set(ad->hig, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
514 elm_gengrid_clear(ad->hig);
516 gic.item_style = "default_grid";
517 gic.func.label_get = NULL;
518 gic.func.icon_get = _grid_icon_get;
519 gic.func.state_get = NULL;
520 gic.func.del = _grid_del;
525 for (i = 0; i < N_IMAGES; i++)
527 clipdrawer_add_item(g_images_path[0], GI_IMAGE);
530 clipdrawer_add_item("clipboard history", GI_TEXT);
532 evas_object_show (ad->hig);
534 // for debugging, calc history pos
536 Evas_Coord x, y, w, h;
537 Evas_Coord vx, vy, vw, vh;
539 edje_object_part_geometry_get(elm_layout_edje_get(ad->ly_main),"imagehistory/list",&x,&y,&w,&h);
540 evas_object_geometry_get (ad->hig, &vx,&vy,&vw,&vh);
541 fprintf(stderr, "## x = %d, y = %d, w = %d, h = %d\n", x, y, w, h);
542 fprintf(stderr, "## vx = %d, vy = %d, vw = %d, vh = %d\n", vx, vy, vw, vh);
545 // if (get_item_counts() != 0)
546 // clipdrawer_update_contents(ad);
551 int clipdrawer_create_view(void *data)
553 struct appdata *ad = data;
558 // at starting, showing app view
559 //clipdrawer_activate_view(ad);
564 Eina_Bool _get_anim_pos(void *data, int *sp, int *ep)
569 struct appdata *ad = data;
570 int angle = get_rotation_degree();
571 int anim_start, anim_end, delta;
573 switch (ad->anim_status)
576 if (angle == 180) // reverse
579 anim_end = (int)(((double)CLIPDRAWER_HEIGHT/SCREEN_HEIGHT)*ad->root_h);
580 anim_end = ad->root_h-anim_end;
581 anim_end = -anim_end;
583 else if (angle == 90) // right rotate
585 anim_end = ad->root_w;
586 anim_start = (int)(((double)CLIPDRAWER_HEIGHT_LANDSCAPE/SCREEN_WIDTH)*ad->root_w);
587 anim_start = ad->root_w-anim_start;
589 else if (angle == -90) // left rotate
592 anim_end = (int)(((double)CLIPDRAWER_HEIGHT_LANDSCAPE/SCREEN_WIDTH)*ad->root_w);
593 anim_end = ad->root_w-anim_end;
594 anim_end = -anim_end;
598 anim_start = (int)((1.0*CLIPDRAWER_HEIGHT/SCREEN_HEIGHT)*ad->root_h);
599 anim_end = ad->root_h;
600 anim_start = anim_end-anim_start;
604 if (angle == 180) // reverse
606 anim_start = (int)(((double)CLIPDRAWER_HEIGHT/SCREEN_HEIGHT)*ad->root_h);
607 anim_start = ad->root_h - anim_start;
608 anim_start = -anim_start;
611 else if (angle == 90) // right rotate
613 anim_start = ad->root_w;
614 anim_end = (int)(((double)CLIPDRAWER_HEIGHT_LANDSCAPE/SCREEN_WIDTH)*ad->root_w);
615 anim_end = anim_start-anim_end;
617 else if (angle == -90) // left rotate
619 anim_start = (int)(((double)CLIPDRAWER_HEIGHT_LANDSCAPE/SCREEN_WIDTH)*ad->root_w);
620 anim_start = ad->root_w-anim_start;
621 anim_start = -anim_start;
626 anim_start = ad->root_h;
627 anim_end = (int)(((double)CLIPDRAWER_HEIGHT/SCREEN_HEIGHT)*ad->root_h);
628 anim_end = anim_start-anim_end;
637 Eina_Bool _do_anim_delta_pos(void *data, int sp, int ep, int ac, int *dp)
642 struct appdata *ad = data;
643 int angle = get_rotation_degree();
646 posprop = 1.0*ac/ANIM_DURATION;
648 switch (ad->anim_status)
651 if (angle == 180) // reverse
653 delta = (int)((sp-ep)*posprop);
654 evas_object_move(ad->win_main, 0, sp-delta);
656 else if (angle == 90) // right rotate
658 delta = (int)((sp-ep)*posprop);
659 evas_object_move(ad->win_main, sp-delta, 0);
661 else if (angle == -90) // left rotate
663 delta = (int)((sp-ep)*posprop);
664 evas_object_move(ad->win_main, sp-delta, 0);
668 delta = (int)((ep-sp)*posprop);
669 evas_object_move(ad->win_main, 0, sp+delta);
673 if (angle == 180) // reverse
675 delta = (int)((ep-sp)*posprop);
676 evas_object_move(ad->win_main, 0, sp+delta);
678 else if (angle == 90) // right rotate
680 delta = (int)((ep-sp)*posprop);
681 evas_object_move(ad->win_main, sp+delta, 0);
683 else if (angle == -90) // left rotate
685 delta = (int)((ep-sp)*posprop);
686 evas_object_move(ad->win_main, sp+delta, 0);
690 delta = (int)((sp-ep)*posprop);
691 evas_object_move(ad->win_main, 0, sp-delta);
701 Eina_Bool anim_pos_calc_cb(void *data)
703 struct appdata *ad = data;
705 static int anim_count = 0;
706 int anim_start, anim_end, delta;
708 _get_anim_pos(ad, &anim_start, &anim_end);
710 if (anim_count > ANIM_DURATION)
713 if (ad->anim_status == HIDE_ANIM)
715 evas_object_hide(ad->win_main);
716 elm_win_lower(ad->win_main);
717 unset_transient_for(ad);
719 ad->anim_status = STATUS_NONE;
720 set_focus_for_app_window(ad->win_main, EINA_FALSE);
724 _do_anim_delta_pos(ad, anim_start, anim_end, anim_count, &delta);
730 void clipdrawer_anim_effect(void *data, anim_status_t atype)
732 struct appdata *ad = data;
734 if (ad->anim_status != STATUS_NONE)
736 DTRACE("ERR: another animation is showing\n");
740 ad->anim_status = atype;
741 ecore_timer_add(ANIM_FLOPS, anim_pos_calc_cb, ad);
744 void clipdrawer_activate_view(void *data)
746 struct appdata *ad = data;
748 set_focus_for_app_window(ad->win_main, EINA_TRUE);
751 set_transient_for(ad);
752 evas_object_show(ad->win_main);
753 elm_win_activate(ad->win_main);
754 // elm_win_raise(ad->win_main);
755 clipdrawer_anim_effect(ad, SHOW_ANIM);
756 ad->windowshow = EINA_TRUE;
760 void clipdrawer_lower_view(void *data)
762 struct appdata *ad = data;
764 if (ad->win_main && ad->windowshow)
766 clipdrawer_anim_effect(ad, HIDE_ANIM);
767 ad->windowshow = EINA_FALSE;
771 void _change_gengrid_paste_textonly_mode(void *data)
773 struct appdata *ad = data;
775 Elm_Gengrid_Item *item;
776 griditem_t *ti = NULL;
778 if (clipdrawer_paste_textonly_get(ad))
779 { // textonly paste mode
780 Elm_Gengrid_Item *item = elm_gengrid_first_item_get(ad->hig);
784 ti = elm_gengrid_item_data_get(item);
785 if ((ti->itype == GI_IMAGE) && (ti->ilayout))
787 edje_object_signal_emit(elm_layout_edje_get(ti->ilayout), "elm,state,hide,delbtn", "elm");
788 Evas_Object *rect = evas_object_rectangle_add(evas_object_evas_get(ad->hig));
789 evas_object_color_set(rect, 0, 0, 0, 200);
790 evas_object_show(rect);
791 elm_layout_content_set(ti->ilayout, "elm.swallow.cover", rect);
793 item = elm_gengrid_item_next_get(item);
797 { // text+image paste mode
798 Elm_Gengrid_Item *item = elm_gengrid_first_item_get(ad->hig);
802 ti = elm_gengrid_item_data_get(item);
803 if ((ti->itype == GI_IMAGE) && (ti->ilayout))
805 edje_object_signal_emit(elm_layout_edje_get(ti->ilayout), "elm,state,show,delbtn", "elm");
806 Evas_Object *rect = elm_layout_content_unset(ti->ilayout, "elm.swallow.cover");
807 evas_object_hide(rect);
808 evas_object_del(rect);
810 item = elm_gengrid_item_next_get(item);
815 void clipdrawer_paste_textonly_set(void *data, Eina_Bool textonly)
817 struct appdata *ad = data;
818 textonly = !!textonly;
819 if (ad->pastetextonly != textonly)
820 ad->pastetextonly = textonly;
821 DTRACE("paste textonly mode = %d\n", textonly);
823 _change_gengrid_paste_textonly_mode(ad);
826 Eina_Bool clipdrawer_paste_textonly_get(void *data)
828 struct appdata *ad = data;
829 return ad->pastetextonly;