diff --git a/qinputcontext_x11.cpp.3.3.5 b/qinputcontext_x11.cpp
index 1b369da..b10e76e 100644
--- a/qinputcontext_x11.cpp.3.3.5
+++ b/qinputcontext_x11.cpp
@@ -1,9 +1,9 @@
 /****************************************************************************
-** $Id$
+** $Id: qt/qinputcontext_x11.cpp   3.3.4   edited Mar 25 2004 $
 **
 ** Implementation of QInputContext class
 **
-** Copyright (C) 2000-2005 Trolltech AS.  All rights reserved.
+** Copyright (C) 2000-2003 Trolltech AS.  All rights reserved.
 **
 ** This file is part of the kernel module of the Qt GUI Toolkit.
 **
@@ -65,6 +65,17 @@ static XFontSet fontsetCache[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
 static int fontsetRefCount = 0;
 
 static const char * const fontsetnames[] = {
+#ifdef _AIX
+//"-monotype-timesnewromanwt-medium-r-normal--16-116-100-100-p-20-iso8859-15",
+"-ibm_aix-fixed-medium-r-normal--19-150-100-100-m-180-jisx0208.1983-0",
+"-ibm_aix-fixed-medium-r-normal--19-150-100-100-m-180-jisx0208.1983-0",
+"-ibm_aix-fixed-medium-r-normal--19-150-100-100-m-180-jisx0208.1983-0",
+"-ibm_aix-fixed-medium-r-normal--19-150-100-100-m-180-jisx0208.1983-0",
+"-ibm_aix-fixed-medium-r-normal--19-150-100-100-m-180-jisx0208.1983-0",
+"-ibm_aix-fixed-medium-r-normal--19-150-100-100-m-180-jisx0208.1983-0",
+"-ibm_aix-fixed-medium-r-normal--19-150-100-100-m-180-jisx0208.1983-0",
+"-ibm_aix-fixed-medium-r-normal--19-150-100-100-m-180-jisx0208.1983-0"
+#else
     "-*-fixed-medium-r-*-*-16-*,-*-*-medium-r-*-*-16-*",
     "-*-fixed-medium-i-*-*-16-*,-*-*-medium-i-*-*-16-*",
     "-*-fixed-bold-r-*-*-16-*,-*-*-bold-r-*-*-16-*",
@@ -73,6 +84,7 @@ static const char * const fontsetnames[] = {
     "-*-fixed-medium-i-*-*-24-*,-*-*-medium-i-*-*-24-*",
     "-*-fixed-bold-r-*-*-24-*,-*-*-bold-r-*-*-24-*",
     "-*-fixed-bold-i-*-*-24-*,-*-*-bold-i-*-*-24-*"
+#endif
 };
 
 static XFontSet getFontSet( const QFont &f )
@@ -108,9 +120,72 @@ static XFontSet getFontSet( const QFont &f )
 #ifdef Q_C_CALLBACKS
 extern "C" {
 #endif // Q_C_CALLBACKS
+    static int xic_caret_callback(XIC, XPointer client_data, XPointer) {
+printf("\n%s:%d caret callback .\n", __FILE__, __LINE__);
+return 0;
+}
+    static int xic_statusdraw_callback(XIC, XPointer client_data, XPointer call_data) {
+printf("\n%s:%d statusdraw callback .\n", __FILE__, __LINE__);
+
+        XIMStatusDrawCallbackStruct *drawstruct =
+            (XIMStatusDrawCallbackStruct *) call_data;
+        XIMText *text = (XIMText *) drawstruct->data.text;
+        if (text) {
+            char *str = 0;
+            if (text->encoding_is_wchar) {
+                int l = wcstombs(NULL, text->string.wide_char, text->length);
+                if (l != -1) {
+                    str = new char[l + 1];
+                    wcstombs(str, text->string.wide_char, l);
+                    str[l] = 0;
+                }
+            } else
+                str = text->string.multi_byte;
+
+            if (! str)
+                return 0;
+
+            if(qApp->focusWidget()) {
+                QWidget * w = qApp->focusWidget()->topLevelWidget();
+                if(w) {
+                        QString s = w->caption() ;
+                        int atLocation = s.find('@');
+                        if( atLocation > 0 ) {
+                                s.setLength(atLocation);
+                        }
+
+                        QString inputDesc = QString::fromLocal8Bit(str);
+                        QString s2 = inputDesc.simplifyWhiteSpace().section(" ", 1,1);
+                        QString s3 = inputDesc.simplifyWhiteSpace().section(" ", 2,2);
+                        QString s4 = inputDesc.simplifyWhiteSpace().section(" ", 3,3);
+
+                        if( !s4.isEmpty() ) {
+                                s +=  "@" + s2 + s3 + s4;
+                        }
+
+                        w->setCaption(s);
+                }
+            }
+
+            if (text->encoding_is_wchar)
+                delete [] str;
+
+    }
+    return 0;
+}
+    static int xic_notify_callback(XIC, XPointer client_data, XPointer) {
+printf("\n%s:%d notify callback .\n", __FILE__, __LINE__);
+    }
+    static int xic_statusstart_callback(XIC, XPointer client_data, XPointer) {
+printf("\n%s:%d statusstart callback .\n", __FILE__, __LINE__);
+    }
+    static int xic_statusdone_callback(XIC, XPointer client_data, XPointer) {
+printf("\n%s:%d statusdone callback .\n", __FILE__, __LINE__);
+    }
 
     static int xic_start_callback(XIC, XPointer client_data, XPointer) {
 	QInputContext *qic = (QInputContext *) client_data;
+printf("\n%s:%d start qic->focusWidget=%x.qApp->focusWidget()=%x.\n", __FILE__, __LINE__, qic->focusWidget, qApp->focusWidget());
 	if (! qic) {
 #ifdef QT_XIM_DEBUG
 	    qDebug("compose start: no qic");
@@ -144,6 +219,8 @@ extern "C" {
 	    return 0;
 	}
 
+printf("\n%s:%d draw qic->focusWidget=%x.qApp->focusWidget()=%x.\n", __FILE__, __LINE__, qic->focusWidget, qApp->focusWidget());
+
 	bool send_imstart = FALSE;
 	if (qApp->focusWidget() != qic->focusWidget && qic->text.isEmpty()) {
 	    if (qic->focusWidget) {
@@ -182,6 +259,7 @@ extern "C" {
 #ifdef QT_XIM_DEBUG
             qDebug( "sending IMStart to %p", qic->focusWidget );
 #endif // QT_XIM_DEBUG
+printf("\n%s:%d draw send IMStart qic->focusWidget=%x.qApp->focusWidget()=%x.\n", __FILE__, __LINE__, qic->focusWidget, qApp->focusWidget());
 
 	    qt_compose_emptied = FALSE;
 	    QIMEvent startevent(QEvent::IMStart, QString::null, -1);
@@ -241,7 +319,7 @@ extern "C" {
 	    // figure out where the selection starts, and how long it is
 	    p = qic->selectedChars.data();
 	    bool started = FALSE;
-	    for ( x = 0; x < QMIN(qic->text.length(), qic->selectedChars.size()); ++x ) {
+	    for ( x = 0; x < qic->selectedChars.size(); ++x ) {
 		if ( started ) {
 		    if ( *p ) ++sellen;
 		    else break;
@@ -277,6 +355,9 @@ extern "C" {
                 qic->focusWidget, qic->text.length() );
 #endif // QT_XIM_DEBUG
 
+printf("\n%s:%d draw qic->focusWidget=%x.qApp->focusWidget()=%x,cursor=%d.\n",
+__FILE__, __LINE__, qic->focusWidget, qApp->focusWidget(),cursor);
+
 	QIMComposeEvent event( QEvent::IMCompose, qic->text, cursor, sellen );
 	QApplication::sendEvent(qic->focusWidget, &event);
 	return 0;
@@ -287,6 +368,8 @@ extern "C" {
 	if (! qic)
 	    return 0;
 
+printf("\n%s:%d DONE qic->focusWidget=%x.qApp->focusWidget()=%x.\n", __FILE__, __LINE__, qic->focusWidget, qApp->focusWidget());
+
 	if (qic->composing && qic->focusWidget) {
 #ifdef QT_XIM_DEBUG
 	    qDebug( "sending IMEnd (empty) to %p", qic->focusWidget );
@@ -333,20 +416,34 @@ QInputContext::QInputContext(QWidget *widget)
     XRectangle rect;
     XVaNestedList preedit_attr = 0;
     XIMCallback startcallback, drawcallback, donecallback;
+    XIMCallback caretcallback, notifycallback;
+    XIMCallback statusstartcallback, statusdrawcallback, statusdonecallback;
 
     font = widget->font();
     fontset = getFontSet( font );
 
+#ifdef _AIX
+XVaNestedList status_attr = 0;
+printf(" qt_xim_style ----- %x\n",qt_xim_style);
+qt_xim_style = XIMPreeditCallbacks|XIMStatusCallbacks;
+//qt_xim_style = XIMPreeditArea|XIMStatusArea;
+//qt_xim_style = XIMPreeditNothing|XIMStatusNothing;
+#endif
     if (qt_xim_style & XIMPreeditArea) {
+	//rect.x = 0;
+	//rect.y = 0;
+	//rect.width = widget->width();
+	//rect.height = widget->height();
 	rect.x = 0;
 	rect.y = 0;
-	rect.width = widget->width();
-	rect.height = widget->height();
+	rect.width = 100;
+	rect.height = 100;
 
 	preedit_attr = XVaCreateNestedList(0,
 					   XNArea, &rect,
 					   XNFontSet, fontset,
 					   (char *) 0);
+printf("\n%s:%d XCreateIC with XIMPreeditArea.\n", __FILE__,__LINE__);
     } else if (qt_xim_style & XIMPreeditPosition) {
 	spot.x = 1;
 	spot.y = 1;
@@ -355,6 +452,7 @@ QInputContext::QInputContext(QWidget *widget)
 					   XNSpotLocation, &spot,
 					   XNFontSet, fontset,
 					   (char *) 0);
+printf("\n%s:%d XCreateIC with XIMPreeditPosition.\n", __FILE__,__LINE__);
     } else if (qt_xim_style & XIMPreeditCallbacks) {
 	startcallback.client_data = (XPointer) this;
 	startcallback.callback = (XIMProc) xic_start_callback;
@@ -363,31 +461,54 @@ QInputContext::QInputContext(QWidget *widget)
 	donecallback.client_data = (XPointer) this;
 	donecallback.callback = (XIMProc) xic_done_callback;
 
+	caretcallback.client_data = (XPointer) this;
+	caretcallback.callback = (XIMProc) xic_caret_callback;
+	notifycallback.client_data = (XPointer) this;
+	notifycallback.callback = (XIMProc) xic_notify_callback;
+	statusdrawcallback.client_data = (XPointer) this;
+	statusdrawcallback.callback = (XIMProc) xic_statusdraw_callback;
+	statusstartcallback.client_data = (XPointer) this;
+	statusstartcallback.callback = (XIMProc) xic_statusstart_callback;
+	statusdonecallback.client_data = (XPointer) this;
+	statusdonecallback.callback = (XIMProc) xic_statusdone_callback;
+
 	preedit_attr = XVaCreateNestedList(0,
 					   XNPreeditStartCallback, &startcallback,
 					   XNPreeditDrawCallback, &drawcallback,
 					   XNPreeditDoneCallback, &donecallback,
+					   XNPreeditCaretCallback, &caretcallback,
+					   XNPreeditStateNotifyCallback, &notifycallback,
 					   (char *) 0);
+
+	status_attr = XVaCreateNestedList(0,
+					   XNStatusStartCallback, &statusstartcallback,
+					   XNStatusDrawCallback, &statusdrawcallback,
+					   XNStatusDoneCallback, &statusdonecallback,
+					   (char *) 0);
+printf("\n%s:%d XCreateIC PreeditCallbacks and StatusCallbacks.\n", __FILE__,__LINE__);
     }
 
     if (preedit_attr) {
 	ic = XCreateIC(qt_xim,
 		       XNInputStyle, qt_xim_style,
 		       XNClientWindow, widget->winId(),
+		       XNStatusAttributes, status_attr,
 		       XNPreeditAttributes, preedit_attr,
 		       (char *) 0);
 	XFree(preedit_attr);
-    } else
+    } else {
 	ic = XCreateIC(qt_xim,
 		       XNInputStyle, qt_xim_style,
 		       XNClientWindow, widget->winId(),
 		       (char *) 0);
+    }
 
     if (! ic)
 	qFatal("Failed to create XIM input context!");
 
     // when resetting the input context, preserve the input state
     (void) XSetICValues((XIC) ic, XNResetState, XIMPreserveState, (char *) 0);
+
 #endif // !QT_NO_XIM
 }
 
@@ -420,7 +541,9 @@ QInputContext::~QInputContext()
 void QInputContext::reset()
 {
 #if !defined(QT_NO_XIM)
+printf("\n%s:%d set focuswidget for qic.focuswidget=%x.\n",__FILE__,__LINE__, focusWidget);
     if (focusWidget && composing && ! text.isNull()) {
+printf("\n%s:%d set focuswidget for qic.\n",__FILE__,__LINE__);
 #ifdef QT_XIM_DEBUG
 	qDebug("QInputContext::reset: composing - sending IMEnd (empty) to %p",
 	       focusWidget);
