Skip to content

Commit

Permalink
zero-width space를 기본 옵션에서 제외
Browse files Browse the repository at this point in the history
issue #75
  • Loading branch information
youknowone committed May 25, 2014
1 parent ceaca29 commit 68e5bdf
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 16 deletions.
4 changes: 3 additions & 1 deletion CommonInputMethod/CIMConfiguration.h
Expand Up @@ -23,12 +23,13 @@ FOUNDATION_EXTERN NSString *kCIMOptionKeyBehavior;
FOUNDATION_EXTERN NSString *kCIMHangulCombinationModeComposing;
FOUNDATION_EXTERN NSString *kCIMHangulCombinationModeCommiting;

#define CIMConfigurationBoolItemCount 4
#define CIMConfigurationBoolItemCount 5
/* Common */
FOUNDATION_EXTERN NSString *kCIMSharedInputManager;
/* Gureum */
FOUNDATION_EXTERN NSString *kCIMAutosaveDefaultInputMode;
FOUNDATION_EXTERN NSString *kCIMRomanModeByEscapeKey;
FOUNDATION_EXTERN NSString *kCIMZeroWidthSpaceForLayoutExchange;
FOUNDATION_EXTERN NSString *kCIMZeroWidthSpaceForBlankComposedString;


Expand Down Expand Up @@ -66,6 +67,7 @@ extern CIMConfiguration *CIMDefaultUserConfiguration;
BOOL sharedInputManager;
BOOL autosaveDefaultInputMode;
BOOL romanModeByEscapeKey;
BOOL zeroWidthSpaceForLayoutExchange;
BOOL zeroWidthSpaceForBlankComposedString;
}
@property(nonatomic, retain) NSUserDefaults *userDefaults;
Expand Down
2 changes: 2 additions & 0 deletions CommonInputMethod/CIMConfiguration.m
Expand Up @@ -22,6 +22,7 @@
NSString * kCIMSharedInputManager = @"CIMSharedInputManager";
NSString * kCIMAutosaveDefaultInputMode = @"CIMAutosaveDefaultInputMode";
NSString * kCIMRomanModeByEscapeKey = @"CIMRomanModeByEscapeKey";
NSString * kCIMZeroWidthSpaceForLayoutExchange = @"CIMZeroWidthSpaceForLayoutExchange";
NSString * kCIMZeroWidthSpaceForBlankComposedString = @"CIMZeroWidthSpaceForBlankComposedString";


Expand Down Expand Up @@ -70,6 +71,7 @@ - (id)initWithUserDefaults:(NSUserDefaults *)aUserDefaults {
{ kCIMAutosaveDefaultInputMode, &self->autosaveDefaultInputMode, YES },
{ kCIMRomanModeByEscapeKey, &self->romanModeByEscapeKey, NO },
{ kCIMZeroWidthSpaceForBlankComposedString, &self->zeroWidthSpaceForBlankComposedString, NO },
{ kCIMZeroWidthSpaceForLayoutExchange, &self->zeroWidthSpaceForLayoutExchange, NO },
};
for (NSInteger i = 0; i < CIMConfigurationBoolItemCount; i++ ) {
self->boolItems[i] = tempBoolItems[i];
Expand Down
2 changes: 1 addition & 1 deletion CommonInputMethod/CIMInputController.m
Expand Up @@ -158,7 +158,7 @@ - (void)cancelCompositionEvent:(CIMInputController *)controller {

- (NSString *)_internalComposedString {
NSString *string = self.composer.composedString;
if (string.length == 0 && CIMSharedInputManager.needsFakeComposedString) {
if (string.length == 0 && CIMSharedInputManager.needsFakeComposedString && CIMSharedInputManager.configuration->zeroWidthSpaceForLayoutExchange) {
string = @"\u200b";
}
return string;
Expand Down
3 changes: 2 additions & 1 deletion GureumKIM/GureumPreferencesWindowController.h
Expand Up @@ -25,7 +25,8 @@
IBOutlet NSComboBox *optionKeyBehaviorComboBox;

IBOutlet NSButton *romanModeByEscapeKeyCheckbox;

IBOutlet NSButton *zeroWidthSpaceForLayoutExchangeCheckbox;

/* Hangul Preferences */
IBOutlet SRRecorderCell *inputModeHanjaKeyRecorderCell;
IBOutlet NSComboBox *hangulCombinationModeComposingComboBox;
Expand Down
2 changes: 2 additions & 0 deletions GureumKIM/GureumPreferencesWindowController.m
Expand Up @@ -162,6 +162,7 @@ - (void)loadFromConfiguration {
self->hangulCombinationModeCommitingComboBox.stringValue = GureumPreferencesHangulSyllablePresentations[configuration->hangulCombinationModeCommiting];

self->romanModeByEscapeKeyCheckbox.integerValue = configuration->romanModeByEscapeKey;
self->zeroWidthSpaceForLayoutExchangeCheckbox.integerValue = configuration->zeroWidthSpaceForLayoutExchange;
self->zeroWidthSpaceForBlankComposedStringCheckbox.integerValue = configuration->zeroWidthSpaceForBlankComposedString;
}

Expand All @@ -181,6 +182,7 @@ - (void)saveToConfiguration:(id)sender {
configuration->hangulCombinationModeCommiting = [GureumPreferencesHangulSyllablePresentations indexOfObject:self->hangulCombinationModeCommitingComboBox.stringValue];

configuration->romanModeByEscapeKey = self->romanModeByEscapeKeyCheckbox.integerValue;
configuration->zeroWidthSpaceForLayoutExchange = self->zeroWidthSpaceForLayoutExchangeCheckbox.integerValue;
configuration->zeroWidthSpaceForBlankComposedString = self->zeroWidthSpaceForBlankComposedStringCheckbox.integerValue;

[configuration saveAllConfigurations];
Expand Down
44 changes: 31 additions & 13 deletions GureumKIM/preferences.xib
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="13C64" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1060" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5053"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="GureumPreferencesWindowController">
Expand All @@ -21,6 +21,7 @@
<outlet property="romanModeByEscapeKeyCheckbox" destination="128" id="131"/>
<outlet property="window" destination="1" id="108"/>
<outlet property="zeroWidthSpaceForBlankComposedStringCheckbox" destination="qS6-9b-zpa" id="ctU-hT-dri"/>
<outlet property="zeroWidthSpaceForLayoutExchangeCheckbox" destination="ofO-Xf-tQi" id="VYd-af-BHG"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
Expand Down Expand Up @@ -100,11 +101,11 @@
</connections>
</window>
<customView id="82">
<rect key="frame" x="0.0" y="0.0" width="363" height="166"/>
<rect key="frame" x="0.0" y="0.0" width="363" height="215"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" id="100" customClass="SRRecorderControl">
<rect key="frame" x="183" y="125" width="127" height="22"/>
<rect key="frame" x="183" y="174" width="127" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" enabled="NO" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="" drawsBackground="YES" id="101" customClass="SRRecorderCell">
<font key="font" metaFont="system"/>
Expand All @@ -124,30 +125,30 @@
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="83">
<rect key="frame" x="17" y="126" width="126" height="20"/>
<rect key="frame" x="17" y="175" width="126" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" enabled="NO" sendsActionOnEndEditing="YES" title="언어 바꾸기 단축키:" id="92">
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="86">
<rect key="frame" x="29" y="74" width="149" height="20"/>
<rect key="frame" x="29" y="123" width="149" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="기본 한글 자판:" id="89">
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="85">
<rect key="frame" x="18" y="100" width="328" height="20"/>
<rect key="frame" x="18" y="149" width="328" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="자판을 선택하면 기본 자판으로 자동으로 지정하기" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="90">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
</buttonCell>
</button>
<comboBox verticalHuggingPriority="750" id="87">
<rect key="frame" x="183" y="70" width="163" height="26"/>
<rect key="frame" x="183" y="119" width="163" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" usesDataSource="YES" numberOfVisibleItems="5" id="88">
<font key="font" metaFont="system"/>
Expand All @@ -159,22 +160,30 @@
</connections>
</comboBox>
<button id="128">
<rect key="frame" x="19" y="18" width="327" height="19"/>
<rect key="frame" x="17" y="39" width="327" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="esc 키로 로마자 자판으로 전환 (vi 모드)" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="129">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<button id="ofO-Xf-tQi">
<rect key="frame" x="17" y="18" width="327" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="자판 전환 시 스페이스 입력 방지 (IntelliJ 등)" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="pBf-dh-gwk">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<box autoresizesSubviews="NO" verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="130">
<rect key="frame" x="13" y="41" width="331" height="5"/>
<rect key="frame" x="13" y="90" width="331" height="5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<font key="titleFont" metaFont="system"/>
</box>
<button horizontalHuggingPriority="750" verticalHuggingPriority="750" id="135">
<rect key="frame" x="312" y="114" width="39" height="38"/>
<rect key="frame" x="312" y="163" width="39" height="38"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="round" title="?" bezelStyle="circular" imagePosition="above" alignment="center" borderStyle="border" imageScaling="proportionallyUpOrDown" id="136">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
Expand All @@ -185,15 +194,15 @@
</connections>
</button>
<textField verticalHuggingPriority="750" id="148">
<rect key="frame" x="29" y="52" width="149" height="20"/>
<rect key="frame" x="29" y="101" width="149" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Option 키 동작:" id="151">
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<comboBox verticalHuggingPriority="750" id="149">
<rect key="frame" x="183" y="48" width="163" height="26"/>
<rect key="frame" x="183" y="97" width="163" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="2" id="150">
<font key="font" metaFont="system"/>
Expand All @@ -208,6 +217,15 @@
<outlet property="dataSource" destination="-2" id="152"/>
</connections>
</comboBox>
<textField verticalHuggingPriority="750" id="Ifn-ec-Gzf">
<rect key="frame" x="17" y="64" width="105" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" enabled="NO" sendsActionOnEndEditing="YES" title="고급 설정" id="JuL-3P-Okt">
<font key="font" size="13" name="AppleSDGothicNeo-Bold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</customView>
<customView id="93">
Expand Down

0 comments on commit 68e5bdf

Please sign in to comment.