]> git.lyx.org Git - lyx.git/blobdiff - src/lyxlookup.C
citation patch from Angus
[lyx.git] / src / lyxlookup.C
index 03e4dc87e0423000c9abee01669893858d0355e9..4f4e20cd069d4ff6d3655a1d74b2da949f47f62b 100644 (file)
@@ -8,6 +8,10 @@
  *
  * ====================================================== */
 
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
 #include <config.h>
 
 #ifdef HAVE_XOPENIM
@@ -22,6 +26,7 @@
 #endif
 #include <clocale>
 
+#include "lyxlookup.h"
 #include "debug.h"
 #include "lyxrc.h"
 
@@ -159,36 +164,50 @@ int LyXLookupString(XEvent * event,
                                << "LyXLookupString: found DeadEvent" << endl;
                        return 0;
                }
+#if 1
                if (XFilterEvent (event, None)) {
-                       //lyxerr <<"XFilterEvent");
+                       lyxerr[Debug::KEY] <<"XFilterEvent" << endl;
                        *keysym_return = NoSymbol;
                         return 0;
                }
+#endif
                if (event->type != KeyPress)
                        lyxerr << "LyXLookupString: wrong event type" 
                               <<  event->type << endl;
-               Status status_return;
+               Status status_return = 0;
                
                result =  XmbLookupString(xic, &event->xkey, buffer_return,
                                       bytes_buffer, keysym_return,
                                       &status_return);
                switch(status_return) {
+               case XBufferOverflow:
+                       lyxerr[Debug::KEY] << "XBufferOverflow" << endl;
+                       break;
                case XLookupBoth:
-                       //lyxerr <<"XLookupBoth");
+                       lyxerr[Debug::KEY] << "XLookupBoth"
+                                          << string(buffer_return, result)
+                                          << endl;
                        break;
                case XLookupChars:
-                       //lyxerr <<"XLookupChars");
+                       lyxerr[Debug::KEY] << "XLookupChars "
+                                          << string(buffer_return, result)
+                                          << endl;
+                       
                        *keysym_return = NoSymbol;
                        break;
                case XLookupKeySym:
-                       //lyxerr <<"XLookupKeySym");
+                       lyxerr[Debug::KEY] << "XLookupKeySym" << endl;
                        result = 0;
                        break;
-               default:
-                       //lyxerr <<"default");
+               case XLookupNone:
+                       lyxerr[Debug::KEY] << "XLookupNone" << endl;
                        *keysym_return = NoSymbol;
                        result = 0;
                        break;
+               default:
+                       lyxerr << "Unknown status_return from"
+                               " XmbLookupString" << endl;
+                       break;
                }
        } else {
                result = XLookupString(&event->xkey, buffer_return,
@@ -198,6 +217,7 @@ int LyXLookupString(XEvent * event,
        return result;
 }
 
+
 // This is called after the main window has been destroyed
 void CloseLyXLookup() 
 {