X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftrans.h;h=a233ace5cdb7a9cc6dde7c75c34363adec2c7628;hb=dd47a9eb1798d583dc84ec1c91c10cecbfa9874a;hp=4b923e87e6e35289f9b986e4bef1dddb34955ef2;hpb=efe0b0b8eb340b7c34ead8afe5d81b410d5e7865;p=lyx.git diff --git a/src/trans.h b/src/trans.h index 4b923e87e6..a233ace5cd 100644 --- a/src/trans.h +++ b/src/trans.h @@ -1,10 +1,14 @@ // -*- C++ -*- -#ifndef Trans_h -#define Trans_h +/** + * \file trans.h + * Copyright 2002 the LyX Team + * Read the file COPYING + * + * \author unknown + */ -#ifdef __GNUG__ -#pragma interface -#endif +#ifndef TRANS_H +#define TRANS_H #include @@ -16,40 +20,9 @@ class LyXLex; class TransManager; -#if 0 -/** - TransInterface: the interface that every translation class - should obey too. - Visitor pattern applied here - */ -class TransInterface { -public: - /// - virtual string const process(char, TransManager &) = 0; - /// - virtual bool isAccentDefined(tex_accent, KmodInfo &) const = 0; -}; - -/** - DefaultTrans: the default translation class. Holds info - on tex-accents. Monostate - */ -class DefaultTrans : public TransInterface { -public: - /// - DefaultTrans(); - /// - virtual string const process(char, TransManager &); -private: - /// - static bool init_; -}; -#endif - /** - Trans: holds a .kmap file + Trans: holds a .kmap file */ -//class Trans : public TransInterface { class Trans { public: /// @@ -67,27 +40,16 @@ public: string const process(char, TransManager &); /// bool isAccentDefined(tex_accent, KmodInfo &) const; - + private: -#if 0 - /// - typedef KmodInfo kmod_list_decl; - /// - typedef KmodException keyexc; -#endif -#if 0 - /// - void AddDeadkey(tex_accent, string const &, string const &); -#else /// void AddDeadkey(tex_accent, string const &); -#endif /// void FreeKeymap(); /// int Load(LyXLex &); /// - inline string const & Match(unsigned char c); + string const & Match(unsigned char c); /// void InsertException(KmodException & exclist, char c, string const & data, bool = false, @@ -97,36 +59,23 @@ private: /// string name_; -#if 0 /// - string keymap_[256]; -#else std::map keymap_; -#endif -#if 0 - /// - kmod_list_decl * kmod_list_[TEX_MAX_ACCENT+1]; -#else /// - //KmodInfo * kmod_list_[TEX_MAX_ACCENT+1]; std::map kmod_list_; -#endif }; /// +inline string const & Trans::Match(unsigned char c) { -#if 0 - return keymap_[c]; -#else std::map::iterator it = keymap_.find(c); if (it != keymap_.end()) { return it->second; } static string dummy; return dummy; -#endif } -#endif +#endif // TRANS_H