projects
/
chise
/
xemacs-chise.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(U+98DF): Separate J0-3F29 and M-44014.
[chise/xemacs-chise.git]
/
src
/
input-method-xlib.c
diff --git
a/src/input-method-xlib.c
b/src/input-method-xlib.c
index
b0068fd
..
9e0acbd
100644
(file)
--- a/
src/input-method-xlib.c
+++ b/
src/input-method-xlib.c
@@
-34,9
+34,9
@@
Boston, MA 02111-1307, USA. */
The XIC is of each frame, by each frame, for each frame.
The exceptions are:
1. Activate XICs on poor frames when the XIM is back.
The XIC is of each frame, by each frame, for each frame.
The exceptions are:
1. Activate XICs on poor frames when the XIM is back.
- 2. Deactivate all the XICs when the XIM go down.
+ 2. Deactivate all the XICs when the XIM goes down.
- Methods:
+ Implementation:
- Register a callback for an XIM when the X device is being initialized.
XIM_init_device (d) { XRegisterIMInstantiateCallback (); }
- Register a callback for an XIM when the X device is being initialized.
XIM_init_device (d) { XRegisterIMInstantiateCallback (); }
@@
-55,7
+55,7
@@
Boston, MA 02111-1307, USA. */
In IMDestroyCallback:
DEVICE_FRAME_LOOP (...) { FRAME_X_XIC (f) = NULL; }
In IMDestroyCallback:
DEVICE_FRAME_LOOP (...) { FRAME_X_XIC (f) = NULL; }
- - Re-enable XIC for all the frames which doesn't have XIC when the XIM
+ - Re-enable XIC for all the frames which don't have XIC when the XIM
is back.
In IMInstantiateCallback:
DEVICE_FRAME_LOOP (...) { XIM_init_frame (f); }
is back.
In IMInstantiateCallback:
DEVICE_FRAME_LOOP (...) { XIM_init_frame (f); }
@@
-71,6
+71,7
@@
Boston, MA 02111-1307, USA. */
#include <config.h>
#include "lisp.h"
#include <X11/Xlocale.h> /* More portable than <locale.h> ? */
#include <config.h>
#include "lisp.h"
#include <X11/Xlocale.h> /* More portable than <locale.h> ? */
+#include <X11/Xlib.h>
#include "frame.h"
#include "device.h"
#include "window.h"
#include "frame.h"
#include "device.h"
#include "window.h"
@@
-79,12
+80,8
@@
Boston, MA 02111-1307, USA. */
#include "EmacsFrame.h"
#include "events.h"
#include "EmacsFrame.h"
#include "events.h"
-#ifdef THIS_IS_X11R6
-#include <X11/IntrinsicP.h>
-#endif
-
-#ifndef XIM_XLIB
-#error XIM_XLIB is not defined??
+#if !defined (XIM_XLIB) && !defined (USE_XFONTSET)
+#error neither XIM_XLIB nor USE_XFONTSET is defined??
#endif
Lisp_Object Qxim_xlib;
#endif
Lisp_Object Qxim_xlib;
@@
-92,6
+89,7
@@
Lisp_Object Qxim_xlib;
#define xim_warn1(fmt, str) warn_when_safe (Qxim_xlib, Qwarning, fmt, str);
#define xim_info(str) warn_when_safe (Qxim_xlib, Qinfo, str);
#define xim_warn1(fmt, str) warn_when_safe (Qxim_xlib, Qwarning, fmt, str);
#define xim_info(str) warn_when_safe (Qxim_xlib, Qinfo, str);
+#ifdef XIM_XLIB /* XIM_XLIB specific */
/* Get/Set IC values for just one attribute */
#ifdef DEBUG_XEMACS
#define XIC_Value(Get_Set, xic, name, attr, value) \
/* Get/Set IC values for just one attribute */
#ifdef DEBUG_XEMACS
#define XIC_Value(Get_Set, xic, name, attr, value) \
@@
-122,13
+120,11
@@
static char DefaultXIMStyles[] =
"XIMPreeditNone|XIMStatusNothing\n"
"XIMPreeditNone|XIMStatusNone";
"XIMPreeditNone|XIMStatusNothing\n"
"XIMPreeditNone|XIMStatusNone";
-static Boolean xim_initted = False;
-
static XIMStyle best_style (XIMStyles *user, XIMStyles *xim);
static XIMStyle best_style (XIMStyles *user, XIMStyles *xim);
+#endif /* XIM_XLIB only */
-/* #### it appears this prototype is missing from the X11R6.4 includes,
- at least the XFree86 version ... */
-char * XSetIMValues(XIM, ...);
+/* This function is documented, but no prototype in the header files */
+EXTERN_C char * XSetIMValues(XIM, ...);
void
Initialize_Locale (void)
void
Initialize_Locale (void)
@@
-181,7
+177,13
@@
Initialize_Locale (void)
}
}
}
}
-#ifdef THIS_IS_X11R6 /* Callbacks for IM are supported from X11R6 or later. */
+#ifdef XIM_XLIB /* starting XIM specific codes */
+
+/* Callbacks for IM are supported from X11R6 or later. */
+#ifdef HAVE_XREGISTERIMINSTANTIATECALLBACK
+
+static Boolean xim_initted = False;
+
/* Called from when XIM is destroying.
Clear all the XIC when the XIM was destroying... */
static void
/* Called from when XIM is destroying.
Clear all the XIC when the XIM was destroying... */
static void
@@
-224,7
+226,7
@@
IMInstantiateCallback (Display *dpy, XPointer client_data, XPointer call_data)
DEVICE_X_XIM (d) = xim = XOpenIM (dpy, XtDatabase (dpy), name, class);
/* destroy callback for im */
DEVICE_X_XIM (d) = xim = XOpenIM (dpy, XtDatabase (dpy), name, class);
/* destroy callback for im */
- ximcallback.callback = IMDestroyCallback;
+ ximcallback.callback = (XIMProc) IMDestroyCallback;
ximcallback.client_data = (XPointer) d;
XSetIMValues (xim, XNDestroyCallback, &ximcallback, NULL);
}
ximcallback.client_data = (XPointer) d;
XSetIMValues (xim, XNDestroyCallback, &ximcallback, NULL);
}
@@
-240,23
+242,29
@@
IMInstantiateCallback (Display *dpy, XPointer client_data, XPointer call_data)
}
return;
}
}
return;
}
-#endif /* if THIS_IS_X11R6 */
+#endif /* HAVE_XREGISTERIMINSTANTIATECALLBACK */
/* Initialize XIM for X device.
Register the use of XIM using XRegisterIMInstantiateCallback. */
void
XIM_init_device (struct device *d)
{
/* Initialize XIM for X device.
Register the use of XIM using XRegisterIMInstantiateCallback. */
void
XIM_init_device (struct device *d)
{
-#ifdef THIS_IS_X11R6
+#ifdef HAVE_XREGISTERIMINSTANTIATECALLBACK /* X11R6+ */
DEVICE_X_XIM (d) = NULL;
XRegisterIMInstantiateCallback (DEVICE_X_DISPLAY (d), NULL, NULL, NULL,
DEVICE_X_XIM (d) = NULL;
XRegisterIMInstantiateCallback (DEVICE_X_DISPLAY (d), NULL, NULL, NULL,
- IMInstantiateCallback,
+#ifdef XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE
/* The sixth parameter is of type
XPointer in XFree86 but (XPointer *)
on most other X11's. */
/* The sixth parameter is of type
XPointer in XFree86 but (XPointer *)
on most other X11's. */
- (void *) d);
+ (XIDProc) IMInstantiateCallback,
+ (XPointer) d
+#else /* X Consortium prototype */
+ (XIMProc) IMInstantiateCallback,
+ (XPointer *) d
+#endif /* XREGISTERIMINSTANTIATECALLBACK_NONSTANDARD_PROTOTYPE */
+ );
return;
return;
-#else
+#else /* pre-X11R6 */
Display *dpy = DEVICE_X_DISPLAY (d);
char *name, *class;
XIM xim;
Display *dpy = DEVICE_X_DISPLAY (d);
char *name, *class;
XIM xim;
@@
-273,7
+281,7
@@
XIM_init_device (struct device *d)
XGetIMValues (xim, XNQueryInputStyle, &DEVICE_X_XIM_STYLES (d), NULL);
return;
}
XGetIMValues (xim, XNQueryInputStyle, &DEVICE_X_XIM_STYLES (d), NULL);
return;
}
-#endif
+#endif /* HAVE_XREGISTERIMINSTANTIATECALLBACK */
}
}
@@
-407,7
+415,7
@@
XIM_init_frame (struct frame *f)
XSetICFocus (xic);
XSetICFocus (xic);
-#ifdef THIS_IS_X11R6
+#ifdef HAVE_XREGISTERIMINSTANTIATECALLBACK
/* when frame is going to be destroyed (closed) */
XtAddCallback (FRAME_X_TEXT_WIDGET(f), XNDestroyCallback,
XIM_delete_frame, (XtPointer)f);
/* when frame is going to be destroyed (closed) */
XtAddCallback (FRAME_X_TEXT_WIDGET(f), XNDestroyCallback,
XIM_delete_frame, (XtPointer)f);
@@
-1109,6
+1117,7
@@
Unit_Test (struct frame *f, char * s)
}
}
#endif
}
}
#endif
+#endif /* XIM_XLIB only */
#if 0
/* Get a fontset for IM to use */
#if 0
/* Get a fontset for IM to use */