[Kde-cygwin-cvs] CVS: qt-3/src/kernel qeventloop_win.cpp, 1.1.2.10.2.10, 1.1.2.10.2.11

Chris January chris at atomice.net
Thu Nov 11 16:47:35 CET 2004


Christian,

Unfortunately these changes don't compile. Any chance you can fix this?

Chris

> Update of /cvsroot/kde-cygwin/qt-3/src/kernel
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15001/src/kernel
> 
> Modified Files:
>       Tag: QT_WIN32_3_3_BRANCH
> 	qeventloop_win.cpp
> Log Message:
> wrap all winapi-functions which are implemented as unicode 
> and ansi with QT_WA / QT_WA_INLINE
> 
> Index: qeventloop_win.cpp
> ===================================================================
> RCS file: 
> /cvsroot/kde-cygwin/qt-3/src/kernel/Attic/qeventloop_win.cpp,v
> retrieving revision 1.1.2.10.2.10
> retrieving revision 1.1.2.10.2.11
> diff -u -r1.1.2.10.2.10 -r1.1.2.10.2.11
> --- qeventloop_win.cpp	6 Nov 2004 18:36:56 -0000	
> 1.1.2.10.2.10
> +++ qeventloop_win.cpp	10 Nov 2004 17:48:46 -0000	
> 1.1.2.10.2.11
> @@ -40,7 +40,6 @@
>  #include "qapplication.h"
>  #include "qbitarray.h"
>  #include "qcolor_p.h"
> -#include "qlibrary.h"   /* resolve() */
>  
>  #if defined(QT_THREAD_SUPPORT)
>  #  include "qmutex.h"
> @@ -108,16 +107,31 @@
>  
>  void QEventLoop::init()
>  {
> -    WNDCLASS wndclass;
> -
> -    memset( &wndclass, 0, sizeof( WNDCLASS ) );
> -    wndclass.lpfnWndProc = qt_SocketWindowProc;
> -    wndclass.lpszClassName = TEXT ( "qt_SocketWindow" );
> -    wndclass.hInstance = qWinAppInst ();
> -    RegisterClass( &wndclass );
> -    qt_SocketWindow = CreateWindow( TEXT( "qt_SocketWindow" 
), NULL, 0, 0, 0, 0, 0,
> -                                    ( HWND ) NULL, ( HMENU ) 
> NULL, qWinAppInst (), ( LPVOID ) NULL );
> -    qt_SocketMessage = RegisterWindowMessage ( TEXT( 
> "qt_SocketMessage" ) );
> +    WNDCLASSA wndclassA;
> +    memset( &wndclassA, 0, sizeof( WNDCLASSA ) );
> +    wndclassA.lpfnWndProc = qt_SocketWindowProc;
> +    wndclassA.lpszClassName = "qt_SocketWindow" ;
> +    wndclassA.hInstance = qWinAppInst ();
> +
> +    WNDCLASSW wndclassW;
> +    memset( &wndclassW, 0, sizeof( WNDCLASSW ) );
> +    wndclassW.lpfnWndProc = qt_SocketWindowProc;
> +    wndclassW.lpszClassName = L"qt_SocketWindow" ;
> +    wndclassW.hInstance = qWinAppInst ();
> +
> +    QT_WA( RegisterClassW( &wndclassW );
> +           RegisterClassA( &wndclassA ); )
> +    qt_SocketWindow = QT_WA_INLINE(
> +                          CreateWindowW( L"qt_SocketWindow", 
> NULL, 0, 0, 0, 0, 0,
> +                                         ( HWND ) NULL, ( 
> HMENU ) NULL,
> +                                         qWinAppInst (), ( 
> LPVOID ) NULL ),
> +                          CreateWindowA( "qt_SocketWindow", 
> NULL, 0, 0, 0, 0, 0,
> +                                         ( HWND ) NULL, ( 
> HMENU ) NULL,
> +                                         qWinAppInst (), ( LPVOID ) 
> + NULL ) );
> +
> +    qt_SocketMessage = QT_WA_INLINE(
> +                           RegisterWindowMessageW ( 
> L"qt_SocketMessage" ),
> +                           RegisterWindowMessageA ( 
> "qt_SocketMessage" 
> + ) );
>  
>      qt_sn_list[ 0 ].clear();
>      qt_sn_list[ 1 ].clear();
> @@ -163,7 +177,7 @@
>  void QEventLoop::cleanup()
>  {
>      /* Clean up pending socket notifiers */
> -    for( int i = 0; i < 3; i++ ) {
> +    for ( int i = 0; i < 3; i++ ) {
>          QPtrListIterator<QSockNot> it( qt_sn_list[ i ] );
>          QSockNot *sn;
>          while ( ( sn = it.current() ) ) { @@ -172,7 +186,8 @@
>          }
>      }
>      DestroyWindow( qt_SocketWindow );
> -    UnregisterClass( TEXT( "qt_SocketWindow" ), 0 );
> +    QT_WA( UnregisterClassW( L"qt_SocketWindow" , 0 );
> +           UnregisterClassA( "qt_SocketWindow", 0 ); )
>  }
>  
>  static bool idleTimerWasActive;
> @@ -182,7 +197,8 @@
>  {
>      KillTimer( 0, idleTimerId );
>      idleTimerWasActive = TRUE;
> -    PostMessage( 0, WM_NULL, 0, 0 );
> +    QT_WA( PostMessageW( 0, WM_NULL, 0, 0 );
> +           PostMessageA( 0, WM_NULL, 0, 0 ); )
>  }
>  
>  extern bool qt_app_idle(); // qapplication_win.cpp @@ -205,7 
> +221,8 @@
>          QApplication::sendPostedEvents();
>  
>          MSG msg;
> -        while ( PeekMessage( &msg, 0, 0, 0, PM_REMOVE ) ) {
> +        while ( QT_WA_INLINE( PeekMessageW( &msg, 0, 0, 0, 
> PM_REMOVE ),
> +                              PeekMessageA( &msg, 0, 0, 0, 
> PM_REMOVE ) 
> + ) ) {
>  #ifdef DEBUG_QEVENTLOOP
>              const char * getMsgName( UINT msgID );
>              qDebug( "peekmessage (%s)", getMsgName( 
> msg.message ) ); @@ -237,7 +254,8 @@  #endif
>  
>              TranslateMessage( &msg );
> -            DispatchMessage( &msg );
> +            QT_WA( DispatchMessageW( &msg );
> +                   DispatchMessageA( &msg ); )
>  #if defined(QT_THREAD_SUPPORT)
>  
>              locker.mutex() ->lock ()
> @@ -293,7 +311,9 @@
>  {
>      extern uint qGlobalPostedEventsCount(); // from qapplication.cpp
>      MSG msg;
> -    return ( qGlobalPostedEventsCount() || PeekMessage( 
> &msg, 0, 0, 0, PM_NOREMOVE ) );
> +    return ( qGlobalPostedEventsCount() ||
> +             QT_WA_INLINE( PeekMessageW( &msg, 0, 0, 0, 
> PM_NOREMOVE ),
> +                           PeekMessageA( &msg, 0, 0, 0, 
> PM_NOREMOVE ) ) 
> + );
>  }
>  
>  #include "qeventloop_win_utils.cpp"



More information about the kde-cygwin mailing list