Changeset 1036 for tests


Ignore:
Timestamp:
Aug 29, 2011, 2:17:00 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

tests/embedded: Updated with QT_PM_NATIVEWIDGETMASK.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/embedded/embedded.cpp

    r1018 r1036  
    1 #include <QDebug>
    2 #include <QtGui>
     1#include <QtGlobal>
    32
    43#ifdef Q_WS_PM
     
    98#include <qt_windows.h>
    109#endif
     10
     11
     12
    1113
    1214class VideoWidget : public QFrame
     
    117119        {
    118120            videoWidget->resize (800, 600);
     121
     122
     123
     124
     125
     126
    119127            resize(size() - stackCentralW->size() + QSize(800, 600));
    120128        }
     
    124132        {
    125133            qDebug() << "window handle" << qDebugFmtHex (id);
     134
     135
     136
    126137            HWND hwnd = id;
    127138            RECTL rcl;
     
    130141            if (hps)
    131142            {
     143
    132144                HRGN hrgn = GpiCreateRegion(hps, 1L, &rcl);
    133                 qt_WinProcessWindowObstacles (hwnd, NULL, hrgn, CRGN_DIFF, PWO_Default);
    134 
    135                 HRGN hrgnOld;
    136                 GpiSetClipRegion (hps, hrgn, &hrgnOld);
    137 
    138                 rcl.xLeft = 0;
    139                 rcl.yBottom = 0;
    140                 rcl.xRight = videoWidget->size().width();
    141                 rcl.yTop = videoWidget->size().height();
    142 
    143                 qDebug() << rcl.xRight << rcl.yTop;
    144 
    145                 WinDrawBorder (hps, &rcl, 3, 3, CLR_RED, CLR_DARKGREEN, DB_INTERIOR);
    146 
    147                 GpiDestroyRegion (hps, hrgnOld);
    148 
     145                ULONG rc = qt_WinProcessWindowObstacles (hwnd, NULL, hrgn, CRGN_DIFF, PWO_Default);
     146                qDebug() << "rc" << rc;
     147               
     148                if (rc == RGN_RECT || rc == RGN_COMPLEX)
     149                {
     150                    HRGN hrgnOld;
     151                    GpiSetClipRegion (hps, hrgn, &hrgnOld);
     152                    hrgn = hrgnOld;
     153#endif
     154                    rcl.xLeft = 0;
     155                    rcl.yBottom = 0;
     156                    rcl.xRight = videoWidget->size().width();
     157                    rcl.yTop = videoWidget->size().height();
     158
     159                    qDebug() << rcl.xRight << rcl.yTop;
     160
     161                    WinDrawBorder (hps, &rcl, 3, 3, CLR_RED, CLR_DARKGREEN, DB_INTERIOR);
     162                   
     163#ifdef QT_PM_NATIVEWIDGETMASK
     164                }
     165
     166                GpiDestroyRegion (hps, hrgn);
     167#endif
    149168                WinReleasePS (hps);
    150169            }
Note: See TracChangeset for help on using the changeset viewer.