Dear Elementary developers. It's a patch about elc_scrolled_entry cnp mode setting. elm_entry has cnp textonly mode set/get function.
1. Add elc_scrolled_entry to elm_entry's relevant functions. - elm_scrolled_entry_cnp_textonly_{set/get} 2. fix typo error in elm_entry textonly mode function's description. Thank you. ---------------------------------- Hyoyoung CHANG Engineer SAMSUNG ELECTRONICS, Co., Ltd. E-mail: hyoyoung.ch...@samsung.com ----------------------------------
Index: src/lib/elc_scrolled_entry.c =================================================================== --- src/lib/elc_scrolled_entry.c (revision 57289) +++ src/lib/elc_scrolled_entry.c (working copy) @@ -1609,3 +1609,44 @@ if (!wd) return EINA_FALSE; return elm_entry_autosave_get(wd->entry); } + +/** + * Control pasting of text and images for the widget. + * + * Normally the scrolled entry allows both text and images to be pasted. + * By setting textonly to be true, this prevents images from being pasted. + * + * Note this only changes the behaviour of text. + * + * @param obj The scrolled entry object + * @param textonly paste mode - EINA_TRUE is text only, EINA_FALSE is text+image+other. + * + * @ingroup Scrolled_Entry + */ +EAPI void +elm_scrolled_entry_cnp_textonly_set(Evas_Object *obj, Eina_Bool textonly) +{ + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + elm_entry_cnp_textonly_set(wd->entry, textonly); +} + +/** + * Getting elm_scrolled_entry text paste/drop mode. + * + * In textonly mode, only text may be pasted or dropped into the widget. + * + * @param obj The scrolled entry object + * @return If the widget only accepts text from pastes. + * + * @ingroup Scrolled_Entry + */ +EAPI Eina_Bool +elm_scrolled_entry_cnp_textonly_get(Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return elm_entry_cnp_textonly_get(wd->entry); +} Index: src/lib/Elementary.h.in =================================================================== --- src/lib/Elementary.h.in (revision 57289) +++ src/lib/Elementary.h.in (working copy) @@ -2269,6 +2269,8 @@ EAPI void elm_scrolled_entry_file_save(Evas_Object *obj) EINA_ARG_NONNULL(1); EAPI void elm_scrolled_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave) EINA_ARG_NONNULL(1); EAPI Eina_Bool elm_scrolled_entry_autosave_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); + EAPI void elm_scrolled_entry_cnp_textonly_set(Evas_Object *obj, Eina_Bool textonly) EINA_ARG_NONNULL(1); + EAPI Eina_Bool elm_scrolled_entry_cnp_textonly_get(Evas_Object *obj) EINA_ARG_NONNULL(1); /* conformant */ EAPI Evas_Object *elm_conformant_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
Index: src/lib/elm_entry.c =================================================================== --- src/lib/elm_entry.c (revision 57289) +++ src/lib/elm_entry.c (working copy) @@ -2839,7 +2839,7 @@ * Note this only changes the behaviour of text. * * @param obj The entry object - * @param pmode paste mode - 0 is text only, 1 is text+image+other. + * @param textonly paste mode - EINA_TRUE is text only, EINA_FALSE is text+image+other. * * @ingroup Entry */
------------------------------------------------------------------------------ Free Software Download: Index, Search & Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel