From 649f4f9e8538960c52e0d39b723a14dba4ef2dc3 Mon Sep 17 00:00:00 2001 From: Myungjae Lee Date: Wed, 29 Sep 2010 01:30:05 +0900 Subject: [PATCH] [textblock] added evas_textblock_cursor_content_get function for edje --- debian/changelog | 9 +++++++++ src/lib/canvas/evas_object_textblock.c | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9645808..d48f103 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +evas (1.0.0.001+svn.51480slp2+build09) unstable; urgency=low + + * [textblock] added evas_textblock_cursor_content_get function for edje + entry + * Git: 165.213.180.234:/git/slp/pkgs/evas + * Tag: evas_1.0.0.001+svn.51480slp2+build09 + + -- Myungjae Lee Wed, 29 Sep 2010 00:54:00 +0900 + evas (1.0.0.001+svn.51480slp2+build08) unstable; urgency=low * repackaging diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index b71bd15..f0596de 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -6030,6 +6030,41 @@ evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_C _evas_textblock_changed(o, cur1->obj); } + +/** + * Return the content of the cursor. + * + * @param cur the cursor + * @return the text in the range + */ +EAPI char * +evas_textblock_cursor_content_get(const Evas_Textblock_Cursor *cur) +{ + const Eina_Unicode *ustr; + Eina_Unicode buf[2]; + char *s; + if (!cur || !cur->node) return NULL; + if (evas_textblock_cursor_format_is_visible_get(cur)) + { + if (evas_textblock_cursor_format_is_visible_get(cur)) + { + const char *tmp; + tmp = evas_textblock_node_format_text_get( + _evas_textblock_node_visible_at_pos_get( + evas_textblock_cursor_format_get(cur))); + return strdup(tmp); + } + } + + ustr = eina_ustrbuf_string_get(cur->node->unicode); + buf[0] = ustr[cur->pos]; + buf[1] = 0; + s = evas_common_encoding_unicode_to_utf8(buf, NULL); + + return s; +} + + /** * Return the text in the range between cur1 and cur2 * -- 2.7.4