Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 14でビルドする #116

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ jobs:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- run: sudo xcode-select -s /Applications/Xcode_13.4.1.app
- run: sudo xcode-select -s /Applications/Xcode_14.1.app
- run: make debug
working-directory: platform/mac
test:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- run: sudo xcode-select -s /Applications/Xcode_13.4.1.app
- run: sudo xcode-select -s /Applications/Xcode_14.1.app
- run: make test
working-directory: platform/mac
release:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- run: sudo xcode-select -s /Applications/Xcode_13.4.1.app
- run: sudo xcode-select -s /Applications/Xcode_14.1.app
- run: make release
working-directory: platform/mac
2 changes: 1 addition & 1 deletion platform/mac/proj/AquaSKK-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.7.4</string>
<string>4.7.5</string>
<key>CFBundleSignature</key>
<string>askk</string>
<key>CFBundleVersion</key>
Expand Down
12 changes: 11 additions & 1 deletion platform/mac/proj/AquaSKK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1250;
LastUpgradeCheck = 1410;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AquaSKK" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -1183,6 +1183,7 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEAD_CODE_STRIPPING = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -1226,6 +1227,7 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
DEAD_CODE_STRIPPING = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_MODEL_TUNING = "";
Expand All @@ -1252,6 +1254,7 @@
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = "";
Expand All @@ -1266,6 +1269,7 @@
"$(inherited)",
"\"$(SRCROOT)/../../../src/engine/tests\"",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
ONLY_ACTIVE_ARCH = YES;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
OTHER_LDFLAGS = (
Expand All @@ -1292,6 +1296,7 @@
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_MODEL_TUNING = "";
Expand All @@ -1304,6 +1309,7 @@
"$(inherited)",
"\"$(SRCROOT)/../../../src/engine/tests\"",
);
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
OTHER_CODE_SIGN_FLAGS = "--timestamp";
OTHER_LDFLAGS = (
"-framework",
Expand All @@ -1329,6 +1335,7 @@
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -1337,6 +1344,7 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "AquaSKKPreferences-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
OTHER_CODE_SIGN_FLAGS = "--timestamp";
OTHER_LDFLAGS = (
"-framework",
Expand All @@ -1361,13 +1369,15 @@
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = aquaskk_Prefix.pch;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = "AquaSKKPreferences-Info.plist";
INSTALL_PATH = "$(HOME)/Applications";
MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)";
OTHER_CODE_SIGN_FLAGS = "--timestamp";
OTHER_LDFLAGS = (
"-framework",
Expand Down
4 changes: 2 additions & 2 deletions platform/mac/proj/AquaSKKPreferences-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.7.4</string>
<string>4.7.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2021-05-26</string>
<string>2022-11-06</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSUIElement</key>
Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/gui/AnnotationView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ - (void)initializeView {

NSScrollView* scrollView = [[NSScrollView alloc] initWithFrame:frame];
[scrollView setHasVerticalScroller:YES];
[[scrollView verticalScroller] setControlSize:NSSmallControlSize];
[[scrollView verticalScroller] setControlSize:NSControlSizeSmall];

textView_ = [[NSTextView alloc] initWithFrame:[[scrollView contentView] frame]];
[textView_ setEditable:NO];
Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/gui/AnnotationWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ - (id)init {
if(self) {
view_ = [[AnnotationView alloc] init];
window_ = [[NSWindow alloc] initWithContentRect:[view_ frame]
styleMask:NSBorderlessWindowMask
styleMask:NSWindowStyleMaskBorderless
backing:NSBackingStoreBuffered
defer:YES];
[window_ setContentView:view_];
Expand Down
4 changes: 2 additions & 2 deletions platform/mac/src/gui/CandidateCell.mm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ + (NSSize)focusSize:(NSSize)size {
- (id)initWithFont:(NSFont*)font {
if(self = [super init]) {
entry_ = [[NSMutableAttributedString alloc] init];
attributes_ = [[NSDictionary dictionaryWithObjectsAndKeys:
attributes_ = [[NSMutableDictionary dictionaryWithObjectsAndKeys:
font, NSFontAttributeName,
[NSColor labelColor], NSForegroundColorAttributeName,
nil]
Expand Down Expand Up @@ -115,7 +115,7 @@ - (void)drawFocusAtPoint:(NSPoint)pt withSize:(NSSize)size {
} else {
[[[NSColor blackColor] colorWithAlphaComponent:0.1] setFill];
}
NSRectFillUsingOperation(focus, NSCompositeSourceOver);
NSRectFillUsingOperation(focus, NSCompositingOperationSourceOver);

[[NSColor windowFrameColor] setStroke];
[NSBezierPath strokeRect:focus];
Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/gui/CandidateView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ - (void)drawRect:(NSRect)rect {
int margin = [CandidateView cellSpacing];

NSPoint offset = NSMakePoint(margin, margin);
int cellCount = [labels_ length];
NSUInteger cellCount = [labels_ length];

for(unsigned index = 0; index < [candidateCells_ count]; ++ index) {
CandidateCell* cell = [candidateCells_ objectAtIndex:index];
Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/gui/CandidateWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
- (void)setPage:(NSRange)page;
- (void)showAt:(NSPoint)origin level:(int)level;
- (void)hide;
- (int)indexOfLabel:(char)label;
- (NSUInteger)indexOfLabel:(char)label;
- (id)newCandidateCell;

@end
Expand Down
4 changes: 2 additions & 2 deletions platform/mac/src/gui/CandidateWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (id)init {
if(self) {
view_ = [[CandidateView alloc] initWithFrame:NSZeroRect];
window_ = [[NSWindow alloc] initWithContentRect:NSZeroRect
styleMask:NSBorderlessWindowMask
styleMask:NSWindowStyleMaskBorderless
backing:NSBackingStoreBuffered
defer:YES];
[window_ setIgnoresMouseEvents:YES];
Expand Down Expand Up @@ -84,7 +84,7 @@ - (void)hide {
[window_ orderOut:nil];
}

- (int)indexOfLabel:(char)label {
- (NSUInteger)indexOfLabel:(char)label {
NSString* target = [NSString stringWithFormat:@"%c", label];
NSRange result = [labels_ rangeOfString:target options:NSCaseInsensitiveSearch];

Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/gui/CompletionWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ - (id)init {
if(self) {
view_ = [[CompletionView alloc] init];
window_ = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 0, 0)
styleMask:NSBorderlessWindowMask
styleMask:NSWindowStyleMaskBorderless
backing:NSBackingStoreBuffered
defer:YES];
[window_ setBackgroundColor:[NSColor clearColor]];
Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/gui/InputModeWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ + (InputModeWindow*)sharedWindow {
- (id)init {
if(self = [super init]) {
window_ = [[NSWindow alloc] initWithContentRect:NSZeroRect
styleMask:NSBorderlessWindowMask
styleMask:NSWindowStyleMaskBorderless
backing:NSBackingStoreBuffered
defer:YES];
[window_ setBackgroundColor:[NSColor clearColor]];
Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/gui/MessengerView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ - (void)drawRect:(NSRect)rect {
pt.x = 3;
pt.y = (NSHeight(frame) - [icon_ size].height) / 2.0;

[icon_ drawAtPoint:pt fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
[icon_ drawAtPoint:pt fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0];
[message_ drawAtPoint:NSMakePoint(pt.x + [icon_ size].width + 2, 4) withAttributes:attributes_];
}

Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/gui/MessengerWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ - (id)init {
if(self) {
view_ = [[MessengerView alloc] init];
window_ = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 0, 0)
styleMask:NSBorderlessWindowMask
styleMask:NSWindowStyleMaskBorderless
backing:NSBackingStoreBuffered
defer:YES];
[window_ setBackgroundColor:[NSColor clearColor]];
Expand Down
10 changes: 5 additions & 5 deletions platform/mac/src/preferences/DictionarySet.mm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ @implementation DictionarySet
- (void)moveObjectsInArrangedObjectsFromIndexes:(NSIndexSet*)indexSet toIndex:(unsigned int)insertIndex {
NSArray* objects = [self arrangedObjects];
NSUInteger idx = [indexSet lastIndex];
int aboveInsertIndexCount = 0;
int removeIndex;
NSUInteger aboveInsertIndexCount = 0;
NSUInteger removeIndex;

while(NSNotFound != idx) {
if(idx >= insertIndex) {
Expand Down Expand Up @@ -93,7 +93,7 @@ - (IBAction)browseLocation:(id)sender {

[panel setDirectoryURL:dirurl];
[panel beginSheetModalForWindow:prefView completionHandler:^(NSInteger result) {
if(result == NSOKButton) {
if(result == NSModalResponseOK) {
[[self selection] setValue:[[panel URL] path]
forKey:SKKDictionarySetKeys::location];
}
Expand All @@ -102,7 +102,7 @@ - (IBAction)browseLocation:(id)sender {

- (BOOL)tableView:(NSTableView*)tv writeRowsWithIndexes:(NSIndexSet*)rowIndexes toPasteboard:(NSPasteboard*)pboard {
NSArray* typesArray = [NSArray arrayWithObjects:DictionaryRowsType, nil];
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes];
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes requiringSecureCoding:YES error:nil];

[pboard declareTypes:typesArray owner:self];
[pboard setData:data forType:DictionaryRowsType];
Expand Down Expand Up @@ -141,7 +141,7 @@ - (BOOL)tableView:(NSTableView*)tv

NSPasteboard* pboard = [info draggingPasteboard];
NSData* rowData = [pboard dataForType:DictionaryRowsType];
NSIndexSet* rowIndexes = [NSKeyedUnarchiver unarchiveObjectWithData:rowData];
NSIndexSet* rowIndexes = [NSKeyedUnarchiver unarchivedObjectOfClass:[NSIndexSet class] fromData:rowData error:nil];

[self moveObjectsInArrangedObjectsFromIndexes:rowIndexes toIndex:row];

Expand Down
4 changes: 2 additions & 2 deletions platform/mac/src/preferences/PreferenceController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ - (IBAction)showFontPanel:(id)sender {
}

- (void)keyboardLayoutDidChange:(id)sender {
int index = [layoutPopUp_ indexOfSelectedItem];
NSInteger index = [layoutPopUp_ indexOfSelectedItem];
NSString* selectedLayout = [layoutNames_ objectAtIndex:index];

if(selectedLayout) {
Expand All @@ -158,7 +158,7 @@ - (IBAction)browseLocation:(id)sender {

[panel setDirectoryURL:dirurl];
[panel beginSheetModalForWindow:prefWindow_ completionHandler:^(NSInteger result) {
if(result == NSOKButton) {
if(result == NSModalResponseOK) {
[preferences_ setObject:[[panel URL] path]
forKey:SKKUserDefaultKeys::user_dictionary_path];
}
Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/server/MacCandidateWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MacCandidateWindow : public SKKCandidateWindow {
NSMutableArray* candidates_;
NSRange page_;
int cursor_;
int cellCount_;
NSUInteger cellCount_;
CandidateWindow* window_;

void reloadUserDefaults();
Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/server/MacCandidateWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
}

int MacCandidateWindow::LabelIndex(char label) {
return [window_ indexOfLabel:label];
return (int)[window_ indexOfLabel:label];
}

// ------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions platform/mac/src/server/MacClipboard.mm
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
const std::string MacClipboard::PasteString() {
NSPasteboard* pasteboard = [NSPasteboard generalPasteboard];

if([[pasteboard types] containsObject:NSStringPboardType] == YES) {
NSString* str = [pasteboard stringForType:NSStringPboardType];
if([[pasteboard types] containsObject:NSPasteboardTypeString] == YES) {
NSString* str = [pasteboard stringForType:NSPasteboardTypeString];
return [str UTF8String];
}

Expand Down
2 changes: 1 addition & 1 deletion platform/mac/src/server/MacConfig.mm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
int MacConfig::integerConfig(NSString* key) {
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];

return [defaults integerForKey:key];
return (int)[defaults integerForKey:key];
}

bool MacConfig::boolConfig(NSString* key) {
Expand Down
7 changes: 2 additions & 5 deletions platform/mac/src/server/MacInputModeWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ CGPoint FlipPoint(int x, int y) {
}

int ActiveProcessID() {
NSDictionary* info = [[NSWorkspace sharedWorkspace] activeApplication];
NSNumber* pid = [info objectForKey:@"NSApplicationProcessIdentifier"];

return [pid intValue];
return [[NSWorkspace sharedWorkspace] frontmostApplication].processIdentifier;
}

typedef std::vector<CGRect> CGRectContainer;
Expand Down Expand Up @@ -98,7 +95,7 @@ - (void)activate:(id)sender {
CGRectContainer list = CreateWindowBoundsListOf(ActiveProcessID());

// カーソル位置がウィンドウ矩形に含まれていなければ無視する
int count = std::count_if(list.begin(), list.end(),
long count = std::count_if(list.begin(), list.end(),
std::bind2nd(std::ptr_fun(CGRectContainsPoint), cursor));
if(!count) {
return;
Expand Down
8 changes: 5 additions & 3 deletions platform/mac/src/server/SKKInputController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ - (void)showDebugInfo:(id)sender {
[alert addButtonWithTitle:@"OK"];
[alert setMessageText:@"デバッグ情報"];
[alert setInformativeText:info];
[alert setAlertStyle:NSInformationalAlertStyle];
[alert setAlertStyle:NSAlertStyleInformational];
[alert setIcon:[NSImage imageNamed:NSImageNameInfo]];
[[alert window] setLevel:kCGPopUpMenuWindowLevel];
[[alert window] setTitle:@"AquaSKK"];
Expand All @@ -296,8 +296,8 @@ - (void)showDebugInfo:(id)sender {

NSPasteboard* pb = [NSPasteboard generalPasteboard];

[pb declareTypes:[NSArray arrayWithObjects:NSStringPboardType, nil] owner:self];
[pb setString:info forType:NSStringPboardType];
[pb declareTypes:[NSArray arrayWithObjects:NSPasteboardTypeString, nil] owner:self];
[pb setString:info forType:NSPasteboardTypeString];

[info release];
}
Expand Down Expand Up @@ -398,6 +398,8 @@ - (SKKInputMode)syncInputSource {
[self changeInputMode:context_.selectedKeyboardInputSource];
return system;
}

return current;
}

- (void)cancelKeyEventForASCII {
Expand Down
Loading