This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository efm2.

View the commit online.

commit fce2d58a2c2399407932f3ed7d764020c2da6616
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
AuthorDate: Tue Sep 26 19:08:01 2023 +0100

    start sending cnp actions back to backend
---
 src/efm/efm.c           | 21 +++++++++++++++++++++
 src/efm/efm_util.c      | 24 ++++++++++++++++++++++++
 src/shared/common/cmd.h |  4 ++++
 3 files changed, 49 insertions(+)

diff --git a/src/efm/efm.c b/src/efm/efm.c
index 7bbe87e..5970858 100644
--- a/src/efm/efm.c
+++ b/src/efm/efm.c
@@ -88,13 +88,27 @@ _cnp_copy_files(Smart_Data *sd)
      }
    if (sd->cnp_cut)
      {
+        Eina_Strbuf *buf = cmd_strbuf_new("cnp-cut");
+
         if (str) printf("XXX: CUT: [%s]\n", str);
         else printf("XXX: CUT: no str\n");
+        if (buf)
+          {
+             _uri_list_cmd_strbuf_append(buf, "path", str);
+             cmd_strbuf_exe_consume(buf, sd->exe_open);
+          }
      }
    else
      {
+        Eina_Strbuf *buf = cmd_strbuf_new("cnp-copy");
+
         if (str) printf("XXX: COPY: [%s]\n", str);
         else printf("XXX: COPY: no str\n");
+        if (buf)
+          {
+             _uri_list_cmd_strbuf_append(buf, "path", str);
+             cmd_strbuf_exe_consume(buf, sd->exe_open);
+          }
      }
    eina_strbuf_free(strbuf);
 }
@@ -115,6 +129,8 @@ _cb_sel_get(void *data,
         tmp = malloc(ev->len + 1);
         if (tmp)
           {
+             Eina_Strbuf *buf = cmd_strbuf_new("cnp-paste");
+
              memcpy(tmp, ev->data, ev->len);
              tmp[ev->len] = 0;
              plist = eina_str_split(tmp, "\n", -1);
@@ -129,6 +145,11 @@ _cb_sel_get(void *data,
                }
              free(*plist);
              free(plist);
+             if (buf)
+               {
+                  _uri_list_cmd_strbuf_append(buf, "path", tmp);
+                  cmd_strbuf_exe_consume(buf, sd->exe_open);
+               }
              free(tmp);
           }
      }
diff --git a/src/efm/efm_util.c b/src/efm/efm_util.c
index 9075e0e..bc736fd 100644
--- a/src/efm/efm_util.c
+++ b/src/efm/efm_util.c
@@ -1509,3 +1509,27 @@ _cb_reblock(void *data)
    sd->reblocked = EINA_TRUE;
    evas_object_smart_changed(sd->o_smart);
 }
+
+static void
+_uri_list_cmd_strbuf_append(Eina_Strbuf *strbuf, const char *key, const char *urilist)
+{
+   char *tmps = strdup(urilist), *se, *s2, *s;
+   size_t len;
+
+   if (!tmps) return;
+   for (s = tmps; *s; s = s2)
+     {
+        se = strchr(s, '\n');
+        if (!se)
+          {
+             len = strlen(s);
+             se = s + len;
+             s2 = NULL;
+          }
+        else s2 = se + 1;
+        *se = '\0';
+        cmd_strbuf_append(strbuf, key, s);
+        if (!s2) break;
+     }
+   free(tmps);
+}
diff --git a/src/shared/common/cmd.h b/src/shared/common/cmd.h
index bafd154..12ade1f 100644
--- a/src/shared/common/cmd.h
+++ b/src/shared/common/cmd.h
@@ -17,6 +17,10 @@
 // list-begin // begin initial listing of dir
 // list-end   // end initial listing of dir 
 // 
+// cnp-cut
+// cnp-copy
+// cnp-paste
+// 
 ////////////////////
 
 

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

Reply via email to