Ignore:
Timestamp:
Feb 6, 2006, 10:43:39 PM (20 years ago)
Author:
dmik
Message:

Implemented QRegion(..., QRegion::Eclipse) and QRegion(QPointArray &,...) constructors.
Improved Qt<->GPI region coordinates translation (it's now implicit), QRegion::handle() takes a height of the target devise as an argument (defaults to 0).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel/qapplication_pm.cpp

    r52 r61  
    4343
    4444#include "qapplication.h"
    45 //@@TODO (dmik): need?
    46 //#if defined(QT_NON_COMMERCIAL)
    47 //#include "qnc_win.h"
    48 //#endif
    4945#include "private/qapplication_p.h"
    5046#include "qwidget.h"
     
    606602}
    607603
    608 //@@TODO (dmik): later (guess remove)
    609 //Q_EXPORT HINSTANCE qWinAppInst()              // get Windows app handle
    610 //{
    611 //    return appInst;
    612 //}
    613 //
    614 //Q_EXPORT HINSTANCE qWinAppPrevInst()          // get Windows prev app handle
    615 //{
    616 //    return appPrevInst;
    617 //}
    618 //
    619 //Q_EXPORT int qWinAppCmdShow()                 // get main window show command
    620 //{
    621 //    return appCmdShow;
    622 //}
    623 
    624604Q_EXPORT HPS qt_display_ps()                    // get display PS
    625605{
     
    10541034//    }
    10551035//    */
    1056 
    1057 //@@TODO (dmik): need?
    1058 //#if defined(QT_NON_COMMERCIAL)
    1059 //    QT_NC_WNDPROC
    1060 //#endif
    10611036
    10621037    if ( qt_pmEventFilter( &qmsg, rc ) )        // send through app filter
     
    13921367            bool window_state_change = FALSE;
    13931368            PSWP pswp = (PSWP) mp1;
    1394 //@@TODO (dmik): need?
    1395 //#if defined(QT_NON_COMMERCIAL)
    1396 //              QT_NC_SYSCOMMAND
    1397 //#endif
    13981369            if ( pswp->fl & SWP_MAXIMIZE ) {
    13991370                window_state_change = TRUE;
     
    14321403        }
    14331404
    1434 //@@TODO (dmik): remove, we processed these in the message above.
    1435 //@@TODO (dmik): what to do with QWhatsThis?..
    1436 //      case WM_SYSCOMMAND: {
    1437 //#ifndef Q_OS_TEMP
    1438 //          bool window_state_change = FALSE;
    1439 //          switch( wParam ) {
    1440 //          case SC_CONTEXTHELP:
    1441 //#ifndef QT_NO_WHATSTHIS
    1442 //              QWhatsThis::enterWhatsThisMode();
    1443 //#endif
    1444 //              QT_WA( {
    1445 //                  DefWindowProc( hwnd, WM_NCPAINT, 1, 0 );
    1446 //              } , {
    1447 //                  DefWindowProcA( hwnd, WM_NCPAINT, 1, 0 );
    1448 //              } );
    1449 //              break;
    1450 //#if defined(QT_NON_COMMERCIAL)
    1451 //              QT_NC_SYSCOMMAND
    1452 //#endif
    1453 //          case SC_MAXIMIZE:
    1454 //              window_state_change = TRUE;
    1455 //              widget->clearWState(Qt::WState_Minimized);
    1456 //              widget->setWState(Qt::WState_Maximized);
    1457 //              result = FALSE;
    1458 //              break;
    1459 //          case SC_MINIMIZE:
    1460 //              window_state_change = TRUE;
    1461 //              widget->setWState(Qt::WState_Minimized);
    1462 //              if ( widget->isVisible() ) {
    1463 //                  QHideEvent e;
    1464 //                  qt_sendSpontaneousEvent( widget, &e );
    1465 //                  widget->hideChildren( TRUE );
    1466 //              }
    1467 //              result = FALSE;
    1468 //              break;
    1469 //          case SC_RESTORE:
    1470 //              window_state_change = TRUE;
    1471 //              if (widget->isMinimized()) {
    1472 //                  widget->clearWState(Qt::WState_Minimized);
    1473 //                  widget->showChildren( TRUE );
    1474 //                  QShowEvent e;
    1475 //                  qt_sendSpontaneousEvent( widget, &e );
    1476 //              } else {
    1477 //                  widget->clearWState(Qt::WState_Maximized);
    1478 //              }
    1479 //              result = FALSE;
    1480 //              break;
    1481 //          default:
    1482 //              result = FALSE;
    1483 //              break;
    1484 //          }
    1485 //
    1486 //          if (window_state_change) {
    1487 //              QEvent e(QEvent::WindowStateChange);
    1488 //              qt_sendSpontaneousEvent(widget, &e);
    1489 //          }
    1490 //#endif
    1491 //
    1492 //          break;
    1493 //      }
    1494 
    1495 //@@TODO (dmik): later
     1405/// @todo (dmik) later
    14961406//      case WM_SETTINGCHANGE:
    14971407//          if ( !msg.wParam ) {
     
    15521462
    15531463        case WM_ACTIVATE:
    1554 //@@TODO (dmik): remove
    1555 //qDebug("WM_ACTIVATE: [%s] %d", widget->name(), SHORT1FROMMP(mp1) );
     1464#if 0
     1465            qDebug( "WM_ACTIVATE: [%s] %d", widget->name(), SHORT1FROMMP(mp1) );
     1466#endif           
    15561467            qApp->pmFocus( widget, SHORT1FROMMP(mp1) );
    15571468            break;
    15581469
    15591470        case WM_SETFOCUS:
    1560 //@@TODO (dmik): remove
    1561 //qDebug("WM_SETFOCUS: [%s] %s [%s]", widget->name(),
    1562 //        SHORT1FROMMP(mp2) ? "<=" : "=>",
    1563 //        QWidget::find( (HWND)mp1 ) ? QWidget::find( (HWND)mp1 )->name() : "{foreign}"
    1564 //);
     1471#if 0           
     1472            qDebug( "WM_SETFOCUS: [%s] %s [%s]", widget->name(),
     1473                    SHORT1FROMMP(mp2) ? "<=" : "=>",
     1474                    QWidget::find( (HWND)mp1 ) ? QWidget::find( (HWND)mp1 )->name()
     1475                                               : "{foreign}" );
     1476#endif           
    15651477            result = FALSE;
    15661478            if ( !SHORT1FROMMP(mp2) ) {
     
    15891501            break;
    15901502
    1591 //@@TODO (dmik): remove, handled in OS/2 version of WM_SETFOCUS above
    1592 //      case WM_ACTIVATE:
    1593 //          if ( QApplication::activePopupWidget() && LOWORD(wParam) == WA_INACTIVE &&
    1594 //              QWidget::find((HWND)lParam) == 0 ) {
    1595 //              // Another application was activated while our popups are open,
    1596 //              // then close all popups.  In case some popup refuses to close,
    1597 //              // we give up after 1024 attempts (to avoid an infinite loop).
    1598 //              int maxiter = 1024;
    1599 //              QWidget *popup;
    1600 //              while ( (popup=QApplication::activePopupWidget()) && maxiter-- )
    1601 //                  popup->close();
    1602 //          }
    1603 //          qApp->winFocus( widget, LOWORD(wParam) == WA_INACTIVE ? 0 : 1 );
    1604 //          break;
    1605 
    1606 //@@TODO (dmik): later
     1503/// @todo (dmik) remove?
    16071504//#ifndef Q_OS_TEMP
    16081505//          case WM_MOUSEACTIVATE:
     
    16231520            result = FALSE;
    16241521            break;
    1625 //@@TODO (dmik): remove later
     1522/// @todo (dmik) remove later
    16261523//          case WM_SHOWWINDOW:
    16271524//#ifndef Q_OS_TEMP
     
    16561553            RETURN(0);                          // always handled
    16571554
    1658 //@@TODO (dmik): it seems we don't need this
     1555/// @todo (dmik) it seems we don't need this
    16591556//      case WM_DESTROY:                        // destroy window
    16601557//          if ( hwnd == curWin ) {
     
    33643261#endif
    33653262
    3366     // convert region y coordinates from GPI to Qt (see qregion_pm.cpp)
    3367     POINTL ptl = { 0, -height() };
    3368     GpiOffsetRegion( hps, hrgn, &ptl );
    3369     // create a non-null region
    3370     QRegion rgn( FALSE );
    3371     // destructor will delete rgn
    3372     rgn.data->rgn = hrgn;
    3373 
    3374     QPaintEvent e(
    3375         rgn,
    3376         QRect( rcl.xLeft, rcl.yBottom, rcl.xRight, rcl.yTop ),
    3377         erase
    3378     );
     3263    // create a region that will take ownership of hrgn
     3264    QRegion rgn( hrgn, height() );
     3265
     3266    QPaintEvent e( rgn, QRect( rcl.xLeft, rcl.yBottom, rcl.xRight, rcl.yTop ),
     3267                   erase );
    33793268    QApplication::sendSpontaneousEvent( this, (QEvent*) &e );
    33803269
     
    34553344        }
    34563345        QPoint newCPos( swp.x, swp.y );
    3457 //@@TODO (dmik): should it apply to OS/2?
    3458 //      // Ignore silly Windows move event to wild pos after iconify.
    3459 //      if ( !isMinimized() && newCPos != oldPos ) {
    34603346        if ( newCPos != oldPos ) {
    34613347            cr.moveTopLeft( newCPos );
Note: See TracChangeset for help on using the changeset viewer.