#include "elm_priv.h"
Elm_Entry_Extension_data *ext_mod;
+typedef struct _Elm_Entry_Context_Menu_Item Elm_Entry_Context_Menu_Item;
+struct _Elm_Entry_Context_Menu_Item
+{
+ Evas_Object *obj;
+ const char *label;
+ const char *icon_file;
+ const char *icon_group;
+ Elm_Icon_Type icon_type;
+ Evas_Smart_Cb func;
+ void *data;
+};
+
static void
_select(void *data, Evas_Object *obj, void *event_info)
static void
_clipboard_menu(void *data, Evas_Object *obj, void *event_info)
{
- // start for cbhm
- ecore_x_selection_secondary_set(elm_win_xwindow_get(obj), "",1);
- elm_cbhm_helper_init(obj);
- elm_cbhm_send_raw_data("show");
- evas_object_hide(ext_mod->popup);
- // end for cbhm
+ // start for cbhm
+#ifdef HAVE_ELEMENTARY_X
+ ecore_x_selection_secondary_set(elm_win_xwindow_get(obj), "",1);
+#endif
+ ext_mod->cnpinit(data,obj,event_info);
+ elm_cbhm_helper_init(obj);
+ if (ext_mod->cnp_mode != ELM_CNP_MODE_MARKUP)
+ elm_cbhm_send_raw_data("show0");
+ else
+ elm_cbhm_send_raw_data("show1");
+ evas_object_hide(ext_mod->popup);
+ // end for cbhm
}
static void
EAPI void
obj_longpress(Evas_Object *obj)
-{
+{
if(!ext_mod) return;
Evas_Object *top;
Evas_Object *list;
-
+
const Eina_List *l;
const Elm_Entry_Context_Menu_Item *it;
/*update*/
if(top)
ext_mod->popup = elm_popup_add(top);
elm_object_style_set(ext_mod->popup,"menustyle");
- elm_popup_set_mode(ext_mod->popup, ELM_POPUP_TYPE_ALERT);
+ elm_popup_mode_set(ext_mod->popup, ELM_POPUP_TYPE_ALERT);
elm_popup_title_label_set(ext_mod->popup,"CopyPaste");
list = elm_list_add(ext_mod->popup);
elm_object_style_set(list,"popup");
- elm_list_horizontal_mode_set(list, ELM_LIST_COMPRESS);
+ elm_list_mode_set(list, ELM_LIST_COMPRESS);
elm_widget_sub_object_add(obj, ext_mod->popup);
if (!ext_mod->selmode)
- {
+ {
if (!ext_mod->password)
elm_list_item_append(list, "Select", NULL, NULL,_select, obj);
if (1) // need way to detect if someone has a selection
}
// elm_ctxpopup_item_add(wd->ctxpopup, NULL, "Selectall",_select_all, obj );
// start for cbhm
- if (!ext_mod->password)
+ if ((!ext_mod->password) && (ext_mod->editable))
elm_list_item_append(list, "More", NULL, NULL,_clipboard_menu, obj);
// end for cbhm
}
}
else
{
- _cancel(obj,ext_mod->popup,NULL);
+ _cancel(obj,ext_mod->popup,NULL);
elm_list_item_append(list, "Select", NULL, NULL,_select, obj);
if (1) // need way to detect if someone has a selection
{
}
}
// start for cbhm
- elm_list_item_append(list, "More", NULL, NULL,_clipboard_menu, obj);
+ if (ext_mod->editable)
+ elm_list_item_append(list, "More", NULL, NULL,_clipboard_menu, obj);
// end for cbhm
}
}
{
elm_list_go(list);
elm_popup_content_set(ext_mod->popup, list);
- evas_object_show(ext_mod->popup);
+ evas_object_show(ext_mod->popup);
evas_render( evas_object_evas_get( ext_mod->popup ) );
}
}
- ext_mod->longpress_timer = NULL;
}
EAPI void
{
/*update*/
elm_entry_extension_module_data_get(obj,ext_mod);
- if (ext_mod->longpress_timer)
- {
- if (ext_mod->have_selection )
- {
- _cancel(obj,ext_mod->popup,NULL);
- }
- }
}