>> Edit article
이름
제목
패스워드
ami수정 diff -uNr ami-1.0.11.orig/src/handler.c ami-1.0.11/src/handler.c --- ami-1.0.11.orig/src/handler.c Thu Apr 12 13:23:46 2001 +++ ami-1.0.11/src/handler.c Wed Apr 17 13:42:29 2002 @@ -304,7 +304,15 @@ } return 1; } - editing_flush_with_c(ic, strbuf[0]); + if(ic->han->pos == ic->han->len) { + if (ic->han->len > 0) { + editing_flush(ic); + send_event_later(call_data); + } else { + IMForwardEvent(ims, (gpointer)call_data); + } + } + //editing_flush_with_c(ic, strbuf[0]); return 1; break; case AUTOMATA_CORRECT: QT수정.... diff -uNr qt.orig/src/widgets/qlineedit.cpp qt/src/widgets/qlineedit.cpp --- qt.orig/src/widgets/qlineedit.cpp Thu Jan 24 15:35:08 2002 +++ qt/src/widgets/qlineedit.cpp Thu Jan 24 15:35:56 2002 @@ -800,6 +800,12 @@ void QLineEdit::imStartEvent( QIMEvent *e ) { d->preeditStart = cursorPosition(); + if (selectedText().length() > 0) { + d->preeditStart -= selectedText().length(); + cut(); + emit textChanged(text()); + } + d->preeditLength = 0; setMicroFocusHint( d->cursor->x() - d->offset, d->cursor->y(), 0, d->cursor->parag()->rect().height(), TRUE ); diff -uNr qt.orig/src/widgets/qtextedit.cpp qt/src/widgets/qtextedit.cpp --- qt.orig/src/widgets/qtextedit.cpp Thu Jan 24 15:35:26 2002 +++ qt/src/widgets/qtextedit.cpp Thu Jan 24 15:36:02 2002 @@ -1053,6 +1049,8 @@ void QTextEdit::imStartEvent( QIMEvent *e ) { d->preeditStart = cursor->index(); + if ( selectedText().length() > 0 ) + d->preeditStart -= selectedText().length(); e->accept(); } diff -uNr qt-x11-free-3.0.4.org/src/kernel/qapplication_x11.cpp qt-x11-free-3.0.4/src/kernel/qapplication_x11.cpp --- qt-x11-free-3.0.4.org/src/kernel/qapplication_x11.cpp Mon May 6 09:46:30 2002 +++ qt-x11-free-3.0.4/src/kernel/qapplication_x11.cpp Mon May 6 09:49:06 2002 @@ -3428,7 +3428,7 @@ if ( inPopupMode() ) // no focus widget, see if we have a popup keywidget = (QETWidget*) activePopupWidget(); else if ( widget ) - keywidget = (QETWidget*)widget->topLevelWidget(); + keywidget = widget->focusWidget()?(QETWidget*)widget->focusWidget():widget; } } } diff -uNr qt-x11-free-3.0.4.org/include/qwidget.h qt-x11-free-3.0.4/include/qwidget.h --- qt-x11-free-3.0.4.org/include/qwidget.h Fri Apr 26 07:48:25 2002 +++ qt-x11-free-3.0.4/include/qwidget.h Mon May 6 09:51:44 2002 @@ -513,7 +513,9 @@ int metric( int ) const; void resetInputContext(); - +#ifndef KO_ONTHE_PATCH + void clearInputContext(); +#endif virtual void create( WId = 0, bool initializeWindow = TRUE, bool destroyOldWindow = TRUE ); virtual void destroy( bool destroyWindow = TRUE, diff -uNr qt-x11-free-3.0.4.org/src/dialogs/qfiledialog.cpp qt-x11-free-3.0.4/src/dialogs/qfiledialog.cpp --- qt-x11-free-3.0.4.org/src/dialogs/qfiledialog.cpp Fri Apr 26 07:48:12 2002 +++ qt-x11-free-3.0.4/src/dialogs/qfiledialog.cpp Mon May 6 09:54:42 2002 @@ -976,7 +976,9 @@ // this is similar to QUrl::encode but does encode "*" and // doesn't encode whitespaces static QString encodeFileName( const QString& fName ) { - +#ifndef KO_ONTHE_PATCH + return fName; +#else QString newStr; QString sChars; #ifdef Q_WS_WIN @@ -1004,6 +1006,7 @@ } } return newStr; +#endif } }; @@ -2987,6 +2990,32 @@ } } } +#ifndef KO_ONTHE_PATCH + // add lab3-qt-patch + QString LineText = nameEdit->text(); + int dot_pos = LineText.find("."); + int line_len = LineText.length(); + if( f.compare("*.*") != 0 && line_len > 0 && LineText.contains('.') < 2 && index >= 0) + { + if(dot_pos >= 0) + { + if(dot_pos != 0 && dot_pos < (line_len-1)) + { + //LineText = LineText.left(LineText.length() - LineText.findRev(".") - 1);^M + LineText = LineText.left(LineText.findRev(".")); + LineText += f.right(f.length() - f.findRev(".")); + nameEdit->setText(LineText); + } + } + else + { + LineText += f.right(f.length() - f.findRev(".")); + nameEdit->setText(LineText); + } + } + // end lab3-qt-patch^M +#endif + rereadDir(); } diff -uNr qt-x11-free-3.0.4.org/src/kernel/qapplication_x11.cpp qt-x11-free-3.0.4/src/kernel/qapplication_x11.cpp --- qt-x11-free-3.0.4.org/src/kernel/qapplication_x11.cpp Mon May 6 09:46:30 2002 +++ qt-x11-free-3.0.4/src/kernel/qapplication_x11.cpp Mon May 6 09:56:41 2002 @@ -5635,8 +5635,15 @@ QWidget *tlw = topLevelWidget(); QInputContext *qic = (QInputContext *) tlw->topData()->xic; - if (qic && qic->composing && ! qic->lastcompose.isNull() && - qic->lastcompose == text) { +#ifndef KO_ONTHE_PATCH + if (qic && qic->composing && ! qic->lastcompose.isNull() && + text.length() && qic->lastcompose.contains(text)) +#else + if (qic && qic->composing && ! qic->lastcompose.isNull() && + qic->lastcompose == text) +#endif + { + // keyevent with same text as last compose, skip it return TRUE; } diff -uNr qt-x11-free-3.0.4.org/src/kernel/qinputcontext_x11.cpp qt-x11-free-3.0.4/src/kernel/qinputcontext_x11.cpp --- qt-x11-free-3.0.4.org/src/kernel/qinputcontext_x11.cpp Fri Apr 26 07:48:18 2002 +++ qt-x11-free-3.0.4/src/kernel/qinputcontext_x11.cpp Mon May 6 10:05:24 2002 @@ -138,26 +138,50 @@ qic->text.remove(drawstruct->chg_first, drawstruct->chg_length); - KeySym sym = XKeycodeToKeysym(QPaintDevice::x11AppDisplay(), - compose_keycode, 0); - - if ( qic->text.isEmpty() ) { - if ( sym == XK_Return ) { - // qDebug("user pressed return, send an IMEnd..."); - QIMEvent endevent(QEvent::IMEnd, qic->lastcompose, -1); - QApplication::sendEvent(qic->focusWidget, &endevent); - qic->focusWidget = 0; - return 0; - } else { - // qDebug("last char deleted, send an IMEnd with null string..."); - QIMEvent endevent(QEvent::IMEnd, QString::null, -1); - QApplication::sendEvent(qic->focusWidget, &endevent); - qic->focusWidget = 0; - return 0; - } - } - } - +#ifndef KO_ONTHE_PATCH + if(qic->text.isEmpty() && drawstruct->chg_length > 0) { + int cursorPos = -1 * drawstruct->chg_length; + QString modifier = QString(getenv("XMODIFIERS")); + if(modifier.contains("Ami")) + cursorPos = -1; + + if(modifier.contains("vje")) + { + QIMEvent event(QEvent::IMCompose, qic->text, drawstruct->caret); + QApplication::sendEvent(qic->focusWidget, &event); + qic->lastcompose = QString::null; + return 0; + } + else + { + QIMEvent endevent(QEvent::IMEnd, qic->lastcompose, cursorPos); + + QApplication::sendEvent(qic->focusWidget, &endevent); + qic->focusWidget = 0; + return 0; + } + } +#else + if (drawstruct->chg_length == 0 || + (qic->text.isEmpty() && drawstruct->chg_length > 1)) { + // user pressed return, send an IMEnd... + QIMEvent endevent(QEvent::IMEnd, qic->lastcompose, -1); + + QApplication::sendEvent(qic->focusWidget, &endevent); + qic->focusWidget = 0; + return 0; + } else if ( qic->text.isEmpty() && + drawstruct->chg_first == 0 && + drawstruct->chg_length == 1 ) { + // last char deleted, send an IMEnd with null string... + QIMEvent endevent(QEvent::IMEnd, QString::null, -1); + QApplication::sendEvent(qic->focusWidget, &endevent); + qic->focusWidget = 0; + return 0; + } +#endif + } + qic->lastcompose = qic->text; QIMEvent event(QEvent::IMCompose, qic->text, drawstruct->caret); @@ -328,7 +352,10 @@ QApplication::sendEvent(focusWidget, &endevent); focusWidget = 0; lastcompose = text = QString::null; - +#ifndef KO_ONTHE_PATCH + text = QString::null; +#endif + char *mb = XmbResetIC((XIC) ic); if (mb) XFree(mb); diff -uNr qt-x11-free-3.0.4.org/src/kernel/qpaintdevice_x11.cpp qt-x11-free-3.0.4/src/kernel/qpaintdevice_x11.cpp --- qt-x11-free-3.0.4.org/src/kernel/qpaintdevice_x11.cpp Fri Apr 26 07:48:20 2002 +++ qt-x11-free-3.0.4/src/kernel/qpaintdevice_x11.cpp Mon May 6 10:06:43 2002 @@ -461,6 +461,9 @@ dpiX = (DisplayWidth(dpy,scr) * 254 + DisplayWidthMM(dpy,scr)*5) / (DisplayWidthMM(dpy,scr)*10); +#ifndef KO_ONTHE_PATCH + dpiX = 75; +#endif } } return dpiX; @@ -484,6 +487,9 @@ (DisplayHeight(dpy,scr) * 254 + DisplayHeightMM(dpy,scr)*5) / (DisplayHeightMM(dpy,scr)*10); } +#ifndef KO_ONTHE_PATCH + dpiY = 75; +#endif return dpiY; } diff -uNr qt-x11-free-3.0.4.org/src/kernel/qrichtext.cpp qt-x11-free-3.0.4/src/kernel/qrichtext.cpp --- qt-x11-free-3.0.4.org/src/kernel/qrichtext.cpp Fri Apr 26 07:48:22 2002 +++ qt-x11-free-3.0.4/src/kernel/qrichtext.cpp Mon May 6 10:09:52 2002 @@ -5415,10 +5415,14 @@ } if ( row < 0x11 ) // no asian font return FALSE; +#ifndef KO_ONTHE_PATCH +#else + if ( row > 0x2d && row < 0xfb || row == 0x11 ) // asian line breaking. Everywhere allowed except directly // in front of a punctuation character. return TRUE; +#endif } return FALSE; } diff -uNr qt-x11-free-3.0.4.org/src/kernel/qwidget.h qt-x11-free-3.0.4/src/kernel/qwidget.h --- qt-x11-free-3.0.4.org/src/kernel/qwidget.h Fri Apr 26 07:48:25 2002 +++ qt-x11-free-3.0.4/src/kernel/qwidget.h Mon May 6 09:51:44 2002 @@ -513,7 +513,9 @@ int metric( int ) const; void resetInputContext(); - +#ifndef KO_ONTHE_PATCH + void clearInputContext(); +#endif virtual void create( WId = 0, bool initializeWindow = TRUE, bool destroyOldWindow = TRUE ); virtual void destroy( bool destroyWindow = TRUE, diff -uNr qt-x11-free-3.0.4.org/src/kernel/qwidget_x11.cpp qt-x11-free-3.0.4/src/kernel/qwidget_x11.cpp --- qt-x11-free-3.0.4.org/src/kernel/qwidget_x11.cpp Fri Apr 26 07:48:25 2002 +++ qt-x11-free-3.0.4/src/kernel/qwidget_x11.cpp Mon May 6 10:13:01 2002 @@ -131,8 +131,12 @@ FocusChangeMask | ExposureMask | PropertyChangeMask | - StructureNotifyMask | SubstructureRedirectMask - ); +#ifndef KO_ONTHE_PATCH + StructureNotifyMask +#else + StructureNotifyMask | SubstructureRedirectMask +#endif + ); const uint stdDesktopEventMask = // X event mask (uint)( @@ -2505,7 +2509,23 @@ } #endif // QT_NO_XIM } - +#ifndef KO_ONTHE_PATCH +void QWidget::clearInputContext() +{ +#ifndef QT_NO_XIM + if (qt_xim_style & XIMPreeditCallbacks) { + QWidget *tlw = topLevelWidget(); + QTLWExtra *topdata = tlw->topData(); + // trigger input context creation if it hasn't happened already + createInputContext(); + if (topdata->xic) { + QInputContext *qic = (QInputContext *) topdata->xic; + qic->lastcompose = QString::null; + } + } +#endif // QT_NO_XIM +} +#endif // KO_ONTHE_PATCH void QWidget::focusInputContext() { diff -uNr qt-x11-free-3.0.4.org/src/widgets/qlineedit.cpp qt-x11-free-3.0.4/src/widgets/qlineedit.cpp --- qt-x11-free-3.0.4.org/src/widgets/qlineedit.cpp Mon May 6 09:46:30 2002 +++ qt-x11-free-3.0.4/src/widgets/qlineedit.cpp Mon May 6 10:16:10 2002 @@ -644,17 +644,24 @@ if ( !t.isEmpty() && (!e->ascii() || e->ascii()>=32) && e->key() != Key_Delete && e->key() != Key_Backspace ) { - if ( d->parag && d->parag->string() && d->parag->string()->isRightToLeft() ) { - QChar *c = (QChar *)t.unicode(); - int l = t.length(); - while( l-- ) { - if ( c->mirrored() ) - *c = c->mirroredChar(); - c++; - } - } - insert( t ); - return; +#ifndef KO_ONTHE_PATCH + // by walker, if there is preedit, replace it + if ( (d->preeditLength > 0) && (cursorPosition() >= 0) ) + { + d->parag->remove(d->preeditStart, d->preeditLength); + d->cursor->setIndex(d->preeditStart ); + } +#endif + insert( t ); +#ifndef KO_ONTHE_PATCH + // qDebug("insert [%s], end=%d, cursor=%d", e->text().local8Bit().data(), d->preeditStart, d->cursor->index()); + d->preeditStart = cursorPosition(); + d->preeditLength = -1; + clearInputContext(); +#endif + + + return; } } bool unknown = FALSE; @@ -847,9 +854,25 @@ */ void QLineEdit::imComposeEvent( QIMEvent *e ) { +#ifndef KO_ONTHE_PATCH + if (d->preeditLength > 0) + { + d->parag->remove(d->preeditStart, d->preeditLength); + d->cursor->setIndex(d->preeditStart); + } + // when selection is exist, it must deleted. + insert( e->text() ); + // qDebug("insert %d,text=%s",d->preeditStart, e->text().local8Bit().data()); + + // when selection is exist, cursor position will be changed. + if (d->preeditLength <= 0) + d->preeditStart = cursorPosition() - e->text().length(); +#else + if (d->preeditLength > 0) d->parag->remove(d->preeditStart, d->preeditLength); d->parag->insert(d->preeditStart, e->text()); +#endif d->preeditLength = e->text().length(); d->cursor->setIndex(d->preeditStart + e->cursorPos()); @@ -861,6 +884,15 @@ */ void QLineEdit::imEndEvent( QIMEvent *e ) { +#ifndef KO_ONTHE_PATCH + // by smwgiant + if ( e->cursorPos() < -1 ) + { + d->preeditStart = cursorPosition() + e->cursorPos(); + d->preeditLength = QABS(e->cursorPos()); + } +#endif + if (d->preeditLength > 0) d->parag->remove(d->preeditStart, d->preeditLength); d->parag->insert(d->preeditStart, e->text()); diff -uNr qt-x11-free-3.0.4.org/src/widgets/qtextedit.cpp qt-x11-free-3.0.4/src/widgets/qtextedit.cpp --- qt-x11-free-3.0.4.org/src/widgets/qtextedit.cpp Mon May 6 09:46:30 2002 +++ qt-x11-free-3.0.4/src/widgets/qtextedit.cpp Mon May 6 10:18:43 2002 @@ -1013,7 +1013,22 @@ c++; } } - insert( t, TRUE, FALSE ); +#ifndef KO_ONTHE_PATCH +// by walker, if there is preedit, replace it + if ( d->preeditLength > 0 && cursor->parag() ) + { + cursor->parag()->remove( d->preeditStart, d->preeditLength ); + cursor->setIndex( d->preeditStart ); + } +#endif + + insert( e->text(), TRUE, FALSE ); +#ifndef KO_ONTHE_PATCH + // qDebug("insert [%s], end=%d, cursor=%d", e->text().local8Bit().data(), d->preeditStart, cursor->index());^M + d->preeditStart = cursor->index(); + d->preeditLength = -1; + clearInputContext(); +#endif } break; } else if ( e->state() & ControlButton ) { @@ -1120,10 +1135,23 @@ /*! eimp */ void QTextEdit::imComposeEvent( QIMEvent *e ) { +#ifndef KO_ONTHE_PATCH + if ( (d->preeditLength > 0) && cursor->parag() ) + { + cursor->parag()->remove( d->preeditStart, d->preeditLength ); + cursor->setIndex( d->preeditStart ); + } + insert( e->text(), TRUE, FALSE ); + // if there is selection, starting position must changed. + if(d->preeditLength <= 0) + d->preeditStart = cursor->index() - e->text().length(); +#else + if ( d->preeditLength > 0 && cursor->parag() ) cursor->parag()->remove( d->preeditStart, d->preeditLength ); cursor->setIndex( d->preeditStart ); insert( e->text(), TRUE, FALSE ); +#endif d->preeditLength = e->text().length(); cursor->setIndex( d->preeditStart + e->cursorPos() ); @@ -1135,6 +1163,15 @@ /*! eimp */ void QTextEdit::imEndEvent( QIMEvent *e ) { +#ifndef KO_ONTHE_PATCH + // by smwgiant + if ( e->cursorPos() < -1 ) + { + d->preeditStart = cursor->index() + e->cursorPos(); + d->preeditLength = QABS(e->cursorPos()); + } +#endif + if ( d->preeditLength > 0 && cursor->parag() ) cursor->parag()->remove( d->preeditStart, d->preeditLength ); cursor->setIndex( d->preeditStart ); diff -uNr qt-x11-free-3.0.4.org/src/kernel/qpsprinter.cpp qt-x11-free-3.0.4/src/kernel/qpsprinter.cpp --- qt-x11-free-3.0.4.org/src/kernel/qpsprinter.cpp Fri Apr 26 16:48:22 2002 +++ qt-x11-free-3.0.4/src/kernel/qpsprinter.cpp Tue May 7 00:59:22 2002 @@ -6414,10 +6557,14 @@ if ( last && !pageBuffer ) return; bool pageFonts = ( buffer == 0 ); +#ifndef KO_ONTHE_PATCH + if ( buffer && last || (buffer && buffer->size() > 2000000) ) +#else if ( buffer && // ( last || pagesInBuffer++ > -1 || // ( pagesInBuffer > 4 && buffer->size() > 262144 ) ) ) (last || buffer->size() > 2000000) ) +#endif { // qDebug("emiting header at page %d", pageCount ); emitHeader( last ); kdelibs kate수정... diff -uNr kdelibs.orig/kate/part/kateview.h kdelibs/kate/part/kateview.h --- kdelibs.orig/kate/part/kateview.h Thu Apr 4 15:28:52 2002 +++ kdelibs/kate/part/kateview.h Thu Apr 4 15:22:05 2002 @@ -105,6 +105,7 @@ private: //uint iconBorderWidth; uint iconBorderHeight; + int preeditStart, preeditLength; public: KateViewInternal(KateView *view, KateDocument *doc); @@ -175,6 +176,10 @@ void resizeEvent(QResizeEvent *); void timerEvent(QTimerEvent *); + void imStartEvent( QIMEvent *e ); + void imComposeEvent( QIMEvent *e ); + void imEndEvent( QIMEvent *e ); + void dragEnterEvent( QDragEnterEvent * ); void dropEvent( QDropEvent * ); diff -uNr kdelibs.orig/kate/part/kateview.cpp kdelibs/kate/part/kateview.cpp --- kdelibs.orig/kate/part/kateview.cpp Thu Apr 4 15:29:01 2002 +++ kdelibs/kate/part/kateview.cpp Thu Apr 4 15:24:34 2002 @@ -1263,6 +1263,47 @@ } } + +// onthespot +void KateViewInternal::imStartEvent( QIMEvent *e ) +{ + VConfig c; + getVConfig(c); + preeditStart = c.cursor.col; + preeditLength = 0; + e->accept(); +} + +void KateViewInternal::imComposeEvent( QIMEvent *e ) +{ + VConfig c; + + if (myView->doc()->isReadWrite()) { + getVConfig(c); + myDoc->removeText ( c.cursor.line, preeditStart, c.cursor.line, preeditStart + preeditLength ); + myDoc->insertChars (c.cursor.line, preeditStart, e->text(), this->myView); + preeditLength = e->text().length(); + myDoc->updateViews(); + } + e->accept(); +} + +void KateViewInternal::imEndEvent( QIMEvent *e ) +{ + VConfig c; + if (myView->doc()->isReadWrite()) { + getVConfig(c); + if (preeditLength > 0) + myDoc->removeText ( c.cursor.line, preeditStart, c.cursor.line, preeditStart + preeditLength ); + myDoc->insertChars (c.cursor.line, preeditStart, e->text(), this->myView); + preeditStart = preeditLength = -1; + myDoc->updateViews(); + } + e->accept(); +} + + + ///////////////////////////////////// // Drag and drop handlers //
Copyleft
1999-2026 by
JSBoard Open Project
Theme Designed by
IDOO
All right reserved