Skip to content

Commit 0f232ff

Browse files
committed
libhangul 업데이트 대응
1 parent 5c7f1f7 commit 0f232ff

File tree

5 files changed

+14
-26
lines changed

5 files changed

+14
-26
lines changed

Hangul.xcodeproj/project.pbxproj

+5-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
38F858F6215A8CA800CD80AE /* libexpat.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 389B61031F53191C0088AE25 /* libexpat.tbd */; };
3333
38F8591D215A8F6600CD80AE /* Hangul.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38F858E3215A8B2200CD80AE /* Hangul.framework */; };
3434
38F85935215A913D00CD80AE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 38FA21F81423219E00444D67 /* InfoPlist.strings */; };
35-
38F8593B215AA54A00CD80AE /* libhangul.m in Sources */ = {isa = PBXBuildFile; fileRef = 38F858D8215A879C00CD80AE /* libhangul.m */; };
3635
38F85944215AAA2800CD80AE /* Hangul-Umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3810008D14B53252004224DE /* Hangul-Umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
3736
38F85945215AAB0600CD80AE /* hangul.h in Headers */ = {isa = PBXBuildFile; fileRef = 3890A8C71423247C00067337 /* hangul.h */; settings = {ATTRIBUTES = (Public, ); }; };
3837
/* End PBXBuildFile section */
@@ -107,14 +106,13 @@
107106
3890A8C61423247C00067337 /* hangul-gettext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "hangul-gettext.h"; sourceTree = "<group>"; };
108107
3890A8C71423247C00067337 /* hangul.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hangul.h; sourceTree = "<group>"; };
109108
3890A8C81423247C00067337 /* hangulctype.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hangulctype.c; sourceTree = "<group>"; };
110-
3890A8C91423247C00067337 /* hangulinputcontext.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hangulinputcontext.c; sourceTree = "<group>"; };
109+
3890A8C91423247C00067337 /* hangulinputcontext.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hangulinputcontext.c; sourceTree = "<group>"; tabWidth = 8; };
111110
3890A8CA1423247C00067337 /* hangulinternals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hangulinternals.h; sourceTree = "<group>"; };
112111
3890A8CB1423247C00067337 /* hangulkeyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hangulkeyboard.h; sourceTree = "<group>"; };
113112
3890A8CC1423247C00067337 /* hanja.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hanja.c; sourceTree = "<group>"; tabWidth = 8; };
114113
3890A8CD1423247C00067337 /* hanjacompatible.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hanjacompatible.h; sourceTree = "<group>"; };
115114
389B61011F52F9310088AE25 /* hangulkeyboard.c */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.c; path = hangulkeyboard.c; sourceTree = "<group>"; tabWidth = 8; };
116115
389B61031F53191C0088AE25 /* libexpat.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libexpat.tbd; path = usr/lib/libexpat.tbd; sourceTree = SDKROOT; };
117-
38F858D8215A879C00CD80AE /* libhangul.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = libhangul.m; sourceTree = "<group>"; };
118116
38F858E3215A8B2200CD80AE /* Hangul.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Hangul.framework; sourceTree = BUILT_PRODUCTS_DIR; };
119117
38F85946215AB09100CD80AE /* Hangul.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; path = Hangul.modulemap; sourceTree = "<group>"; };
120118
38FA21F41423219E00444D67 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -242,7 +240,6 @@
242240
38FA21F51423219E00444D67 /* Hangul */ = {
243241
isa = PBXGroup;
244242
children = (
245-
38F858D8215A879C00CD80AE /* libhangul.m */,
246243
3810008D14B53252004224DE /* Hangul-Umbrella.h */,
247244
3890A8B11423238E00067337 /* HGCharacter.h */,
248245
3890A8B21423238E00067337 /* HGCharacter.m */,
@@ -432,7 +429,6 @@
432429
isa = PBXSourcesBuildPhase;
433430
buildActionMask = 2147483647;
434431
files = (
435-
38F8593B215AA54A00CD80AE /* libhangul.m in Sources */,
436432
38F858F0215A8B6000CD80AE /* HGHanja.m in Sources */,
437433
38F858EC215A8B6000CD80AE /* HGCharacter.m in Sources */,
438434
38F858EE215A8B6000CD80AE /* HGInputContext.m in Sources */,
@@ -503,8 +499,9 @@
503499
COPY_PHASE_STRIP = NO;
504500
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = (
505501
"LIBHANGUL_DEFAULT_HANJA_DIC=\"\\\"$(INSTALL_PATH)/HanjaDictionary\\\"\"",
502+
"LIBHANGUL_DATA_DIR=\"\\\"$(INSTALL_PATH)/keyboards\\\"\"",
506503
"ENABLE_EXTERNAL_KEYBOARDS=1",
507-
"LIBHANGUL_DYNAMIC_DATA_DIR=1",
504+
"HAVE_GLOB_H=1",
508505
);
509506
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
510507
INSTALL_PATH = /usr/local/lib;
@@ -523,8 +520,9 @@
523520
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
524521
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = (
525522
"LIBHANGUL_DEFAULT_HANJA_DIC=\"\\\"$(INSTALL_PATH)/HanjaDictionary\\\"\"",
523+
"LIBHANGUL_DATA_DIR=\"\\\"$(INSTALL_PATH)/keyboards\\\"\"",
526524
"ENABLE_EXTERNAL_KEYBOARDS=1",
527-
"LIBHANGUL_DYNAMIC_DATA_DIR=1",
525+
"HAVE_GLOB_H=1",
528526
);
529527
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
530528
INSTALL_PATH = /usr/local/lib;

Hangul/HGCharacter.m

-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ @implementation NSString (HGUCS)
102102
- (instancetype)initWithUCSString:(const HGUCSChar *)ucsString {
103103
NSInteger length = wcslen((const wchar_t *)ucsString); // XXX: 길이 알아내는 or 길이 없이 NSString 만드는 방법이 있을까?
104104
// initWithCString + UTF32LE 로는 안된다. null 문자가 보이면 무조건 종료하는 듯
105-
//return [self initWithBytesNoCopy:(void *)ucsString length:length encoding:NSUTF32LittleEndianStringEncoding freeWhenDone:NO];
106105
return [self initWithBytes:ucsString length:length*sizeof(HGUCSChar) encoding:NSUTF32LittleEndianStringEncoding];
107106
}
108107

Hangul/HGInputContext.m

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#import "HGInputContext.h"
1010

11+
extern unsigned hangul_keyboard_list_load_dir(const char* path);
12+
1113
#define dlog(...)
1214
#define DEBUG_HANGUL FALSE
1315

@@ -20,6 +22,12 @@ static void HangulInitialize() {
2022
// Initialization code.
2123
initialized = 1;
2224
hangul_init();
25+
26+
// load keyboad data
27+
NSBundle *hangulBundle = [NSBundle bundleForClass:[HGKeyboard class]];
28+
NSString *dataPath = hangulBundle.resourcePath;
29+
NSString *keyboardsPath = [dataPath stringByAppendingString:@"/keyboards"];
30+
hangul_keyboard_list_load_dir(keyboardsPath.fileSystemRepresentation);
2331
}
2432
}
2533

Hangul/libhangul.m

-17
Original file line numberDiff line numberDiff line change
@@ -1,17 +0,0 @@
1-
//
2-
// libhangul.m
3-
// Hangul
4-
//
5-
// Created by Jeong YunWon on 2018. 9. 26..
6-
// Copyright © 2018 youknowone.org. All rights reserved.
7-
//
8-
9-
@import Foundation;
10-
11-
#import "Hangul/HGInputContext.h"
12-
13-
const char *libhangul_data_dir() {
14-
NSBundle *hangulBundle = [NSBundle bundleForClass:[HGKeyboard class]];
15-
NSString *path = hangulBundle.resourcePath;
16-
return path.fileSystemRepresentation;
17-
}

0 commit comments

Comments
 (0)