EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [eo])
EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [efl])
EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [eina])
-EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [evas])
-EFL_INTERNAL_DEPEND_PKG([ECORE_COCOA], [emile])
### Checks for header files
#endif
#include <Eina.h>
-#include <Evas.h>
#import <Cocoa/Cocoa.h>
#import "ecore_cocoa_window.h"
#include "ecore_cocoa_private.h"
}
if (type & ECORE_COCOA_CNP_TYPE_MARKUP)
{
- char *utf8;
-
- utf8 = evas_textblock_text_markup_to_utf8(NULL, (const char *)data);
- str = [[NSString alloc] initWithBytes: utf8
- length: strlen(utf8) // XXX strlen() ?
- encoding: NSUTF8StringEncoding];
- free(utf8);
- if (str)
- [objects addObject: str];
+ WRN("Markup CNP: NOT IMPLEMENTED");
}
+
if (type & ECORE_COCOA_CNP_TYPE_IMAGE)
{
WRN("Image CNP: NOT IMPLEMENTED");
classes = [[NSMutableArray alloc] init];
- if ((type & ECORE_COCOA_CNP_TYPE_STRING) ||
- (type & ECORE_COCOA_CNP_TYPE_MARKUP))
+ if (type & ECORE_COCOA_CNP_TYPE_STRING)
{
string_class = YES;
[classes addObject: [NSString class]];
if ((fmt & EFL_SELECTION_FORMAT_TEXT) ||
(fmt & EFL_SELECTION_FORMAT_VCARD))
type |= ECORE_COCOA_CNP_TYPE_STRING;
- if (fmt & EFL_SELECTION_FORMAT_MARKUP)
- type |= ECORE_COCOA_CNP_TYPE_MARKUP;
if (fmt & EFL_SELECTION_FORMAT_HTML)
type |= ECORE_COCOA_CNP_TYPE_HTML;
if (fmt & EFL_SELECTION_FORMAT_IMAGE)
ddata.format = EFL_SELECTION_FORMAT_NONE;
if (get_type & ECORE_COCOA_CNP_TYPE_STRING)
ddata.format |= EFL_SELECTION_FORMAT_TEXT;
- if (get_type & ECORE_COCOA_CNP_TYPE_MARKUP)
- ddata.format |= EFL_SELECTION_FORMAT_MARKUP;
if (get_type & ECORE_COCOA_CNP_TYPE_IMAGE)
ddata.format |= EFL_SELECTION_FORMAT_IMAGE;
if (get_type & ECORE_COCOA_CNP_TYPE_HTML)
evas_object_event_callback_add(sel->owner, EVAS_CALLBACK_DEL,
_cocoa_sel_obj_del_cb, sel);
ELM_SAFE_FREE(sel->data.mem, free);
- /* TIZEN_ONLY(20180430): fix duplicated string memory issue
- sel->data = eina_slice_dup(data);
- */
- sel->data = _eina_slice_dup_safe(data);
- /* END */
+
+ if (format == EFL_SELECTION_FORMAT_MARKUP)
+ {
+ //FIXME this code assumes that sel->data.mem has a \0 at the end
+ sel->data.mem = evas_textblock_text_markup_to_utf8(NULL, data.mem);
+ sel->data.len = strlen(sel->data.mem);
+ //set the new text
+ format = EFL_SELECTION_FORMAT_TEXT;
+ }
+ else
+ {
+ sel->data = eina_slice_dup(data);
+ }
+
if (sel->data.mem)
{
ecore_type = _sel_format_to_ecore_cocoa_cnp_type(format);