summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-04-14 11:29:32 -0400
committerMike Blumenkrantz <zmike@samsung.com>2020-04-14 11:29:32 -0400
commit7288e98b9ea0b94285f1adbb3711ed050757e29b (patch)
treec1ce8784fd8ef007db9a96bd6028af6492d0c481
parent1fb7facaa5c979e3544e469e71cf1f6b6c3ea037 (diff)
ecore_evas_x: allow parsing of links form the link list
Summary: this is needed in order to return the data the same way the legacy impl did. This however has the annoying sideeffect that ecore_evas_x now depends on efreet, and we had to change the build order. Depends on D11696 Reviewers: zmike, stefan_schmidt, raster Reviewed By: zmike Subscribers: devilhorns, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11697
-rw-r--r--meson.build2
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c37
-rw-r--r--src/modules/ecore_evas/engines/x/meson.build2
3 files changed, 36 insertions, 5 deletions
diff --git a/meson.build b/meson.build
index 0250512057..23c515c379 100644
--- a/meson.build
+++ b/meson.build
@@ -317,11 +317,11 @@ subprojects = [
317['ecore_drm2' ,['drm'] , false, true, false, false, false, false, ['ecore'], ['libdrm']], 317['ecore_drm2' ,['drm'] , false, true, false, false, false, false, ['ecore'], ['libdrm']],
318['ecore_cocoa' ,['cocoa'] , false, true, false, false, false, false, ['eina'], []], 318['ecore_cocoa' ,['cocoa'] , false, true, false, false, false, false, ['eina'], []],
319['evas' ,[] , true, true, false, false, true, true, ['eina', 'efl', 'eo'], ['vg_common', 'libunibreak']], 319['evas' ,[] , true, true, false, false, true, true, ['eina', 'efl', 'eo'], ['vg_common', 'libunibreak']],
320['efreet' ,[] , false, true, false, false, true, false, ['eina', 'efl', 'eo'], []],
320['ecore_input_evas' ,[] , false, true, false, false, false, false, ['eina', 'evas'], []], 321['ecore_input_evas' ,[] , false, true, false, false, false, false, ['eina', 'evas'], []],
321['ecore_evas' ,[] , true, true, true, false, false, false, ['evas', 'ector'], []], 322['ecore_evas' ,[] , true, true, true, false, false, false, ['evas', 'ector'], []],
322['ecore_imf' ,[] , true, true, false, false, false, false, ['eina'], []], 323['ecore_imf' ,[] , true, true, false, false, false, false, ['eina'], []],
323['embryo' ,[] , false, true, true, false, false, false, ['eina', 'efl', 'eo'], []], 324['embryo' ,[] , false, true, true, false, false, false, ['eina', 'efl', 'eo'], []],
324['efreet' ,[] , false, true, false, false, true, false, ['eina', 'efl', 'eo'], []],
325['eio' ,[] , false, true, false, false, true, true, ['eina', 'eet'], []], 325['eio' ,[] , false, true, false, false, true, true, ['eina', 'eet'], []],
326['efreet' ,[] , false, false, true, false, false, false, ['eina', 'efl', 'eo'], []], 326['efreet' ,[] , false, false, true, false, false, false, ['eina', 'efl', 'eo'], []],
327['ecore_imf_evas' ,[] , false, true, false, false, false, false, ['eina', 'efl', 'eo'], []], 327['ecore_imf_evas' ,[] , false, true, false, false, false, false, ['eina', 'efl', 'eo'], []],
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 68f437c4a2..eb545a256a 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -13,6 +13,7 @@
13 13
14#include <Ecore_X.h> 14#include <Ecore_X.h>
15#include <Ecore_X_Atoms.h> 15#include <Ecore_X_Atoms.h>
16#include <Efreet.h>
16 17
17#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11 18#ifdef BUILD_ECORE_EVAS_SOFTWARE_X11
18# include <Evas_Engine_Software_X11.h> 19# include <Evas_Engine_Software_X11.h>
@@ -3858,17 +3859,45 @@ _create_deliveriy_content(unsigned long int size, const void *mem, const char *m
3858static void 3859static void
3859_deliver_content(Ecore_Evas *ee, Ecore_Evas_Engine_Data_X11 *edata, Ecore_Evas_Selection_Buffer selection, Ecore_X_Event_Selection_Notify *ev) 3860_deliver_content(Ecore_Evas *ee, Ecore_Evas_Engine_Data_X11 *edata, Ecore_Evas_Selection_Buffer selection, Ecore_X_Event_Selection_Notify *ev)
3860{ 3861{
3861 Ecore_X_Selection_Data *x11_data = ev->data;
3862 Eina_Content *result = NULL; 3862 Eina_Content *result = NULL;
3863 Eina_Stringshare *mime_type = _decrypt_type(edata->selection_data[selection].requested_type); 3863 Eina_Stringshare *mime_type = _decrypt_type(edata->selection_data[selection].requested_type);
3864 3864
3865 if (!x11_data->data) 3865 if (!ev->data)
3866 { 3866 {
3867 ERR("delivering NULL content"); 3867 ERR("delivering NULL content");
3868 return; 3868 return;
3869 } 3869 }
3870 if (eina_str_has_prefix(mime_type,"text")) 3870
3871 if (eina_streq(mime_type, "text/uri-list"))
3872 {
3873 Ecore_X_Selection_Data_Files *files = ev->data;
3874 Efreet_Uri *uri;
3875 Eina_Strbuf *strbuf;
3876 int i;
3877
3878 strbuf = eina_strbuf_new();
3879
3880 for (i = 0; i < files->num_files ; i++)
3881 {
3882 uri = efreet_uri_decode(files->files[i]);
3883 if (uri)
3884 {
3885 eina_strbuf_append(strbuf, uri->path);
3886 efreet_uri_free(uri);
3887 }
3888 else
3889 {
3890 eina_strbuf_append(strbuf, files->files[i]);
3891 }
3892 if (i < (files->num_files - 1))
3893 eina_strbuf_append(strbuf, "\n");
3894 }
3895 result = _create_deliveriy_content(eina_strbuf_length_get(strbuf) + 1, eina_strbuf_string_get(strbuf), mime_type);
3896 eina_strbuf_free(strbuf);
3897 }
3898 else if (eina_str_has_prefix(mime_type,"text"))
3871 { 3899 {
3900 Ecore_X_Selection_Data *x11_data = ev->data;
3872 //ensure that we always have a \0 at the end, there is no assertion that \0 is included here. 3901 //ensure that we always have a \0 at the end, there is no assertion that \0 is included here.
3873 void *null_terminated = eina_memdup(x11_data->data, x11_data->length, EINA_TRUE); 3902 void *null_terminated = eina_memdup(x11_data->data, x11_data->length, EINA_TRUE);
3874 3903
@@ -3877,6 +3906,7 @@ _deliver_content(Ecore_Evas *ee, Ecore_Evas_Engine_Data_X11 *edata, Ecore_Evas_S
3877 } 3906 }
3878 else if (eina_str_has_prefix(mime_type,"image")) 3907 else if (eina_str_has_prefix(mime_type,"image"))
3879 { 3908 {
3909 Ecore_X_Selection_Data *x11_data = ev->data;
3880 Eina_Content *tmp_container = eina_content_new((Eina_Slice){.len = x11_data->length, .mem = x11_data->data}, mime_type); 3910 Eina_Content *tmp_container = eina_content_new((Eina_Slice){.len = x11_data->length, .mem = x11_data->data}, mime_type);
3881 const char *file = eina_content_as_file(tmp_container); 3911 const char *file = eina_content_as_file(tmp_container);
3882 3912
@@ -3885,6 +3915,7 @@ _deliver_content(Ecore_Evas *ee, Ecore_Evas_Engine_Data_X11 *edata, Ecore_Evas_S
3885 } 3915 }
3886 else 3916 else
3887 { 3917 {
3918 Ecore_X_Selection_Data *x11_data = ev->data;
3888 result = _create_deliveriy_content(x11_data->length, x11_data->data, mime_type); 3919 result = _create_deliveriy_content(x11_data->length, x11_data->data, mime_type);
3889 } 3920 }
3890 EINA_SAFETY_ON_NULL_RETURN(result); 3921 EINA_SAFETY_ON_NULL_RETURN(result);
diff --git a/src/modules/ecore_evas/engines/x/meson.build b/src/modules/ecore_evas/engines/x/meson.build
index 582a782115..1108f9c755 100644
--- a/src/modules/ecore_evas/engines/x/meson.build
+++ b/src/modules/ecore_evas/engines/x/meson.build
@@ -14,7 +14,7 @@ endif
14 14
15shared_module(mod_full_name, engine_src, 15shared_module(mod_full_name, engine_src,
16 include_directories : config_dir + [engine_include_dir], 16 include_directories : config_dir + [engine_include_dir],
17 dependencies : [eina, ecore_evas, ecore_input_evas] + engine_deps, 17 dependencies : [eina, ecore_evas, ecore_input_evas, efreet] + engine_deps,
18 install : true, 18 install : true,
19 install_dir : mod_install_dir, 19 install_dir : mod_install_dir,
20 name_suffix : sys_mod_extension 20 name_suffix : sys_mod_extension