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

百度网盘已过期,能否重新分享一下,谢谢~~~ #77

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
3e69012
更新 .gitignore 并删除已被忽略的文件
xqin Aug 13, 2017
0771502
更新开发者id(因为我并没有作者的appleid所以只能更新为自己的才能进行编译),并修复XCode 8.3.3 无法编译通过的问题
xqin Aug 13, 2017
9612927
修复不能连续手工选词及手工选词之后按空格无法将已选词录入的问题
xqin Aug 13, 2017
0b5e396
修复在有编码输入的情况下按下 backspace 不松,不会删除已输入的编码的问题
xqin Aug 13, 2017
c1fe36a
删除 PlaySound 相关的文件,按键声音使用系统默认的声音
xqin Aug 13, 2017
b7604ab
调整绘制小地球图标(切换输入法)的线条宽度为2
xqin Aug 13, 2017
48872a2
修复在英文状态下双击shift进入大写锁定状态后,点返回输入的内容为大写字母,而不是正常输入编码的问题
xqin Aug 13, 2017
bb688a8
开启单击iRime图标打开输入法配置的功能
xqin Aug 13, 2017
7aa745d
更新网页管理文件界面,增加批量删除文件的功能并且在删除文件前增加确认提示,防止误删除文件
xqin Aug 13, 2017
d992f4c
修复在没有退出配置程序的情况下多次 还原配置 导致输入法方案列表中会重复出现的问题
xqin Aug 13, 2017
9f34f7c
增加第一次启动键盘时是否有创建目录的判断(同步dev_v1.4.5分支上的代码)
xqin Aug 13, 2017
83bdad4
更新README,增加仓库代码使用说明
xqin Aug 13, 2017
d1b7691
优化生成数字键盘左侧 +-*/: 的代码
xqin Aug 14, 2017
dd978e4
优化生成数字键盘右侧按钮的代码
xqin Aug 14, 2017
976cb41
修复下拉加载更多时功能失效的问题
xqin Aug 14, 2017
365248f
统一在左右滑动空格之后的处理逻辑
xqin Sep 6, 2017
394a379
清理无用代码(kCatTypeEnabled)
xqin Sep 6, 2017
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.DS_Store
.DS_Store
xcuserdata/
build/
iRime/LibAndResource
Binary file added LibAndResource.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 39 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@


## 鳴謝/Credits
- [Rime]: [佛振](https://github.com/lotem)
- \[Rime\]: [佛振](https://github.com/lotem)
- 圖文教程:[xiaoqun2016](https://github.com/xiaoqun2016)
- 在[Issues](https://github.com/jimmy54/iRime/issues)、[貼吧](http://tieba.baidu.com/f?kw=rime)、QQ羣中反饋意見的網友
- 依賴的第三方庫等開源項目
Expand All @@ -53,11 +53,46 @@
The GNU General Public License v3.0 (GPL v3)

>Copyright (C) 2014 Stackia
>
>
>This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
>
>
>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
>
>
>You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.



---

## 克隆本仓库, 并下载所依赖的第三方库(`LibAndResource`)

`LibAndResource` 下载地址:
链接: http://pan.baidu.com/s/1mi0wt88 密码: ey9v
下载之后将解压出来的文件夹 `LibAndResource` 放置在 `iRime` 目录下, 具体位置可参考下图:
![位置参考](https://raw.githubusercontent.com/xqin/iRime/master/LibAndResource.png "位置参考")



## 如果你有MAC电脑的话, 可以跳到本步骤.

#### 在 `Windows` 上使用 `VMWare Player` 安装 `macOS Sierra(10.12)`
教程如下(网页中有相关工具下载地址):
https://techsviewer.com/install-macos-sierra-vmware-windows/

> `VMWare` 的虚拟机文件, 百度盘下载地址:
链接:http://pan.baidu.com/s/1eR9L1KY 密码:qcm9

> `VMware Player` 请从 [VMWare官网](https://www.vmware.com/products/player/playerpro-evaluation.html) 直接下载(免费).


### 下载 `XCode 8.3.3` 并安装至MAC系统中

[XCode 8.3.3下载地址](https://developer.apple.com/download/)


完成上面的操作之后, 用 `XCode` 打开 `iRime` 目录下的 `iRime.xcworkspace` 文件,
更新 项目中 所关联的 Apple Id 为您自己的账号及对应的group.
然后将手机连接至电脑上, 将目标选择为自己的手机,
然后按 `Command+R` 就可以编译代码并将编译后的程序安装到您的手机上了.

## PS: 该仓库中原有代码版权归原作者所有, 请在使用时遵守相关的 LICENSE.
Binary file removed iRime/.DS_Store
Binary file not shown.
3 changes: 1 addition & 2 deletions iRime/Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
#import "AGEmojiPageView.h"
#import "SVProgressHUD.h"
#import "FileManger.h"
#import "NSString+path.h"
#import "NSString+Path.h"
#import "common.h"
#import "PlaySound.h"
#import "OpenCCService.h"
#import <Masonry.h>
#import <MJRefresh.h>
Expand Down
Binary file removed iRime/Keyboard/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion iRime/Keyboard/Keyboard.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.Rime</string>
<string>group.xqin.net</string>
</array>
</dict>
</plist>
Binary file removed iRime/Keyboard/RimeWrapeper/.DS_Store
Binary file not shown.
141 changes: 71 additions & 70 deletions iRime/Keyboard/RimeWrapeper/Source/RimeWrapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ typedef NS_OPTIONS(NSUInteger, NSEventModifierFlags) {
static id<RimeNotificationDelegate> notificationDelegate_ = nil;

void notificationHandler(void* context_object, RimeSessionId session_id, const char* message_type, const char* message_value) {

if (notificationDelegate_ == nil) {
return;
}

if (!strcmp(message_type, "deploy")) { // Deployment state change

if (!strcmp(message_value, "start")) {
if ([notificationDelegate_ respondsToSelector:@selector(onDeploymentStarted)]) {
[notificationDelegate_ onDeploymentStarted];
Expand All @@ -114,20 +114,20 @@ void notificationHandler(void* context_object, RimeSessionId session_id, const c
[notificationDelegate_ onDeploymentFailed];
}
}

} else if (!strcmp(message_type, "schema") && [notificationDelegate_ respondsToSelector:@selector(onSchemaChangedWithNewSchema:)]) { // Schema change

const char* schema_name = strchr(message_value, '/');
if (schema_name) {
++schema_name;
[notificationDelegate_ onSchemaChangedWithNewSchema:[NSString stringWithFormat:@"%@", [NSString stringWithUTF8String:schema_name]]];
}

} else if (!strcmp(message_type, "option") && [notificationDelegate_ respondsToSelector:@selector(onOptionChangedWithOption:value:)]) { // Option change

XRimeOption option = XRimeOptionUndefined;
BOOL value = (message_value[0] != '!');;

if (!strcmp(message_value, "ascii_mode") || !strcmp(message_value, "!ascii_mode")) {
option = XRimeOptionASCIIMode;
}
Expand All @@ -143,9 +143,9 @@ void notificationHandler(void* context_object, RimeSessionId session_id, const c
else if (!strcmp(message_value, "extended_charset") || !strcmp(message_value, "!extended_charset")) {
option = XRimeOptionExtendedCharset;
}

[notificationDelegate_ onOptionChangedWithOption:option value:value];

}
}

Expand All @@ -156,16 +156,16 @@ + (void)setNotificationDelegate:(id<RimeNotificationDelegate>)delegate {
}

+ (BOOL)startService {

NSString *rimePath = nil;
NSString *shareSupportPath = nil;
NSString *userPath = nil;

shareSupportPath = [NSString appendingHostAppBundlePath:@"SharedSupport"];
rimePath = [NSString rimeResource];
userPath = [NSString userPath];


NSError *err = nil;
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:rimePath]) {
Expand All @@ -174,13 +174,13 @@ + (BOOL)startService {
return NO;
}
}

if (![fileManager fileExistsAtPath:userPath]) {
if (![fileManager createDirectoryAtPath:userPath withIntermediateDirectories:YES attributes:nil error:&err]) {
NSLog(@"Failed to create user data directory. err :%@", err);
}
}

RIME_STRUCT(RimeTraits, vXIMETraits);
vXIMETraits.shared_data_dir = [shareSupportPath UTF8String];
vXIMETraits.user_data_dir = [rimePath UTF8String];
Expand All @@ -191,10 +191,10 @@ + (BOOL)startService {
NSString *dir = [NSString stringWithFormat:@"%@/%@", rimePath, @"testDir"];
NSFileManager * f = [NSFileManager defaultManager];
NSURL * url = [f containerURLForSecurityApplicationGroupIdentifier:GROUP_ID];

res = [f createDirectoryAtPath:[url absoluteString] withIntermediateDirectories:YES attributes:NULL error:&err];


NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"test", @"test----", nil];
dir = [NSString stringWithFormat:@"%@/%@", rimePath, @"test.txt"];
res = [dic writeToFile:dir atomically:YES];
Expand All @@ -206,19 +206,19 @@ + (BOOL)startService {
vXIMETraits.distribution_code_name = "iRime";
vXIMETraits.distribution_version = [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] UTF8String];
vXIMETraits.app_name = "iRime";

// Set Rime notification handler
RimeSetNotificationHandler(notificationHandler, (__bridge void *)self);

// Setup deployer and logging
RimeSetup(&vXIMETraits);

// Load modules and start service
RimeInitialize(NULL);

// Fast deploy
[self deployWithFastMode:YES];

return YES;
}

Expand All @@ -241,7 +241,7 @@ + (void)redeployWithFastMode:(BOOL)fastMode {
// Restart service
RimeFinalize();
RimeInitialize(NULL);

// Deploy
[self deployWithFastMode:fastMode];
}
Expand Down Expand Up @@ -391,12 +391,12 @@ + (XRimeContext *)contextForSession:(RimeSessionId)sessiodId {
if (ctx.commit_text_preview) {
[xCtx setCommitTextPreview:[NSString stringWithUTF8String:ctx.commit_text_preview]];
}

XRimeMenu *xMenu = [[XRimeMenu alloc] init];
XRimeComposition * xComp = [[XRimeComposition alloc] init];
[xCtx setMenu:xMenu];
[xCtx setComposition:xComp];

[xMenu setPageSize:ctx.menu.page_size];
[xMenu setPageNumber:ctx.menu.page_no];
[xMenu setIsLastPage:ctx.menu.is_last_page == True];
Expand Down Expand Up @@ -440,26 +440,26 @@ + (NSArray *)getCandidateListForSession:(RimeSessionId)sessionId
//candidate
RimeCandidateListIterator ite;
NSMutableArray *candidates = [NSMutableArray new];

@autoreleasepool {


bool res = RimeCandidateListBegin(sessionId, &ite);
if (res == false) {
return nil;
}

NSString *s = nil;
while (RimeCandidateListNext(&ite)) {

if (ite.index > kMaxCandidateListCount) {
break;
}
s = [NSString stringWithUTF8String:ite.candidate.text];
// NSLog(@"%@", s);
[candidates addObject:s];
}

RimeCandidateListEnd(&ite);
}
return candidates;
Expand All @@ -471,37 +471,38 @@ +(NSArray*)getCandidateListForSession:(RimeSessionId)sessionId andIndex:(NSInteg
if (index > kMaxCandidateListCount) {
return candidates;
}

//candidate
RimeCandidateListIterator ite;

@autoreleasepool {

bool res = RimeCandidateListBeginWithIndex((int)index, sessionId, &ite);
if (res == false) {
return nil;
bool res = RimeCandidateListBegin(sessionId, &ite);
if (res == false) {
return nil;
}


NSString *s = nil;
NSInteger candidateMax = index + count;

if (candidateMax > kMaxCandidateListCount) {
candidateMax = kMaxCandidateListCount;
}

while (RimeCandidateListNext(&ite)) {
if (ite.index <= index) {
continue;
}
NSInteger candidateMax = index + count;


//NSInteger i = index;
NSString *s = nil;
while (RimeCandidateListNext(&ite)) {

if (ite.index > candidateMax) {
break;
}
s = [NSString stringWithUTF8String:ite.candidate.text];
//NSLog(@"%d:%@", i, s);
// i++;
[candidates addObject:s];

if (ite.index > candidateMax) {
break;
}

RimeCandidateListEnd(&ite);

s = [NSString stringWithUTF8String:ite.candidate.text];
[candidates addObject:s];
}


RimeCandidateListEnd(&ite);

return candidates;

}


Expand All @@ -519,34 +520,34 @@ + (BOOL)selectCandidateForSession:(RimeSessionId)seesionId inIndex:(size_t)index

+(NSArray*)getSchemaList
{

RimeSchemaList schemaList;

Bool r = rime_get_api()->get_schema_list(&schemaList);
if (r == NO) {
NSLog(@"get schema list fail");
return nil;
}


NSMutableArray *res = [NSMutableArray new];
RimeSchemaListItem *item = nil;

for (int i = 0; i < schemaList.size; i++) {

item = &schemaList.list[i];

}


return res;


}

+(void)selectSchemaInRimeSeesiong:(RimeSessionId) seesionId useSchemaId:(const char*) schemaId
{

}


Expand Down
Binary file removed iRime/Keyboard/ZipArchive/.DS_Store
Binary file not shown.
Binary file not shown.
Loading