[aquaskk-changes 399] CVS update: AquaSKK/src/editor

Back to archive index

t-suw****@users***** t-suw****@users*****
2007年 10月 5日 (金) 23:40:16 JST


Index: AquaSKK/src/editor/SKKDirectInputState.cpp
diff -u AquaSKK/src/editor/SKKDirectInputState.cpp:1.1.2.3 AquaSKK/src/editor/SKKDirectInputState.cpp:removed
--- AquaSKK/src/editor/SKKDirectInputState.cpp:1.1.2.3	Mon Sep 24 11:09:04 2007
+++ AquaSKK/src/editor/SKKDirectInputState.cpp	Fri Oct  5 23:40:16 2007
@@ -1,155 +0,0 @@
-/* -*- C++ -*-
-   MacOS X implementation of the SKK input method.
-
-   Copyright (C) 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
-   the Free Software Foundation; either version 2 of the License, or
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <iostream>
-#include "SKKDirectInputState.h"
-#include "SKKContext.h"
-#include "SKKEventParam.h"
-#include "SKKEmptySubController.h"
-
-SKKDirectInputState& SKKDirectInputState::theInstance() {
-    static SKKDirectInputState obj;
-    return obj;
-}
-
-SKKSubController* SKKDirectInputState::HandleInput(SKKContext& context, const SKKEventParam& param) {
-    // 直接入力文字は無視する
-    if(param.IsDirect()) {
-	// port 呼び出し
-	return 0;
-    }
-    
-    SKKInputBuffer& buffer = context.InputBuffer();
-    SKKOutputPort& port = context.OutputPort();
-    if(!buffer.Input(param.code)) {
-	State state = 0;
-	// 確定しないのはかな入力時のみ
-	do {
-	    if(param.IsSwitchToAscii()) {
-		state = State::Transition(&SKKEnvironment::Ascii);
-		break;
-	    }
-
-	    if(param.IsSwitchToJisx0208Latin()) {
-		state = State::Transition(&SKKEnvironment::Jisx0208Latin);
-		break;
-	    }
-
-	    if(param.IsUpperCases()) {
-		state = State::Forward(&SKKEnvironment::Japanese);
-		break;
-	    }
-
-	    if(param.IsEnterJapanese()) {
-		state = State::Transition(&SKKEnvironment::Japanese);
-		break;
-	    }
-
-	    if(param.IsEnterAbbrev()) {
-		state = State::Transition(&SKKEnvironment::Abbreviation);
-		break;
-	    }
-	} while(0);
-
-	if(state) {
-	    buffer.Clear();
-	    port.Terminate();
-	    return new SKKEmptySubController(state);
-	}
-    }
-
-    if(!buffer.FixedString().empty()) {
-	port.FixString(buffer.FixedString());
-    }
-
-    port.DisplayString(buffer.InputString());
-
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandleEnter(SKKContext&, const SKKEventParam&) {
-    // 登録完了の場合もある
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandleJmode(SKKContext&, const SKKEventParam&) {
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandleCancel(SKKContext& context, const SKKEventParam&) {
-    SKKInputBuffer& buffer = context.InputBuffer();
-    SKKOutputPort& port = context.OutputPort();
-
-    if(!buffer.IsEmpty()) {
-	buffer.Clear();
-    } else {
-	// port 呼び出し
-    }
-
-    port.DisplayString(buffer.InputString());
-
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandleBackSpace(SKKContext& context, const SKKEventParam&) {
-    SKKInputBuffer& buffer = context.InputBuffer();
-    SKKOutputPort& port = context.OutputPort();
-
-    if(!buffer.IsEmpty()) {
-	buffer.BackSpace();
-    }
-
-    port.DisplayString(buffer.InputString());
-
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandleDelete(SKKContext&, const SKKEventParam&) {
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandleTab(SKKContext&, const SKKEventParam&) {
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandlePaste(SKKContext&, const SKKEventParam&) {
-    // port 呼び出し
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandleCursorLeft(SKKContext&, const SKKEventParam&) {
-    // port 呼び出し
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandleCursorRight(SKKContext&, const SKKEventParam&) {
-    // port 呼び出し
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandleCursorUp(SKKContext&, const SKKEventParam&) {
-    // port 呼び出し
-    return 0;
-}
-
-SKKSubController* SKKDirectInputState::HandleCursorDown(SKKContext&, const SKKEventParam&) {
-    // port 呼び出し
-    return 0;
-}
Index: AquaSKK/src/editor/SKKDirectInputState.h
diff -u AquaSKK/src/editor/SKKDirectInputState.h:1.1.2.3 AquaSKK/src/editor/SKKDirectInputState.h:removed
--- AquaSKK/src/editor/SKKDirectInputState.h:1.1.2.3	Sun Sep 16 09:18:52 2007
+++ AquaSKK/src/editor/SKKDirectInputState.h	Fri Oct  5 23:40:16 2007
@@ -1,44 +0,0 @@
-/* -*- C++ -*-
-   MacOS X implementation of the SKK input method.
-
-   Copyright (C) 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
-   the Free Software Foundation; either version 2 of the License, or
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef INC__SKKDirectInputState__
-#define INC__SKKDirectInputState__
-
-#include "SKKState.h"
-
-// 直接入力状態
-struct SKKDirectInputState : public SKKState {
-    static SKKDirectInputState& theInstance();
-
-    virtual SKKSubController* HandleInput(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleEnter(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleJmode(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleCancel(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleBackSpace(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleDelete(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleTab(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandlePaste(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleCursorLeft(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleCursorRight(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleCursorUp(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleCursorDown(SKKContext& context, const SKKEventParam& param);
-};
-
-#endif
Index: AquaSKK/src/editor/SKKEditor.cpp
diff -u AquaSKK/src/editor/SKKEditor.cpp:1.1.2.3 AquaSKK/src/editor/SKKEditor.cpp:removed
--- AquaSKK/src/editor/SKKEditor.cpp:1.1.2.3	Mon Sep 24 11:09:04 2007
+++ AquaSKK/src/editor/SKKEditor.cpp	Fri Oct  5 23:40:16 2007
@@ -1,152 +0,0 @@
-/* -*- C++ -*-
-  MacOS X implementation of the SKK input method.
-
-  Copyright (C) 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
-  the Free Software Foundation; either version 2 of the License, or
-  any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include "SKKEditor.h"
-#include "SKKDirectInputState.h"
-#include "SKKEntryInputState.h"
-
-// ======================================================================
-// SKKRegistrationInfo インタフェース
-// ======================================================================
-SKKRegistrationInfo::SKKRegistrationInfo() {
-}
-
-SKKRegistrationInfo::SKKRegistrationInfo(const std::string& prompt, SKKEngine::State returnPoint)
-    : prompt_(prompt), returnPoint_(returnPoint) {
-}
-
-const std::string& SKKRegistrationInfo::Prompt() const {
-    return prompt_;
-}
-
-const SKKEngine::State SKKRegistrationInfo::ReturnPoint() const {
-    return returnPoint_;
-}
-
-// ======================================================================
-// SKKEditor インタフェース
-// ======================================================================
-SKKEditor::SKKEditor() {
-    initialize();
-}
-
-SKKEditor::SKKEditor(const SKKRegistrationInfo& info) : context_(info.Prompt()), registrationInfo_(info) {
-    initialize();
-}
-
-SKKEditor::SKKEditor(const SKKEditor& src)
-    : context_(src.context_), registrationInfo_(src.registrationInfo_), state_(src.state_) {
-}
-
-// ======================================================================
-// キー入力は全て状態クラスに移譲する
-// ======================================================================
-SKKSubController* SKKEditor::HandleInput(const SKKEventParam& param) {
-    return state_->HandleInput(context_, param);
-}
-
-SKKSubController* SKKEditor::HandleEnter(const SKKEventParam& param) {
-    return state_->HandleEnter(context_, param);
-}
-
-SKKSubController* SKKEditor::HandleJmode(const SKKEventParam& param) {
-    return state_->HandleJmode(context_, param);
-}
-
-SKKSubController* SKKEditor::HandleCancel(const SKKEventParam& param) {
-    return state_->HandleCancel(context_, param);
-}
-
-SKKSubController* SKKEditor::HandleBackSpace(const SKKEventParam& param) {
-    return state_->HandleBackSpace(context_, param);
-}
-
-SKKSubController* SKKEditor::HandleDelete(const SKKEventParam& param) {
-    return state_->HandleDelete(context_, param);
-}
-
-SKKSubController* SKKEditor::HandleTab(const SKKEventParam& param) {
-    return state_->HandleTab(context_, param);
-}
-
-SKKSubController* SKKEditor::HandlePaste(const SKKEventParam& param) {
-    return state_->HandlePaste(context_, param);
-}
-
-SKKSubController* SKKEditor::HandleCursorLeft(const SKKEventParam& param) {
-    return state_->HandleCursorLeft(context_, param);
-}
-
-SKKSubController* SKKEditor::HandleCursorRight(const SKKEventParam& param) {
-    return state_->HandleCursorRight(context_, param);
-}
-
-SKKSubController* SKKEditor::HandleCursorUp(const SKKEventParam& param) {
-    return state_->HandleCursorUp(context_, param);
-}
-
-SKKSubController* SKKEditor::HandleCursorDown(const SKKEventParam& param) {
-    return state_->HandleCursorDown(context_, param);
-}
-
-// 入力モード変更
-void SKKEditor::SelectInputMode(SKK::InputMode mode) {
-    context_.InputBuffer().SelectInputMode(mode);
-}
-
-// 内部状態変更
-void SKKEditor::ChangeState(SKK::EditState state) {
-    switch(state) {
-    case SKK::DirectInput:
-	state_ = &SKKDirectInputState::theInstance();
-	break;
-
-    case SKK::EntryInput:
-	state_ = &SKKEntryInputState::theInstance();
-	break;
-
-    case SKK::OkuriInput:
-    case SKK::AbbrevInput:
-    case SKK::Completion:
-    case SKK::SingleCandidate:
-    case SKK::MultipleCandidate:
-    case SKK::EntryRemove:
-	break;
-    }
-}
-
-const SKKRegistrationInfo& SKKEditor::RegistrationInfo() const {
-    return registrationInfo_;
-}
-
-const std::string& SKKEditor::EditString() const {
-    return context_.Word();
-}
-
-void SKKEditor::Commit(const std::string& str) {
-    context_.OutputPort().FixString(str);
-}
-
-// ======================================================================
-// private method
-// ======================================================================
-void SKKEditor::initialize() {
-    state_ = &SKKDirectInputState::theInstance();
-}
Index: AquaSKK/src/editor/SKKEditor.h
diff -u AquaSKK/src/editor/SKKEditor.h:1.1.2.3 AquaSKK/src/editor/SKKEditor.h:removed
--- AquaSKK/src/editor/SKKEditor.h:1.1.2.3	Mon Sep 24 11:09:04 2007
+++ AquaSKK/src/editor/SKKEditor.h	Fri Oct  5 23:40:16 2007
@@ -1,91 +0,0 @@
-/* -*- C++ -*-
-  MacOS X implementation of the SKK input method.
-
-  Copyright (C) 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
-  the Free Software Foundation; either version 2 of the License, or
-  any later version.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef INC__SKKEditor__
-#define INC__SKKEditor__
-
-#include "SKK.h"
-#include "SKKEngine.h"
-#include "SKKContext.h"
-
-class SKKState;
-class SKKSubController;
-class SKKEventParam;
-
-// 再帰的辞書登録用データ
-class SKKRegistrationInfo {
-    std::string prompt_;
-    SKKEngine::State returnPoint_;
-
-public:
-    SKKRegistrationInfo();
-    SKKRegistrationInfo(const std::string& prompt, SKKEngine::State returnPoint);
-
-    const std::string& Prompt() const;
-    const SKKEngine::State ReturnPoint() const;
-};
-
-// 編集インタフェース
-class SKKEditor {
-    SKKContext context_;
-    SKKState* state_;
-    SKKRegistrationInfo registrationInfo_;
-
-    void initialize();
-
-public:
-    // キー入力ハンドラー
-    typedef SKKSubController* (SKKEditor::*Handler)(const SKKEventParam&);
-
-    SKKEditor();
-    SKKEditor(const SKKRegistrationInfo& info);
-    SKKEditor(const SKKEditor& src);
-
-    // キー入力処理
-    SKKSubController* HandleInput(const SKKEventParam& param);
-    SKKSubController* HandleEnter(const SKKEventParam& param);
-    SKKSubController* HandleJmode(const SKKEventParam& param);
-    SKKSubController* HandleCancel(const SKKEventParam& param);
-    SKKSubController* HandleBackSpace(const SKKEventParam& param);
-    SKKSubController* HandleDelete(const SKKEventParam& param);
-    SKKSubController* HandleTab(const SKKEventParam& param);
-    SKKSubController* HandlePaste(const SKKEventParam& param);
-    SKKSubController* HandleCursorLeft(const SKKEventParam& param);
-    SKKSubController* HandleCursorRight(const SKKEventParam& param);
-    SKKSubController* HandleCursorUp(const SKKEventParam& param);
-    SKKSubController* HandleCursorDown(const SKKEventParam& param);
-
-    // 入力モード変更
-    void SelectInputMode(SKK::InputMode mode);
-
-    // 内部状態変更
-    void ChangeState(SKK::EditState state);
-
-    // 登録情報を取得
-    const SKKRegistrationInfo& RegistrationInfo() const;
-
-    // 編集文字列を取得
-    const std::string& EditString() const;
-
-    // 確定
-    void Commit(const std::string& str);
-};
-
-#endif  // INC__SKKEditor__
Index: AquaSKK/src/editor/SKKEntryInputState.cpp
diff -u AquaSKK/src/editor/SKKEntryInputState.cpp:1.1.2.2 AquaSKK/src/editor/SKKEntryInputState.cpp:removed
--- AquaSKK/src/editor/SKKEntryInputState.cpp:1.1.2.2	Mon Sep 24 11:09:04 2007
+++ AquaSKK/src/editor/SKKEntryInputState.cpp	Fri Oct  5 23:40:16 2007
@@ -1,308 +0,0 @@
-/* -*- C++ -*-
-   MacOS X implementation of the SKK input method.
-
-   Copyright (C) 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
-   the Free Software Foundation; either version 2 of the License, or
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#include <iostream>
-#include "SKKEntryInputState.h"
-#include "SKKContext.h"
-#include "SKKEventParam.h"
-#include "SKKEmptySubController.h"
-#include "jconv.h"
-
-SKKEntryInputState& SKKEntryInputState::theInstance() {
-    static SKKEntryInputState obj;
-    return obj;
-}
-
-SKKSubController* SKKEntryInputState::HandleInput(SKKContext& context, const SKKEventParam& param) {
-    SKKInputBuffer& buffer = context.InputBuffer();
-    SKKEditBuffer& edit = context.EditBuffer();
-    SKKOutputPort& port = context.OutputPort();
-
-    if(!edit.IsEmpty()) {
-	State state = 0;
-
-	do {
-	    // トグル変換 #1
-	    if(param.IsToggleKana()) {
-		std::string result;
-		toggleKana(buffer.InputMode(), edit.EditString(), result);
-		edit.Clear();
-		port.FixString(result);
-		state = State::Transition(&SKKEnvironment::KanaInput);
-		break;
-	    }
-
-	    // トグル変換 #2
-	    if(param.IsToggleJisx0201Kana()) {
-		std::string result;
-		toggleJisx0201Kana(buffer.InputMode(), edit.EditString(), result);
-		edit.Clear();
-		port.FixString(result);
-		state = State::Transition(&SKKEnvironment::KanaInput);
-		break;
-	    }
-
-	    // 送りあり
-	    if(param.IsUpperCases()) {
-		std::cerr << "送りあり開始" << std::endl;
-		state = State::Transition(&SKKEnvironment::Okuri);
-		break;
-	    }
-
-	    // 変換
-	    if(param.IsNextCandidate()) {
-		std::cerr << "変換開始" << std::endl;
-		break;
-	    }
-	} while(0);
-
-	if(state) {
-	    port.Terminate();
-	    return new SKKEmptySubController(state);
-	}
-    }
-
-    if(buffer.Input(std::tolower(param.code))) {
-	edit.Insert(buffer.FixedString());
-    } else {
-	State state = 0;
-
-	do {
-	    if(param.IsSwitchToAscii()) {
-		state = State::Transition(&SKKEnvironment::Ascii);
-		break;
-	    }
-
-	    if(param.IsSwitchToJisx0208Latin()) {
-		state = State::Transition(&SKKEnvironment::Jisx0208Latin);
-		break;
-	    }
-
-	    if(param.IsEnterJapanese() && !edit.IsEmpty()) {
-		state = State::Transition(&SKKEnvironment::Japanese);
-		break;
-	    }
-	} while(0);
-
-	if(state) {
-	    port.FixString(edit.EditString());
-	    edit.Clear();
-	    buffer.Clear();
-	    return new SKKEmptySubController(state);
-	}
-
-	if(!buffer.FixedString().empty()) {
-	    edit.Insert(buffer.FixedString());
-	}
-    }
-    
-    display(context);
-
-    return 0;
-}
-
-SKKSubController* SKKEntryInputState::HandleEnter(SKKContext& context, const SKKEventParam& param) {
-    SKKSubController* result = HandleJmode(context, param);
-
-    // 改行するかどうか?(egg-like-new-line)
-
-    return result;
-}
-
-SKKSubController* SKKEntryInputState::HandleJmode(SKKContext& context, const SKKEventParam&) {
-    SKKInputBuffer& buffer = context.InputBuffer();
-    SKKEditBuffer& edit = context.EditBuffer();
-    SKKOutputPort& port = context.OutputPort();
-
-    // 現在の候補で確定
-    port.FixString(edit.EditString());
-
-    edit.Clear();
-    buffer.Clear();
-
-    return new SKKEmptySubController(State::Transition(&SKKEnvironment::KanaInput));
-}
-
-SKKSubController* SKKEntryInputState::HandleCancel(SKKContext& context, const SKKEventParam&) {
-    SKKInputBuffer& buffer = context.InputBuffer();
-    SKKEditBuffer& edit = context.EditBuffer();
-    SKKOutputPort& port = context.OutputPort();
-
-    edit.Clear();
-    buffer.Clear();
-
-    // 空にする
-    port.Terminate();
-
-    return new SKKEmptySubController(State::Transition(&SKKEnvironment::KanaInput));
-}
-
-SKKSubController* SKKEntryInputState::HandleBackSpace(SKKContext& context, const SKKEventParam&) {
-    SKKInputBuffer& buffer = context.InputBuffer();
-    SKKEditBuffer& edit = context.EditBuffer();
-    SKKOutputPort& port = context.OutputPort();
-
-    if(!buffer.IsEmpty()) {
-	buffer.BackSpace();
-    } else {
-	if(!edit.IsEmpty()) {
-	    edit.BackSpace();
-	} else {
-	    port.Terminate();
-
-	    return new SKKEmptySubController(State::Transition(&SKKEnvironment::KanaInput));
-	}
-    }
-
-    display(context);
-
-    return 0;
-}
-
-SKKSubController* SKKEntryInputState::HandleDelete(SKKContext& context, const SKKEventParam&) {
-    SKKInputBuffer& buffer = context.InputBuffer();
-    SKKEditBuffer& edit = context.EditBuffer();
-
-    if(buffer.IsEmpty() && !edit.IsEmpty()) {
-	edit.Delete();
-    }
-
-    display(context);
-
-    return 0;
-}
-
-SKKSubController* SKKEntryInputState::HandleTab(SKKContext&, const SKKEventParam&) {
-    // 検索できた?
-    if(0) {
-	// 補完モード
-	return new SKKEmptySubController(State::Transition(&SKKEnvironment::EntryCompletion));
-    } else {
-	return 0;
-    }
-}
-
-SKKSubController* SKKEntryInputState::HandlePaste(SKKContext& context, const SKKEventParam&) {
-    // テキストがある?
-    if(0) {
-	SKKInputBuffer& buffer = context.InputBuffer();
-	SKKEditBuffer& edit = context.EditBuffer();
-
-	buffer.Clear();
-	edit.Insert("paste string");
-
-	display(context);
-    }
-
-    return 0;
-}
-
-SKKSubController* SKKEntryInputState::HandleCursorLeft(SKKContext& context, const SKKEventParam&) {
-    context.InputBuffer().Clear();
-    context.EditBuffer().CursorLeft();
-
-    display(context);
-
-    return 0;
-}
-
-SKKSubController* SKKEntryInputState::HandleCursorRight(SKKContext& context, const SKKEventParam&) {
-    context.InputBuffer().Clear();
-    context.EditBuffer().CursorRight();
-
-    display(context);
-
-    return 0;
-}
-
-SKKSubController* SKKEntryInputState::HandleCursorUp(SKKContext& context, const SKKEventParam&) {
-    context.InputBuffer().Clear();
-    context.EditBuffer().CursorUp();
-
-    display(context);
-
-    return 0;
-}
-
-SKKSubController* SKKEntryInputState::HandleCursorDown(SKKContext& context, const SKKEventParam&) {
-    context.InputBuffer().Clear();
-    context.EditBuffer().CursorDown();
-
-    display(context);
-
-    return 0;
-}
-
-// ======================================================================
-// private method
-// ======================================================================
-void SKKEntryInputState::display(SKKContext& context) {
-    SKKOutputPort& port = context.OutputPort();
-    SKKInputBuffer& input = context.InputBuffer();
-    SKKEditBuffer edit(context.EditBuffer());
-
-    if(!input.IsEmpty()) {
-	edit.Insert(input.InputString());
-    }
-    
-    port.DisplayString("â–½" + edit.EditString(), 1 + edit.CursorPosition());
-}
-
-void SKKEntryInputState::toggleKana(SKK::InputMode mode, const std::string& from, std::string& to) {
-    to.clear();
-
-    switch(mode) {
-    case SKK::Hirakana:
-	jconv::hirakana_to_katakana(from, to);
-	break;
-
-    case SKK::Katakana:
-	jconv::katakana_to_hirakana(from, to);
-	break;
-		
-    case SKK::Jisx0201Kana:
-	jconv::jisx0201_kana_to_katakana(from, to);
-	break;
-
-    default:
-	break;
-    }
-}
-
-void SKKEntryInputState::toggleJisx0201Kana(SKK::InputMode mode, const std::string& from, std::string& to) {
-    to.clear();
-
-    switch(mode) {
-    case SKK::Hirakana:
-	jconv::hirakana_to_jisx0201_kana(from, to);
-	break;
-
-    case SKK::Katakana:
-	jconv::katakana_to_jisx0201_kana(from, to);
-	break;
-		
-    case SKK::Jisx0201Kana:
-	jconv::jisx0201_kana_to_hirakana(from, to);
-	break;
-
-    default:
-	break;
-    }
-}
Index: AquaSKK/src/editor/SKKEntryInputState.h
diff -u AquaSKK/src/editor/SKKEntryInputState.h:1.1.2.2 AquaSKK/src/editor/SKKEntryInputState.h:removed
--- AquaSKK/src/editor/SKKEntryInputState.h:1.1.2.2	Mon Sep 24 11:09:04 2007
+++ AquaSKK/src/editor/SKKEntryInputState.h	Fri Oct  5 23:40:16 2007
@@ -1,51 +0,0 @@
-/* -*- C++ -*-
-   MacOS X implementation of the SKK input method.
-
-   Copyright (C) 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
-   the Free Software Foundation; either version 2 of the License, or
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef INC__SKKEntryInputState__
-#define INC__SKKEntryInputState__
-
-#include <string>
-#include "SKK.h"
-#include "SKKState.h"
-
-// 見出し語入力状態
-class SKKEntryInputState : public SKKState {
-    void display(SKKContext& context);
-    void toggleKana(SKK::InputMode mode, const std::string& from, std::string& to);
-    void toggleJisx0201Kana(SKK::InputMode mode, const std::string& from, std::string& to);
-
-public:
-    static SKKEntryInputState& theInstance();
-
-    virtual SKKSubController* HandleInput(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleEnter(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleJmode(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleCancel(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleBackSpace(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleDelete(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleTab(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandlePaste(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleCursorLeft(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleCursorRight(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleCursorUp(SKKContext& context, const SKKEventParam& param);
-    virtual SKKSubController* HandleCursorDown(SKKContext& context, const SKKEventParam& param);
-};
-
-#endif
Index: AquaSKK/src/editor/SKKState.h
diff -u AquaSKK/src/editor/SKKState.h:1.1.2.2 AquaSKK/src/editor/SKKState.h:removed
--- AquaSKK/src/editor/SKKState.h:1.1.2.2	Sun Sep 16 09:18:52 2007
+++ AquaSKK/src/editor/SKKState.h	Fri Oct  5 23:40:16 2007
@@ -1,46 +0,0 @@
-/* -*- C++ -*-
-   MacOS X implementation of the SKK input method.
-
-   Copyright (C) 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
-   the Free Software Foundation; either version 2 of the License, or
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef INC__SKKState__
-#define INC__SKKState__
-
-#include "SKKEngine.h"
-
-class SKKContext;
-class SKKEventParam;
-class SKKSubController;
-
-// 状態クラスインタフェース
-struct SKKState : public StateContainerTraits<SKKEngine> {
-    virtual SKKSubController* HandleInput(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandleEnter(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandleJmode(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandleCancel(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandleBackSpace(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandleDelete(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandleTab(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandlePaste(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandleCursorLeft(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandleCursorRight(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandleCursorUp(SKKContext& context, const SKKEventParam& param) = 0;
-    virtual SKKSubController* HandleCursorDown(SKKContext& context, const SKKEventParam& param) = 0;
-};
-
-#endif


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