From 248fb9b2d99b8b6f211b7dd72dd2f6840d2e9fd7 Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Thu, 4 Oct 2012 23:18:18 +0000 Subject: [PATCH] ecore-x: expose ecore_x_selection_converter_text Needed to convert COMPOUND_TEXT SVN revision: 77477 --- legacy/ecore/ChangeLog | 4 +++ legacy/ecore/NEWS | 1 + legacy/ecore/src/lib/ecore_x/Ecore_X.h | 1 + .../src/lib/ecore_x/xcb/ecore_xcb_selection.c | 31 +++++++------------ .../src/lib/ecore_x/xlib/ecore_x_selection.c | 31 +++++++------------ 5 files changed, 30 insertions(+), 38 deletions(-) diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog index 0277282c79..c47de4f123 100644 --- a/legacy/ecore/ChangeLog +++ b/legacy/ecore/ChangeLog @@ -981,3 +981,7 @@ 2012-10-04 Cedric Bail * Add ecore_x_input_raw_select and ECORE_X_RAW_*. + +2012-10-04 Sebastian Dransfeld + + * Expose ecore_x_selection_converter_text diff --git a/legacy/ecore/NEWS b/legacy/ecore/NEWS index 34b08b0a78..9693193ad4 100644 --- a/legacy/ecore/NEWS +++ b/legacy/ecore/NEWS @@ -10,6 +10,7 @@ Additions: - ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_UP. - ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_DOWN. - ecore_x_input_raw_select. + - +ecore_x_selection_converter_text. - ECORE_X_RAW_MOTION, ECORE_X_RAW_BUTTON_PRESS and ECORE_X_RAW_BUTTON_RELEASE. * ecore_imf: - ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SIGNIN. diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h index b3cb89513a..b3fc0fabab 100644 --- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h +++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h @@ -1308,6 +1308,7 @@ EAPI void ecore_x_selection_parser_add(const char *target, EAPI void ecore_x_selection_parser_del(const char *target); EAPI void ecore_x_selection_owner_set(Ecore_X_Window win, Ecore_X_Atom atom, Ecore_X_Time tm); EAPI Ecore_X_Window ecore_x_selection_owner_get(Ecore_X_Atom atom); +EAPI Eina_Bool ecore_x_selection_converter_text(char *target, void *data, int size, void **data_ret, int *size_ret, Ecore_X_Atom *targprop, int *s); /** @since 1.8 */ EAPI void ecore_x_dnd_aware_set(Ecore_X_Window win, Eina_Bool on); EAPI int ecore_x_dnd_version_get(Ecore_X_Window win); diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_selection.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_selection.c index afb1b8c9a7..2fe148ba5e 100644 --- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_selection.c +++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_selection.c @@ -4,13 +4,6 @@ #define ECORE_XCB_SELECTION_DATA(x) ((Ecore_X_Selection_Data *)(x)) /* local function prototypes */ -static Eina_Bool _ecore_xcb_selection_converter_text(char *target, - void *data, - int size, - void **data_ret, - int *size_ret, - Ecore_X_Atom *type, - int *size_type); static void *_ecore_xcb_selection_parser_text(const char *target __UNUSED__, void *data, int size, @@ -53,13 +46,13 @@ _ecore_xcb_selection_init(void) /* init converters */ ecore_x_selection_converter_atom_add(ECORE_X_ATOM_TEXT, - _ecore_xcb_selection_converter_text); + ecore_x_selection_converter_text); ecore_x_selection_converter_atom_add(ECORE_X_ATOM_UTF8_STRING, - _ecore_xcb_selection_converter_text); + ecore_x_selection_converter_text); ecore_x_selection_converter_atom_add(ECORE_X_ATOM_COMPOUND_TEXT, - _ecore_xcb_selection_converter_text); + ecore_x_selection_converter_text); ecore_x_selection_converter_atom_add(ECORE_X_ATOM_STRING, - _ecore_xcb_selection_converter_text); + ecore_x_selection_converter_text); /* init parsers */ ecore_x_selection_parser_add("text/plain", @@ -672,14 +665,14 @@ _ecore_xcb_selection_request(Ecore_X_Window win, XCB_CURRENT_TIME); } -static Eina_Bool -_ecore_xcb_selection_converter_text(char *target, - void *data, - int size, - void **data_ret, - int *size_ret, - Ecore_X_Atom *type __UNUSED__, - int *size_type __UNUSED__) +EAPI Eina_Bool +ecore_x_selection_converter_text(char *target, + void *data, + int size, + void **data_ret, + int *size_ret, + Ecore_X_Atom *type __UNUSED__, + int *size_type __UNUSED__) { Ecore_Xcb_Encoding_Style style; Ecore_Xcb_Textproperty ret; diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c index fa177c3dd2..e94d5a3a14 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c +++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_selection.c @@ -15,13 +15,6 @@ static Ecore_X_Selection_Intern selections[4]; static Ecore_X_Selection_Converter *converters = NULL; static Ecore_X_Selection_Parser *parsers = NULL; -static Eina_Bool _ecore_x_selection_converter_text(char *target, - void *data, - int size, - void **data_ret, - int *size_ret, - Ecore_X_Atom *tprop, - int *); static int _ecore_x_selection_data_default_free(void *data); static void *_ecore_x_selection_parser_files(const char *target, void *data, @@ -49,15 +42,15 @@ _ecore_x_selection_data_init(void) /* Initialize converters */ ecore_x_selection_converter_atom_add(ECORE_X_ATOM_TEXT, - _ecore_x_selection_converter_text); + ecore_x_selection_converter_text); #ifdef X_HAVE_UTF8_STRING ecore_x_selection_converter_atom_add(ECORE_X_ATOM_UTF8_STRING, - _ecore_x_selection_converter_text); + ecore_x_selection_converter_text); #endif /* ifdef X_HAVE_UTF8_STRING */ ecore_x_selection_converter_atom_add(ECORE_X_ATOM_COMPOUND_TEXT, - _ecore_x_selection_converter_text); + ecore_x_selection_converter_text); ecore_x_selection_converter_atom_add(ECORE_X_ATOM_STRING, - _ecore_x_selection_converter_text); + ecore_x_selection_converter_text); /* Initialize parsers */ ecore_x_selection_parser_add("text/plain", @@ -582,14 +575,14 @@ ecore_x_selection_convert(Ecore_X_Atom selection, /* TODO: We need to work out a mechanism for automatic conversion to any requested * locale using Ecore_Txt functions */ /* Converter for standard non-utf8 text targets */ -static Eina_Bool -_ecore_x_selection_converter_text(char *target, - void *data, - int size, - void **data_ret, - int *size_ret, - Ecore_X_Atom *targprop __UNUSED__, - int *s __UNUSED__) +EAPI Eina_Bool +ecore_x_selection_converter_text(char *target, + void *data, + int size, + void **data_ret, + int *size_ret, + Ecore_X_Atom *targprop __UNUSED__, + int *s __UNUSED__) { XTextProperty text_prop; char *mystr;