{
Cnp_Selection *sel;
sel = selections + *((int *)data);
- if (sel->active)
+ if (sel->active &&
+ (sel->format >= ELM_SEL_TARGETS) && (sel->format < ELM_SEL_FORMAT_MAX))
return sel->format;
}
return ELM_SEL_FORMAT_NONE;
int i,count;
Ecore_X_Atom *aret;
Cnp_Selection *sel;
+ Elm_Sel_Format seltype;
if (!data_ret) return EINA_FALSE;
if (_get_selection_type(data, size) == ELM_SEL_FORMAT_NONE)
{
- if (data_ret)
- {
- *data_ret = malloc(size * sizeof(char) + 1);
- memcpy(*data_ret, data, size);
- ((char**)(data_ret))[0][size] = 0;
- }
- if (size_ret) *size_ret = size;
- return EINA_TRUE;
+ /* TODO : fallback into precise type */
+ seltype = ELM_SEL_FORMAT_TEXT;
+ }
+ else
+ {
+ sel = selections + *((int *)data);
+ seltype = sel->format;
}
-
- sel = selections + *((int *)data);
for (i = 0, count = 0; i < CNP_N_ATOMS ; i++)
{
- if (sel->format & atoms[i].formats) count++;
+ if (seltype & atoms[i].formats) count++;
}
aret = malloc(sizeof(Ecore_X_Atom) * count);
for (i = 0, count = 0; i < CNP_N_ATOMS; i++)
{
- if (sel->format & atoms[i].formats) aret[count ++] = atoms[i].atom;
+ if (seltype & atoms[i].formats) aret[count ++] = atoms[i].atom;
}
*data_ret = aret;
ELM_SEL_FORMAT_VCARD = 0x08,
/** Raw HTMLish things for widgets that want that stuff (hello webkit!) */
ELM_SEL_FORMAT_HTML = 0x10,
+
+ ELM_SEL_FORMAT_MAX
} Elm_Sel_Format;
struct _Elm_Selection_Data