X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftrans_mgr.h;h=f0126244ccee91df45d8feeb5654e0d49ab3db32;hb=09e01879979643949f1f2c7216023f1f35d5ada2;hp=7b7e812c328baf60eabdbacafacd89ed0fcd40fb;hpb=efe0b0b8eb340b7c34ead8afe5d81b410d5e7865;p=lyx.git diff --git a/src/trans_mgr.h b/src/trans_mgr.h index 7b7e812c32..f0126244cc 100644 --- a/src/trans_mgr.h +++ b/src/trans_mgr.h @@ -1,10 +1,6 @@ // -*- C++ -*- -#ifndef Trans_Manager_h -#define Trans_Manager_h - -#ifdef __GNUG__ -#pragma interface -#endif +#ifndef TRANS_MANAGER_H +#define TRANS_MANAGER_H #include "tex-accent.h" #include "trans_decl.h" @@ -14,18 +10,13 @@ class LyXText; class Trans; -/// Translation State +/// Translation state class TransState { public: /// virtual ~TransState() {} -#if 0 - /// - virtual string const normalkey(char, string const &) = 0; -#else /// virtual string const normalkey(char) = 0; -#endif /// virtual bool backspace() = 0; /// @@ -48,13 +39,8 @@ protected: char deadkey2_; /// KmodInfo deadkey2_info_; -#if 0 - /// - KmodException comb_info_; -#else /// Keyexc comb_info_; -#endif /// TransState * init_state_; /// @@ -71,17 +57,12 @@ public: /// Init State -class TransInitState : virtual public TransFSMData, public TransState { +class TransInitState :virtual public TransFSMData, public TransState { public: /// TransInitState(); -#if 0 - /// - virtual string const normalkey(char, string const &); -#else /// virtual string const normalkey(char); -#endif /// virtual bool backspace() { return true; } /// @@ -94,13 +75,8 @@ class TransDeadkeyState : virtual public TransFSMData, public TransState { public: /// TransDeadkeyState(); -#if 0 - /// - virtual string const normalkey(char, string const &); -#else /// virtual string const normalkey(char); -#endif /// virtual bool backspace() { currentState = init_state_; @@ -116,20 +92,15 @@ class TransCombinedState : virtual public TransFSMData, public TransState { public: /// TransCombinedState(); -#if 0 - /// - virtual string const normalkey(char, string const &); -#else /// virtual string const normalkey(char); -#endif /// virtual bool backspace() { // cancel the second deadkey deadkey2_ = 0; deadkey2_info_.accent = TEX_NOACCENT; currentState = deadkey_state_; - + return false; } /// @@ -192,31 +163,18 @@ public: void TranslateAndInsert(char, LyXText *); /// string const deadkey(char, KmodInfo); -#if 0 - /// - string const normalkey(char, string const &); -#else /// string const normalkey(char); -#endif /// void deadkey(char, tex_accent, LyXText *); }; -#if 0 -inline -string const TransManager::normalkey(char c, string const & t) -{ - return trans_fsm_.currentState->normalkey(c, t); -} -#else inline string const TransManager::normalkey(char c) { return trans_fsm_.currentState->normalkey(c); } -#endif inline @@ -225,4 +183,4 @@ string const TransManager::deadkey(char c, KmodInfo t) return trans_fsm_.currentState->deadkey(c, t); } -#endif +#endif // TRANS_MANAGER_H