t-suw****@users*****
t-suw****@users*****
2007年 9月 19日 (水) 22:57:17 JST
Index: AquaSKK/BIMInputEvents.cpp
diff -u AquaSKK/BIMInputEvents.cpp:1.3 AquaSKK/BIMInputEvents.cpp:1.4
--- AquaSKK/BIMInputEvents.cpp:1.3 Wed Apr 26 22:36:12 2006
+++ AquaSKK/BIMInputEvents.cpp Wed Sep 19 22:57:17 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.4 2007/09/19 13:57:17 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;
Index: AquaSKK/ChangeLog
diff -u AquaSKK/ChangeLog:1.43 AquaSKK/ChangeLog:1.44
--- AquaSKK/ChangeLog:1.43 Fri Jun 15 22:18:28 2007
+++ AquaSKK/ChangeLog Wed Sep 19 22:57:17 2007
@@ -1,3 +1,18 @@
+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/Info-AquaSKKInputMethod.plist
diff -u AquaSKK/Info-AquaSKKInputMethod.plist:1.16 AquaSKK/Info-AquaSKKInputMethod.plist:1.17
--- AquaSKK/Info-AquaSKKInputMethod.plist:1.16 Sat Jun 9 10:53:53 2007
+++ AquaSKK/Info-AquaSKKInputMethod.plist Wed Sep 19 22:57:17 2007
@@ -19,11 +19,11 @@
<key>CFBundlePackageType</key>
<string>thng</string>
<key>CFBundleShortVersionString</key>
- <string>3.4</string>
+ <string>modest-learning 1.1</string>
<key>CFBundleSignature</key>
<string>askk</string>
<key>CFBundleVersion</key>
- <string>2007-06-09</string>
+ <string>2007-09-18</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>tsInputMethodIconFileKey</key>
Index: AquaSKK/Info-AquaSKKServer.plist
diff -u AquaSKK/Info-AquaSKKServer.plist:1.16 AquaSKK/Info-AquaSKKServer.plist:1.17
--- AquaSKK/Info-AquaSKKServer.plist:1.16 Sat Jun 9 10:53:53 2007
+++ AquaSKK/Info-AquaSKKServer.plist Wed Sep 19 22:57:17 2007
@@ -19,11 +19,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>3.4</string>
+ <string>modest-learning 1.1</string>
<key>CFBundleSignature</key>
<string>askk</string>
<key>CFBundleVersion</key>
- <string>2007-06-09</string>
+ <string>2007-09-18</string>
<key>NSMainNibFile</key>
<string>Principal</string>
<key>NSPrincipalClass</key>
Index: AquaSKK/KanjiConversionMode.cpp
diff -u AquaSKK/KanjiConversionMode.cpp:1.13 AquaSKK/KanjiConversionMode.cpp:1.14
--- AquaSKK/KanjiConversionMode.cpp:1.13 Thu Jun 14 21:00:16 2007
+++ AquaSKK/KanjiConversionMode.cpp Wed Sep 19 22:57:17 2007
@@ -1,5 +1,5 @@
/*
- $Id: KanjiConversionMode.cpp,v 1.13 2007/06/14 12:00:16 t-suwa Exp $
+ $Id: KanjiConversionMode.cpp,v 1.14 2007/09/19 13:57:17 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/KotoeriDictionary.cpp
diff -u AquaSKK/KotoeriDictionary.cpp:1.4 AquaSKK/KotoeriDictionary.cpp:1.5
--- AquaSKK/KotoeriDictionary.cpp:1.4 Mon Dec 18 00:05:41 2006
+++ AquaSKK/KotoeriDictionary.cpp Wed Sep 19 22:57:17 2007
@@ -1,5 +1,5 @@
/*
- $Id: KotoeriDictionary.cpp,v 1.4 2006/12/17 15:05:41 t-suwa Exp $
+ $Id: KotoeriDictionary.cpp,v 1.5 2007/09/19 13:57:17 t-suwa Exp $
MacOS X implementation of the SKK input method.
@@ -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
@@ -129,7 +130,7 @@
// Get one data from AERecord
status = AEGetParamPtr(&dataList,
kDCMJapaneseHyokiTag,
- typeUTF8Text,
+ 'ut16', // typeUTF16ExternalRepresentation
&actualType,
dataBuffer,
kMaxKanjiLengthInAppleJapaneseDictionary,
@@ -140,8 +141,10 @@
if(status != noErr) break;
+ CppCFString tmp(CppCFData(dataBuffer, actualSize).getData());
+
result += '/';
- result.append(dataBuffer, actualSize);
+ result += tmp.encode().toStdString(kCFStringEncodingUTF8);
}
DCMDisposeRecordIterator(iterator);
@@ -162,12 +165,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/KotoeriDictionary.h
diff -u AquaSKK/KotoeriDictionary.h:1.3 AquaSKK/KotoeriDictionary.h:1.4
--- AquaSKK/KotoeriDictionary.h:1.3 Mon Dec 18 00:05:41 2006
+++ AquaSKK/KotoeriDictionary.h Wed Sep 19 22:57:17 2007
@@ -1,5 +1,5 @@
/*
- $Id: KotoeriDictionary.h,v 1.3 2006/12/17 15:05:41 t-suwa Exp $
+ $Id: KotoeriDictionary.h,v 1.4 2007/09/19 13:57:17 t-suwa Exp $
MacOS X implementation of the SKK input method.
@@ -27,6 +27,7 @@
#ifndef INC__KotoeriDictionary__
#define INC__KotoeriDictionary__
+#include <Carbon/Carbon.h>
#include "Dictionary.h"
class KotoeriDictionary: public Dictionary {
Index: AquaSKK/SKKDictionary.cpp
diff -u AquaSKK/SKKDictionary.cpp:1.15 AquaSKK/SKKDictionary.cpp:1.16
--- AquaSKK/SKKDictionary.cpp:1.15 Fri Dec 29 00:37:03 2006
+++ AquaSKK/SKKDictionary.cpp Wed Sep 19 22:57:17 2007
@@ -1,5 +1,5 @@
/*
- $Id: SKKDictionary.cpp,v 1.15 2006/12/28 15:37:03 t-suwa Exp $
+ $Id: SKKDictionary.cpp,v 1.16 2007/09/19 13:57:17 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/skkserv.cpp
diff -u AquaSKK/skkserv.cpp:1.5 AquaSKK/skkserv.cpp:1.6
--- AquaSKK/skkserv.cpp:1.5 Sat Jan 27 12:52:30 2007
+++ AquaSKK/skkserv.cpp Wed Sep 19 22:57:17 2007
@@ -1,5 +1,5 @@
/*
- $Id: skkserv.cpp,v 1.5 2007/01/27 03:52:30 t-suwa Exp $
+ $Id: skkserv.cpp,v 1.6 2007/09/19 13:57:17 t-suwa Exp $
MacOS X implementation of the SKK input method.
@@ -93,6 +93,7 @@
switch(cmd) {
case '0': // åæ
break;
+
case '1': { // æ¤ç´¢
std::string word;
sock >> word;
@@ -114,23 +115,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');