fi
fi
+ AC_CACHE_CHECK([for Mac OS X 12.0 or later],
+ [emacs_cv_macosx_12_0],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <AvailabilityMacros.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
+Mac OS X 12.x or later.
+#endif
+ ]])], [emacs_cv_macosx_12_0=no],
+ [emacs_cv_macosx_12_0=yes]))
+
if test "${with_native_image_api}" = yes; then
AC_DEFINE(HAVE_NATIVE_IMAGE_API, 1, [Define to use native OS APIs for images.])
NATIVE_IMAGE_API="yes (ns)"
if test "$NS_IMPL_COCOA" = "yes"; then
libs_nsgui="$libs_nsgui -framework IOKit -framework Carbon \
-framework IOSurface -framework QuartzCore"
+ if test "$emacs_cv_macosx_12_0" = "yes"; then
+ libs_nsgui="$libs_nsgui -framework UniformTypeIdentifiers"
+ fi
fi
else
libs_nsgui=
#ifdef NS_IMPL_COCOA
#include <IOKit/graphics/IOGraphicsLib.h>
#include "macfont.h"
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
+#include <UniformTypeIdentifiers/UniformTypeIdentifiers.h>
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
+#define IOMasterPort IOMainPort
+#endif
+#endif
#endif
#ifdef HAVE_NS
Lisp_Object chain, elt;
NSAutoreleasePool *pool;
BOOL setMini = YES;
+ NSWorkspace *workspace;
NSTRACE ("ns_implicitly_set_icon_type");
block_input ();
pool = [[NSAutoreleasePool alloc] init];
+ workspace = [NSWorkspace sharedWorkspace];
if (f->output_data.ns->miniimage
&& [[NSString stringWithLispString:f->name]
isEqualToString: [(NSImage *)f->output_data.ns->miniimage name]])
if (image == nil)
{
- image = [[[NSWorkspace sharedWorkspace] iconForFileType: @"text"] retain];
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000
+ if ([workspace respondsToSelector: @selector (iconForContentType:)])
+#endif
+ image = [[workspace iconForContentType:
+ [UTType typeWithIdentifier: @"text"]] retain];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000
+ else
+#endif
+#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000
+ image = [[workspace iconForFileType: @"text"] retain];
+#endif
setMini = NO;
}
ns_fd_data.ret = NO;
#ifdef NS_IMPL_COCOA
if (! NILP (mustmatch) || ! NILP (dir_only_p))
- [panel setAllowedFileTypes: nil];
+ {
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000
+ if ([panel respondsToSelector: @selector (setAllowedContentTypes:)])
+#endif
+ [panel setAllowedContentTypes: [NSArray array]];
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000
+ else
+#endif
+#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 120000
+ [panel setAllowedFileTypes: nil];
+#endif
+ }
if (dirS) [panel setDirectoryURL: [NSURL fileURLWithPath: dirS]];
if (initS && NILP (Ffile_directory_p (init)))
[panel setNameFieldStringValue: [initS lastPathComponent]];
[configuration.preferences setValue:@YES
forKey:@"developerExtrasEnabled"];
+#if 0 /* Plugins are not supported by Mac OS X anymore. */
Lisp_Object enablePlugins =
Fintern (build_string ("xwidget-webkit-enable-plugins"), Qnil);
+
if (!EQ (Fsymbol_value (enablePlugins), Qnil))
configuration.preferences.plugInsEnabled = YES;
+#endif
self = [super initWithFrame:frame configuration:configuration];
if (self)