Alexandre Julliard : winex11: Add clipboard support for the polymorphic TEXT format.

Alexandre Julliard julliard at winehq.org
Wed Sep 28 10:34:00 CDT 2016


Module: wine
Branch: master
Commit: f59c076d13fe15d837e6a830f9f563624bc56a2a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f59c076d13fe15d837e6a830f9f563624bc56a2a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Sep 28 11:38:23 2016 +0900

winex11: Add clipboard support for the polymorphic TEXT format.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/clipboard.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c
index 314b916..9c22f85 100644
--- a/dlls/winex11.drv/clipboard.c
+++ b/dlls/winex11.drv/clipboard.c
@@ -115,12 +115,14 @@ static HANDLE import_image_bmp( Atom type, const void *data, size_t size );
 static HANDLE import_string( Atom type, const void *data, size_t size );
 static HANDLE import_utf8_string( Atom type, const void *data, size_t size );
 static HANDLE import_compound_text( Atom type, const void *data, size_t size );
+static HANDLE import_text( Atom type, const void *data, size_t size );
 static HANDLE import_text_uri_list( Atom type, const void *data, size_t size );
 static HANDLE import_targets( Atom type, const void *data, size_t size );
 
 static BOOL export_data( Display *display, Window win, Atom prop, Atom target, HANDLE handle );
 static BOOL export_string( Display *display, Window win, Atom prop, Atom target, HANDLE handle );
 static BOOL export_utf8_string( Display *display, Window win, Atom prop, Atom target, HANDLE handle );
+static BOOL export_text( Display *display, Window win, Atom prop, Atom target, HANDLE handle );
 static BOOL export_compound_text( Display *display, Window win, Atom prop, Atom target, HANDLE handle );
 static BOOL export_pixmap( Display *display, Window win, Atom prop, Atom target, HANDLE handle );
 static BOOL export_image_bmp( Display *display, Window win, Atom prop, Atom target, HANDLE handle );
@@ -154,6 +156,7 @@ static const struct
     { 0, CF_UNICODETEXT,     XATOM_COMPOUND_TEXT,       import_compound_text, export_compound_text },
     { 0, CF_UNICODETEXT,     XA_STRING,                 import_string,        export_string },
     { 0, CF_UNICODETEXT,     XATOM_text_plain,          import_string,        export_string },
+    { 0, CF_UNICODETEXT,     XATOM_TEXT,                import_text,          export_text },
     { 0, CF_SYLK,            XATOM_WCF_SYLK,            import_data,          export_data },
     { 0, CF_DIF,             XATOM_WCF_DIF,             import_data,          export_data },
     { 0, CF_TIFF,            XATOM_WCF_TIFF,            import_data,          export_data },
@@ -715,6 +718,21 @@ static HANDLE import_compound_text( Atom type, const void *data, size_t size )
 
 
 /**************************************************************************
+ *		import_text
+ *
+ * Import XA_TEXT, converting the string to CF_UNICODETEXT.
+ */
+static HANDLE import_text( Atom type, const void *data, size_t size )
+{
+    if (type == XA_STRING) return import_string( type, data, size );
+    if (type == x11drv_atom(UTF8_STRING)) return import_utf8_string( type, data, size );
+    if (type == x11drv_atom(COMPOUND_TEXT)) return import_compound_text( type, data, size );
+    FIXME( "unsupported TEXT type %s\n", debugstr_xatom( type ));
+    return 0;
+}
+
+
+/**************************************************************************
  *		import_pixmap
  *
  *  Import XA_PIXMAP, converting the image to CF_DIB.
@@ -1112,6 +1130,17 @@ static BOOL export_utf8_string( Display *display, Window win, Atom prop, Atom ta
 
 
 /**************************************************************************
+ *		export_text
+ *
+ *  Export CF_UNICODE to the polymorphic TEXT type, using UTF8.
+ */
+static BOOL export_text( Display *display, Window win, Atom prop, Atom target, HANDLE handle )
+{
+    return export_utf8_string( display, win, prop, x11drv_atom(UTF8_STRING), handle );
+}
+
+
+/**************************************************************************
  *		export_compound_text
  *
  *  Export CF_UNICODE to COMPOUND_TEXT




More information about the wine-cvs mailing list