[src/lib/Elementary.h.in] Corrected some description errors in tickernoti's APIs.
[framework/uifw/elementary.git] / src / modules / ctxpopup_copypasteshareUI / copypaste.c
index 80d8b1f..854857b 100644 (file)
@@ -79,19 +79,21 @@ static void
 _share(void *data, Evas_Object *obj, void *event_info)
 {
        char *str = NULL;
+#ifdef HAVE_ELEMENTARY_X
        Ecore_X_Atom atom;
-
+#endif
        str = elm_entry_markup_to_utf8(elm_entry_selection_get(data));
         if (!str) return;
-
+#ifdef HAVE_ELEMENTARY_X
         atom = ecore_x_atom_get("_TEXT_SHARE_TEST");
         if (atom)
           {
              ecore_x_window_prop_string_set(ecore_x_window_root_first_get(), atom, str);
-             ecore_x_client_message32_send(ecore_x_window_root_first_get(), 
+             ecore_x_client_message32_send(ecore_x_window_root_first_get(),
                                            atom, ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
                                            0, 0, 0, 0, 0);
           }
+#endif
         free(str);
 
        evas_object_hide(obj);
@@ -110,10 +112,12 @@ static void
 _clipboard_menu(void *data, Evas_Object *obj, void *event_info)
 {
        // 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->textonly)
+       if (ext_mod->cnp_mode != ELM_CNP_MODE_MARKUP)
                elm_cbhm_send_raw_data("show0");
        else
                elm_cbhm_send_raw_data("show1");
@@ -167,7 +171,7 @@ obj_unhook(Evas_Object *obj)
 
 EAPI void
 obj_longpress(Evas_Object *obj)
-{      
+{
        if(!ext_mod) return;
        Evas_Object *top;
        const Eina_List *l;
@@ -195,7 +199,7 @@ obj_longpress(Evas_Object *obj)
 
                elm_widget_sub_object_add(obj, ext_mod->popup);
                if (!ext_mod->selmode)
-               {       
+               {
                        if (!ext_mod->password)
                        {
                                if (!elm_entry_is_empty(obj))
@@ -227,7 +231,7 @@ obj_longpress(Evas_Object *obj)
                                                {
                                                        elm_ctxpopup_item_append(ext_mod->popup, "Copy", NULL, _copy, obj );
                                                        if (ext_mod->editable)
-                                                               elm_ctxpopup_item_append(ext_mod->popup, "Cut", NULL, _cut, obj );                                                      
+                                                               elm_ctxpopup_item_append(ext_mod->popup, "Cut", NULL, _cut, obj );
                                                        if (ext_mod->editable)
                                                                elm_ctxpopup_item_append(ext_mod->popup, "Paste", NULL, _paste, obj );
                                                        icon = elm_icon_add(ext_mod->popup);
@@ -237,7 +241,7 @@ obj_longpress(Evas_Object *obj)
                                                }
                                        else
                                                {
-                                                       _cancel(obj,ext_mod->popup,NULL);               
+                                                       _cancel(obj,ext_mod->popup,NULL);
                                                        if (!elm_entry_is_empty(obj))
                                                        {
                                                                elm_ctxpopup_item_append(ext_mod->popup, "Select", NULL, _select, obj );
@@ -268,10 +272,9 @@ obj_longpress(Evas_Object *obj)
                        {
                                elm_object_scroll_freeze_push(ext_mod->popup);
                                _ctxpopup_position(obj);
-                               evas_object_show(ext_mod->popup);                 
+                               evas_object_show(ext_mod->popup);
                        }
                }
-       ext_mod->longpress_timer = NULL;
        }
 
 EAPI void
@@ -283,13 +286,6 @@ obj_mouseup(Evas_Object *obj)
 
 /*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);
-                       }
-     }     
 }