3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
11 #import <Cocoa/Cocoa.h>
12 #include "AppleSupport.h"
15 void appleCleanupEditMenu() {
17 // Remove (disable) the "Start Dictation..." and "Emoji & Symbols" menu items
18 // from the "Edit" menu
20 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledDictationMenuItem"];
21 [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"NSDisabledCharacterPaletteMenuItem"];
25 void appleCleanupViewMenu() {
27 #if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 101200)
28 // Remove the "Show Tab Bar" menu item from the "View" menu, if supported
29 // See the Apple developer release notes:
30 // What should an application which already has support for tabbing do?
31 // - The application should explicitly opt-out of automatic window tabbing...
32 // It should respect the userTabbingPreference... see below
33 // https://developer.apple.com/library/archive/releasenotes/AppKit/RN-AppKitOlderNotes/index.html
34 if ([NSWindow respondsToSelector:@selector(allowsAutomaticWindowTabbing)])
35 [NSWindow setAllowsAutomaticWindowTabbing:NO];
37 // Remove the "Enter Full Screen" menu item from the "View" menu
38 [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"NSFullScreenMenuItemEverywhere"];
44 bool appleUserTabbingPreferenceAlways() {
45 #if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 101200)
46 return [NSWindow respondsToSelector:@selector(userTabbingPreference)] &&
47 [NSWindow userTabbingPreference] == NSWindowUserTabbingPreferenceAlways;
54 int NSTextInsertionPointBlinkPeriodOn() {
55 NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
57 return [prefs objectForKey:@"NSTextInsertionPointBlinkPeriodOn"] == nil ?
58 -1 : [prefs floatForKey:@"NSTextInsertionPointBlinkPeriodOn"];
62 int NSTextInsertionPointBlinkPeriodOff() {
63 NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
65 return [prefs objectForKey:@"NSTextInsertionPointBlinkPeriodOff"] == nil ?
66 -1 : [prefs floatForKey:@"NSTextInsertionPointBlinkPeriodOff"];