/* This file is part of
- * ======================================================
- *
+ * ======================================================
+ *
* LyX, The Document Processor
- *
- * Copyright 1995 Matthias Ettrich
+ *
+ * Copyright 1995 Matthias Ettrich
* Copyright 1995-2001 The LyX team.
*
* ====================================================== */
// This is called after the main LyX window has been created
-void InitLyXLookup(Display * display, Window window)
+void InitLyXLookup(Display * display, Window window)
{
xic = 0;
// This part could be done before opening display
string oldlocale = setlocale(LC_CTYPE, 0);
setlocale(LC_CTYPE, "");
- if (!XSupportsLocale()) {
+ if (!XSupportsLocale()) {
lyxerr[Debug::KEY]
<< "InitLyXLookup: X does not support this locale."
<< endl;
}
// reset the LC_CTYPE locale to previous value.
setlocale(LC_CTYPE, oldlocale.c_str());
-
+
char const * locmod;
if (!(locmod = XSetLocaleModifiers(""))) {
lyxerr[Debug::KEY] << "InitLyXLookup: Could not set modifiers "
else
lyxerr[Debug::KEY] << "InitLyXLookup: X locale modifiers are `"
<< locmod << '\'' << endl;
-
+
// This part will have to be done for each frame
xim = XOpenIM (display, 0, 0, 0);
if (xim) {
XNInputStyle,
XIMPreeditNothing|XIMStatusNothing,
XNClientWindow, window,
- XNFocusWindow, window,
+ XNFocusWindow, window,
0);
-
+
if (!xic) {
lyxerr[Debug::KEY] << "InitLyXLookup: "
"could not create an input context" << endl;
XCloseIM (xim);
xim = 0;
- }
+ }
}
- else
+ else
lyxerr[Debug::KEY] << "InitLyXLookup: could not open "
"an input method." << endl;
}
// This is called instead of XLookupString()
-int LyXLookupString(XEvent * event,
+int LyXLookupString(XEvent * event,
char * buffer_return, int bytes_buffer,
- KeySym * keysym_return)
+ KeySym * keysym_return)
{
if (event->type != KeyPress) {
lyxerr << "LyXLookupString: wrong event type: "
<< event->type << endl;
return 0;
}
-
+
int result = 0;
if (xic) {
#if 1
XLookupString(&event->xkey, buffer_return,
bytes_buffer, keysym_return,
0);
-
+
if (lyxrc.override_x_deadkeys &&
isDeadEvent(*keysym_return)) {
- lyxerr[Debug::KEY]
+ lyxerr[Debug::KEY]
<< "LyXLookupString: found DeadEvent" << endl;
return 0;
}
if (XFilterEvent (event, None)) {
lyxerr[Debug::KEY] <<"XFilterEvent" << endl;
*keysym_return = NoSymbol;
- return 0;
+ return 0;
}
#endif
Status status_return = 0;
-
+
result = XmbLookupString(xic, &event->xkey, buffer_return,
bytes_buffer, keysym_return,
&status_return);
lyxerr[Debug::KEY] << "XLookupChars "
<< string(buffer_return, result)
<< endl;
-
+
*keysym_return = NoSymbol;
break;
case XLookupKeySym:
// This is called after the main window has been destroyed
-void CloseLyXLookup()
+void CloseLyXLookup()
{
if (xic) {
lyxerr[Debug::KEY] << "CloseLyXLookup: destroying input context"
XComposeStatus compose_status= {0, 0};
// This is called after the main LyX window has been created
-void InitLyXLookup(Display *, Window)
+void InitLyXLookup(Display *, Window)
{
//Nothing to do.
}
// This is called instead of XLookupString(). I this particular case,
// this *is* XLookupString...
-int LyXLookupString(XEvent * event,
+int LyXLookupString(XEvent * event,
char * buffer_return, int bytes_buffer,
- KeySym * keysym_return)
+ KeySym * keysym_return)
{
return XLookupString(&event->xkey, buffer_return,
bytes_buffer, keysym_return,
}
// This is called after the main window has been destroyed
-void CloseLyXLookup()
+void CloseLyXLookup()
{
// Nothing to do
}
#endif // HAVE_XOPENIM
-