t-suw****@users*****
t-suw****@users*****
2007年 10月 14日 (日) 14:50:34 JST
Index: AquaSKK/src/component/SKK.h diff -u AquaSKK/src/component/SKK.h:1.1.2.2 AquaSKK/src/component/SKK.h:1.1.2.3 --- AquaSKK/src/component/SKK.h:1.1.2.2 Sun Sep 2 12:36:24 2007 +++ AquaSKK/src/component/SKK.h Sun Oct 14 14:50:33 2007 @@ -1,5 +1,5 @@ /* -*- C++ -*- - $Id: SKK.h,v 1.1.2.2 2007/09/02 03:36:24 t-suwa Exp $ + $Id: SKK.h,v 1.1.2.3 2007/10/14 05:50:33 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -23,6 +23,9 @@ #ifndef INC__SKK__ #define INC__SKK__ +#include <vector> +#include <string> + namespace SKK { enum InputMode { Hirakana, @@ -32,16 +35,40 @@ Ascii }; - enum EditState { - DirectInput, - EntryInput, - OkuriInput, - AbbrevInput, - Completion, - SingleCandidate, - MultipleCandidate, - EntryRemove + // åä¸ã®å¤æåè£ + class Candidate { + std::string face_; // è¡¨ç¤ºç¨ + std::string body_; // æ°å¤å¤ææã®ãªãªã¸ãã« + + public: + Candidate() {} + Candidate(const std::string& str) : face_(str), body_("") {} + Candidate(const std::string& face, const std::string& body) : face_(face), body_(body) {} + + void Clear() { + face_.clear(); + body_.clear(); + } + + const std::string& Face() const { + return face_; + } + + void SetFace(const std::string& str) { + face_ = str; + } + + const std::string& Body() const { + return !body_.empty() ? body_ : face_; + } + + void SetBody(const std::string& str) { + body_ = str; + } }; + + typedef std::vector<Candidate> CandidateContainer; + typedef CandidateContainer::iterator CandidateIterator; } #endif Index: AquaSKK/src/component/SKKSession.cpp diff -u AquaSKK/src/component/SKKSession.cpp:1.1.2.4 AquaSKK/src/component/SKKSession.cpp:1.1.2.5 --- AquaSKK/src/component/SKKSession.cpp:1.1.2.4 Mon Sep 24 07:44:34 2007 +++ AquaSKK/src/component/SKKSession.cpp Sun Oct 14 14:50:33 2007 @@ -1,5 +1,5 @@ /* -*- C++ -*- - $Id: SKKSession.cpp,v 1.1.2.4 2007/09/23 22:44:34 t-suwa Exp $ + $Id: SKKSession.cpp,v 1.1.2.5 2007/10/14 05:50:33 t-suwa Exp $ MacOS X implementation of the SKK input method. @@ -35,7 +35,6 @@ // ã¤ãã³ã bool SKKSession::HandleInput(const EventRef event) { SKKEventParam param = SKKPreProcessor::theInstance().Execute(event); - std::cerr << param.dump() << std::endl; handled_ = false; engine_.Dispatch(SKKEngine::Event(param.event, param));