aWin->SetXICSpotLocation(textEvent.theReply.mCursorPosition);
nsPoint spot; spot.x = textEvent.theReply.mCursorPosition.x; spot.y = textEvent.theReply.mCursorPosition.y + textEvent.theReply.mCursorPosition.height; aWin->SetXICBaseFontSize(textEvent.theReply.mCursorPosition.height-1); aWin->SetXICSpotLocation(spot);
static gint composition_draw(GdkEventKey *aEvent, nsWindow *aWin,                             nsEventStatus *aStatus) {  nsresult res= NS_OK;  if (!aWin->mIMECompositionUniString) {    aWin->mIMECompositionUniStringSize = 128;    aWin->mIMECompositionUniString =      new PRUnichar[aWin->mIMECompositionUniStringSize];  }  PRUnichar *uniChar;  PRInt32 uniCharSize;  PRInt32 srcLen = aEvent->length;  for (;;) {    uniChar = aWin->mIMECompositionUniString;    uniCharSize = aWin->mIMECompositionUniStringSize - 1;    res = nsGtkIMEHelper::GetSingleton()->ConvertToUnicode(            (char*)aEvent->string, &srcLen, uniChar, &uniCharSize);    if(NS_ERROR_ABORT == res)      return FALSE;    if (srcLen == aEvent->length &&        uniCharSize < aWin->mIMECompositionUniStringSize - 1) {      break;    }    aWin->mIMECompositionUniStringSize += 32;    if(aWin->mIMECompositionUniString)	delete [] aWin->mIMECompositionUniString;    aWin->mIMECompositionUniString =      new PRUnichar[aWin->mIMECompositionUniStringSize];  }  aWin->mIMECompositionUniString[uniCharSize] = 0;  nsTextEvent textEvent;  textEvent.message = NS_TEXT_EVENT;  textEvent.widget = (nsWidget*)aWin;  textEvent.time = aEvent->time;  textEvent.point.x = 0;  textEvent.point.y = 0;  textEvent.theText = aWin->mIMECompositionUniString;  textEvent.rangeCount = 0;  textEvent.rangeArray = nsnull;  textEvent.isShift = (aEvent->state & GDK_SHIFT_MASK) ? PR_TRUE : PR_FALSE;  textEvent.isControl = (aEvent->state & GDK_CONTROL_MASK) ? PR_TRUE : PR_FALSE;  textEvent.isAlt = (aEvent->state & GDK_MOD1_MASK) ? PR_TRUE : PR_FALSE;  // XXX  textEvent.isMeta = PR_FALSE; //(aEvent->state & GDK_MOD2_MASK) ? PR_TRUE : PR_FALSE;  textEvent.eventStructType = NS_TEXT_EVENT;  aWin->DispatchEvent(&textEvent, *aStatus);  aWin->SetXICSpotLocation(textEvent.theReply.mCursorPosition);  return True;}