Permalink
Browse files

GureumConfiguration (read-only)

  • Loading branch information...
youknowone committed Apr 30, 2018
1 parent fcbc5b0 commit 31ed17bc5bbf32b7dce438a48d4d37cdc0909305
@@ -23,12 +23,12 @@ FOUNDATION_EXTERN const char CIMKeyMapUpper[CIMKeyMapSize];
@enum
@brief 최종적으로 CIMInputController가 처리할 결과
*/
typedef enum {
typedef NS_ENUM(int, CIMInputTextProcessResult) {
CIMInputTextProcessResultNotProcessedAndNeedsCommit = -2,
CIMInputTextProcessResultNotProcessedAndNeedsCancel = -1,
CIMInputTextProcessResultNotProcessed = 0,
CIMInputTextProcessResultProcessed = 1,
} CIMInputTextProcessResult;
};
/*!
@protocol
@@ -71,3 +71,4 @@
@interface CIMBaseComposer : CIMComposer
@end
@@ -190,7 +190,7 @@ - (NSString *)_internalComposedString {
// Getting Input Strings and Candidates
// 현재 입력 중인 글자를 반환한다. -updateComposition: 이 사용
- (id)composedString:(id)sender controller:(CIMInputController *)controller {
NSString *string = [self _internalComposedString];
NSString *string = self._internalComposedString;
dlog(DEBUG_LOGGING, @"LOGGING::CHECK::COMPOSEDSTRING::(%@)", string);
dlog(DEBUG_INPUTCONTROLLER, @"** CIMInputController -composedString: with return: '%@'", string);
return string;
@@ -9,6 +9,7 @@
/* Begin PBXBuildFile section */
380E1C6314B7F5D800289EE7 /* CIMInputControllerGureum.m in Sources */ = {isa = PBXBuildFile; fileRef = 380E1C6214B7F5D800289EE7 /* CIMInputControllerGureum.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
380ECC8316ECF49F0063B881 /* Gureum.iconset in Resources */ = {isa = PBXBuildFile; fileRef = 380ECC8216ECF49F0063B881 /* Gureum.iconset */; };
381228DB208D869B00BB7D5D /* GureumConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38C2AE4C208795E700FE211A /* GureumConfiguration.swift */; };
38162DF5141263270077AA2D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38863C63140E64EB00A8ED76 /* Cocoa.framework */; };
38162DFB141263280077AA2D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 38162DF9141263280077AA2D /* InfoPlist.strings */; };
38162E04141263280077AA2D /* GureumAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 38162E03141263280077AA2D /* GureumAppDelegate.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
@@ -935,6 +936,7 @@
buildActionMask = 2147483647;
files = (
381CA2EF1FCE16EA00DDB81D /* Preferences.swift in Sources */,
381228DB208D869B00BB7D5D /* GureumConfiguration.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -63,7 +63,7 @@ + (void)initialize {
[names addObject:info[layout]];
}
GureumPreferencesHangulLayoutLocalizedNames = [[NSArray alloc] initWithArray:names];
GureumPreferencesHangulSyllablePresentations = [[NSArray alloc] initWithObjects:
NSLocalizedStringFromTable(@"HangulPresentationRemoveFillers", @"Hangul", @""),
NSLocalizedStringFromTable(@"HangulPresentationAllFillers", @"Hangul", @""),
@@ -84,7 +84,7 @@ - (instancetype)initWithWindow:(NSWindow *)window
- (void)windowDidLoad {
[super windowDidLoad];
self->preferenceViews = [[NSDictionary alloc] initWithObjectsAndKeys:
shortcutPreferenceView, @"Shortcut",
gureumPreferenceView, @"Gureum",
@@ -119,10 +119,10 @@ - (BOOL)validateToolbarItem:(NSToolbarItem *)theItem {
- (void)showPreferenceViewWithIdentifier:(id)identifier animate:(BOOL)animate {
NSView *newPreferenceView = self->preferenceViews[identifier];
if (newPreferenceView == nil) return;
NSArray *preferenceSubviews = self->preferenceContainerView.subviews;
NSView *oldPreferenceView = preferenceSubviews.count > 0 ? preferenceSubviews[0] : nil;
// Remove old one
if (oldPreferenceView == newPreferenceView) return;
[oldPreferenceView removeFromSuperview];
@@ -141,9 +141,9 @@ - (void)showPreferenceViewWithIdentifier:(id)identifier animate:(BOOL)animate {
CGFloat heightDiff = windowFrame.size.height - self.window.frame.size.height;
windowFrame.origin.y -= heightDiff; // keep origin y
[self.window setFrame:windowFrame display:YES animate:animate];
self->preferenceContainerView.frame = containerRect;
// Add new one
[self->preferenceContainerView addSubview:newPreferenceView];
}
@@ -76,7 +76,7 @@ - (void)setKeyboardWithIdentifier:(NSString *)identifier {
- (CIMInputTextProcessResult)inputController:(CIMInputController *)inputController inputText:(NSString *)string key:(NSInteger)keyCode modifiers:(NSEventModifierFlags)flags client:(id)sender {
// libhangul은 backspace를 키로 받지 않고 별도로 처리한다.
if (keyCode == kVK_Delete) {
return [self->_inputContext backspace] ? CIMInputTextProcessResultProcessed : CIMInputTextProcessResultNotProcessed;
return self->_inputContext.backspace ? CIMInputTextProcessResultProcessed : CIMInputTextProcessResultNotProcessed;
}
if (keyCode > 50 || keyCode == kVK_Delete || keyCode == kVK_Return || keyCode == kVK_Tab || keyCode == kVK_Space) {
@@ -128,7 +128,7 @@ - (NSString *)dequeueCommitString {
}
- (void)cancelComposition {
NSString *flushedString = [[self class] commitStringByCombinationModeWithUCSString:[self->_inputContext flushUCSString]];
NSString *flushedString = [[self class] commitStringByCombinationModeWithUCSString:self->_inputContext.flushUCSString];
[self->_commitString appendString:flushedString];
}
@@ -64,10 +64,10 @@ class RomanComposer: CIMComposer {
newString = String(newChr)
}
self._commitString = newString
return CIMInputTextProcessResultProcessed
return CIMInputTextProcessResult.processed;
} else {
self._commitString = nil
return CIMInputTextProcessResultNotProcessed
return CIMInputTextProcessResult.notProcessed
}
}
@@ -136,10 +136,10 @@ class DvorakComposer: CIMComposer {
newChr = chr
}
self._commitString = String(map[newChr]!)
return CIMInputTextProcessResultProcessed
return CIMInputTextProcessResult.processed
} else {
self._commitString = nil
return CIMInputTextProcessResultNotProcessed
return CIMInputTextProcessResult.notProcessed
}
}
@@ -7,3 +7,7 @@ target 'OSX' do
pod 'Fabric'
pod 'Crashlytics'
end
target 'OSXTests' do
pod 'cdebug'
pod 'FoundationExtension', '>= 1.2.4'
end
@@ -10,36 +10,11 @@ import Foundation
import PreferencePanes
import Cocoa
/*
define_preference_key(CIMLastHangulInputMode);
define_preference_key(CIMLeftCommandKeyShortcutBehavior);
define_preference_key(CIMLeftOptionKeyShortcutBehavior);
define_preference_key(CIMLeftControlKeyShortcutBehavior);
define_preference_key(CIMRightCommandKeyShortcutBehavior);
define_preference_key(CIMRightOptionKeyShortcutBehavior);
define_preference_key(CIMRightControlKeyShortcutBehavior);
define_preference_key(CIMInputModeExchangeKeyModifier);
define_preference_key(CIMInputModeExchangeKeyCode);
define_preference_key(CIMInputModeHanjaKeyModifier);
define_preference_key(CIMInputModeHanjaKeyCode);
define_preference_key(CIMInputModeEnglishKeyModifier);
define_preference_key(CIMInputModeEnglishKeyCode);
define_preference_key(CIMInputModeKoreanKeyModifier);
define_preference_key(CIMInputModeKoreanKeyCode);
define_preference_key(CIMOptionKeyBehavior);
define_preference_key(CIMHangulCombinationModeComposing);
define_preference_key(CIMHangulCombinationModeCommiting);
define_preference_key(CIMSharedInputManager);
define_preference_key(CIMAutosaveDefaultInputMode);
define_preference_key(CIMRomanModeByEscapeKey);
define_preference_key(CIMShowsInputForHanjaCandidates);
*/
class GureumPreferencePane: NSPreferencePane {
// @IBOutlet var _window: UIWindow documented in NSPreferencePane but not automatically supported by IB
@IBOutlet var capslockCheckbox: NSButton!
var configuration: GureumConfiguration = GureumConfiguration();
func loadFromData() {

0 comments on commit 31ed17b

Please sign in to comment.