[aquaskk-changes 288] CVS update: AquaSKK

Back to archive index

Tomotaka SUWA t-suw****@users*****
2007年 1月 27日 (土) 12:52:30 JST


Index: AquaSKK/AsciiConversionMode.cpp
diff -u AquaSKK/AsciiConversionMode.cpp:1.8 AquaSKK/AsciiConversionMode.cpp:1.9
--- AquaSKK/AsciiConversionMode.cpp:1.8	Mon Dec 18 00:05:41 2006
+++ AquaSKK/AsciiConversionMode.cpp	Sat Jan 27 12:52:30 2007
@@ -1,10 +1,10 @@
 /*
-  $Id: AsciiConversionMode.cpp,v 1.8 2006/12/17 15:05:41 t-suwa Exp $
+  $Id: AsciiConversionMode.cpp,v 1.9 2007/01/27 03:52:30 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
   Copyright (C) 2002-2004 phonohawk
-  Copyright (C) 2006 Tomotaka SUWA <t.suw****@mac*****>
+  Copyright (C) 2006-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
@@ -183,11 +183,10 @@
 	// ¤ƒ‚[ƒh‚âŒó•â‘I‘ð‰æ–Ê‚È‚ç‘f’Ê‚èB
     }
 
-    if(SKKConfig::AbbrevModeKey() == skkchar) {
+    if(SKKConfig::AbbrevModeKey() == skkchar || SKKConfig::SetHenkanPointKey() == skkchar) {
 	if(status == STATUS_BLACK || status == STATUS_BLACK_WITH_WINDOW) {
 	    parent->fix(this->getStringToFix());
-	    parent->handleInput(skkchar);
-	    return false;
+	    return parent->handleInput(skkchar);
 	}
     }
 
@@ -242,22 +241,9 @@
 	    index += skkchar;
 	}
 	else if(status == STATUS_BLACK) {
-	    // Œ»Ý‚ÌŒó•â‚ðŠm’肵‚½ŒãA‰Šú‰»‚µ‚ďI—¹‚·‚邪A
-	    // “¯Žž‚ɍ¡‰ñ‚Ì•\Ž¦/fix‚ª”½‰f‚³‚ê‚È‚¢‚ƍ¢‚é‚Ì‚Å
-	    // ƒAƒXƒL[•ÏŠ·ƒ‚[ƒh‚ðI—¹‚³‚¹‚Ä‚©‚çparent‚ÌhandleInput‚É“n‚·B
-	    // AsciiConversionMode‚ÍSTATUS_NULL‚ÌŽž‚É‚Í
-	    // í‚ÉkIgnoreThis‚ð•Ô‚·B
-
-	    // ŽI‚É‘—M
-	    sendCurrentCandidateToServerToRegister();
-
-	    // „šû‚³‚ê‚È‚¢‚ªA‹­§“I‚ÉŠm’肳‚¹‚éB
-	    parent->fix(convertNumeric(numconv_, candidates[current_candidate_index]));
-
-	    parent->setEnabledAsciiConversionMode(false);
-	    initialize();
-
-	    parent->handleInput(skkchar);
+	    // Œ»Ý‚ÌŒó•â‚ðŠm’肵‚ďˆ—‚ðŒp‘±
+	    parent->fix(getStringToFix());
+	    return parent->handleInput(skkchar);
 	}
 	else if(status == STATUS_BLACK_WITH_WINDOW) {
 	    // asdfjkli1ƒtƒŒ[ƒ€“–‚½‚è‚ÌŒó•â”‚ª7‚æ‚菭‚È‚¯‚ê‚΂±‚ê‚àŒ¸‚éBj‚Ì•¶Žš‚Å‚ ‚ê‚Î
@@ -310,19 +296,11 @@
 	}
     }
     else if(status == STATUS_BLACK) {
-	// Œ»Ý‚ÌŒó•â‚ðŠm’肵‚Ä‚©‚çÅŒã‚Ì•¶Žš‚ðíœB
-	// ‚»‚µ‚ú‰»‚µ‚ďI—¹B
-	CppCFString str_to_fix(convertNumeric(numconv_, candidates[current_candidate_index]));
-	str_to_fix.eraseLast(1);
-
-	// ŽI‚É‘—M
-	sendCurrentCandidateToServerToRegister();
-
-	// ‰œ‚ÌŽè
-	parent->fix(str_to_fix);
+	// Œ»Ý‚ÌŒó•â‚ðŠm’肵‚ĈꕶŽšíœ
+	CppCFString str(getStringToFix());
+	str.eraseLast(1);
+	parent->fix(str);
 	parent->display(CppCFString());
-	parent->setEnabledAsciiConversionMode(false);
-	initialize();
     }
     else if(status == STATUS_BLACK_WITH_WINDOW) {
 	// Å‰‚̃tƒŒ[ƒ€‚È‚çA¥ƒ‚[ƒh‚Ö–ß‚é
@@ -399,16 +377,8 @@
     }
     
     if(status == STATUS_BLACK || status == STATUS_BLACK_WITH_WINDOW) {
-	// ŽI‚É‘—M
-	sendCurrentCandidateToServerToRegister();
-	
-	// Œ»Ý‚ÌŒó•â‚ðŠm’èB
-	parent->fix(convertNumeric(numconv_, candidates[current_candidate_index]));
-	
-	if(status == STATUS_BLACK_WITH_WINDOW) {
-	    // ƒEƒCƒ“ƒhƒE‚ð•Â‚¶‚éB
-	    closeCandidatesWindow();
-	}
+	// Œ»Ý‚ÌŒó•â‚ðŠm’è‚·‚é
+	parent->fix(getStringToFix());
     }
     
     // ƒAƒXƒL[•ÏŠ·ƒ‚[ƒh‚ðI—¹‚·‚éB
Index: AquaSKK/BIM.cpp
diff -u AquaSKK/BIM.cpp:1.14 AquaSKK/BIM.cpp:1.15
--- AquaSKK/BIM.cpp:1.14	Sat Jul  1 08:44:30 2006
+++ AquaSKK/BIM.cpp	Sat Jan 27 12:52:30 2007
@@ -1,10 +1,10 @@
 /*
-  $Id: BIM.cpp,v 1.14 2006/06/30 23:44:30 t-suwa Exp $
+  $Id: BIM.cpp,v 1.15 2007/01/27 03:52:30 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
   Copyright (C) 2002-2004 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,9 +24,8 @@
 #define TARGET_API_MAC_CARBON 1
 
 #include <Carbon/Carbon.h>
-#include <vector>
-#include <map>
-#include <stdio.h>
+#include <list>
+#include <cstdio>
 
 #include "BIM.h"
 #include "BIMInputEvents.h"
@@ -53,10 +52,15 @@
 #include "SKKConfig.h"
 
 enum {
-    kAboutSKKMenuCommand = 'ABOU',
-    kPreferencesMenuCommand = 'PREF'
+    kAboutCommand = 'abou',
+    kPreferencesCommand = 'pref',
+    kProjectWebCommand = 'sfjp',
+    kTipsCommand = 'tips'
 };
 
+static CFStringRef project_web_url = CFSTR("http://aquaskk.sourceforge.jp/");
+static CFStringRef tips_url = CFSTR("http://aquaskk.sourceforge.jp/inside_aquaskk/");
+
 static MenuRef gPencilMenu;
 
 static pascal OSStatus BIMPencilMenuEventHandler(EventHandlerCallRef inEventHandlerCallRef,
@@ -64,78 +68,36 @@
 
 // ƒZƒbƒVƒ‡ƒ“ŠÇ——p‚̃†[ƒeƒBƒŠƒeƒBƒNƒ‰ƒX
 class ActiveSession {
-    CFMutableArrayRef sessions_;
+    std::list<BIMSessionHandle> sessions_;
 
-    ActiveSession() : sessions_(0) {
-	CFArrayCallBacks c;
-	c.version = 0;
-	c.retain = ActiveSession::retain;
-	c.release = ActiveSession::release;
-	c.copyDescription = NULL;
-	c.equal = ActiveSession::equal;
-	sessions_ = CFArrayCreateMutable(kCFAllocatorDefault, 0, &c);
-    }
-
-    // ˆÈ‰º‚ÌŽO‚Â‚Í callback —p
-    static const void* retain(CFAllocatorRef /* allocator */, const void* value) {
-	return (const void *)CFRetain((CFTypeRef)value);
-    }
-
-    static void release(CFAllocatorRef /* allocator */, const void* value) {
-	return CFRelease((CFTypeRef)value);
-    }
-
-    static Boolean equal(const void* value1, const void* value2) {
-	return CFEqual((CFTypeRef)value1, (CFTypeRef)value2);
-    }
+    ActiveSession() {}
 
 public:
     // ƒVƒ“ƒOƒ‹ƒgƒ“
     static ActiveSession& theInstance() {
-	static ActiveSession self;
-	return self;
+	static ActiveSession obj;
+	return obj;
     }
 
-    ~ActiveSession() {
-	CFRelease(sessions_);
+    void Add(BIMSessionHandle handle) {
+	Remove(handle);
+	sessions_.push_back(handle);
     }
 
-    void Add(CFIndex session) {
-	CFNumberRef h = CFNumberCreate(kCFAllocatorDefault, kCFNumberCFIndexType, &session);
-	CFRange r = {0, 0};
-	CFIndex i = CFArrayGetFirstIndexOfValue(sessions_, r, h);
-	if(i != -1) {
-	    CFArrayRemoveValueAtIndex(sessions_, i);
-	}
-	// V‚µ‚¢ƒZƒbƒVƒ‡ƒ“‚ð”z—ñ‚Ì––”ö‚ɒljÁ‚·‚é
-	CFArrayAppendValue(sessions_, h);
-	CFRelease(h);
+    void Remove(BIMSessionHandle handle) {
+	sessions_.remove(handle);
     }
 
-    void Remove(CFIndex session) {
-	CFNumberRef h = CFNumberCreate(kCFAllocatorDefault, kCFNumberCFIndexType, &session);
-	CFRange r = {0, 0};
-	CFIndex i = CFArrayGetFirstIndexOfValue(sessions_, r, h);
-	if(i != -1) {
-	    CFArrayRemoveValueAtIndex(sessions_, i);
+    BIMSessionHandle GetCurrent() const {
+	if(sessions_.empty()) {
+	    return 0;
 	}
-	CFRelease(h);
-    }
 
-    void* GetCurrent() const {
-	CFIndex i = Count();
-	if(i >= 0) {
-	    CFNumberRef n = (CFNumberRef)CFArrayGetValueAtIndex(sessions_, i - 1);
-	    CFIndex h = 0;
-	    if(CFNumberGetValue(n, kCFNumberCFIndexType, &h)) {
-		return (void*)h;
-	    }
-	}
-	return NULL;
+	return sessions_.back();
     }
 
-    int Count(void) const {
-	return CFArrayGetCount(sessions_);
+    int Count() const {
+	return sessions_.size();
     }
 };
 
@@ -147,6 +109,14 @@
     KLSetCurrentKeyboardLayout(kbd);
 }
 
+void OpenURL(const CFStringRef str) {
+    CFURLRef url = CFURLCreateWithString(kCFAllocatorDefault, str, 0);
+
+    LSOpenCFURLRef(url, 0);
+
+    CFRelease(url);
+}
+
 // ƒOƒ[ƒoƒ‹‚È’l‚ð‰Šú‰»‚µA‰”•Mƒƒjƒ…[‚ð\’z‚·‚éB
 ComponentResult BIMInitialize(ComponentInstance /* inComponentInstance */, MenuRef *outTextServiceMenu) {
     ComponentResult result;
@@ -256,7 +226,7 @@
 
 // ƒZƒbƒVƒ‡ƒ“‚ªƒAƒNƒeƒBƒu‚É‚È‚é
 ComponentResult BIMSessionActivate(BIMSessionHandle inSessionHandle) {
-    ActiveSession::theInstance().Add((CFIndex)inSessionHandle);
+    ActiveSession::theInstance().Add(inSessionHandle);
 
     // Ý’è‚ðƒŠƒ[ƒh
     ClientConfiguration::theInstance().reloadConfiguration();
@@ -272,7 +242,7 @@
 
 // ƒZƒbƒVƒ‡ƒ“‚ªƒAƒNƒeƒBƒu‚Å‚È‚­‚È‚éB
 ComponentResult BIMSessionDeactivate(BIMSessionHandle inSessionHandle) {
-    ActiveSession::theInstance().Remove((CFIndex)inSessionHandle);
+    ActiveSession::theInstance().Remove(inSessionHandle);
 
     // ƒAƒNƒeƒBƒu‚Å‚È‚­‚È‚Á‚½Ž–‚ðŽI‚É“`‚¦‚éB
     if(ActiveSession::theInstance().Count() == 0) {
@@ -342,7 +312,7 @@
 
 // ƒAƒNƒeƒBƒu‚ȃZƒbƒVƒ‡ƒ“‚ð•Ô‚·B
 BIMSessionHandle BIMGetActiveSession() {
-    return (BIMSessionHandle)ActiveSession::theInstance().GetCurrent();
+    return ActiveSession::theInstance().GetCurrent();
 }
 
 // •¶Žš‚Ì“ü—͂ɑ΂µ‚Ă̏ˆ—B
@@ -420,12 +390,18 @@
     result = GetEventParameter(inEventRef, kEventParamDirectObject, typeHICommand, nil, sizeof(command), nil, &command);
     if(result == noErr) {
 	switch(command.commandID) {
-	case kAboutSKKMenuCommand:
+	case kAboutCommand:
 	    ServerConnectionFactory::theInstance().newConnection().send(kSKKShowAboutBox);
 	    break;
-	case kPreferencesMenuCommand:
+	case kPreferencesCommand:
 	    ServerConnectionFactory::theInstance().newConnection().send(kSKKShowPreferencesBox);
 	    break;
+	case kProjectWebCommand:
+	    OpenURL(project_web_url);
+	    break;
+	case kTipsCommand:
+	    OpenURL(tips_url);
+	    break;
 	default:
 	    BIMLog("unknown menu event[%d], index[%d]\n", command.commandID, command.menu.menuItemIndex);
 	    result = eventNotHandledErr;
Index: AquaSKK/ChangeLog
diff -u AquaSKK/ChangeLog:1.37 AquaSKK/ChangeLog:1.38
--- AquaSKK/ChangeLog:1.37	Fri Dec 29 09:57:18 2006
+++ AquaSKK/ChangeLog	Sat Jan 27 12:52:30 2007
@@ -1,3 +1,22 @@
+2007-01-27  Tomotaka SUWA  <t.suw****@mac*****>
+
+	* Makefile: チェック、リリース用のターゲットを追加。
+
+	* BIM.cpp: OpenURL() 関数を追加。Web サイト用のメニュー項目処理を実
+	装。ActiveSession クラスをリファクタリング。
+
+	* Japanese.lproj/Menu.nib: Web サイト用のリンク項目を追加。
+
+	* KanjiConversionMode.cpp, AsciiConversionMode.cpp:
+	SKKConfig::SetHenkanPointKey() の処理を追加。リファクタリング。
+
+2007-01-25  Tomotaka SUWA  <t.suw****@mac*****>
+
+	* KanaTreeController.*: decode() メソッドを追加。"&comma;" → ","、
+	"&sharp;" → "#"、"&space;" → " " にデコードする。
+
+	* skkserv.cpp: 『送りあり』の判定ミスを修正。
+
 2006-12-29  Tomotaka SUWA  <t.suw****@mac*****>
 
 	* AquaSKK 3.3 リリース。
Index: AquaSKK/Info-AquaSKKInputMethod.plist
diff -u AquaSKK/Info-AquaSKKInputMethod.plist:1.13 AquaSKK/Info-AquaSKKInputMethod.plist:1.14
--- AquaSKK/Info-AquaSKKInputMethod.plist:1.13	Fri Dec 29 09:57:18 2006
+++ AquaSKK/Info-AquaSKKInputMethod.plist	Sat Jan 27 12:52:30 2007
@@ -19,11 +19,11 @@
 	<key>CFBundlePackageType</key>
 	<string>thng</string>
 	<key>CFBundleShortVersionString</key>
-	<string>3.3</string>
+	<string>fix-skkserv 1.0</string>
 	<key>CFBundleSignature</key>
 	<string>askk</string>
 	<key>CFBundleVersion</key>
-	<string>2006-12-29</string>
+	<string>2007-01-27</string>
 	<key>CSResourcesFileMapped</key>
 	<true/>
 	<key>tsInputMethodIconFileKey</key>
Index: AquaSKK/Info-AquaSKKServer.plist
diff -u AquaSKK/Info-AquaSKKServer.plist:1.13 AquaSKK/Info-AquaSKKServer.plist:1.14
--- AquaSKK/Info-AquaSKKServer.plist:1.13	Fri Dec 29 09:57:18 2006
+++ AquaSKK/Info-AquaSKKServer.plist	Sat Jan 27 12:52:30 2007
@@ -7,7 +7,7 @@
 	<key>CFBundleExecutable</key>
 	<string>AquaSKKServer</string>
 	<key>CFBundleGetInfoString</key>
-	<string>Copyright 息 2005-2006, AquaSKK Project</string>
+	<string>Copyright 息 2005-2007, AquaSKK Project</string>
 	<key>CFBundleIconFile</key>
 	<string></string>
 	<key>CFBundleIdentifier</key>
@@ -19,11 +19,11 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>3.3</string>
+	<string>fix-skkserv 1.0</string>
 	<key>CFBundleSignature</key>
 	<string>askk</string>
 	<key>CFBundleVersion</key>
-	<string>2006-12-29</string>
+	<string>2007-01-27</string>
 	<key>NSMainNibFile</key>
 	<string>Principal</string>
 	<key>NSPrincipalClass</key>
Index: AquaSKK/KanaTreeController.cpp
diff -u AquaSKK/KanaTreeController.cpp:1.4 AquaSKK/KanaTreeController.cpp:1.5
--- AquaSKK/KanaTreeController.cpp:1.4	Wed May 17 01:13:10 2006
+++ AquaSKK/KanaTreeController.cpp	Sat Jan 27 12:52:30 2007
@@ -1,10 +1,10 @@
 /*
-  $Id: KanaTreeController.cpp,v 1.4 2006/05/16 16:13:10 t-suwa Exp $
+  $Id: KanaTreeController.cpp,v 1.5 2007/01/27 03:52:30 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
   Copyright (C) 2002-2004 phonohawk
-  Copyright (C) 2006 Tomotaka SUWA <t.suw****@mac*****>
+  Copyright (C) 2006-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
@@ -55,6 +55,14 @@
     // empty
 }
 
+void KanaTreeController::decode(std::vector<CppCFString>& items) const {
+    for(unsigned i = 0; i < items.size(); ++ i) {
+	items[i].replace("&comma;", ",");
+	items[i].replace("&sharp;", "#");
+	items[i].replace("&space;", " ");
+    }
+}
+
 void KanaTreeController::load(istream& is) {
     CppCFString empty;
     
@@ -66,6 +74,7 @@
 	
 	CppCFString line(str_line.c_str(),kCFStringEncodingEUC_JP);
 	vector<CppCFString> items = line.split(',');
+	decode(items);
 	
 	if (items.size() < 4) {
 	    // ˆÙí‚ȍsB
@@ -75,7 +84,7 @@
 	}
 	
 	// ˆÊ’u‚ðŒˆ‚ß‚é€–Ú‚ðlocation‚Æ‚·‚é‚ƁAlocation‚̐擪‚©‚çÅŒã-1”Ô–Ú‚Ü‚Å‚ÌŽ}‚ª‘S‚Ä‘¶Ý‚·‚邱‚Æ‚ðŠm”F‚µA‚à‚µ–³‚¯‚ê‚΍ì‚éB
-	CppCFString location = items[0].replace("&comma;",",");
+	CppCFString location = items[0];
 	unsigned len_location = location.length();
 	KanaTreeElement* current_branch = &root;
 	for (unsigned i = 0;i < len_location - 1;i++) {
Index: AquaSKK/KanaTreeController.h
diff -u AquaSKK/KanaTreeController.h:1.4 AquaSKK/KanaTreeController.h:1.5
--- AquaSKK/KanaTreeController.h:1.4	Wed May 17 01:13:10 2006
+++ AquaSKK/KanaTreeController.h	Sat Jan 27 12:52:30 2007
@@ -1,10 +1,10 @@
 /*
-  $Id: KanaTreeController.h,v 1.4 2006/05/16 16:13:10 t-suwa Exp $
+  $Id: KanaTreeController.h,v 1.5 2007/01/27 03:52:30 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
   Copyright (C) 2002-2004 phonohawk
-  Copyright (C) 2006 Tomotaka SUWA <t.suw****@mac*****>
+  Copyright (C) 2006-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
@@ -32,6 +32,8 @@
 class CppCFString;
 
 class KanaTreeController {
+    void decode(std::vector<CppCFString>& items) const;
+
 protected:
     KanaTreeElement root;
 
Index: AquaSKK/KanjiConversionMode.cpp
diff -u AquaSKK/KanjiConversionMode.cpp:1.9 AquaSKK/KanjiConversionMode.cpp:1.10
--- AquaSKK/KanjiConversionMode.cpp:1.9	Mon Dec 18 00:05:41 2006
+++ AquaSKK/KanjiConversionMode.cpp	Sat Jan 27 12:52:30 2007
@@ -1,10 +1,10 @@
 /*
-  $Id: KanjiConversionMode.cpp,v 1.9 2006/12/17 15:05:41 t-suwa Exp $
+  $Id: KanjiConversionMode.cpp,v 1.10 2007/01/27 03:52:30 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
   Copyright (C) 2002-2004 phonohawk
-  Copyright (C) 2006 Tomotaka SUWA <t.suw****@mac*****>
+  Copyright (C) 2006-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
@@ -322,11 +322,46 @@
 
     // •ÏŠ·ƒ|ƒCƒ“ƒgƒL[‚ª‚¨‚³‚ꂽŽž‚Ì“®ì
     if(SKKConfig::SetHenkanPointKey() == skkchar) {
-	if(status == STATUS_NULL || status == STATUS_WHITE_ROOT && root.length() == 0) {
+	if(status == STATUS_NULL || (status == STATUS_WHITE_ROOT && root.length() == 0)) {
 	    status = STATUS_WHITE_ROOT; // ¤ƒ‚[ƒh‚ցB
 
 	    // ‰æ–Ê•\Ž¦—p
 	    root_to_display.clear().append(root).append(parent->getCurrentInputMode().getStringToDisplay());
+	    return false;
+	}
+
+	// Šm’肵‚ÄŒp‘±
+	if(status == STATUS_WHITE_ROOT || status == STATUS_BLACK || status == STATUS_BLACK_WITH_WINDOW) {
+	    parent->fix(getStringToFix());
+	    parent->setEnabledKanjiMode(true);
+	    return handleInput(skkchar);
+	}
+    }
+
+    // ƒvƒƒ“ƒvƒg‚ɒljÁ
+    if(status == STATUS_PROMPT) {
+	prompt_input += skkchar;
+	return false;
+    }
+
+    // Œ»Ý‚ÌŒó•â‚ðŠm’肵‚ÄŒp‘±
+    if(status == STATUS_BLACK) {
+	parent->fix(getStringToFix());
+	return parent->handleInput(skkchar);
+    }
+
+    // ‘I‘ð‚³‚ê‚½Œó•â‚ÅŠm’è‚·‚é
+    if(status == STATUS_BLACK_WITH_WINDOW) {
+	CppCFString labels = CppCFString("asdfjkl").substring(0, candidates_window_cands_per_frame);
+	int cand_index = labels.indexOf(std::tolower(skkchar));
+
+	if(cand_index != -1) {
+	    unsigned new_index = current_candidate_index + cand_index;
+	    if(new_index < candidates.size()) {
+		// ‚±‚̃Cƒ“ƒfƒBƒbƒNƒX‚ª‹–‚³‚ê‚é‚È‚çŠm’èB
+		current_candidate_index = new_index;
+		return true;
+	    }
 	}
 	return false;
     }
@@ -399,38 +434,6 @@
 		return handleInput(' '); // Ä“Ë“üBˆÓ–¡“I‚ɂ͍ċA‚Å‚Í‚È‚­continueB
 	    }
 	}
-	else if(status == STATUS_BLACK) {
-	    // Œ»Ý‚ÌŒó•â‚ðŠm’肵‚½ŒãAˆê’U‰Šú‰»‚µ‚Ä‚©‚çÄ“Ë“ü‚·‚éB
-	    // „‘E‚Í‚³‚ê‚È‚¢‚ªŽd•û‚È‚¢B
-
-	    // ŽI‚É‘—M
-	    sendCurrentCandidateToServerToRegister();
-
-	    // Šm’è
-	    parent->fix(convertNumeric(numconv_, candidates[current_candidate_index]));
-
-	    initialize();
-	    return handleInput(skkchar); // Ä“Ë“ü
-	}
-	else if(status == STATUS_BLACK_WITH_WINDOW) {
-	    // ASDFJKLi1ƒtƒŒ[ƒ€“–‚½‚è‚ÌŒó•â”‚ª7‚æ‚菭‚È‚¯‚ê‚΂±‚ê‚àŒ¸‚éBj‚Ì•¶Žš‚Å‚ ‚ê‚Î
-	    // ‚»‚ÌŒó•â‚ð‚½‚¾Šm’è‚·‚éB
-	    // ‚»‚¤‚Å‚È‚¯‚ê‚ÎŒ»Ý‚ÌŒó•â‚ð‚½‚¾Šm’è‚·‚éB
-	    int cand_index = CppCFString("ASDFJKL").substring(0, candidates_window_cands_per_frame).indexOf(skkchar);
-	    if(cand_index != -1) {
-		unsigned new_index = current_candidate_index + cand_index;
-		if(new_index < candidates.size()) {
-		    // ‚±‚̃Cƒ“ƒfƒBƒbƒNƒX‚ª‹–‚³‚ê‚é‚È‚çŠm’èB
-		    current_candidate_index = new_index;
-		    return true;
-		}				
-	    }
-	    return false;
-	}
-	else if(status == STATUS_PROMPT) {
-	    // ‚»‚Ì‚Ü‚Üprompt_input‚ɒljÁB
-	    prompt_input += skkchar;
-	}
     } else {
 	if(status == STATUS_WHITE_ROOT) {
 	    // ‰¼–¼“ü—Í‚ðŽÀsB
@@ -460,44 +463,8 @@
 		return handleInput(' '); // Ä“Ë“üBˆÓ–¡“I‚ɂ͍ċA‚Å‚Í‚È‚­continueB
 	    }
 	}
-	else if(status == STATUS_BLACK) {
-	    // Œ»Ý‚ÌŒó•â‚ðŠm’肵‚½ŒãA‰Šú‰»‚µ‚ďI—¹‚·‚邪A
-	    // “¯Žž‚ɍ¡‰ñ‚Ì•\Ž¦/fix‚ª”½‰f‚³‚ê‚È‚¢‚ƍ¢‚é‚Ì‚Å
-	    // Š¿Žš•ÏŠ·ƒ‚[ƒh‚ðI—¹‚³‚¹‚Ä‚©‚çparent‚ÌhandleInput‚É“n‚·B
-	    // KanjiConversionMode‚ÍSTATUS_NULL‚ÌŽž‚É‚Í
-	    // í‚ÉkIgnoreThis‚ð•Ô‚·B
-
-	    // ŽI‚É‘—M
-	    sendCurrentCandidateToServerToRegister();
-
-	    // „§‚³‚ê‚È‚¢‚ªA‹­§“I‚ÉŠm’肳‚¹‚éB
-	    parent->fix(convertNumeric(numconv_, candidates[current_candidate_index]));
-
-	    parent->setEnabledKanjiMode(false);
-	    initialize();
-
-	    parent->handleInput(skkchar);
-	}
-	else if(status == STATUS_BLACK_WITH_WINDOW) {
-	    // asdfjkli1ƒtƒŒ[ƒ€“–‚½‚è‚ÌŒó•â”‚ª7‚æ‚菭‚È‚¯‚ê‚΂±‚ê‚àŒ¸‚éBj‚Ì•¶Žš‚Å‚ ‚ê‚Î
-	    // ‚»‚ÌŒó•â‚ð‚½‚¾Šm’è‚·‚éB
-	    // ‚»‚¤‚Å‚È‚¯‚ê‚ÎŒ»Ý‚ÌŒó•â‚ð‚½‚¾Šm’è‚·‚éB
-	    int cand_index = CppCFString("asdfjkl").substring(0, candidates_window_cands_per_frame).indexOf(skkchar);
-	    if(cand_index != -1) {
-		unsigned new_index = current_candidate_index + cand_index;
-		if(new_index < candidates.size()) {
-		    // ‚±‚̃Cƒ“ƒfƒBƒbƒNƒX‚ª‹–‚³‚ê‚é‚È‚çŠm’èB
-		    current_candidate_index = new_index;
-		    return true;
-		}				
-	    }
-	    return false;
-	}
-	else if(status == STATUS_PROMPT) {
-	    // prompt_input‚É‚»‚̂܂܉Á‚¦‚éB
-	    prompt_input += skkchar;
-	}
     }
+
     return false;
 }
 
@@ -574,19 +541,11 @@
 	}
     }
     else if (status == STATUS_BLACK) {
-	// Œ»Ý‚ÌŒó•â‚ðŠm’肵‚Ä‚©‚çÅŒã‚Ì•¶Žš‚ðíœB
-	// ‚»‚µ‚ú‰»‚µ‚ďI—¹B
-	CppCFString str_to_fix(convertNumeric(numconv_, candidates[current_candidate_index]));
-	str_to_fix.eraseLast(1);
-	
-	// ŽI‚É‘—M
-	sendCurrentCandidateToServerToRegister();
-	
-	// ‰œ‚ÌŽè
-	parent->fix(str_to_fix);
+	// Œ»Ý‚ÌŒó•â‚ðŠm’肵‚ĈꕶŽšíœ
+	CppCFString str(getStringToFix());
+	str.eraseLast(1);
+	parent->fix(str);
 	parent->display(CppCFString());
-	parent->setEnabledKanjiMode(false);
-	initialize();
     }
     else if (status == STATUS_BLACK_WITH_WINDOW) {
 	// Å‰‚̃tƒŒ[ƒ€‚Ȃ灥ƒ‚[ƒh‚Ö–ß‚éB
@@ -678,16 +637,8 @@
     parent->getCurrentInputMode().getStringToFix();
     
     if (status == STATUS_BLACK || status == STATUS_BLACK_WITH_WINDOW) {
-	// ŽI‚É‘—M
-	sendCurrentCandidateToServerToRegister();
-	
-	// Œ»Ý‚ÌŒó•â‚ðŠm’èB
-	parent->fix(convertNumeric(numconv_, candidates[current_candidate_index]));
-	
-	if (status == STATUS_BLACK_WITH_WINDOW) {
-	    // ƒEƒCƒ“ƒhƒE‚ð•Â‚¶‚éB
-	    closeCandidatesWindow();
-	}
+	// Œ»Ý‚ÌŒó•â‚ðŠm’è
+	parent->fix(getStringToFix());
     }
     
     // Š¿Žš•ÏŠ·ƒ‚[ƒh‚ðI—¹‚·‚éB
Index: AquaSKK/Makefile
diff -u AquaSKK/Makefile:1.3 AquaSKK/Makefile:1.4
--- AquaSKK/Makefile:1.3	Wed Apr 26 22:36:12 2006
+++ AquaSKK/Makefile	Sat Jan 27 12:52:30 2007
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.3 2006/04/26 13:36:12 t-suwa Exp $
+# $Id: Makefile,v 1.4 2007/01/27 03:52:30 t-suwa Exp $
 
 DARWIN	= $(firstword $(subst ., ,$(shell uname -r)))
 TARGET	= AquaSKKInputMethod.component
@@ -26,5 +26,14 @@
 	sudo mkdir -p $(DEST)
 	sudo cp -r $(BUILD)/$(TARGET) $(DEST)
 
+check: all
+	cd tests; make check; cd ..
+
+beta: check
+	cd Package; make beta; cd ..
+
+release: check
+	cd Package; make release; cd ..
+
 tar:
 	tar zcf ../AquaSKK.tar.gz . --exclude="./build" --exclude="./Package/contents"
Index: AquaSKK/skkserv.cpp
diff -u AquaSKK/skkserv.cpp:1.4 AquaSKK/skkserv.cpp:1.5
--- AquaSKK/skkserv.cpp:1.4	Mon Dec 18 00:05:41 2006
+++ AquaSKK/skkserv.cpp	Sat Jan 27 12:52:30 2007
@@ -1,10 +1,10 @@
 /*
-  $Id: skkserv.cpp,v 1.4 2006/12/17 15:05:41 t-suwa Exp $
+  $Id: skkserv.cpp,v 1.5 2007/01/27 03:52:30 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
   Copyright (C) 2002-2004 phonohawk
-  Copyright (C) 2006 Tomotaka SUWA <t.suw****@mac*****>
+  Copyright (C) 2006-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
@@ -104,7 +104,7 @@
 	    jconv::convert_eucj_to_utf8(word, key);
 
 	    // 検索文字列の最後が [a-z] なら『送りあり』
-	    if(key.size() > 0 && std::isalpha(key[key.size() - 1])) {
+	    if(1 < key.size() && 0x7f < (unsigned)key[0] && std::isalpha(key[key.size() - 1])) {
 		result = DictionarySet::theInstance().FindOkuriAri(key, std::string(), '/');
 	    } else {
 		result = DictionarySet::theInstance().FindOkuriNasi(key, '/');


aquaskk-changes メーリングリストの案内
Back to archive index