if (EQ (sym, QCLIPBOARD)) return NSPasteboardNameGeneral;
if (EQ (sym, QPRIMARY)) return NXPrimaryPboard;
if (EQ (sym, QSECONDARY)) return NXSecondaryPboard;
- if (EQ (sym, QTEXT)) return NSStringPboardType;
+ if (EQ (sym, QTEXT)) return NSPasteboardTypeString;
return [NSString stringWithUTF8String: SSDATA (SYMBOL_NAME (sym))];
}
return QPRIMARY;
if ([t isEqualToString: NXSecondaryPboard])
return QSECONDARY;
- if ([t isEqualToString: NSStringPboardType])
+ if ([t isEqualToString: NSPasteboardTypeString])
return QTEXT;
if ([t isEqualToString: NSFilenamesPboardType])
return QFILE_NAME;
- if ([t isEqualToString: NSTabularTextPboardType])
+ if ([t isEqualToString: NSPasteboardTypeTabularText])
return QTEXT;
return intern ([t UTF8String]);
}
else
{
// Used for ns-own-selection-internal.
- eassert (gtype == NSStringPboardType);
+ eassert (gtype == NSPasteboardTypeString);
[pb setString: nsStr forType: gtype];
}
[nsStr release];
}
/* We only support copy of text. */
- type = NSStringPboardType;
+ type = NSPasteboardTypeString;
target_symbol = ns_string_to_symbol (type);
if (STRINGP (value))
{
[NSNumber numberWithLong:0], NSPasteboardNameGeneral,
[NSNumber numberWithLong:0], NXPrimaryPboard,
[NSNumber numberWithLong:0], NXSecondaryPboard,
- [NSNumber numberWithLong:0], NSStringPboardType,
+ [NSNumber numberWithLong:0], NSPasteboardTypeString,
[NSNumber numberWithLong:0], NSFilenamesPboardType,
- [NSNumber numberWithLong:0], NSTabularTextPboardType,
+ [NSNumber numberWithLong:0], NSPasteboardTypeTabularText,
nil] retain];
}
- (NSColor *)colorUsingDefaultColorSpace
{
- /* FIXMES: We're checking for colorWithSRGBRed here so this will
- only work in the same place as in the method above. It should
- really be a check whether we're on macOS 10.7 or above. */
+ /* FIXME: We're checking for colorWithSRGBRed here so this will only
+ work in the same place as in the method above. It should really
+ be a check whether we're on macOS 10.7 or above. */
#if defined (NS_IMPL_COCOA) \
&& MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
- if (ns_use_srgb_colorspace
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
- && [NSColor respondsToSelector:
- @selector(colorWithSRGBRed:green:blue:alpha:)]
+ if ([NSColor respondsToSelector:
+ @selector(colorWithSRGBRed:green:blue:alpha:)])
#endif
- )
- return [self colorUsingColorSpace: [NSColorSpace sRGBColorSpace]];
+ {
+ if (ns_use_srgb_colorspace)
+ return [self colorUsingColorSpace: [NSColorSpace sRGBColorSpace]];
+ else
+ return [self colorUsingColorSpace: [NSColorSpace deviceRGBColorSpace]];
+ }
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
+ else
#endif
+#endif /* NS_IMPL_COCOA && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 */
+#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 1070
return [self colorUsingColorSpaceName: NSCalibratedRGBColorSpace];
+#endif
}
@end
static BOOL ns_fake_keydown = NO;
#ifdef NS_IMPL_COCOA
static BOOL ns_menu_bar_is_hidden = NO;
-
-/* The number of times NSDisableScreenUpdates has been called. */
-static int disable_screen_updates_count = 0;
#endif
/* static int debug_lock = 0; */
}
-#ifdef NS_IMPL_COCOA
-/* Disabling screen updates can be used to make several actions appear
- "atomic" to the end user. It seems some actions can still update
- the display, though.
-
- When we re-enable screen updates the number of calls to
- NSEnableScreenUpdates should match the number to
- NSDisableScreenUpdates.
-
- We use these functions to prevent the user seeing a blank frame
- after it has been resized. ns_set_window_size disables updates and
- when redisplay completes unwind_redisplay enables them again
- (bug#30699). */
-
-static void
-ns_disable_screen_updates (void)
-{
- NSDisableScreenUpdates ();
- disable_screen_updates_count++;
-}
-
-void
-ns_enable_screen_updates (void)
-/* Re-enable screen updates. Called from unwind_redisplay. */
-{
- while (disable_screen_updates_count > 0)
- {
- NSEnableScreenUpdates ();
- disable_screen_updates_count--;
- }
-}
-#endif
-
-
static BOOL
ns_menu_bar_should_be_hidden (void)
/* True, if the menu bar should be hidden. */
block_input ();
-#ifdef NS_IMPL_COCOA
- /* To prevent showing the user a blank frame, stop updates being
- flushed to the screen until after redisplay has completed. This
- breaks live resize (resizing with a mouse), so don't do it if
- we're in a live resize loop. */
- if (![view inLiveResize])
- ns_disable_screen_updates ();
-#endif
-
if (pixelwise)
{
pixelwidth = FRAME_TEXT_TO_PIXEL_WIDTH (f, width);
NSTRACE_MSG ("Input/output types");
- ns_send_types = [[NSArray arrayWithObjects: NSStringPboardType, nil] retain];
- ns_return_types = [[NSArray arrayWithObjects: NSStringPboardType, nil]
+ ns_send_types = [[NSArray arrayWithObjects: NSPasteboardTypeString, nil] retain];
+ ns_return_types = [[NSArray arrayWithObjects: NSPasteboardTypeString, nil]
retain];
ns_drag_types = [[NSArray arrayWithObjects:
- NSStringPboardType,
- NSTabularTextPboardType,
+ NSPasteboardTypeString,
+ NSPasteboardTypeTabularText,
NSFilenamesPboardType,
- NSURLPboardType, nil] retain];
+ NSPasteboardTypeURL, nil] retain];
/* If fullscreen is in init/default-frame-alist, focus isn't set
right for fullscreen windows, so set this. */
{
return NO;
}
+ /* FIXME: NSFilenamesPboardType is deprecated in 10.14, but the
+ NSURL method can only handle one file at a time. Stick with the
+ existing code at the moment. */
else if ([type isEqualToString: NSFilenamesPboardType])
{
NSArray *files;
NSTRACE ("[EmacsView writeSelectionToPasteboard:types:]");
- /* We only support NSStringPboardType. */
- if ([types containsObject:NSStringPboardType] == NO) {
+ /* We only support NSPasteboardTypeString. */
+ if ([types containsObject:NSPasteboardTypeString] == NO) {
return NO;
}
if (! STRINGP (val))
return NO;
- typesDeclared = [NSArray arrayWithObject:NSStringPboardType];
+ typesDeclared = [NSArray arrayWithObject:NSPasteboardTypeString];
[pb declareTypes:typesDeclared owner:nil];
ns_string_to_pasteboard (pb, val);
return YES;
last_hit_part = horizontal ? scroll_bar_before_handle : scroll_bar_above_handle; break;
case NSScrollerIncrementPage:
last_hit_part = horizontal ? scroll_bar_after_handle : scroll_bar_below_handle; break;
+#if defined (NS_IMPL_GNUSTEP) || MAC_OS_X_VERSION_MIN_REQUIRED < 1070
case NSScrollerDecrementLine:
last_hit_part = horizontal ? scroll_bar_left_arrow : scroll_bar_up_arrow; break;
case NSScrollerIncrementLine:
last_hit_part = horizontal ? scroll_bar_right_arrow : scroll_bar_down_arrow; break;
+#endif
case NSScrollerKnob:
last_hit_part = horizontal ? scroll_bar_horizontal_handle : scroll_bar_handle; break;
case NSScrollerKnobSlot: /* GNUstep-only */