Changeset 749 for trunk/src


Ignore:
Timestamp:
Jun 15, 2010, 4:52:07 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: OS/2: Exported qt_WinProcessWindowObstacles().

Location:
trunk/src/gui/kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r711 r749  
    230230}
    231231
    232 /** \internal flags for qt_WinProcessWindowObstacles() */
    233 enum {
    234     PWO_Children = 0x01,
    235     PWO_Sibings = 0x02,
    236     PWO_Ancestors = 0x04,
    237     PWO_Screen = 0x08,
    238     PWO_TopLevel = 0x80000000,
    239     // PWO_Default is suitable in most cases (for simple paint operations)
    240     PWO_Default = PWO_Children | PWO_Sibings | PWO_Ancestors | PWO_Screen,
    241 };
    242 
    243232/*!
    244233    \internal
    245234
    246     Helper function to collect all relative windows intersecting with the
    247     given window and placed above it in z-order.
    248 
    249     \param hwnd  window in question
    250     \param prcl  rectangle (in window coordinates) to limit processing to
    251                  (if null, the whole window rectange is used)
    252     \param hrgn  region where to combine all obstacles
    253                  (if 0, obstacles are directly validated instead of collecting)
    254     \param op    region operation perfomed when combining obstacles (CRGN_*)
    255     \param flags flags defining the scope (PWO_* ORed together)
    256 
    257     \return complexity of the combined region (only when \a hrgn is not 0)
     235    Helper function to collect all relative windows intersecting with the given
     236    \a hwnd and placed above it in z-order. The area of interest is limited to
     237    the \a prcl rectangle (in window coordinates) which may be NULL to indicate
     238    the whole window. If \a hrgn is not NULL, all found obstacles are combined
     239    with the given region using the \a op operation (CRGN_*); otherwise they are
     240    directly validated on the window. The scope of relativeness is defined by
     241    the \fl argument which is one or more PWO_* flags OR-ed together.
     242
     243    Returns the complexity of the combined region (only when \a hrgn is not
     244    NULL). Note that if no combining occurs (e.g. no relatives in the requested
     245    scope), the return value is RGN_NULL regardless of the original complexity
     246    of \a hrgn.
    258247 */
    259 static LONG qt_WinProcessWindowObstacles(HWND hwnd, PRECTL prcl, HRGN hrgn,
    260                                          LONG op, LONG flags = PWO_Default)
     248LONG qt_WinProcessWindowObstacles(HWND hwnd, RECTL *prcl, HRGN hrgn,
     249                                  LONG op, LONG flags)
    261250{
    262251    Q_ASSERT(hwnd);
     
    279268    HRGN whrgn = GpiCreateRegion(displayPS, 0, NULL);
    280269
    281     LONG cmplx = RGN_NULL;
     270    LONG cmplx;
    282271    HWND relative;
    283272    SWP swp;
     273
     274    bool cmplxChanged = false;
    284275
    285276    // first, process areas placed outside the screen bounds
     
    301292            if (hrgn != NULLHANDLE) {
    302293                cmplx = GpiCombineRegion(displayPS, hrgn, hrgn, whrgn, op);
     294                cmplxChanged = true;
    303295            } else {
    304296                WinValidateRegion(hwnd, whrgn, FALSE);
     
    336328                if (hrgn != NULLHANDLE) {
    337329                    cmplx = GpiCombineRegion(displayPS, hrgn, hrgn, whrgn, op);
     330                    cmplxChanged = true;
    338331                } else {
    339332                    WinValidateRegion(hwnd, whrgn, FALSE);
     
    377370            if (hrgn != NULLHANDLE) {
    378371                cmplx = GpiCombineRegion(displayPS, hrgn, hrgn, whrgn, op);
     372                cmplxChanged = true;
    379373            } else {
    380374                WinValidateRegion(hwnd, whrgn, FALSE);
     
    436430                if (hrgn != NULLHANDLE) {
    437431                    cmplx = GpiCombineRegion(displayPS, hrgn, hrgn, whrgn, op);
     432                    cmplxChanged = true;
    438433                } else {
    439434                    WinValidateRegion(hwnd, whrgn, FALSE);
     
    448443
    449444    GpiDestroyRegion(displayPS, whrgn);
     445
     446    if (hrgn != NULLHANDLE && cmplxChanged == false) {
     447        // make sure to return the original complexity of the region
     448        RECTL rclDummy;
     449        cmplx = GpiQueryRegionBox(displayPS, hrgn, &rclDummy);
     450    }
    450451
    451452    return cmplx;
  • trunk/src/gui/kernel/qwindowdefs_pm.h

    r748 r749  
    6868typedef void *MRESULT;
    6969
     70typedef struct _RECTL RECTL;
     71typedef RECTL *PRECTL;
     72
    7073typedef HWND WId;
    7174
     
    8588
    8689Q_GUI_EXPORT QWidget *qt_widget_from_hwnd(HWND hwnd);
     90
     91/** \internal flags for qt_WinProcessWindowObstacles() */
     92enum {
     93    PWO_Children = 0x01,
     94    PWO_Sibings = 0x02,
     95    PWO_Ancestors = 0x04,
     96    PWO_Screen = 0x08,
     97    PWO_TopLevel = 0x80000000,
     98    // PWO_Default is suitable in most cases (for simple paint operations)
     99    PWO_Default = PWO_Children | PWO_Sibings | PWO_Ancestors | PWO_Screen,
     100};
     101
     102Q_GUI_EXPORT LONG qt_WinProcessWindowObstacles(HWND hwnd, RECTL *prcl, HRGN hrgn,
     103                                               LONG op, LONG flags = PWO_Default);
    87104
    88105// QDebug helpers for debugging various API types
Note: See TracChangeset for help on using the changeset viewer.