]> git.lyx.org Git - lyx.git/blobdiff - src/trans.h
Fix paragraph spacing
[lyx.git] / src / trans.h
index bb896ee9a79880fb15a93b87bcd6f8770de58107..4b923e87e6e35289f9b986e4bef1dddb34955ef2 100644 (file)
@@ -6,6 +6,8 @@
 #pragma interface
 #endif
 
+#include <map>
+
 #include "tex-accent.h"
 #include "LString.h"
 #include "trans_decl.h"
@@ -14,6 +16,7 @@ class LyXLex;
 
 class TransManager;
 
+#if 0
 /**
   TransInterface: the interface that every translation class
   should obey too.
@@ -41,17 +44,18 @@ private:
        ///
        static bool init_;
 };
-
+#endif
 
 /**
   Trans: holds a .kmap file 
   */
-class Trans : public TransInterface {
+//class Trans : public TransInterface {
+class Trans {
 public:
        ///
        Trans();
        ///
-       virtual ~Trans();
+       ~Trans();
 
        ///
        int Load(string const & language);
@@ -65,10 +69,12 @@ public:
        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 &);
@@ -83,26 +89,44 @@ private:
        ///
        inline string const & Match(unsigned char c);
        ///
-       void InsertException(keyexc & exclist, char c,
+       void InsertException(KmodException & exclist, char c,
                             string const & data, bool = false,
                             tex_accent = TEX_NOACCENT);
        ///
-       void FreeException(keyexc & exclist);
+       void FreeException(KmodException & exclist);
 
        ///
        string name_;
+#if 0
        ///
        string keymap_[256];
+#else
+       std::map<int, string> keymap_;
+#endif
+#if 0
        ///
        kmod_list_decl * kmod_list_[TEX_MAX_ACCENT+1];
-
+#else
+       ///
+       //KmodInfo * kmod_list_[TEX_MAX_ACCENT+1];
+       std::map<int, KmodInfo> kmod_list_;
+#endif
 };
 
 
 ///
 string const & Trans::Match(unsigned char c)
 {
+#if 0
        return keymap_[c];
+#else
+       std::map<int, string>::iterator it = keymap_.find(c);
+       if (it != keymap_.end()) {
+               return it->second;
+       }
+       static string dummy;
+       return dummy;
+#endif
 }
 
 #endif