[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 9d37be3: Fix selection for old GNUstep and GCC
From: |
Alan Third |
Subject: |
master 9d37be3: Fix selection for old GNUstep and GCC |
Date: |
Thu, 25 Nov 2021 16:05:53 -0500 (EST) |
branch: master
commit 9d37be35227fcb419e7b52978f8d5a8b1379567f
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>
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 e999835..8b23f6f 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<NSString *, NSString *> *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 8175f99..a32b8fe 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 9d37be3: Fix selection for old GNUstep and GCC,
Alan Third <=