From t-suwa ¡÷ users.sourceforge.jp Mon Dec 17 23:48:49 2007 From: t-suwa ¡÷ users.sourceforge.jp (t-suwa ¡÷ users.sourceforge.jp) Date: Mon, 17 Dec 2007 23:48:49 +0900 Subject: [aquaskk-changes 437] CVS update: AquaSKK Message-ID: <1197902929.505410.21424.nullmailer@users.sourceforge.jp> Index: AquaSKK/BIM.cpp diff -u AquaSKK/BIM.cpp:1.17 AquaSKK/BIM.cpp:1.18 --- AquaSKK/BIM.cpp:1.17 Sun Nov 11 14:18:52 2007 +++ AquaSKK/BIM.cpp Mon Dec 17 23:48:49 2007 @@ -1,5 +1,5 @@ /* - $Id: BIM.cpp,v 1.17 2007/11/11 05:18:52 t-suwa Exp $ + $Id: BIM.cpp,v 1.18 2007/12/17 14:48:49 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -380,6 +380,12 @@ case kUpArrowCharCode: case kDownArrowCharCode: return (*inSessionHandle)->imsession_input_mode->handleArrow(event); + + case kHomeCharCode: + case kEndCharCode: + case kHelpCharCode: + return false; + default: if(event == SKKConfig::CancelKey()) { return (*inSessionHandle)->imsession_input_mode->handleCg(); Index: AquaSKK/ChangeLog diff -u AquaSKK/ChangeLog:1.55 AquaSKK/ChangeLog:1.56 --- AquaSKK/ChangeLog:1.55 Mon Nov 19 23:13:36 2007 +++ AquaSKK/ChangeLog Mon Dec 17 23:48:49 2007 @@ -1,3 +1,15 @@ +2007-12-17 Tomotaka SUWA + + * BIM.cpp: ASCII ?¢ã???»¥å¤?? HOME, END, HELP ??????????·å???¿® + æ­?#11413)??+ + * Japanese.lproj/AboutBox.nib/*: ????¢ã?????????¿®æ­£ã? + + * CppMessagePortServer.*: ?¡ã??»ã??¸ã??¼ã????????ºã??¤ã??³ã???? + ?¹ã?????¿ã?移å???+ + * PreferencesController.mm: ????¤ã??³ã??¸ã?ä¸??????¥ã??????+ 2007-11-19 Tomotaka SUWA * SKKDictionary.cpp: ????´æ?è¾???????????????¥å??§è?????????Index: AquaSKK/CppMessagePortServer.cpp diff -u AquaSKK/CppMessagePortServer.cpp:1.3 AquaSKK/CppMessagePortServer.cpp:1.4 --- AquaSKK/CppMessagePortServer.cpp:1.3 Wed Apr 26 22:36:12 2006 +++ AquaSKK/CppMessagePortServer.cpp Mon Dec 17 23:48:49 2007 @@ -1,5 +1,5 @@ /* - $Id: CppMessagePortServer.cpp,v 1.3 2006/04/26 13:36:12 t-suwa Exp $ + $Id: CppMessagePortServer.cpp,v 1.4 2007/12/17 14:48:49 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -46,24 +46,25 @@ context.copyDescription = NULL; // ???????????? - CFMessagePortRef port = CFMessagePortCreateLocal( - NULL, - portName.getString(), - CppMessagePortServer::callbackFunction, - &context, - NULL); - if(port == NULL) { + port_ = CFMessagePortCreateLocal(NULL, portName.getString(), + CppMessagePortServer::callbackFunction, + &context, NULL); + if(port_ == NULL) { throw exception_CFMessagePortCreateLocal(); } // RunLoop ????? - runLoopSource_ = CFMessagePortCreateRunLoopSource(NULL, port, 0); + runLoopSource_ = CFMessagePortCreateRunLoopSource(NULL, port_, 0); privateRunLoop_ = new PrivateRunLoop(loopMode, runLoopSource_); - - CFRelease(port); } CppMessagePortServer::~CppMessagePortServer() { + // Important: If you want to tear down the connection, you must + // invalidate the port (using CFMessagePortInvalidate) before + // releasing the runloop source and the message port object. + // (ADC ????????) + CFMessagePortInvalidate(port_); + // RunLoop ???? if(privateRunLoop_) { delete privateRunLoop_; @@ -72,10 +73,12 @@ if(runLoopSource_) { CFRelease(runLoopSource_); } + + CFRelease(port_); } CFDataRef CppMessagePortServer::callbackFunction(CFMessagePortRef local, SInt32 msgid, CFDataRef data, void* info) { - CppMessagePortServer* self = static_cast(info); + CppMessagePortServer* self = reinterpret_cast(info); CppCFData packet(data); return self->messageReceived(msgid, packet).getCloneOfData(); Index: AquaSKK/CppMessagePortServer.h diff -u AquaSKK/CppMessagePortServer.h:1.4 AquaSKK/CppMessagePortServer.h:1.5 --- AquaSKK/CppMessagePortServer.h:1.4 Wed Apr 26 22:36:12 2006 +++ AquaSKK/CppMessagePortServer.h Mon Dec 17 23:48:49 2007 @@ -1,5 +1,5 @@ /* - $Id: CppMessagePortServer.h,v 1.4 2006/04/26 13:36:12 t-suwa Exp $ + $Id: CppMessagePortServer.h,v 1.5 2007/12/17 14:48:49 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -38,6 +38,7 @@ */ class CppMessagePortServer { + CFMessagePortRef port_; PrivateRunLoop* privateRunLoop_; CFRunLoopSourceRef runLoopSource_; Index: AquaSKK/Info-AquaSKKInputMethod.plist diff -u AquaSKK/Info-AquaSKKInputMethod.plist:1.22 AquaSKK/Info-AquaSKKInputMethod.plist:1.23 --- AquaSKK/Info-AquaSKKInputMethod.plist:1.22 Sun Nov 11 14:18:52 2007 +++ AquaSKK/Info-AquaSKKInputMethod.plist Mon Dec 17 23:48:49 2007 @@ -19,11 +19,11 @@ CFBundlePackageType thng CFBundleShortVersionString - objc-gc 1.1 + objc-gc 1.3 CFBundleSignature askk CFBundleVersion - 2007-11-11 + 2007-12-17 CSResourcesFileMapped tsInputMethodIconFileKey Index: AquaSKK/Info-AquaSKKServer.plist diff -u AquaSKK/Info-AquaSKKServer.plist:1.22 AquaSKK/Info-AquaSKKServer.plist:1.23 --- AquaSKK/Info-AquaSKKServer.plist:1.22 Sun Nov 11 14:18:52 2007 +++ AquaSKK/Info-AquaSKKServer.plist Mon Dec 17 23:48:49 2007 @@ -19,11 +19,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - objc-gc 1.1 + objc-gc 1.3 CFBundleSignature askk CFBundleVersion - 2007-11-11 + 2007-12-17 NSMainNibFile Principal NSPrincipalClass Index: AquaSKK/PreferencesController.mm diff -u AquaSKK/PreferencesController.mm:1.9 AquaSKK/PreferencesController.mm:1.10 --- AquaSKK/PreferencesController.mm:1.9 Mon Dec 18 00:05:41 2006 +++ AquaSKK/PreferencesController.mm Mon Dec 17 23:48:49 2007 @@ -1,5 +1,5 @@ /* -*- objc -*- - $Id: PreferencesController.mm,v 1.9 2006/12/17 15:05:41 t-suwa Exp $ + $Id: PreferencesController.mm,v 1.10 2007/12/17 14:48:49 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -220,9 +220,6 @@ skkserv.start([defaults integerForKey:KEY_skkserv_port], [defaults boolForKey:KEY_skkserv_localonly]); } - // ????????????? - ClientConnectionFactory::theInstance().newConnection().send(kSKKClientConfigurationModified, CppCFData()); - return TRUE; } From t-suwa ¡÷ users.sourceforge.jp Mon Dec 17 23:48:49 2007 From: t-suwa ¡÷ users.sourceforge.jp (t-suwa ¡÷ users.sourceforge.jp) Date: Mon, 17 Dec 2007 23:48:49 +0900 Subject: [aquaskk-changes 438] CVS update: AquaSKK/Japanese.lproj/AboutBox.nib Message-ID: <1197902929.837395.21439.nullmailer@users.sourceforge.jp> Index: AquaSKK/Japanese.lproj/AboutBox.nib/classes.nib diff -u AquaSKK/Japanese.lproj/AboutBox.nib/classes.nib:1.2 AquaSKK/Japanese.lproj/AboutBox.nib/classes.nib:1.3 --- AquaSKK/Japanese.lproj/AboutBox.nib/classes.nib:1.2 Thu Nov 3 14:46:51 2005 +++ AquaSKK/Japanese.lproj/AboutBox.nib/classes.nib Mon Dec 17 23:48:49 2007 @@ -1,13 +1,39 @@ -{ - IBClasses = ( - { - ACTIONS = {showWindow = id; }; - CLASS = AboutBoxController; - LANGUAGE = ObjC; - OUTLETS = {copyrightField = id; versionField = id; }; - SUPERCLASS = NSWindowController; - }, - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } - ); - IBVersion = 1; -} \ No newline at end of file + + + + + IBClasses + + + ACTIONS + + showWindow + id + + CLASS + AboutBoxController + LANGUAGE + ObjC + OUTLETS + + copyrightField + id + versionField + id + + SUPERCLASS + NSWindowController + + + CLASS + FirstResponder + LANGUAGE + ObjC + SUPERCLASS + NSObject + + + IBVersion + 1 + + Index: AquaSKK/Japanese.lproj/AboutBox.nib/info.nib diff -u AquaSKK/Japanese.lproj/AboutBox.nib/info.nib:1.3 AquaSKK/Japanese.lproj/AboutBox.nib/info.nib:1.4 --- AquaSKK/Japanese.lproj/AboutBox.nib/info.nib:1.3 Wed Apr 26 22:36:13 2006 +++ AquaSKK/Japanese.lproj/AboutBox.nib/info.nib Mon Dec 17 23:48:49 2007 @@ -1,16 +1,18 @@ - + - IBDocumentLocation - 275 124 356 240 0 0 1280 1002 IBFramework Version - 443.0 + 629 + IBLastKnownRelativeProjectPath + ../../AquaSKK.xcodeproj IBOldestOS - 3 + 5 + IBOpenObjects + IBSystem Version - 8H1619 - IBUsesTextArchiving - + 9B18 + targetFramework + IBCocoaFramework Index: AquaSKK/Japanese.lproj/AboutBox.nib/keyedobjects.nib From t-suwa ¡÷ users.sourceforge.jp Fri Dec 21 22:11:21 2007 From: t-suwa ¡÷ users.sourceforge.jp (t-suwa ¡÷ users.sourceforge.jp) Date: Fri, 21 Dec 2007 22:11:21 +0900 Subject: [aquaskk-changes 439] CVS update: AquaSKK Message-ID: <1198242681.308846.7120.nullmailer@users.sourceforge.jp> Index: AquaSKK/AquaSKKServer.mm diff -u AquaSKK/AquaSKKServer.mm:1.3 AquaSKK/AquaSKKServer.mm:1.4 --- AquaSKK/AquaSKKServer.mm:1.3 Mon Dec 18 00:05:41 2006 +++ AquaSKK/AquaSKKServer.mm Fri Dec 21 22:11:21 2007 @@ -1,5 +1,5 @@ /* -*- objc -*- - $Id: AquaSKKServer.mm,v 1.3 2006/12/17 15:05:41 t-suwa Exp $ + $Id: AquaSKKServer.mm,v 1.4 2007/12/21 13:11:21 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -61,15 +61,13 @@ NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults]; - // Ž«??z??????? - NSArray* content = [[PreferencesController sharedController] contentForDictionarySet]; + // ?????????????? + ServerMessageReceiver::start(kAquaSKKServerRunLoopMode); // Ž«?T???????? + NSArray* content = [[PreferencesController sharedController] contentForDictionarySet]; DictionarySet::theInstance().Initialize((CFArrayRef)content); - // ?????????????? - ServerMessageReceiver::start(kAquaSKKServerRunLoopMode); - // skkserv ??????????? if([defaults boolForKey:KEY_skkserv_enabled]) { skkserv::theInstance().start([defaults integerForKey:KEY_skkserv_port], Index: AquaSKK/ChangeLog diff -u AquaSKK/ChangeLog:1.56 AquaSKK/ChangeLog:1.57 --- AquaSKK/ChangeLog:1.56 Mon Dec 17 23:48:49 2007 +++ AquaSKK/ChangeLog Fri Dec 21 22:11:21 2007 @@ -1,3 +1,10 @@ +2007-12-21 Tomotaka SUWA + + * AquaSKKServer.mm: è¾???µã??????????????¼ã???³ã?????????? + ??????å¤????+ + * DictionarySet.*: è¾????????????????? + 2007-12-17 Tomotaka SUWA * BIM.cpp: ASCII ?¢ã???»¥å¤?? HOME, END, HELP ??????????·å???¿® Index: AquaSKK/DictionarySet.cpp diff -u AquaSKK/DictionarySet.cpp:1.9 AquaSKK/DictionarySet.cpp:1.10 --- AquaSKK/DictionarySet.cpp:1.9 Tue Jun 12 23:25:08 2007 +++ AquaSKK/DictionarySet.cpp Fri Dec 21 22:11:21 2007 @@ -1,5 +1,5 @@ /* - $Id: DictionarySet.cpp,v 1.9 2007/06/12 14:25:08 t-suwa Exp $ + $Id: DictionarySet.cpp,v 1.10 2007/12/21 13:11:21 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -104,7 +104,17 @@ return id.str(); } -void DictionarySet::load(CFArrayRef arrayRef) { +void* DictionarySet::thread(void* param) { + DictionarySet* obj = reinterpret_cast(param); + + obj->load(); + + return 0; +} + +void DictionarySet::load() { + Guard scope(async_); + DictionaryContainer cache; DictionaryPref entry; @@ -124,8 +134,8 @@ } // ???????¸ã????????¥ã?????????- for(CFIndex index = 0; index < CFArrayGetCount(arrayRef); ++ index) { - CFDictionaryRef dictRef = (CFDictionaryRef)CFRetain(CFArrayGetValueAtIndex(arrayRef, index)); + for(CFIndex index = 0; index < CFArrayGetCount(arrayRef_); ++ index) { + CFDictionaryRef dictRef = (CFDictionaryRef)CFRetain(CFArrayGetValueAtIndex(arrayRef_, index)); // DictionaryPref ????? entry.active = ((CFBooleanRef)CFDictionaryGetValue(dictRef, CFSTR("active")) == kCFBooleanTrue); @@ -161,6 +171,8 @@ // è¾??????£ã??·ã?????????? std::for_each(dicts_.begin(), dicts_.end(), DeleteDictionary()); cache.swap(dicts_); + + CFRelease(arrayRef_); } DictionarySet::DictionarySet() { @@ -179,21 +191,32 @@ } void DictionarySet::Initialize(CFArrayRef arrayRef) { - // è¾??????¼ã???? - load(arrayRef); + Guard scope(async_); + + arrayRef_ = (CFArrayRef)CFRetain(arrayRef); + + pthread_t loader_; + pthread_create(&loader_, 0, DictionarySet::thread, this); + pthread_detach(loader_); } void DictionarySet::Terminate() { + Guard scope(async_); + // ???????¸ã??????? std::for_each(dicts_.begin(), dicts_.end(), DeleteDictionary()); dicts_.clear(); } std::string DictionarySet::CompleteEntry(const std::string& key, char result_delimiter) { + Guard scope(async_); + return userdict_->findCompletions(key, result_delimiter); } std::string DictionarySet::FindOkuriAri(const std::string& key, const std::string& okuri, char result_delimiter) { + Guard scope(async_); + SKKEntry strict_match = SKKEntry::CreateOkuriAri(key); SKKEntry normal_match = strict_match; @@ -243,6 +266,8 @@ } std::string DictionarySet::FindOkuriNasi(const std::string& key, char result_delimiter) { + Guard scope(async_); + SKKEntry match = SKKEntry::CreateOkuriNasi(key); for(DictionaryPrefIterator iter = prefs_.begin(); iter != prefs_.end(); ++ iter) { @@ -265,6 +290,8 @@ } void DictionarySet::RegisterOkuriAri(const std::string& key, const std::string& okuri, const std::string& entry) { + Guard scope(async_); + if(key.empty() || entry.empty() || okuri.empty()) { std::cerr << "AquaSKK: Invalid registration received" << std::endl; } else { @@ -273,6 +300,8 @@ } void DictionarySet::RegisterOkuriNasi(const std::string& key, const std::string& entry) { + Guard scope(async_); + // key ????????????(??????????»é???? entry ???) if(key.empty()) { std::cerr << "AquaSKK: Invalid registration received" << std::endl; @@ -282,6 +311,8 @@ } void DictionarySet::RemoveOkuriAri(const std::string& key, const std::string& entry) { + Guard scope(async_); + if(key.empty() || entry.empty()) { std::cerr << "AquaSKK: Invalid removal received" << std::endl; } else { @@ -290,6 +321,8 @@ } void DictionarySet::RemoveOkuriNasi(const std::string& key, const std::string& entry) { + Guard scope(async_); + if(key.empty() || entry.empty()) { std::cerr << "AquaSKK: Invalid removal received" << std::endl; } else { Index: AquaSKK/DictionarySet.h diff -u AquaSKK/DictionarySet.h:1.3 AquaSKK/DictionarySet.h:1.4 --- AquaSKK/DictionarySet.h:1.3 Mon Dec 18 00:05:41 2006 +++ AquaSKK/DictionarySet.h Fri Dec 21 22:11:21 2007 @@ -1,5 +1,5 @@ /* -*- c++ -*- - $Id: DictionarySet.h,v 1.3 2006/12/17 15:05:41 t-suwa Exp $ + $Id: DictionarySet.h,v 1.4 2007/12/21 13:11:21 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -27,11 +27,14 @@ #include #include #include +#include "Mutex.h" class Dictionary; class UserDictionary; class DictionarySet { + Mutex async_; + // è¾????¨®é¡? enum DictionaryTypes { SKKDictionaryType = 10, @@ -58,9 +61,12 @@ DictionaryPrefContainer prefs_; DictionaryContainer dicts_; + CFArrayRef arrayRef_; + Dictionary* createDictionary(const DictionaryPref& pref) const; std::string generateID(const DictionaryPref& pref) const; - void load(CFArrayRef arrayRef); + static void* thread(void* param); + void load(); DictionarySet(); ~DictionarySet(); Index: AquaSKK/Info-AquaSKKInputMethod.plist diff -u AquaSKK/Info-AquaSKKInputMethod.plist:1.23 AquaSKK/Info-AquaSKKInputMethod.plist:1.24 --- AquaSKK/Info-AquaSKKInputMethod.plist:1.23 Mon Dec 17 23:48:49 2007 +++ AquaSKK/Info-AquaSKKInputMethod.plist Fri Dec 21 22:11:21 2007 @@ -23,7 +23,7 @@ CFBundleSignature askk CFBundleVersion - 2007-12-17 + 2007-12-21 CSResourcesFileMapped tsInputMethodIconFileKey Index: AquaSKK/Info-AquaSKKServer.plist diff -u AquaSKK/Info-AquaSKKServer.plist:1.23 AquaSKK/Info-AquaSKKServer.plist:1.24 --- AquaSKK/Info-AquaSKKServer.plist:1.23 Mon Dec 17 23:48:49 2007 +++ AquaSKK/Info-AquaSKKServer.plist Fri Dec 21 22:11:21 2007 @@ -23,7 +23,7 @@ CFBundleSignature askk CFBundleVersion - 2007-12-17 + 2007-12-21 NSMainNibFile Principal NSPrincipalClass