Tomotaka SUWA
t-suw****@users*****
2006年 3月 16日 (木) 00:33:30 JST
Index: AquaSKK/ChangeLog diff -u AquaSKK/ChangeLog:1.20.2.13 AquaSKK/ChangeLog:1.20.2.14 --- AquaSKK/ChangeLog:1.20.2.13 Fri Mar 10 00:33:20 2006 +++ AquaSKK/ChangeLog Thu Mar 16 00:33:29 2006 @@ -1,3 +1,16 @@ +2006-03-16 Tomotaka SUWA <t.suw****@mac*****> + + * Package/scripts/postflight: ~/Library/AquaSKK fBNgðì¬ + ·éèðÇÁBDictionarySet.plist ðú»·éêÉÍA©®XV + «ðg¤æ¤ÉC³B + + * SKKDictionary.cpp: [hðt@N^OB + + * ProxyDictionary.cpp: localhost Åú»µÈ¢æ¤ÉC³B + + * PreferencesController.mm: Intel Mac Éηé½ßAIconRef ¨ + NSImage Ï·ðæè|[^uÈû@ÉÏXB + 2006-03-10 Tomotaka SUWA <t.suw****@mac*****> * skkserv.cpp: OñÌC³ð³Éß·BÀSDZë©ë¯ÈC³¾Á½B Index: AquaSKK/PreferencesController.mm diff -u AquaSKK/PreferencesController.mm:1.6.2.11 AquaSKK/PreferencesController.mm:1.6.2.12 --- AquaSKK/PreferencesController.mm:1.6.2.11 Fri Mar 10 00:33:20 2006 +++ AquaSKK/PreferencesController.mm Thu Mar 16 00:33:29 2006 @@ -1,5 +1,5 @@ /* -*- objc -*- - $Id: PreferencesController.mm,v 1.6.2.11 2006/03/09 15:33:20 t-suwa Exp $ + $Id: PreferencesController.mm,v 1.6.2.12 2006/03/15 15:33:29 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -63,7 +63,6 @@ KeyboardLayoutIdentifier kbdId; CFStringRef name; IconRef icon = NULL; - NSImage* image = NULL; NSMutableDictionary* kbdDict = [[[NSMutableDictionary alloc] init] autorelease]; @@ -74,23 +73,19 @@ // IconRef ¨ NSImage Ï· if(icon) { - IconFamilyHandle iconFamily; - NSData* iconData; - - IconRefToIconFamily(icon, kSelectorAllSmallData, &iconFamily); - -#define Swap32(val) val = CFSwapInt32BigToHost(val); - Swap32(iconFamily[0]->resourceType); - Swap32(iconFamily[0]->resourceSize); - Swap32(iconFamily[0]->elements[0].elementType); - Swap32(iconFamily[0]->elements[0].elementSize); - iconData = [NSData dataWithBytes: *iconFamily length: iconFamily[0]->resourceSize]; - image = [[[NSImage alloc] initWithData:iconData] autorelease]; + CGRect rect = CGRectMake(0.0, 0.0, 16.0, 16.0); + NSImage* image = [[[NSImage alloc] initWithSize:NSMakeSize(rect.size.width, rect.size.height)] autorelease]; + [image lockFocus]; + PlotIconRefInContext((CGContextRef)[[NSGraphicsContext currentContext] graphicsPort], + &rect, kAlignNone, kTransformNone, NULL, kPlotIconRefNormalFlags, icon); + [image unlockFocus]; + [kbdDict setObject:image forKey:KbdIconKey]; + } else { + [kbdDict setObject:nil forKey:KbdIconKey]; } [kbdDict setObject:[NSNumber numberWithInt:kbdId] forKey:KbdIdKey]; [kbdDict setObject:(NSString*)name forKey:KbdNameKey]; - [kbdDict setObject:image forKey:KbdIconKey]; return kbdDict; } Index: AquaSKK/ProxyDictionary.cpp diff -u AquaSKK/ProxyDictionary.cpp:1.1.2.1 AquaSKK/ProxyDictionary.cpp:1.1.2.2 --- AquaSKK/ProxyDictionary.cpp:1.1.2.1 Mon Mar 6 21:03:00 2006 +++ AquaSKK/ProxyDictionary.cpp Thu Mar 16 00:33:29 2006 @@ -1,5 +1,5 @@ /* - $Id: ProxyDictionary.cpp,v 1.1.2.1 2006/03/06 12:03:00 t-suwa Exp $ + $Id: ProxyDictionary.cpp,v 1.1.2.2 2006/03/15 15:33:29 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -25,7 +25,7 @@ #include "OkuriganaEntry.h" #include "ProxyDictionary.h" -ProxyDictionary::ProxyDictionary() : host_("localhost"), port_(1178), active_(false) { +ProxyDictionary::ProxyDictionary() : host_(""), port_(1178), active_(false) { // empty } @@ -38,8 +38,7 @@ std::string::size_type pos = path.find_first_of(":"); if(pos != std::string::npos) { host_ = path.substr(0, pos); - std::stringstream buf(path.substr(pos + 1)); - buf >> port_; + port_ = atoi(path.substr(pos + 1).c_str()); } else { if(!path.empty()) { host_ = path; Index: AquaSKK/SKKDictionary.cpp diff -u AquaSKK/SKKDictionary.cpp:1.6.2.5 AquaSKK/SKKDictionary.cpp:1.6.2.6 --- AquaSKK/SKKDictionary.cpp:1.6.2.5 Fri Mar 10 00:33:20 2006 +++ AquaSKK/SKKDictionary.cpp Thu Mar 16 00:33:29 2006 @@ -1,5 +1,5 @@ /* - $Id: SKKDictionary.cpp,v 1.6.2.5 2006/03/09 15:33:20 t-suwa Exp $ + $Id: SKKDictionary.cpp,v 1.6.2.6 2006/03/15 15:33:29 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -77,6 +77,18 @@ return true; } + // «©ç©oµêÆóâÌyAðæ¾·é + bool GetEntry(std::ifstream& dic, std::string& index, std::string& line) { + dic >> index; + if(dic.eof()) { + return false; + } + dic.ignore(1, ' '); + std::getline(dic, line); + + return true; + } + // SKKPair ðär·ét@N^(Effective STL, p.99) class EntryCompare { bool keyLess(const SKKPair::first_type& k1, const SKKPair::first_type& k2) const { @@ -134,30 +146,20 @@ void SKKDictionary::initializeContainer(EntryContainer& okuriAri, EntryContainer& okuriNasi) { std::string line; std::string index; - std::string entry; std::ifstream dic; if(!skkdic::OpenAndSeek(path_, dic)) { return; } - while(1) { - dic >> index; - if(dic.eof()) break; - dic.ignore(1, ' '); - std::getline(dic, line); + while(skkdic::GetEntry(dic, index, line)) { if(skkdic::OkuriNasiMark.find(line) != std::string::npos) break; // èȵGgÍ~Å\[g³êÄ¢é͸ okuriAri.push_front(SKKPair(index, line)); } - while(1) { - dic >> index; - if(dic.eof()) break; - dic.ignore(1, ' '); - std::getline(dic, line); - + while(skkdic::GetEntry(dic, index, line)) { // è èGg͸Å\[g³êÄ¢é͸ okuriNasi.push_back(SKKPair(index, line)); } @@ -279,7 +281,8 @@ session << "GET " << obj->url_ << " HTTP/1.1" << std::endl; session << "Host: " << obj->host_ << std::endl; session << "If-Modified-Since: " << timestamp << std::endl; - session << "Connection: close" << std::endl << std::endl; + session << "Connection: close" << std::endl; + session << std::endl; // X|X std::string response; @@ -300,6 +303,7 @@ if(response.empty()) break; ofs << response << std::endl; } + ofs.close(); // [h EntryContainer tmpOkuriAri; @@ -347,20 +351,13 @@ return; } - while(1) { - dic >> index; - if(dic.eof()) break; - dic.ignore(1, ' '); - std::getline(dic, line); + while(skkdic::GetEntry(dic, index, line)) { if(skkdic::OkuriNasiMark.find(line) != std::string::npos) break; + okuriAri_.push_back(SKKPair(index, line)); } - while(1) { - dic >> index; - if(dic.eof()) break; - dic.ignore(1, ' '); - std::getline(dic, line); + while(skkdic::GetEntry(dic, index, line)) { okuriNasi_.push_back(SKKPair(index, line)); }