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 9f96788e0afb2297b4520149554a0f09772d8684
Author: Boris Faure <bill...@gmail.com>
AuthorDate: Sun Aug 20 13:10:20 2023 +0200

    termio: add external API to set selection
---
 src/bin/termio.c | 22 +++++++++++++++-------
 src/bin/termio.h |  2 +-
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/src/bin/termio.c b/src/bin/termio.c
index 5da5f40..5ff625e 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -1011,11 +1011,10 @@ _lost_selection(void *data, Elm_Sel_Type selection)
      }
 }
 
-
 /* Set the @type selection to @text.
  * This does not modify the widget itself */
 void
-termio_set_selection_text(Termio *sd, Elm_Sel_Type type, const char *text)
+_termio_set_selection_text(Termio *sd, Elm_Sel_Type type, const char *text)
 {
    EINA_SAFETY_ON_NULL_RETURN(sd);
 
@@ -1037,6 +1036,15 @@ termio_set_selection_text(Termio *sd, Elm_Sel_Type type, const char *text)
    sd->sel_str = eina_stringshare_add(text);
 }
 
+void
+termio_set_selection_text(Evas_Object *obj, Elm_Sel_Type type, const char *text)
+{
+   Termio *sd = termio_get_from_obj(obj);
+
+   EINA_SAFETY_ON_NULL_RETURN(sd);
+   _termio_set_selection_text(sd, type, text);
+}
+
 
 Eina_Bool
 termio_take_selection(Evas_Object *obj, Elm_Sel_Type type)
@@ -1051,7 +1059,7 @@ termio_take_selection(Evas_Object *obj, Elm_Sel_Type type)
    if (s)
      {
         if ((sd->win) && (len > 0))
-          termio_set_selection_text(sd, type, s);
+          _termio_set_selection_text(sd, type, s);
         eina_stringshare_del(s);
         return EINA_TRUE;
      }
@@ -1073,7 +1081,7 @@ _cb_ctxp_link_content_copy(void *data,
 
         if (!hl->url)
           return;
-        termio_set_selection_text(sd, ELM_SEL_TYPE_CLIPBOARD, hl->url);
+        _termio_set_selection_text(sd, ELM_SEL_TYPE_CLIPBOARD, hl->url);
      }
    else
      {
@@ -1085,7 +1093,7 @@ _cb_ctxp_link_content_copy(void *data,
                              sd->link.x2, sd->link.y2,
                              &sb, EINA_FALSE);
         raw_link = ty_sb_steal_buf(&sb);
-        termio_set_selection_text(sd, ELM_SEL_TYPE_CLIPBOARD, raw_link);
+        _termio_set_selection_text(sd, ELM_SEL_TYPE_CLIPBOARD, raw_link);
         free(raw_link);
      }
 
@@ -1102,7 +1110,7 @@ _cb_ctxp_link_copy(void *data,
    Termio *sd = evas_object_smart_data_get(term);
    EINA_SAFETY_ON_NULL_RETURN(sd);
    EINA_SAFETY_ON_NULL_RETURN(sd->link.string);
-   termio_set_selection_text(sd, ELM_SEL_TYPE_CLIPBOARD, sd->link.string);
+   _termio_set_selection_text(sd, ELM_SEL_TYPE_CLIPBOARD, sd->link.string);
 
    sd->ctxpopup = NULL;
    evas_object_del(obj);
@@ -1260,7 +1268,7 @@ _cb_ctxp_color_copy(void *data,
    txt = _color_to_txt(sd);
    if (!txt) return;
 
-   termio_set_selection_text(sd, ELM_SEL_TYPE_CLIPBOARD, txt);
+   _termio_set_selection_text(sd, ELM_SEL_TYPE_CLIPBOARD, txt);
 
    eina_stringshare_del(txt);
    sd->ctxpopup = NULL;
diff --git a/src/bin/termio.h b/src/bin/termio.h
index 4b58345..f87c092 100644
--- a/src/bin/termio.h
+++ b/src/bin/termio.h
@@ -17,7 +17,7 @@ Termio *termio_get_from_obj(Evas_Object *obj);
 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(Termio *sd, Elm_Sel_Type type, const char *text);
+void termio_set_selection_text(Evas_Object *obj, Elm_Sel_Type type, const char *text);
 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);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to