[aquaskk-changes 434] CVS update: AquaSKK

Back to archive index

t-suw****@users***** t-suw****@users*****
2007年 11月 11日 (日) 14:18:53 JST


Index: AquaSKK/AsciiConversionMode.cpp
diff -u AquaSKK/AsciiConversionMode.cpp:1.12 AquaSKK/AsciiConversionMode.cpp:1.13
--- AquaSKK/AsciiConversionMode.cpp:1.12	Sat Oct 20 10:38:08 2007
+++ AquaSKK/AsciiConversionMode.cpp	Sun Nov 11 14:18:52 2007
@@ -1,5 +1,5 @@
 /*
-  $Id: AsciiConversionMode.cpp,v 1.12 2007/10/20 01:38:08 t-suwa Exp $
+  $Id: AsciiConversionMode.cpp,v 1.13 2007/11/11 05:18:52 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
@@ -648,6 +648,8 @@
 			   current_candidate_index,
 			   candidates.size(),
 			   mode);
+
+    parent->setWindowID(candidates_window_id);
 }
 
 void AsciiConversionMode::goToNextCandidatesFrame() {
@@ -682,4 +684,6 @@
     // ウインドウID(UInt16)を含むCFDataを作成し、鯖へ送る。
     ServerConnectionFactory::theInstance().newConnection().
 	send(kSKKCloseCandidatesWindow, newCFDataRefWithWindowID(candidates_window_id));
+
+    parent->clearWindowID();
 }
Index: AquaSKK/BIM.cpp
diff -u AquaSKK/BIM.cpp:1.16 AquaSKK/BIM.cpp:1.17
--- AquaSKK/BIM.cpp:1.16	Sat Feb  3 13:04:21 2007
+++ AquaSKK/BIM.cpp	Sun Nov 11 14:18:52 2007
@@ -1,5 +1,5 @@
 /*
-  $Id: BIM.cpp,v 1.16 2007/02/03 04:04:21 t-suwa Exp $
+  $Id: BIM.cpp,v 1.17 2007/11/11 05:18:52 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
@@ -224,6 +224,15 @@
     }
 }
 
+CppCFData getWindowID(BIMSessionHandle inSessionHandle) {
+    CppCFData data;
+
+    IMSessionInputMode* session = (*inSessionHandle)->imsession_input_mode;
+    data.append(CFSwapInt16HostToBig(session->getWindowID()));
+
+    return data;
+}
+
 // ƒZƒbƒVƒ‡ƒ“‚ªƒAƒNƒeƒBƒu‚É‚È‚é
 ComponentResult BIMSessionActivate(BIMSessionHandle inSessionHandle) {
     ActiveSession::theInstance().Add(inSessionHandle);
@@ -231,8 +240,9 @@
     // Ý’è‚ðƒŠƒ[ƒh
     ClientConfiguration::theInstance().reloadConfiguration();
 
-    // ƒAƒNƒeƒBƒu‚É‚È‚Á‚½Ž–‚ðŽI‚É“`‚¦‚é
-    ServerConnectionFactory::theInstance().newConnection().send(kBasicMessageActivated);
+    // ƒAƒNƒeƒBƒu‚É‚È‚Á‚½Ž–‚ðƒT[ƒo[‚É“`‚¦‚é
+    ServerConnectionFactory::theInstance().newConnection().send(kBasicMessageActivated,
+								getWindowID(inSessionHandle));
 
     // ƒL[ƒ{[ƒhƒŒƒCƒAƒEƒg‚ð‰Šú‰»‚·‚é
     InitializeKeyboardLayout();
@@ -244,10 +254,9 @@
 ComponentResult BIMSessionDeactivate(BIMSessionHandle inSessionHandle) {
     ActiveSession::theInstance().Remove(inSessionHandle);
 
-    // ƒAƒNƒeƒBƒu‚Å‚È‚­‚È‚Á‚½Ž–‚ðŽI‚É“`‚¦‚éB
-    if(ActiveSession::theInstance().Count() == 0) {
-	ServerConnectionFactory::theInstance().newConnection().send(kBasicMessageDeactivated);
-    }
+    // ƒAƒNƒeƒBƒu‚Å‚È‚­‚È‚Á‚½Ž–‚ðƒT[ƒo[‚É“`‚¦‚é
+    ServerConnectionFactory::theInstance().newConnection().send(kBasicMessageDeactivated,
+								getWindowID(inSessionHandle));
 
     return 0;
 }
Index: AquaSKK/CandidatesManager.h
diff -u AquaSKK/CandidatesManager.h:1.5 AquaSKK/CandidatesManager.h:1.6
--- AquaSKK/CandidatesManager.h:1.5	Sat Nov 10 20:05:05 2007
+++ AquaSKK/CandidatesManager.h	Sun Nov 11 14:18:52 2007
@@ -1,5 +1,5 @@
 /*
-  $Id: CandidatesManager.h,v 1.5 2007/11/10 11:05:05 t-suwa Exp $
+  $Id: CandidatesManager.h,v 1.6 2007/11/11 05:18:52 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
@@ -40,5 +40,7 @@
     void windowNext(unsigned int window_id);
     void windowPrev(unsigned int window_id);
     void closeWindow(unsigned int window_id);
+    void showWindow(unsigned int window_id);
+    void hideWindow(unsigned int window_id);
     CandidatesWindowController* getWindowController(unsigned window_id);
 };
Index: AquaSKK/CandidatesManager.mm
diff -u AquaSKK/CandidatesManager.mm:1.7 AquaSKK/CandidatesManager.mm:1.8
--- AquaSKK/CandidatesManager.mm:1.7	Sat Nov 10 20:05:05 2007
+++ AquaSKK/CandidatesManager.mm	Sun Nov 11 14:18:52 2007
@@ -1,5 +1,5 @@
 /* -*- objc -*-
-  $Id: CandidatesManager.mm,v 1.7 2007/11/10 11:05:05 t-suwa Exp $
+  $Id: CandidatesManager.mm,v 1.8 2007/11/11 05:18:52 t-suwa Exp $
 	
   MacOS X implementation of the SKK input method.
 
@@ -115,6 +115,18 @@
     cand_windows[window_id] = NULL;
 }
 
+void CandidatesManager::showWindow(unsigned int window_id) {
+    CandidatesWindowController* cwc = cand_windows[window_id];
+
+    [[cwc window] orderFront:nil];
+}
+
+void CandidatesManager::hideWindow(unsigned int window_id) {
+    CandidatesWindowController* cwc = cand_windows[window_id];
+
+    [[cwc window] orderOut:nil];
+}
+
 CandidatesWindowController* CandidatesManager::getWindowController(unsigned window_id) {
     return cand_windows[window_id];
 }
Index: AquaSKK/ChangeLog
diff -u AquaSKK/ChangeLog:1.53 AquaSKK/ChangeLog:1.54
--- AquaSKK/ChangeLog:1.53	Sun Nov 11 01:54:24 2007
+++ AquaSKK/ChangeLog	Sun Nov 11 14:18:52 2007
@@ -1,5 +1,11 @@
 2007-11-11  Tomotaka SUWA  <t.suw****@mac*****>
 
+	* BIM.cpp, ParentInputMode.*, *ConversionMode.cpp,
+	ServerMessageReceiver.*: 候補ウィンドウのアクティブ化・非アクティブ
+	化に対応。
+
+	* CandidatesManager.*: showWindow() と hideWindow() を追加。
+
 	* KanjiConversionMode.cpp: ヘルプ検索と Spotlight 検索で候補ウィン
 	ドウが前面に表示されない不具合を修正。
 
Index: AquaSKK/Info-AquaSKKInputMethod.plist
diff -u AquaSKK/Info-AquaSKKInputMethod.plist:1.21 AquaSKK/Info-AquaSKKInputMethod.plist:1.22
--- AquaSKK/Info-AquaSKKInputMethod.plist:1.21	Sat Nov 10 20:05:05 2007
+++ AquaSKK/Info-AquaSKKInputMethod.plist	Sun Nov 11 14:18:52 2007
@@ -23,7 +23,7 @@
 	<key>CFBundleSignature</key>
 	<string>askk</string>
 	<key>CFBundleVersion</key>
-	<string>2007-11-10</string>
+	<string>2007-11-11</string>
 	<key>CSResourcesFileMapped</key>
 	<true/>
 	<key>tsInputMethodIconFileKey</key>
Index: AquaSKK/Info-AquaSKKServer.plist
diff -u AquaSKK/Info-AquaSKKServer.plist:1.21 AquaSKK/Info-AquaSKKServer.plist:1.22
--- AquaSKK/Info-AquaSKKServer.plist:1.21	Sat Nov 10 20:05:05 2007
+++ AquaSKK/Info-AquaSKKServer.plist	Sun Nov 11 14:18:52 2007
@@ -23,7 +23,7 @@
 	<key>CFBundleSignature</key>
 	<string>askk</string>
 	<key>CFBundleVersion</key>
-	<string>2007-11-10</string>
+	<string>2007-11-11</string>
 	<key>NSMainNibFile</key>
 	<string>Principal</string>
 	<key>NSPrincipalClass</key>
Index: AquaSKK/KanjiConversionMode.cpp
diff -u AquaSKK/KanjiConversionMode.cpp:1.17 AquaSKK/KanjiConversionMode.cpp:1.18
--- AquaSKK/KanjiConversionMode.cpp:1.17	Sun Nov 11 01:54:25 2007
+++ AquaSKK/KanjiConversionMode.cpp	Sun Nov 11 14:18:52 2007
@@ -1,5 +1,5 @@
 /*
-  $Id: KanjiConversionMode.cpp,v 1.17 2007/11/10 16:54:25 t-suwa Exp $
+  $Id: KanjiConversionMode.cpp,v 1.18 2007/11/11 05:18:52 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
@@ -1145,6 +1145,8 @@
 			   candidates_window_num_of_frames,
 			   candidates_window_current_frame,
 			   current_candidate_index, candidates.size(), mode);
+
+    parent->setWindowID(candidates_window_id);
 }
 
 SInt32 getCandidatesWindowLevel(const Point& pt) {
@@ -1277,6 +1279,8 @@
     // ウインドウID(UInt16)を含むCFDataを作成し、鯖へ送る。
     ServerConnectionFactory::theInstance().newConnection().
 	send(kSKKCloseCandidatesWindow, newCFDataRefWithWindowID(candidates_window_id));
+
+    parent->clearWindowID();
 }
 
 void mergeCandidates(const NumericConverter& numconv,
Index: AquaSKK/ParentInputMode.cpp
diff -u AquaSKK/ParentInputMode.cpp:1.7 AquaSKK/ParentInputMode.cpp:1.8
--- AquaSKK/ParentInputMode.cpp:1.7	Sat Oct 20 10:38:08 2007
+++ AquaSKK/ParentInputMode.cpp	Sun Nov 11 14:18:52 2007
@@ -1,5 +1,5 @@
 /*
-  $Id: ParentInputMode.cpp,v 1.7 2007/10/20 01:38:08 t-suwa Exp $
+  $Id: ParentInputMode.cpp,v 1.8 2007/11/11 05:18:52 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
@@ -44,17 +44,17 @@
 #include "SKKConfig.h"
 
 ParentInputMode::ParentInputMode()
-	:hiragana_input_mode(*this),
-	 zen_kata_input_mode(*this),
-	 han_kata_input_mode(*this),
-	 han_asc_input_mode(*this),
-	 zen_asc_input_mode(*this),
-	 kanji_conversion_mode(*this),
-	 ascii_conversion_mode(*this),
-	 is_kanji_mode(false),
-	 is_ascii_conv_mode(false),
-	 current_input_mode(&hiragana_input_mode) {
-    // empty
+    : hiragana_input_mode(*this),
+      zen_kata_input_mode(*this),
+      han_kata_input_mode(*this),
+      han_asc_input_mode(*this),
+      zen_asc_input_mode(*this),
+      kanji_conversion_mode(*this),
+      ascii_conversion_mode(*this),
+      is_kanji_mode(false),
+      is_ascii_conv_mode(false),
+      current_input_mode(&hiragana_input_mode) {
+    clearWindowID();
 }
 
 ParentInputMode::~ParentInputMode() {
@@ -317,3 +317,15 @@
 	redisplay();
     }
 }
+
+void ParentInputMode::setWindowID(unsigned short id) {
+    windowID_ = id;
+}
+
+void ParentInputMode::clearWindowID() {
+    windowID_ = 0xffff;
+}
+
+unsigned short ParentInputMode::getWindowID() const {
+    return windowID_;
+}
Index: AquaSKK/ParentInputMode.h
diff -u AquaSKK/ParentInputMode.h:1.6 AquaSKK/ParentInputMode.h:1.7
--- AquaSKK/ParentInputMode.h:1.6	Wed May 17 01:13:10 2006
+++ AquaSKK/ParentInputMode.h	Sun Nov 11 14:18:52 2007
@@ -1,10 +1,10 @@
 /*
-  $Id: ParentInputMode.h,v 1.6 2006/05/16 16:13:10 t-suwa Exp $
+  $Id: ParentInputMode.h,v 1.7 2007/11/11 05:18:52 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
@@ -51,6 +51,8 @@
 class ChildInputMode;
 
 class ParentInputMode: public InputMode {
+    unsigned short windowID_;
+
 protected:
     HiraganaInputMode hiragana_input_mode;
     ZenKataInputMode zen_kata_input_mode;
@@ -124,6 +126,10 @@
 
     // •¶Žš—ñ‚ð•\Ž¦‚·‚鎞‚ɌĂ΂ê‚éB‚ǂ̂悤‚É•\Ž¦‚·‚é‚©‚Í‹ï‘̃Nƒ‰ƒX‚ªŒˆ’è‚·‚éB
     virtual void display(const CppCFString& str_to_display) = 0;
+
+    void setWindowID(unsigned short id);
+    void clearWindowID();
+    unsigned short getWindowID() const;
 };
 
 #endif	// INC__ParentInputMode__
Index: AquaSKK/ServerMessageReceiver.h
diff -u AquaSKK/ServerMessageReceiver.h:1.6 AquaSKK/ServerMessageReceiver.h:1.7
--- AquaSKK/ServerMessageReceiver.h:1.6	Tue Jun 12 23:25:08 2007
+++ AquaSKK/ServerMessageReceiver.h	Sun Nov 11 14:18:52 2007
@@ -1,5 +1,5 @@
 /*
-  $Id: ServerMessageReceiver.h,v 1.6 2007/06/12 14:25:08 t-suwa Exp $
+  $Id: ServerMessageReceiver.h,v 1.7 2007/11/11 05:18:52 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
@@ -51,6 +51,8 @@
     void showPreferencesBox();
     CppCFData fetchCompletions(const CppCFData& attachment);
     CppCFData valueForKey(NSString* key); 
+    void showCandidatesWindow(const CppCFData& data);
+    void hideCandidatesWindow(const CppCFData& data);
 
 public:
     static void start(const CFStringRef loopMode);
Index: AquaSKK/ServerMessageReceiver.mm
diff -u AquaSKK/ServerMessageReceiver.mm:1.11 AquaSKK/ServerMessageReceiver.mm:1.12
--- AquaSKK/ServerMessageReceiver.mm:1.11	Sat Nov 10 20:05:05 2007
+++ AquaSKK/ServerMessageReceiver.mm	Sun Nov 11 14:18:52 2007
@@ -1,5 +1,5 @@
 /* -*- objc -*-
-  $Id: ServerMessageReceiver.mm,v 1.11 2007/11/10 11:05:05 t-suwa Exp $
+  $Id: ServerMessageReceiver.mm,v 1.12 2007/11/11 05:18:52 t-suwa Exp $
 
   MacOS X implementation of the SKK input method.
 
@@ -70,69 +70,87 @@
     switch(msgid) {
     case kBasicMessageActivated: // クライアントがアクティブになった
 	ClientConnectionFactory::theInstance().setDefaultTarget(header.fProcessSerialNumber);
+	showCandidatesWindow(body);
 	break;
+
     case kBasicMessageDeactivated: { // クライアントがアクティブでなくなった
 	ProcessSerialNumber psn;
 	psn.highLongOfPSN = 0;
 	psn.lowLongOfPSN = kNoProcess;
-			
 	ClientConnectionFactory::theInstance().setDefaultTarget(psn);
+	hideCandidatesWindow(body);
 	break;
     }
+
     case kBasicMessageHidePalettes: // パレットを隠すようTSMから指示が入った
 	break;
+
     case kSKKMessageSearch:
 	reply = searchWord(body);
 	break;
+
     case kSKKCreateCandidatesWindow:
 	reply = createCandidatesWindow(body);
 	break;
+
     case kSKKCandidatesWindowNext:
 	reply = candidatesWindowNext(body);
 	break;
+
     case kSKKCandidatesWindowPrev:
 	reply = candidatesWindowPrev(body);
 	break;
+
     case kSKKCloseCandidatesWindow:
 	closeCandidatesWindow(body);
 	break;
+
     case kSKKRegisterThisToUserDic:
 	registerThisToUserDic(body);
 	break;
+
     case kSKKRegisterToggleEntry:
 	registerToggleEntry(body);
 	break;
+
     case kSKKRemoveThisFromUserDic:
 	removeThisFromUserDic(body);
 	break;
+
     case kSKKShowAboutBox:
 	showAboutBox();
 	break;
+
     case kSKKShowPreferencesBox:
 	showPreferencesBox();
 	break;
+
     case kSKKShowWordRegistrationBox:
 	break;
+
     case kSKKFetchCompletions:
 	reply = fetchCompletions(body);
 	break;
+
     case kBasicMessageIsSkkEggLikeNewline:
 	reply = valueForKey(KEY_egg_like_newline);
 	break;
+
     case kBasicMessageIsNumericKeypad_HalfWidth:
 	reply = valueForKey(KEY_numkeypad_use_halfwidth);
 	break;
+
     case kBasicMessageIsAsciiModeStartup:
 	reply = valueForKey(KEY_force_ascii_mode_startup);
 	break;
+
     case kBasicMessageUseNumericConversion:
 	reply = valueForKey(KEY_use_numeric_conversion);
 	break;
+
     case kBasicMessageKbdLayoutId:
 	reply = valueForKey(KEY_keyboard_layout_id);
 	break;
-    default:
-	break;
     }
 
     return reply;
@@ -292,3 +310,19 @@
 
     return CppCFData(&result, sizeof(result));
 }
+
+void ServerMessageReceiver::showCandidatesWindow(const CppCFData& data) {
+    unsigned short window_id = CFSwapInt16BigToHost(data.getUInt16(0));
+    if(window_id == 0xffff) return;
+
+    CandidatesManager& cm = CandidatesManager::sharedManager();
+    cm.showWindow(window_id);
+}
+
+void ServerMessageReceiver::hideCandidatesWindow(const CppCFData& data) {
+    unsigned short window_id = CFSwapInt16BigToHost(data.getUInt16(0));
+    if(window_id == 0xffff) return;
+
+    CandidatesManager& cm = CandidatesManager::sharedManager();
+    cm.hideWindow(window_id);
+}


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