This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository terminology.
View the commit online.
commit 4a39744ad746cc746becdf61f34df4a9c40780c9
Author: Boris Faure <bill...@gmail.com>
AuthorDate: Mon Aug 21 16:15:08 2023 +0200
termio: wrap selection_get api
---
src/bin/termio.c | 9 +++++++++
src/bin/termio.h | 5 +++++
src/bin/tytest_common.c | 44 ++++++++++++++++++++++++++++++++++++--------
3 files changed, 50 insertions(+), 8 deletions(-)
diff --git a/src/bin/termio.c b/src/bin/termio.c
index 6978bf1..7f076ee 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -1011,6 +1011,15 @@ _lost_selection(void *data, Elm_Sel_Type selection)
}
}
+void termio_selection_buffer_get_cb(Evas_Object *obj,
+ Elm_Sel_Type type,
+ Elm_Sel_Format format,
+ Elm_Drop_Cb cb,
+ void *data)
+{
+ elm_cnp_selection_get(obj, type, format, cb, data);
+}
+
/* Set the @type selection to @text.
* This does not modify the widget itself */
void
diff --git a/src/bin/termio.h b/src/bin/termio.h
index f87c092..9da9a9b 100644
--- a/src/bin/termio.h
+++ b/src/bin/termio.h
@@ -18,6 +18,11 @@ void termio_win_set(Evas_Object *obj, Evas_Object *win);
void termio_theme_set(Evas_Object *obj, Evas_Object *theme);
Eina_Bool termio_selection_exists(const Evas_Object *obj);
void termio_set_selection_text(Evas_Object *obj, Elm_Sel_Type type, const char *text);
+void termio_selection_buffer_get_cb(Evas_Object *obj,
+ Elm_Sel_Type type,
+ Elm_Sel_Format format,
+ Elm_Drop_Cb cb,
+ void *data);
void termio_scroll_top_backlog(Evas_Object *obj);
void termio_scroll_delta(Evas_Object *obj, int delta, int by_page);
void termio_scroll_set(Evas_Object *obj, int scroll);
diff --git a/src/bin/tytest_common.c b/src/bin/tytest_common.c
index 0527b3a..766e12c 100644
--- a/src/bin/tytest_common.c
+++ b/src/bin/tytest_common.c
@@ -360,9 +360,38 @@ termio_bg_get(const Evas_Object *obj EINA_UNUSED)
}
static char *_sel_primary = NULL;
-static char *_sel_secondary = NULL;
static char *_sel_clipboard = NULL;
+void termio_selection_buffer_get_cb(Evas_Object *obj,
+ Elm_Sel_Type type,
+ Elm_Sel_Format format EINA_UNUSED,
+ Elm_Drop_Cb cb,
+ void *data)
+{
+ Elm_Selection_Data ev = {};
+ switch (type)
+ {
+ case ELM_SEL_TYPE_PRIMARY:
+ ev.data = ""
+ if (_sel_primary)
+ ev.len = strlen(_sel_primary) + 1;
+ else
+ ev.len = 0;
+ cb(data, obj, &ev);
+ break;
+ case ELM_SEL_TYPE_CLIPBOARD:
+ ev.data = ""
+ if (_sel_clipboard)
+ ev.len = strlen(_sel_clipboard) + 1;
+ else
+ ev.len = 0;
+ cb(data, obj, &ev);
+ break;
+ default:
+ break;
+ }
+
+}
void
termio_set_selection_text(Evas_Object *obj EINA_UNUSED,
Elm_Sel_Type type, const char *text)
@@ -371,18 +400,17 @@ termio_set_selection_text(Evas_Object *obj EINA_UNUSED,
{
case ELM_SEL_TYPE_PRIMARY:
free(_sel_primary);
- if (text)
+ if (text[0])
_sel_primary = strdup(text);
- break;
- case ELM_SEL_TYPE_SECONDARY:
- free(_sel_secondary);
- if (text)
- _sel_secondary = strdup(text);
+ else
+ _sel_primary = NULL;
break;
case ELM_SEL_TYPE_CLIPBOARD:
free(_sel_clipboard);
- if (text)
+ if (text[0])
_sel_clipboard = strdup(text);
+ else
+ _sel_clipboard = NULL;
break;
default:
break;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.