Commit 79fed460 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Remove old XIM code.

Wed Mar  7 20:47:41 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtktext.c gtk/gtkoldeditable.[ch] gdk/gdk.[ch]
	gdk/Makefile.am gdk/x11/Makefile.am gdk/x11/gdkevents-x11.c
	gdk/x11/gdkglobals-x11.c gdk/x11/gdkprivate-x11.c
	gdk/x11/gdkx.h gdk/x11/gdkim-x11.c: Remove old XIM code.

	* gdk/win32/gdkim-win32.c gdk/linux-fb/gdkim-fb.c: Remove
	gdk_im/gdk_ic.
parent f4cd3854
Wed Mar 7 20:47:41 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c gtk/gtkoldeditable.[ch] gdk/gdk.[ch]
gdk/Makefile.am gdk/x11/Makefile.am gdk/x11/gdkevents-x11.c
gdk/x11/gdkglobals-x11.c gdk/x11/gdkprivate-x11.c
gdk/x11/gdkx.h gdk/x11/gdkim-x11.c: Remove old XIM code.
* gdk/win32/gdkim-win32.c gdk/linux-fb/gdkim-fb.c: Remove
gdk_im/gdk_ic.
2001-03-09 Hans Breuer <hans@breuer.org>
* gdk/gdk.def : updated
......
Wed Mar 7 20:47:41 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c gtk/gtkoldeditable.[ch] gdk/gdk.[ch]
gdk/Makefile.am gdk/x11/Makefile.am gdk/x11/gdkevents-x11.c
gdk/x11/gdkglobals-x11.c gdk/x11/gdkprivate-x11.c
gdk/x11/gdkx.h gdk/x11/gdkim-x11.c: Remove old XIM code.
* gdk/win32/gdkim-win32.c gdk/linux-fb/gdkim-fb.c: Remove
gdk_im/gdk_ic.
2001-03-09 Hans Breuer <hans@breuer.org>
* gdk/gdk.def : updated
......
Wed Mar 7 20:47:41 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c gtk/gtkoldeditable.[ch] gdk/gdk.[ch]
gdk/Makefile.am gdk/x11/Makefile.am gdk/x11/gdkevents-x11.c
gdk/x11/gdkglobals-x11.c gdk/x11/gdkprivate-x11.c
gdk/x11/gdkx.h gdk/x11/gdkim-x11.c: Remove old XIM code.
* gdk/win32/gdkim-win32.c gdk/linux-fb/gdkim-fb.c: Remove
gdk_im/gdk_ic.
2001-03-09 Hans Breuer <hans@breuer.org>
* gdk/gdk.def : updated
......
Wed Mar 7 20:47:41 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c gtk/gtkoldeditable.[ch] gdk/gdk.[ch]
gdk/Makefile.am gdk/x11/Makefile.am gdk/x11/gdkevents-x11.c
gdk/x11/gdkglobals-x11.c gdk/x11/gdkprivate-x11.c
gdk/x11/gdkx.h gdk/x11/gdkim-x11.c: Remove old XIM code.
* gdk/win32/gdkim-win32.c gdk/linux-fb/gdkim-fb.c: Remove
gdk_im/gdk_ic.
2001-03-09 Hans Breuer <hans@breuer.org>
* gdk/gdk.def : updated
......
Wed Mar 7 20:47:41 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c gtk/gtkoldeditable.[ch] gdk/gdk.[ch]
gdk/Makefile.am gdk/x11/Makefile.am gdk/x11/gdkevents-x11.c
gdk/x11/gdkglobals-x11.c gdk/x11/gdkprivate-x11.c
gdk/x11/gdkx.h gdk/x11/gdkim-x11.c: Remove old XIM code.
* gdk/win32/gdkim-win32.c gdk/linux-fb/gdkim-fb.c: Remove
gdk_im/gdk_ic.
2001-03-09 Hans Breuer <hans@breuer.org>
* gdk/gdk.def : updated
......
Wed Mar 7 20:47:41 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c gtk/gtkoldeditable.[ch] gdk/gdk.[ch]
gdk/Makefile.am gdk/x11/Makefile.am gdk/x11/gdkevents-x11.c
gdk/x11/gdkglobals-x11.c gdk/x11/gdkprivate-x11.c
gdk/x11/gdkx.h gdk/x11/gdkim-x11.c: Remove old XIM code.
* gdk/win32/gdkim-win32.c gdk/linux-fb/gdkim-fb.c: Remove
gdk_im/gdk_ic.
2001-03-09 Hans Breuer <hans@breuer.org>
* gdk/gdk.def : updated
......
Wed Mar 7 20:47:41 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c gtk/gtkoldeditable.[ch] gdk/gdk.[ch]
gdk/Makefile.am gdk/x11/Makefile.am gdk/x11/gdkevents-x11.c
gdk/x11/gdkglobals-x11.c gdk/x11/gdkprivate-x11.c
gdk/x11/gdkx.h gdk/x11/gdkim-x11.c: Remove old XIM code.
* gdk/win32/gdkim-win32.c gdk/linux-fb/gdkim-fb.c: Remove
gdk_im/gdk_ic.
2001-03-09 Hans Breuer <hans@breuer.org>
* gdk/gdk.def : updated
......
......@@ -62,7 +62,6 @@ gdk_public_h_sources = @STRIP_BEGIN@ \
gdkgc.h \
gdkkeysyms.h \
gdki18n.h \
gdkim.h \
gdkimage.h \
gdkinput.h \
gdkkeys.h \
......
......@@ -340,10 +340,6 @@ gdk_init_check (int *argc,
gdk_input_init ();
gdk_dnd_init ();
#ifdef USE_XIM
gdk_im_open ();
#endif
gdk_initialized = 1;
return TRUE;
......@@ -424,12 +420,6 @@ gdk_exit_func (void)
if (gdk_initialized)
{
#ifdef USE_XIM
/* cleanup IC */
gdk_ic_cleanup ();
/* close IM */
gdk_im_close ();
#endif
gdk_image_exit ();
gdk_input_exit ();
gdk_key_repeat_restore ();
......
......@@ -34,7 +34,6 @@
#include <gdk/gdkevents.h>
#include <gdk/gdkfont.h>
#include <gdk/gdkgc.h>
#include <gdk/gdkim.h>
#include <gdk/gdkimage.h>
#include <gdk/gdkinput.h>
#include <gdk/gdkkeys.h>
......
......@@ -125,13 +125,6 @@ void gdk_synthesize_window_state (GdkWindow *window,
* Interfaces used by windowing code *
*************************************/
#ifdef USE_XIM
/* XIM support */
gint gdk_im_open (void);
void gdk_im_close (void);
void gdk_ic_cleanup (void);
#endif /* USE_XIM */
void _gdk_window_destroy (GdkWindow *window,
gboolean foreign_destroy);
void _gdk_window_clear_update_area (GdkWindow *window);
......
......@@ -97,90 +97,6 @@ gdk_set_locale (void)
return current_locale;
}
void
gdk_im_begin (GdkIC *ic, GdkWindow* window)
{
}
void
gdk_im_end (void)
{
}
GdkIMStyle
gdk_im_decide_style (GdkIMStyle supported_style)
{
return GDK_IM_PREEDIT_NONE | GDK_IM_STATUS_NONE;
}
GdkIMStyle
gdk_im_set_best_style (GdkIMStyle style)
{
return GDK_IM_PREEDIT_NONE | GDK_IM_STATUS_NONE;
}
gint
gdk_im_ready (void)
{
return FALSE;
}
gint
gdk_im_open(void)
{
return TRUE;
}
void
gdk_im_close(void)
{
}
GdkIC *
gdk_ic_new (GdkICAttr *attr, GdkICAttributesType mask)
{
return NULL;
}
void
gdk_ic_destroy (GdkIC *ic)
{
}
GdkIMStyle
gdk_ic_get_style (GdkIC *ic)
{
return GDK_IM_PREEDIT_NONE | GDK_IM_STATUS_NONE;
}
void
gdk_ic_set_values (GdkIC *ic, ...)
{
}
void
gdk_ic_get_values (GdkIC *ic, ...)
{
}
GdkICAttributesType
gdk_ic_set_attr (GdkIC *ic, GdkICAttr *attr, GdkICAttributesType mask)
{
return 0;
}
GdkICAttributesType
gdk_ic_get_attr (GdkIC *ic, GdkICAttr *attr, GdkICAttributesType mask)
{
return 0;
}
GdkEventMask
gdk_ic_get_events (GdkIC *ic)
{
return 0;
}
/*
* gdk_wcstombs
*
......@@ -225,18 +141,3 @@ gdk_mbstowcs (GdkWChar *dest, const gchar *src, gint dest_max)
return i;
}
void
gdk_ic_cleanup(void)
{
}
GdkICAttr* gdk_ic_attr_new (void)
{
return NULL;
}
void
gdk_ic_attr_destroy (GdkICAttr *attr)
{
}
......@@ -30,7 +30,6 @@
#include <string.h>
#include <locale.h>
#include "gdkim.h"
#include "gdkpixmap.h"
#include "gdkinternals.h"
#include "gdki18n.h"
......@@ -58,90 +57,6 @@ gdk_set_locale (void)
return g_win32_getlocale ();
}
void
gdk_im_begin (GdkIC *ic, GdkWindow* window)
{
}
void
gdk_im_end (void)
{
}
GdkIMStyle
gdk_im_decide_style (GdkIMStyle supported_style)
{
return GDK_IM_PREEDIT_NONE | GDK_IM_STATUS_NONE;
}
GdkIMStyle
gdk_im_set_best_style (GdkIMStyle style)
{
return GDK_IM_PREEDIT_NONE | GDK_IM_STATUS_NONE;
}
gint
gdk_im_ready (void)
{
return FALSE;
}
GdkIC *
gdk_ic_new (GdkICAttr *attr, GdkICAttributesType mask)
{
return NULL;
}
void
gdk_ic_destroy (GdkIC *ic)
{
}
GdkIMStyle
gdk_ic_get_style (GdkIC *ic)
{
return GDK_IM_PREEDIT_NONE | GDK_IM_STATUS_NONE;
}
GdkICAttr*
gdk_ic_attr_new (void)
{
return NULL;
}
void
gdk_ic_attr_destroy (GdkICAttr *attr)
{
}
void
gdk_ic_set_values (GdkIC *ic, ...)
{
}
void
gdk_ic_get_values (GdkIC *ic, ...)
{
}
GdkICAttributesType
gdk_ic_set_attr (GdkIC *ic, GdkICAttr *attr, GdkICAttributesType mask)
{
return 0;
}
GdkICAttributesType
gdk_ic_get_attr (GdkIC *ic, GdkICAttr *attr, GdkICAttributesType mask)
{
return 0;
}
GdkEventMask
gdk_ic_get_events (GdkIC *ic)
{
return 0;
}
/*
* gdk_wcstombs
*
......
......@@ -397,12 +397,7 @@ gdk_event_translate (GdkEvent *event,
static XComposeStatus compose;
KeySym keysym;
int charcount;
#ifdef USE_XIM
static gchar* buf = NULL;
static gint buf_len= 0;
#else
char buf[16];
#endif
gint return_val;
gint xoffset, yoffset;
......@@ -471,41 +466,6 @@ gdk_event_translate (GdkEvent *event,
}
}
#ifdef USE_XIM
if (window == NULL && gdk_xim_window && xevent->type == KeyPress &&
!GDK_WINDOW_DESTROYED (gdk_xim_window))
{
/*
* If user presses a key in Preedit or Status window, keypress event
* is sometimes sent to these windows. These windows are not managed
* by GDK, so we redirect KeyPress event to xim_window.
*
* If someone want to use the window whitch is not managed by GDK
* and want to get KeyPress event, he/she must register the filter
* function to gdk_default_filters to intercept the event.
*/
GdkFilterReturn result;
window = gdk_xim_window;
window_private = (GdkWindowObject *) window;
gdk_window_ref (window);
event->any.window = window;
GDK_NOTE (XIM,
g_message ("KeyPress event is redirected to xim_window: %#lx",
xevent->xany.window));
result = gdk_event_apply_filters (xevent, event,
window_private->filters);
if (result != GDK_FILTER_CONTINUE)
{
return_val = (result == GDK_FILTER_TRANSLATE) ? TRUE : FALSE;
goto done;
}
}
#endif
/* We do a "manual" conversion of the XEvent to a
* GdkEvent. The structures are mostly the same so
* the conversion is fairly straightforward. We also
......@@ -531,49 +491,8 @@ gdk_event_translate (GdkEvent *event,
/* Lookup the string corresponding to the given keysym.
*/
#ifdef USE_XIM
if (buf_len == 0)
{
buf_len = 128;
buf = g_new (gchar, buf_len);
}
keysym = GDK_VoidSymbol;
if (gdk_xim_ic && gdk_xim_ic->xic)
{
Status status;
/* Clear keyval. Depending on status, may not be set */
charcount = XmbLookupString(gdk_xim_ic->xic,
&xevent->xkey, buf, buf_len-1,
&keysym, &status);
if (status == XBufferOverflow)
{ /* retry */
/* alloc adequate size of buffer */
GDK_NOTE (XIM,
g_message("XIM: overflow (required %i)", charcount));
while (buf_len <= charcount)
buf_len *= 2;
buf = (gchar *) g_realloc (buf, buf_len);
charcount = XmbLookupString (gdk_xim_ic->xic,
&xevent->xkey, buf, buf_len-1,
&keysym, &status);
}
if (status == XLookupNone)
{
return_val = FALSE;
break;
}
}
else
charcount = XLookupString (&xevent->xkey, buf, buf_len,
&keysym, &compose);
#else
charcount = XLookupString (&xevent->xkey, buf, 16,
&keysym, &compose);
#endif
event->key.keyval = keysym;
event->key.hardware_keycode = xevent->xkey.keycode;
......@@ -631,13 +550,6 @@ gdk_event_translate (GdkEvent *event,
break;
}
#ifdef USE_XIM
if (buf_len == 0)
{
buf_len = 128;
buf = g_new (gchar, buf_len);
}
#endif
keysym = GDK_VoidSymbol;
charcount = XLookupString (&xevent->xkey, buf, 16,
&keysym, &compose);
......@@ -1476,26 +1388,7 @@ gdk_events_queue (void)
while (!gdk_event_queue_find_first() && XPending (gdk_display))
{
#ifdef USE_XIM
Window w = None;
XNextEvent (gdk_display, &xevent);
if (gdk_xim_window)
switch (xevent.type)
{
case KeyPress:
case KeyRelease:
case ButtonPress:
case ButtonRelease:
w = GDK_WINDOW_XWINDOW (gdk_xim_window);
break;
}
if (XFilterEvent (&xevent, w))
continue;
#else
XNextEvent (gdk_display, &xevent);
#endif
switch (xevent.type)
{
......
......@@ -45,9 +45,6 @@ gchar *gdk_progclass = NULL;
gboolean gdk_null_window_warnings = TRUE;
gboolean gdk_xim_using; /* using XIM Protocol if TRUE */
#ifdef USE_XIM
GdkICPrivate *gdk_xim_ic; /* currently using IC */
#endif /* USE_XIM */
GdkWindow *gdk_xim_window; /* currently using Widow */
GdkWindowObject *gdk_xgrab_window = NULL; /* Window that currently holds the
......
This diff is collapsed.
......@@ -110,34 +110,6 @@ static const int gdk_ndebug_keys = sizeof(gdk_debug_keys)/sizeof(GDebugKey);
#endif /* G_ENABLE_DEBUG */
static void
gdk_arg_xim_preedit_cb (const gchar *arg, const gchar *value, gpointer cb_data)
{
if (strcmp ("none", value) == 0)
gdk_im_set_best_style (GDK_IM_PREEDIT_NONE);
else if (strcmp ("nothing", value) == 0)
gdk_im_set_best_style (GDK_IM_PREEDIT_NOTHING);
else if (strcmp ("area", value) == 0)
gdk_im_set_best_style (GDK_IM_PREEDIT_AREA);
else if (strcmp ("position", value) == 0)
gdk_im_set_best_style (GDK_IM_PREEDIT_POSITION);
else if (strcmp ("callbacks", value) == 0)
gdk_im_set_best_style (GDK_IM_PREEDIT_CALLBACKS);
}
static void
gdk_arg_xim_status_cb (const gchar *arg, const gchar *value, gpointer cb_data)
{
if (strcmp ("none", value) == 0)
gdk_im_set_best_style (GDK_IM_STATUS_NONE);
else if (strcmp ("nothing", value) == 0)
gdk_im_set_best_style (GDK_IM_STATUS_NOTHING);
else if (strcmp ("area", value) == 0)
gdk_im_set_best_style (GDK_IM_STATUS_AREA);
else if (strcmp ("callbacks", value) == 0)
gdk_im_set_best_style (GDK_IM_STATUS_CALLBACKS);
}
GdkArgDesc _gdk_windowing_args[] = {
{ "display", GDK_ARG_STRING, &gdk_display_name, (GdkArgFunc)NULL },
{ "sync", GDK_ARG_BOOL, &gdk_synchronize, (GdkArgFunc)NULL },
......@@ -145,8 +117,6 @@ GdkArgDesc _gdk_windowing_args[] = {
{ "class", GDK_ARG_STRING, &gdk_progclass, (GdkArgFunc)NULL },
{ "gxid-host", GDK_ARG_STRING, &gdk_input_gxid_host, (GdkArgFunc)NULL },
{ "gxid-port", GDK_ARG_INT, &gdk_input_gxid_port, (GdkArgFunc)NULL },
{ "xim-preedit", GDK_ARG_CALLBACK, NULL, gdk_arg_xim_preedit_cb },
{ "xim-status", GDK_ARG_CALLBACK, NULL, gdk_arg_xim_status_cb },
{ NULL }
};
......
......@@ -106,16 +106,12 @@ extern GdkWindowObject *gdk_xgrab_window; /* Window that currently holds the
* x pointer grab
*/
#ifdef USE_XIM
extern GdkICPrivate *gdk_xim_ic; /* currently using IC */
extern GdkWindow *gdk_xim_window; /* currently using Window */
#endif /* USE_XIM */
/* Used to detect not-up-to-date keymap */
extern guint _gdk_keymap_serial;
#ifdef HAVE_XKB
extern gboolean _gdk_use_xkb;
extern gboolean _gdk_have_xkb_autorepeat;
#endif
/* Whether we were able to turn on detectable-autorepeat using
......
......@@ -42,10 +42,6 @@ typedef struct _GdkFontPrivateX GdkFontPrivateX;
typedef struct _GdkImagePrivateX11 GdkImagePrivateX11;
typedef struct _GdkVisualPrivate GdkVisualPrivate;
#ifdef USE_XIM
typedef struct _GdkICPrivate GdkICPrivate;
#endif /* USE_XIM */
struct _GdkCursorPrivate
{
GdkCursor cursor;
......@@ -89,18 +85,6 @@ struct _GdkImagePrivateX11
};
#ifdef USE_XIM
struct _GdkICPrivate
{
XIC xic;
GdkICAttr *attr;
GdkICAttributesType mask;
};
#endif /* USE_XIM */
typedef struct _GdkGCX11 GdkGCX11;
typedef struct _GdkGCX11Class GdkGCX11Class;
......
......@@ -433,10 +433,6 @@ gtk_old_editable_init (GtkOldEditable *old_editable)
old_editable->visible = 1;
old_editable->clipboard_text = NULL;
#ifdef USE_XIM
old_editable->ic = NULL;
#endif
gtk_selection_add_targets (GTK_WIDGET (old_editable), GDK_SELECTION_PRIMARY,
targets, G_N_ELEMENTS (targets));
}
......
......@@ -66,8 +66,6 @@ struct _GtkOldEditable
/*< private >*/
guint editable : 1;
guint visible : 1;
GdkIC *ic;
GdkICAttr *ic_attr;
gchar *clipboard_text;
};
......
......@@ -1342,71 +1342,6 @@ gtk_text_realize (GtkWidget *widget)
gdk_gc_set_exposures (text->gc, TRUE);
gdk_gc_set_foreground (text->gc, &widget->style->text[GTK_STATE_NORMAL]);
#ifdef USE_XIM
if (gdk_im_ready () && (old_editable->ic_attr = gdk_ic_attr_new ()) != NULL)
{
gint width, height;
GdkColormap *colormap;
GdkEventMask mask;
GdkICAttr *attr = old_editable->ic_attr;
GdkICAttributesType attrmask = GDK_IC_ALL_REQ;
GdkIMStyle style;
GdkIMStyle supported_style = GDK_IM_PREEDIT_NONE |
GDK_IM_PREEDIT_NOTHING |
GDK_IM_PREEDIT_POSITION |
GDK_IM_STATUS_NONE |
GDK_IM_STATUS_NOTHING;
if (widget->style && widget->style->font->type != GDK_FONT_FONTSET)
supported_style &= ~GDK_IM_PREEDIT_POSITION;
attr->style = style = gdk_im_decide_style (supported_style);
attr->client_window = text->text_area;
if ((colormap = gtk_widget_get_colormap (widget)) !=
gtk_widget_get_default_colormap ())
{
attrmask |= GDK_IC_PREEDIT_COLORMAP;
attr->preedit_colormap = colormap;
}
switch (style & GDK_IM_PREEDIT_MASK)
{
case GDK_IM_PREEDIT_POSITION:
if (widget->style && widget->style->font->type != GDK_FONT_FONTSET)
{
g_warning ("over-the-spot style requires fontset");
break;
}
attrmask |= GDK_IC_PREEDIT_POSITION_REQ;
gdk_window_get_size (text->text_area, &width, &height);
attr->spot_location.x = 0;
attr->spot_location.y = height;
attr->preedit_area.x = 0;
attr->preedit_area.y = 0;
attr->preedit_area.width = width;
attr->preedit_area.height = height;
attr->preedit_fontset = widget->style->font;
break;
}
old_editable->ic = gdk_ic_new (attr, attrmask);
if (old_editable->ic == NULL)
g_warning ("Can't create input context.");
else
{
mask = gdk_window_get_events (text->text_area);
mask |= gdk_ic_get_events (old_editable->ic);
gdk_window_set_events (text->text_area, mask);
if (GTK_WIDGET_HAS_FOCUS (widget))
gdk_im_begin (old_editable->ic, text->text_area);
}
}
#endif
realize_properties (text);
gdk_window_show (text->text_area);
init_properties (text);
......@@ -1468,19 +1403,6 @@ gtk_text_unrealize (GtkWidget *widget)
text = GTK_TEXT (widget);
#ifdef USE_XIM
if (GTK_OLD_EDITABLE (widget)->ic)
{
gdk_ic_destroy (GTK_OLD_EDITABLE (widget)->ic);
GTK_OLD_EDITABLE (widget)->ic = NULL;
}
if (GTK_OLD_EDITABLE (widget)->ic_attr)
{
gdk_ic_attr_destroy (GTK_OLD_EDITABLE (widget)->ic_attr);
GTK_OLD_EDITABLE (widget)->ic_attr = NULL;
}
#endif
gdk_window_set_user_data (text->text_area, NULL);
gdk_window_destroy (text->text_area);
text->text_area = NULL;
......@@ -1662,20 +1584,6 @@ gtk_text_size_allocate (GtkWidget *widget,
MAX (1, (gint)widget->allocation.height - (gint)(widget->style->ythickness +
(gint)TEXT_BORDER_ROOM) * 2));
#ifdef USE_XIM
if (old_editable->ic && (gdk_ic_get_style (old_editable->ic) & GDK_IM_PREEDIT_POSITION))
{
gint width, height;
gdk_window_get_size (text->text_area, &width, &height);
old_editable->ic_attr->preedit_area.width = width;
old_editable->ic_attr->preedit_area.height = height;
gdk_ic_set_attr (old_editable->ic,
old_editable->ic_attr, GDK_IC_PREEDIT_AREA);
}
#endif
recompute_geometry (text);
}
}
......@@ -2232,11 +2140,6 @@ gtk_text_focus_in (GtkWidget *widget,
TDEBUG (("in gtk_text_focus_in\n"));
#ifdef USE_XIM
if (GTK_OLD_EDITABLE (widget)->ic)
gdk_im_begin (GTK_OLD_EDITABLE (widget)->ic, GTK_TEXT(widget)->text_area);