t-suw****@users*****
t-suw****@users*****
2007年 9月 24日 (月) 20:10:05 JST
Index: AquaSKK/skkserv.cpp diff -u AquaSKK/skkserv.cpp:1.3.2.7 AquaSKK/skkserv.cpp:1.3.2.8 --- AquaSKK/skkserv.cpp:1.3.2.7 Fri Aug 17 21:47:26 2007 +++ AquaSKK/skkserv.cpp Mon Sep 24 20:10:04 2007 @@ -1,5 +1,5 @@ /* - $Id: skkserv.cpp,v 1.3.2.7 2007/08/17 12:47:26 t-suwa Exp $ + $Id: skkserv.cpp,v 1.3.2.8 2007/09/24 11:10:04 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -94,6 +94,7 @@ switch(cmd) { case '0': // åæ break; + case '1': { // æ¤ç´¢ std::string word; sock >> word; @@ -115,23 +116,32 @@ if(result != "//") { std::string candidates; jconv::convert_utf8_to_eucj(result, candidates); - sock << "1" << candidates << "\n"; + sock << '1' << candidates << std::endl; } else { - sock << "4" << word << "\n"; + sock << '4' << word << ' '; } sock.flush(); } break; + case '2': // ãã¼ã¸ã§ã³ - sock << "AquaSKKServer (skkserv emulation)" << std::endl; + sock << "AquaSKKServer1.0 "; sock.flush(); break; + case '3': // ãã¹ãæ å ± - sock << ip_address::getsockname(sock.socket()) << ":0.0.0.0:" << std::endl; + sock << ip_address::getsockname(sock.socket()) << ":0.0.0.0: "; sock.flush(); break; + + case '4': // ãµã¼ãã¼è£å® + // ä»ã®ã¨ããæªå¯¾å¿ + sock.ignore(0xff, ' '); + default: // ç¡å¹ãªã³ãã³ã fprintf(stderr, "AquaSKK(skkserv): Unknown command[0x%02x]\n", cmd); + sock << '0'; + sock.flush(); break; } } while(sock.good() && cmd != '0'); Index: AquaSKK/SKKDictionary.cpp diff -u AquaSKK/SKKDictionary.cpp:1.12.2.5 AquaSKK/SKKDictionary.cpp:1.12.2.6 --- AquaSKK/SKKDictionary.cpp:1.12.2.5 Sat Feb 3 17:52:48 2007 +++ AquaSKK/SKKDictionary.cpp Mon Sep 24 20:10:04 2007 @@ -1,5 +1,5 @@ /* - $Id: SKKDictionary.cpp,v 1.12.2.5 2007/02/03 08:52:48 t-suwa Exp $ + $Id: SKKDictionary.cpp,v 1.12.2.6 2007/09/24 11:10:04 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -462,7 +462,7 @@ // è¦ã¤ãã£ãï¼ if(i != okuriAri_.end()) { entry = SKKEntry::ParseOkuriAri(i->first, i->second); - okuriAri_.erase(std::remove(okuriAri_.begin(), okuriAri_.end(), *i), okuriAri_.end()); + okuriAri_.erase(i); } entry.Update(SKKCandidate(kanji), okuri); @@ -479,7 +479,7 @@ // è¦ã¤ãã£ãï¼ if(i != okuriNasi_.end()) { entry = SKKEntry::ParseOkuriNasi(i->first, i->second); - okuriNasi_.erase(std::remove(okuriNasi_.begin(), okuriNasi_.end(), *i), okuriNasi_.end()); + okuriNasi_.erase(i); } entry.Update(SKKCandidate(kanji)); @@ -506,7 +506,7 @@ *i = SKKPair(entry.Key(), entry.Candidate()); } else { // ãã®ã¨ã³ããªãæ¶ãã¦ãã¾ã - okuriAri_.erase(std::remove(okuriAri_.begin(), okuriAri_.end(), *i), okuriAri_.end()); + okuriAri_.erase(i); } // ä¿åãã @@ -530,7 +530,7 @@ *i = SKKPair(entry.Key(), entry.Candidate()); } else { // ãã®ã¨ã³ããªãæ¶ãã¦ãã¾ã - okuriNasi_.erase(std::remove(okuriNasi_.begin(), okuriNasi_.end(), *i), okuriNasi_.end()); + okuriNasi_.erase(i); } // ä¿åãã Index: AquaSKK/KotoeriDictionary.cpp diff -u AquaSKK/KotoeriDictionary.cpp:1.3.2.4 AquaSKK/KotoeriDictionary.cpp:1.3.2.5 --- AquaSKK/KotoeriDictionary.cpp:1.3.2.4 Sat Feb 3 17:52:48 2007 +++ AquaSKK/KotoeriDictionary.cpp Mon Sep 24 20:10:04 2007 @@ -1,10 +1,10 @@ /* - $Id: KotoeriDictionary.cpp,v 1.3.2.4 2007/02/03 08:52:48 t-suwa Exp $ + $Id: KotoeriDictionary.cpp,v 1.3.2.5 2007/09/24 11:10:04 t-suwa Exp $ MacOS X implementation of the SKK input method. Copyright (C) 2002 phonohawk - Copyright (C) 2005-2006 Tomotaka SUWA <t.suw****@mac*****> + Copyright (C) 2005-2007 Tomotaka SUWA <t.suw****@mac*****> 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 @@ -24,10 +24,11 @@ Directory Maneger対å¿ã2002.09.25 Shin_ichi Abe. */ -#include <Carbon/Carbon.h> #include <iostream> #include <vector> #include "KotoeriDictionary.h" +#include "CppCFData.h" +#include "CppCFString.h" KotoeriDictionary::KotoeriDictionary() : path_(0), isRegistered_(false), id_(0) { // empty @@ -123,13 +124,13 @@ if(status != noErr) break; DescType actualType; - char dataBuffer[kMaxKanjiLengthInAppleJapaneseDictionary]; + UInt8 dataBuffer[kMaxKanjiLengthInAppleJapaneseDictionary]; Size actualSize; // Get one data from AERecord status = AEGetParamPtr(&dataList, kDCMJapaneseHyokiTag, - typeUTF8Text, + typeUnicodeText, &actualType, dataBuffer, kMaxKanjiLengthInAppleJapaneseDictionary, @@ -140,8 +141,12 @@ if(status != noErr) break; + CFStringRef entry = CFStringCreateWithBytes(0, dataBuffer, actualSize, kCFStringEncodingUnicode, 0); + CppCFString tmp(entry); + CFRelease(entry); + result += '/'; - result.append(dataBuffer, actualSize); + result += tmp.encode().toStdString(kCFStringEncodingUTF8); } DCMDisposeRecordIterator(iterator); @@ -162,12 +167,13 @@ // ã¬ã³ã¼ããæ¤ç´¢ OSStatus status; DCMFieldTag dataFieldTagList[] = { kDCMJapaneseHyokiTag }; - CFStringRef keydata = CFStringCreateWithCString(NULL, key.c_str(), kCFStringEncodingUTF8); + CFStringRef keydata = CppCFString(key.c_str(), kCFStringEncodingUTF8).toBigEndianCFString(); + status = DCMFindRecords(ref, // Dictionary reference - kDCMJapaneseYomiTag, // key field tag - CFStringGetLength(keydata) * sizeof(UInt16), // key data length + kDCMJapaneseYomiTag, // key field tag + CFStringGetLength(keydata) * sizeof(UniChar), // key data length CFStringGetCharactersPtr(keydata), // key data - kDCMFindMethodExactMatch, // find method + kDCMFindMethodExactMatch, // find method 1, // number of data field dataFieldTagList, // data field tag list 0, 0, // search all records Index: AquaSKK/KanjiConversionMode.cpp diff -u AquaSKK/KanjiConversionMode.cpp:1.8.2.6 AquaSKK/KanjiConversionMode.cpp:1.8.2.7 --- AquaSKK/KanjiConversionMode.cpp:1.8.2.6 Thu Aug 16 19:58:18 2007 +++ AquaSKK/KanjiConversionMode.cpp Mon Sep 24 20:10:04 2007 @@ -1,5 +1,5 @@ /* - $Id: KanjiConversionMode.cpp,v 1.8.2.6 2007/08/16 10:58:18 t-suwa Exp $ + $Id: KanjiConversionMode.cpp,v 1.8.2.7 2007/09/24 11:10:04 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -1028,7 +1028,7 @@ // ã㪠仮åãâã-ã㪠仮å // èªã¿ã«ã¤ãã¦ã¯å ¨è§ä»®åã¨åè§ä»®åã平仮åã«å¤æ query.append('-').append(HiraganaInputMode::convert(root)).append(SKK_MSG_DELIMITER); - query.append(candidates[current_candidate_index]); + query.append(candidates[current_candidate_index].encode()); } // é¯ã«æ¸¡ã Index: AquaSKK/ChangeLog diff -u AquaSKK/ChangeLog:1.33.2.9 AquaSKK/ChangeLog:1.33.2.10 --- AquaSKK/ChangeLog:1.33.2.9 Thu Aug 16 19:58:18 2007 +++ AquaSKK/ChangeLog Mon Sep 24 20:10:04 2007 @@ -1,3 +1,23 @@ +2007-09-22 Tomotaka SUWA <t.suw****@mac*****> + + * KotoeriDictionary.cpp: æ¤ç´¢çµæãåãåºãã¿ã¤ãã + typeUnicodeText ã«çµ±ä¸ãã¦ã³ã³ãã¤ã©ãã£ã¬ã¯ãã£ããé¤å»ã + +2007-09-19 Tomotaka SUWA <t.suw****@mac*****> + + * BIMInputEvents.cpp (BIMHandleOffsetToPos): ã»ãã·ã§ã³ãã³ãã«ãè¦ + æ±ãããªã¼ãã¼ãã¼ããå»æ¢ã + + * skkserv.cpp: ãµã¼ãã¼è£å®è¦æ±æã«ã¯æ示çã«ç¡è¦ããããã«ä¿®æ£ã + + * SKKDictionary.cpp: åèªåé¤æã®ä¸è¦ãªæ¤ç´¢ãé¤å»ã + + * KotoeriDictionary.cpp: æ¤ç´¢ã§ããªãä¸å ·åãä¿®æ£ãã¾ããæ¤ç´¢çµæã® + ã¨ã³ã³ã¼ããå¿ãã¦ãããã追å ã + + * KanjiConversionMode.cpp: åé¤å¯¾è±¡åè£ãã¨ã³ã³ã¼ããå¿ãã¦ãããã + ã«åé¤ã§ããªãã£ãä¸å ·åãä¿®æ£ã + 2007-06-15 Tomotaka SUWA <t.suw****@mac*****> * AquaSKK.pbproj/project.pbxproj: Panther ã§ãã«ãã§ããããã«ä¿® Index: AquaSKK/BIMInputEvents.cpp diff -u AquaSKK/BIMInputEvents.cpp:1.3 AquaSKK/BIMInputEvents.cpp:1.3.2.1 --- AquaSKK/BIMInputEvents.cpp:1.3 Wed Apr 26 22:36:12 2006 +++ AquaSKK/BIMInputEvents.cpp Mon Sep 24 20:10:04 2007 @@ -1,5 +1,5 @@ /* - $Id: BIMInputEvents.cpp,v 1.3 2006/04/26 13:36:12 t-suwa Exp $ + $Id: BIMInputEvents.cpp,v 1.3.2.1 2007/09/24 11:10:04 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -228,10 +228,7 @@ // CvbgGAÌeíîñð¾éB void BIMHandleOffsetToPos(struct OffsetToPosParams *offsetToPosParams) { - BIMHandleOffsetToPos(BIMGetActiveSession(), offsetToPosParams); -} - -void BIMHandleOffsetToPos(BIMSessionHandle inSessionHandle, struct OffsetToPosParams *offsetToPosParams) { + BIMSessionHandle inSessionHandle = BIMGetActiveSession(); OSStatus status; ComponentInstance componentInstance; EventRef event;