From 9d37be35227fcb419e7b52978f8d5a8b1379567f Mon Sep 17 00:00:00 2001 From: Alan Third Date: Thu, 25 Nov 2021 20:58:37 +0000 Subject: [PATCH] Fix selection for old GNUstep and GCC * src/nsselect.m (ns_get_foreign_selection): Remove language features not yet supported by GCC. Be more selective with which pasteboard types we use. * src/nsterm.h: Set up some more #defines for deprecated variables. --- src/nsselect.m | 12 ++++++++---- src/nsterm.h | 9 +++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/nsselect.m b/src/nsselect.m index e999835014d..8b23f6f51ad 100644 --- a/src/nsselect.m +++ b/src/nsselect.m @@ -215,7 +215,7 @@ ns_get_local_selection (Lisp_Object selection_name, static Lisp_Object ns_get_foreign_selection (Lisp_Object symbol, Lisp_Object target) { - NSDictionary *typeLookup; + NSDictionary *typeLookup; id pb; pb = ns_symbol_to_pb (symbol); @@ -229,10 +229,14 @@ ns_get_foreign_selection (Lisp_Object symbol, Lisp_Object target) #else @"text/plain", NSFilenamesPboardType, #endif - @"text/html", NSPasteboardTypeHTML, +#ifdef NS_IMPL_COCOA + /* FIXME: I believe these are actually available in recent + versions of GNUstep. */ @"text/plain", NSPasteboardTypeMultipleTextSelection, - @"application/pdf", NSPasteboardTypePDF, @"image/png", NSPasteboardTypePNG, +#endif + @"text/html", NSPasteboardTypeHTML, + @"application/pdf", NSPasteboardTypePDF, @"application/rtf", NSPasteboardTypeRTF, @"application/rtfd", NSPasteboardTypeRTFD, @"STRING", NSPasteboardTypeString, @@ -272,7 +276,7 @@ ns_get_foreign_selection (Lisp_Object symbol, Lisp_Object target) = [typeLookup allKeysForObject: [NSString stringWithLispString:SYMBOL_NAME (target)]]; else - availableTypes = @[NSPasteboardTypeString]; + availableTypes = [NSArray arrayWithObject:NSPasteboardTypeString]; t = [pb availableTypeFromArray:availableTypes]; diff --git a/src/nsterm.h b/src/nsterm.h index 8175f996644..a32b8fe149c 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -1346,9 +1346,18 @@ enum NSWindowTabbingMode #if !defined (NS_IMPL_COCOA) || !defined (MAC_OS_X_VERSION_10_14) /* Deprecated in macOS 10.14. */ +/* FIXME: Some of these new names, if not all, are actually available + in some recent version of GNUstep. */ #define NSPasteboardTypeString NSStringPboardType #define NSPasteboardTypeTabularText NSTabularTextPboardType #define NSPasteboardTypeURL NSURLPboardType +#define NSPasteboardTypeHTML NSHTMLPboardType +#define NSPasteboardTypeMultipleTextSelection NSMultipleTextSelectionPboardType +#define NSPasteboardTypePDF NSPDFPboardType +#define NSPasteboardTypePNG NSPNGPboardType +#define NSPasteboardTypeRTF NSRTFPboardType +#define NSPasteboardTypeRTFD NSRTFDPboardType +#define NSPasteboardTypeTIFF NSTIFFPboardType #define NSControlStateValueOn NSOnState #define NSControlStateValueOff NSOffState #define NSBezelStyleRounded NSRoundedBezelStyle -- 2.39.5