[uim-commit] r378 - in trunk/qt/quiminputcontextplugin: . src

kzk@freedesktop.org kzk@freedesktop.org
Fri Jan 28 07:34:45 PST 2005


Author: kzk
Date: 2005-01-28 07:34:42 -0800 (Fri, 28 Jan 2005)
New Revision: 378

Modified:
   trunk/qt/quiminputcontextplugin/configure.in.in
   trunk/qt/quiminputcontextplugin/src/candidatewindow.cpp
   trunk/qt/quiminputcontextplugin/src/plugin.cpp
   trunk/qt/quiminputcontextplugin/src/quiminputcontext.cpp
Log:
* this commit aims to introduce --enable-uimqt-debug configure
  option for suppressing the debug message.

* qt/quiminputcontextplugin/configure.in.in
  - add --enable-uimqt-debug option
* qt/quiminputcontextplugin/src/quiminputcontext.cpp
  - include config.h
  - turn on qDebug when ENABLE_DEBUG is defined
* qt/quiminputcontextplugin/src/plugin.cpp
  - Ditto
* qt/quiminputcontextplugin/src/candidatewindow.cpp
  - Ditto
* qt/quiminputcontextplugin/src/candidatewindow.cpp
  - Ditto


Modified: trunk/qt/quiminputcontextplugin/configure.in.in
===================================================================
--- trunk/qt/quiminputcontextplugin/configure.in.in	2005-01-28 15:09:06 UTC (rev 377)
+++ trunk/qt/quiminputcontextplugin/configure.in.in	2005-01-28 15:34:42 UTC (rev 378)
@@ -41,19 +41,17 @@
 AC_SUBST(kde_locale)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [The gettext domain])
 
-#AC_ARG_ENABLE(uimqt-debug,
-#              [  --enable-uim-debug            Turn on debugging],
-#              uimqt_debug=yes,
-#              uimqt_debug=no)
+AC_ARG_ENABLE(uimqt-debug,
+              [  --enable-uimqt-debug            Turn on debugging],
+              uimqt_debug=yes,
+              uimqt_debug=no)
 
-#if test "$uimqt_debug" = "yes"; then
-#  AC_DEFINE(ENABLE_DEBUG,1,[Define this to enable the debug facility in UimQt])
-#  AC_DEFINE(QT_DEBUG,,[Enable QT debug output])
-#  CFLAGS="$CFLAGS -g"
-#  CXXFLAGS="$CXXFLAGS -g"
-#else
-#  AC_DEFINE(ENABLE_DEBUG,0)
-#fi
+if test "$uimqt_debug" = "yes"; then
+  AC_DEFINE(ENABLE_DEBUG,1,[Define this to enable the debug facility in UimQt])
+  AC_DEFINE(QT_DEBUG,,[Enable QT debug output])
+  CFLAGS="$CFLAGS -g"
+  CXXFLAGS="$CXXFLAGS -g"
+fi
 
 INPUTMETHODSDIR=$QTROOTDIR/plugins/inputmethods
 AC_SUBST(INPUTMETHODSDIR)

Modified: trunk/qt/quiminputcontextplugin/src/candidatewindow.cpp
===================================================================
--- trunk/qt/quiminputcontextplugin/src/candidatewindow.cpp	2005-01-28 15:09:06 UTC (rev 377)
+++ trunk/qt/quiminputcontextplugin/src/candidatewindow.cpp	2005-01-28 15:34:42 UTC (rev 378)
@@ -129,7 +129,9 @@
 
 void CandidateWindow::clearCandidates()
 {
+#ifdef ENABLE_DEBUG
     qDebug( "clear Candidates" );
+#endif
 
     candidateIndex = -1;
     displayLimit = 0;
@@ -144,7 +146,9 @@
 
 void CandidateWindow::setCandidates( int dl, const QValueList<uim_candidate> &candidates )
 {
+#ifdef ENABLE_DEBUG
     qDebug( "setCandidates" );
+#endif
 
     // remove old data
     if ( !stores.isEmpty() )
@@ -167,7 +171,9 @@
 
 void CandidateWindow::setPage( int page )
 {
+#ifdef ENABLE_DEBUG
     qDebug( "setPage : page = %d", page );
+#endif
 
     // clear items
     cList->clear();
@@ -245,7 +251,9 @@
 
 void CandidateWindow::setIndex( int totalindex )
 {
+#ifdef ENABLE_DEBUG
     qDebug( "setIndex : totalindex = %d", totalindex );
+#endif
 
     // validity check
     if ( totalindex < 0 )
@@ -299,7 +307,10 @@
 
 void CandidateWindow::shiftPage( bool forward )
 {
+#ifdef ENABLE_DEBUG
     qDebug( "candidateIndex = %d", candidateIndex );
+#endif
+    
     if ( forward )
     {
         candidateIndex += displayLimit;

Modified: trunk/qt/quiminputcontextplugin/src/plugin.cpp
===================================================================
--- trunk/qt/quiminputcontextplugin/src/plugin.cpp	2005-01-28 15:09:06 UTC (rev 377)
+++ trunk/qt/quiminputcontextplugin/src/plugin.cpp	2005-01-28 15:34:42 UTC (rev 378)
@@ -132,7 +132,9 @@
             qs = "uim-" + qs;
             lst << qs;
 
+#ifdef ENABLE_DEBUG
             qDebug( "name = %s", name );
+#endif
         }
     }
     uim_release_context( tmp_uc );

Modified: trunk/qt/quiminputcontextplugin/src/quiminputcontext.cpp
===================================================================
--- trunk/qt/quiminputcontextplugin/src/quiminputcontext.cpp	2005-01-28 15:09:06 UTC (rev 377)
+++ trunk/qt/quiminputcontextplugin/src/quiminputcontext.cpp	2005-01-28 15:34:42 UTC (rev 378)
@@ -43,6 +43,7 @@
 #include <ctype.h>
 #include <string.h>
 
+#include "../config.h"
 #include "candidatewindow.h"
 #include "qhelpermanager.h"
 
@@ -64,6 +65,10 @@
         : QInputContext(), m_imname( imname ), m_lang( lang ), m_uc( 0 ),
         candwinIsActive( false )
 {
+#ifdef ENABLE_DEBUG
+    qDebug( "QUimInputContext()" );
+#endif
+
     contextList.append( this );
 
     if ( imname )
@@ -83,13 +88,13 @@
 
     // read configuration
     readIMConf();
-
-    qDebug( "QUimInputContext()" );
 }
 
 QUimInputContext::~QUimInputContext()
 {
+#ifdef ENABLE_DEBUG
     qDebug( "~QUimInputContext()" );
+#endif
 
     contextList.remove( this );
 
@@ -136,7 +141,9 @@
 
 bool QUimInputContext::filterEvent( const QEvent *event )
 {
-    //qDebug("filterEvent");
+#ifdef ENABLE_DEBUG
+    // qDebug("filterEvent");
+#endif
 
     int type = event->type();
 
@@ -254,8 +261,10 @@
 
 void QUimInputContext::setFocus()
 {
+#ifdef ENABLE_DEBUG
     qDebug( "QUimInputContext: %p->setFocus(), focusWidget()=%p",
             this, focusWidget() );
+#endif
 
     focusedInputContext = this;
     disableFocusedContext = false;
@@ -272,8 +281,10 @@
 
 void QUimInputContext::unsetFocus()
 {
+#ifdef ENABLE_DEBUG
     qDebug( "QUimInputContext: %p->unsetFocus(), focusWidget()=%p",
             this, focusWidget() );
+#endif
 
     // Don't reset Japanese input context here. Japanese input context
     // sometimes contains a whole paragraph and has minutes of
@@ -295,7 +306,9 @@
 
 void QUimInputContext::setMicroFocus( int x, int y, int w, int h, QFont *f )
 {
+#ifdef ENABLE_DEBUG
     // qDebug("IC setMicroFocus (%d, %d), (%d, %d)", x, y, w, h);
+#endif
     cwin->layoutWindow( x, y, w, h );
 }
 
@@ -309,8 +322,10 @@
     case QEvent::MouseButtonRelease:
     case QEvent::MouseButtonDblClick:
     case QEvent::MouseMove:
+#ifdef ENABLE_DEBUG
         qDebug( "QUimInputContext::mouseHandler: "
                 "x=%d, type=%d, button=%d, state=%d", x, type, button, state );
+#endif
         break;
     default:
         break;
@@ -319,7 +334,9 @@
 
 void QUimInputContext::reset()
 {
+#ifdef ENABLE_DEBUG
     qDebug( "QUimInputContext::reset()" );
+#endif
 
     QInputContext::reset();
     preeditString = QString::null;
@@ -342,15 +359,18 @@
 void QUimInputContext::commit_cb( void *ptr, const char *str )
 {
     QString qs = QString::fromUtf8( str );
+#ifdef ENABLE_DEBUG
     qDebug( "commit_cb : str = |%s|", ( const char* ) qs.local8Bit() );
-
+#endif
     QUimInputContext *ic = ( QUimInputContext * ) ptr;
     ic->commitString( qs );
 }
 
 void QUimInputContext::clear_cb( void *ptr )
 {
+#ifdef ENABLE_DEBUG
     qDebug( "clear_cb" );
+#endif
 
     QUimInputContext* ic = ( QUimInputContext* ) ptr;
     ic->clearPreedit();
@@ -359,10 +379,12 @@
 void QUimInputContext::pushback_cb( void *ptr, int attr, const char *str )
 {
     QString qs = QString::fromUtf8( str );
+#ifdef ENABLE_DEBUG
     qDebug( "pushback_cb :  str = |%s|", ( const char* ) qs.local8Bit() );
-
+#endif
     if ( !str )
         return ;
+    
     // Reject invalid empty string. UPreeditAttr_Cursor or
     // UPreeditAttr_Separator with empty string is *valid* and
     // required to work properly.
@@ -375,7 +397,9 @@
 
 void QUimInputContext::update_cb( void *ptr )
 {
+#ifdef ENABLE_DEBUG
     qDebug( "update_cb" );
+#endif
 
     QUimInputContext *ic = ( QUimInputContext* ) ptr;
     ic->updatePreedit();
@@ -383,7 +407,9 @@
 
 void QUimInputContext::cand_activate_cb( void *ptr, int nr, int displayLimit )
 {
+#ifdef ENABLE_DEBUG
     qDebug( "cand_activate_cb" );
+#endif
 
     QUimInputContext *ic = ( QUimInputContext* ) ptr;
     ic->candidateActivate( nr, displayLimit );
@@ -391,7 +417,9 @@
 
 void QUimInputContext::cand_select_cb( void *ptr, int index )
 {
+#ifdef ENABLE_DEBUG
     qDebug( "cand_select_cb" );
+#endif
 
     QUimInputContext *ic = ( QUimInputContext* ) ptr;
     ic->candidateSelect( index );
@@ -399,7 +427,9 @@
 
 void QUimInputContext::cand_shift_page_cb( void *ptr, int direction )
 {
+#ifdef ENABLE_DEBUG
     qDebug( "cand_shift_page_cb" );
+#endif
 
     QUimInputContext *ic = ( QUimInputContext* ) ptr;
     CandidateWindow *cwin = ic->cwin;
@@ -409,7 +439,9 @@
 
 void QUimInputContext::cand_deactivate_cb( void *ptr )
 {
+#ifdef ENABLE_DEBUG
     qDebug( "cand_deactivate_cb" );
+#endif
 
     QUimInputContext *ic = ( QUimInputContext* ) ptr;
     ic->candidateDeactivate();
@@ -452,7 +484,9 @@
 
     if ( ! newString.isEmpty() )
     {
+#ifdef ENABLE_DEBUG
         qDebug( "cursor = %d, length = %d", cursor, newString.length() );
+#endif
         sendIMEvent( QEvent::IMCompose, newString, cursor, selLength );
     }
 



More information about the Uim-commit mailing list