forked from enlightenment/efl
Elm: CNP: Images/Markup split up
So basically you can request markup without images. If you want both request MARKUP | IMAGES. Then when an image comes in you'll get an image as markup. SVN revision: 56076
This commit is contained in:
parent
512553c410
commit
9f48c78ee6
|
@ -220,7 +220,7 @@ static Cnp_Atom atoms[CNP_N_ATOMS] = {
|
||||||
},
|
},
|
||||||
[CNP_ATOM_text_urilist] = {
|
[CNP_ATOM_text_urilist] = {
|
||||||
"text/uri-list",
|
"text/uri-list",
|
||||||
ELM_SEL_FORMAT_IMAGE | ELM_SEL_FORMAT_MARKUP,
|
ELM_SEL_FORMAT_IMAGE,
|
||||||
uri_converter,
|
uri_converter,
|
||||||
NULL,
|
NULL,
|
||||||
notify_handler_uri,
|
notify_handler_uri,
|
||||||
|
@ -959,17 +959,17 @@ text_converter(char *target __UNUSED__, void *data, int size __UNUSED__, void **
|
||||||
sel = selections + *((int *)data);
|
sel = selections + *((int *)data);
|
||||||
if (!sel->active) return EINA_TRUE;
|
if (!sel->active) return EINA_TRUE;
|
||||||
|
|
||||||
if ((sel->format == ELM_SEL_FORMAT_MARKUP) ||
|
if ((sel->format & ELM_SEL_FORMAT_MARKUP) ||
|
||||||
(sel->format == ELM_SEL_FORMAT_HTML))
|
(sel->format & ELM_SEL_FORMAT_HTML))
|
||||||
{
|
{
|
||||||
*data_ret = remove_tags(sel->selbuf, size_ret);
|
*data_ret = remove_tags(sel->selbuf, size_ret);
|
||||||
}
|
}
|
||||||
else if (sel->format == ELM_SEL_FORMAT_TEXT)
|
else if (sel->format & ELM_SEL_FORMAT_TEXT)
|
||||||
{
|
{
|
||||||
*data_ret = strdup(sel->selbuf);
|
*data_ret = strdup(sel->selbuf);
|
||||||
*size_ret = strlen(sel->selbuf);
|
*size_ret = strlen(sel->selbuf);
|
||||||
}
|
}
|
||||||
else if (sel->format == ELM_SEL_FORMAT_IMAGE)
|
else if (sel->format & ELM_SEL_FORMAT_IMAGE)
|
||||||
{
|
{
|
||||||
cnp_debug("Image %s\n", evas_object_type_get(sel->widget));
|
cnp_debug("Image %s\n", evas_object_type_get(sel->widget));
|
||||||
cnp_debug("Elm type: %s\n", elm_object_widget_type_get(sel->widget));
|
cnp_debug("Elm type: %s\n", elm_object_widget_type_get(sel->widget));
|
||||||
|
@ -1360,20 +1360,9 @@ found:
|
||||||
ddata.x = savedtypes.x;
|
ddata.x = savedtypes.x;
|
||||||
ddata.y = savedtypes.y;
|
ddata.y = savedtypes.y;
|
||||||
|
|
||||||
if (dropable->types & ELM_SEL_FORMAT_IMAGE)
|
/* If it's markup that also supports images */
|
||||||
{
|
if ((dropable->types & ELM_SEL_FORMAT_MARKUP) &&
|
||||||
cnp_debug("Doing image insert (%s)\n", savedtypes.pi->file);
|
(dropable->types & ELM_SEL_FORMAT_IMAGE))
|
||||||
ddata.format = ELM_SEL_FORMAT_IMAGE;
|
|
||||||
ddata.data = (char *)savedtypes.pi->file;
|
|
||||||
dropable->dropcb(dropable->cbdata, dropable->obj, &ddata);
|
|
||||||
ecore_x_dnd_send_finished();
|
|
||||||
|
|
||||||
pasteimage_free(savedtypes.pi);
|
|
||||||
savedtypes.pi = NULL;
|
|
||||||
|
|
||||||
return EINA_TRUE;
|
|
||||||
}
|
|
||||||
else if (dropable->types & ELM_SEL_FORMAT_MARKUP)
|
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
ddata.format = ELM_SEL_FORMAT_MARKUP;
|
ddata.format = ELM_SEL_FORMAT_MARKUP;
|
||||||
|
@ -1387,11 +1376,26 @@ found:
|
||||||
cnp_debug("Insert %s\n", (char *)ddata.data);
|
cnp_debug("Insert %s\n", (char *)ddata.data);
|
||||||
dropable->dropcb(dropable->cbdata, dropable->obj, &ddata);
|
dropable->dropcb(dropable->cbdata, dropable->obj, &ddata);
|
||||||
ecore_x_dnd_send_finished();
|
ecore_x_dnd_send_finished();
|
||||||
|
return EINA_TRUE;
|
||||||
|
}
|
||||||
|
else if (dropable->types & ELM_SEL_FORMAT_IMAGE)
|
||||||
|
{
|
||||||
|
cnp_debug("Doing image insert (%s)\n", savedtypes.pi->file);
|
||||||
|
ddata.format = ELM_SEL_FORMAT_IMAGE;
|
||||||
|
ddata.data = (char *)savedtypes.pi->file;
|
||||||
|
dropable->dropcb(dropable->cbdata, dropable->obj, &ddata);
|
||||||
|
ecore_x_dnd_send_finished();
|
||||||
|
|
||||||
|
pasteimage_free(savedtypes.pi);
|
||||||
|
savedtypes.pi = NULL;
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cnp_debug("Umm,, dropped that\n");
|
cnp_debug("Item doesn't support images... passing\n");
|
||||||
|
pasteimage_free(savedtypes.pi);
|
||||||
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (savedtypes.textreq)
|
else if (savedtypes.textreq)
|
||||||
|
|
Loading…
Reference in New Issue