Changeset 11993


Ignore:
Timestamp:
Oct 22, 1999, 8:11:51 PM (26 years ago)
Author:
sandervl
Message:

Lots of changes/fixes

Location:
tags/trunk/src/user32
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/user32/USER32.DEF

    r11667 r11993  
    1 ; $Id: USER32.DEF,v 1.14 1999-09-28 08:00:57 dengert Exp $
     1; $Id: USER32.DEF,v 1.15 1999-10-22 18:11:41 sandervl Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    1010
    1111IMPORTS
    12     WinSetDAXData              = PMMERGE.5448
    13     GpiQueryDCData             = PMGPI.665
    14     GpiEnableYInversion        = PMGPI.723
    15     HPSToHDC                   = PMWINX.1022
    16     DeleteHDC                  = PMWINX.1023
    17     _DestroyCaret              = PMMERGE.10001
    18     _GetCaretBlinkTime         = PMMERGE.10002
    19     _HideCaret                 = PMMERGE.10004
    20     _SetCaretBlinkTime         = PMMERGE.10005
    21     _ShowCaret                 = PMMERGE.10007
     12    _WinSetDAXData             = PMMERGE.5448
     13    _GpiQueryDCData            = PMGPI.665
     14    _GpiEnableYInversion       = PMGPI.723
     15    _HPSToHDC                  = PMWINX.1022
     16    _DeleteHDC                 = PMWINX.1023
     17    __DestroyCaret              = PMMERGE.10001
     18    __GetCaretBlinkTime         = PMMERGE.10002
     19    __HideCaret                 = PMMERGE.10004
     20    __SetCaretBlinkTime         = PMMERGE.10005
     21    __ShowCaret                 = PMMERGE.10007
    2222
    2323EXPORTS
     
    629629    GetSysColorPen              = _GetSysColorPen@4              @2002
    630630; COMCTL32 helper functions
    631     NativeDlgBoxIP             = _NativeDlgBoxIP@24          @2003
    632     NativeCreateDlgIP          = _NativeCreateDlgIP@24       @2004
    633631    NativeLoadBitmap           = _NativeLoadBitmap@8         @2005
    634632
  • TabularUnified tags/trunk/src/user32/caret.cpp

    r11757 r11993  
    1 /* $Id: caret.cpp,v 1.5 1999-10-07 15:44:15 cbratschi Exp $ */
     1/* $Id: caret.cpp,v 1.6 1999-10-22 18:11:42 sandervl Exp $ */
    22
    33/*
     
    1010#define INCL_WIN
    1111#define INCL_GPI
    12 #include <os2.h>
     12#include <os2wrap.h>
    1313#include <os2sel.h>
    1414#include <stdlib.h>
     
    2020#include "oslibwin.h"
    2121#include "dcdata.h"
     22#define INCLUDED_BY_DC
    2223#include "dc.h"
    2324#include "caret.h"
     
    4041#pragma data_seg()
    4142
    42 PVOID   APIENTRY  GpiQueryDCData (HPS hps);
    43 VOID    OPEN32API _O32_SetLastError( DWORD );
    44 BOOL    OPEN32API _O32_CreateCaret (HWND hwnd, HBITMAP hbm, int width, int height);
    45 BOOL    APIENTRY  _DestroyCaret (void);
    46 UINT    APIENTRY  _GetCaretBlinkTime (void);
    47 BOOL    APIENTRY  _HideCaret (HWND hwnd);
    48 BOOL    APIENTRY  _SetCaretBlinkTime (UINT mSecs);
    49 BOOL    APIENTRY  _ShowCaret (HWND hwnd);
    5043
    5144BOOL WIN32API CreateCaret (HWND hwnd, HBITMAP hBmp, int width, int height)
     
    6457       if (!wnd) return (FALSE);
    6558
    66        USHORT sel = RestoreOS2FS();
    6759       wnd->SetFakeOpen32();
    6860
     
    7769
    7870       wnd->RemoveFakeOpen32();
    79        SetFS(sel);
    8071       return (rc);
    8172   }
     
    8576{
    8677   BOOL rc;
    87    USHORT sel = RestoreOS2FS();
    8878
    8979   dprintf(("USER32:  DestroyCaret"));
     
    9787   rc = _DestroyCaret();
    9888
    99    SetFS(sel);
    10089   return (rc);
    10190}
     
    10392BOOL WIN32API SetCaretBlinkTime (UINT mSecs)
    10493{
    105    USHORT sel = RestoreOS2FS();
    10694   BOOL rc;
    10795
     
    11098   rc = _SetCaretBlinkTime (mSecs);
    11199
    112    SetFS(sel);
    113100   return (rc);
    114101}
     
    117104{
    118105   UINT rc;
    119    USHORT sel = RestoreOS2FS();
    120106
    121107   dprintf(("USER32:  GetCaretBlinkTime"));
    122108
    123109   rc = _GetCaretBlinkTime();
    124 
    125    SetFS(sel);
    126110   return (rc);
    127111}
     
    129113BOOL WIN32API SetCaretPos (int x, int y)
    130114{
    131    USHORT     sel = RestoreOS2FS();
    132115   LONG       xNew = 0, yNew = 0;
    133116   BOOL       result = TRUE;
     
    152135           {
    153136              _O32_SetLastError (ERROR_INTERNAL_ERROR);
    154               SetFS(sel);
    155137              return FALSE;
    156138           }
     
    184166   }
    185167
    186    SetFS(sel);
    187168   return (result);
    188169}
     
    190171BOOL WIN32API GetCaretPos (PPOINT pPoint)
    191172{
    192    USHORT sel = RestoreOS2FS();
    193173   CURSORINFO cursorInfo;
    194174
     
    207187         else
    208188         {
    209            SetFS(sel);
    210189           return FALSE;
    211190         }
     
    225204      pPoint->y = cursorInfo.y;
    226205
    227       SetFS(sel);
    228206      return TRUE;
    229207   }
    230208   else
    231209   {
    232       SetFS(sel);
    233210      return FALSE;
    234211   }
     
    237214BOOL WIN32API ShowCaret (HWND hwnd)
    238215{
    239    USHORT sel = RestoreOS2FS();
    240216   BOOL   rc = FALSE;
    241217
     
    245221   rc = _ShowCaret (Win32BaseWindow::Win32ToOS2Handle (hwnd));
    246222
    247    SetFS(sel);
    248223   return (rc);
    249224}
     
    251226BOOL WIN32API HideCaret (HWND hwnd)
    252227{
    253    USHORT sel = RestoreOS2FS();
    254228   BOOL rc = FALSE;
    255229
     
    259233   rc = _HideCaret (Win32BaseWindow::Win32ToOS2Handle (hwnd));
    260234
    261    SetFS(sel);
    262235   return (rc);
    263236}
  • TabularUnified tags/trunk/src/user32/caret.h

    r11743 r11993  
    1 /* $Id: caret.h,v 1.2 1999-10-06 10:36:39 dengert Exp $ */
     1/* $Id: caret.h,v 1.3 1999-10-22 18:11:43 sandervl Exp $ */
    22
    33/*
     
    1212extern BOOL WIN32API GetCaretPos (PPOINT pPoint);
    1313
     14
     15
  • TabularUnified tags/trunk/src/user32/dc.cpp

    r11939 r11993  
    1 /* $Id: dc.cpp,v 1.16 1999-10-18 11:59:57 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.17 1999-10-22 18:11:43 sandervl Exp $ */
    22
    33/*
     
    1313
    1414#include <odin.h>
    15 #include <odinwrap.h>
    16 #include <os2sel.h>
    1715
    1816#define INCL_WIN
     
    2018#define INCL_GREALL
    2119#define INCL_DEV
    22 #include <os2.h>
     20#include <os2wrap.h>
    2321#include <pmddi.h>
    2422#include <stdlib.h>
     23
    2524#include "win32type.h"
    2625#include <winconst.h>
    27 #include <wprocess.h>
    2826#include <misc.h>
    2927#include <win32wbase.h>
     
    3331#include "dcdata.h"
    3432
    35 ODINDEBUGCHANNEL(USER32-DC)
     33#define INCLUDED_BY_DC
     34#include "dc.h"
    3635
    3736#undef SEVERITY_ERROR
    3837#include <winerror.h>
    39 
    40 #ifndef OPEN32API
    41 #define OPEN32API _System
    42 #endif
    43 
    44 /*********************/
    45 typedef struct
    46 {
    47     HDC   hdc;
    48     BOOL  fErase;
    49     RECT  rcPaint;
    50     BOOL  fRestore;
    51     BOOL  IncUpdate;
    52     BYTE  rgbReserved[32];
    53 } PAINTSTRUCT_W, *PPAINTSTRUCT_W, *LPPAINTSTRUCT_W;
    54 
    55 #define PS_SOLID_W         0x00000000
    56 #define PS_DASH_W          0x00000001
    57 #define PS_DOT_W           0x00000002
    58 #define PS_DASHDOT_W       0x00000003
    59 #define PS_DASHDOTDOT_W    0x00000004
    60 #define PS_NULL_W          0x00000005
    61 #define PS_INSIDEFRAME_W   0x00000006
    62 #define PS_USERSTYLE_W     0x00000007
    63 #define PS_ALTERNATE_W     0x00000008
    64 #define PS_STYLE_MASK_W    0x0000000f
    65 
    66 typedef struct
    67 {
    68     UINT   lopnStyle;
    69     POINT  lopnWidth;
    70     ULONG  lopnColor;
    71 } LOGPEN_W, *LPLOGPEN_W;
    72 
    73 typedef struct tagEXTLOGPEN
    74 {
    75     DWORD elpPenStyle;
    76     DWORD elpWidth;
    77     DWORD elpBrushStyle;
    78     DWORD elpColor;
    79     DWORD elpNumEntries;
    80     DWORD elpStyleEntry[1];
    81 } EXTLOGPEN_W, *PEXTLOGPEN_W, *NPEXTLOGPEN_W, *LPEXTLOGPEN_W;
    82 
    83 typedef struct
    84 {
    85     UINT   lbStyle;
    86     ULONG  lbColor;
    87     INT    lbHatch;
    88 } LOGBRUSH_W, *LPLOGBRUSH_W;
    89 
    90 typedef struct _penobject
    91 {
    92    ULONG filler[9];
    93    union {
    94      struct {
    95        PEXTLOGPEN_W      pExtLogPen;
    96        LOGBRUSH_W        logbrush;
    97        LOGPEN_W          logpen;
    98      } ExtPen;
    99      struct {
    100        LOGPEN_W          logpen;
    101      } Pen;
    102    };
    103 } tPenObject, *pPenObject;
    104 
    105 /* DC Graphics Mode */
    106 #define GM_COMPATIBLE_W     1
    107 #define GM_ADVANCED_W       2
    108 
    109 #define DCX_WINDOW_W                    0x00000001L
    110 #define DCX_CACHE_W                     0x00000002L
    111 #define DCX_NORESETATTRS_W              0x00000004L
    112 #define DCX_CLIPCHILDREN_W              0x00000008L
    113 #define DCX_CLIPSIBLINGS_W              0x00000010L
    114 #define DCX_PARENTCLIP_W                0x00000020L
    115 #define DCX_EXCLUDERGN_W                0x00000040L
    116 #define DCX_INTERSECTRGN_W              0x00000080L
    117 #define DCX_EXCLUDEUPDATE_W             0x00000100L
    118 #define DCX_INTERSECTUPDATE_W           0x00000200L
    119 #define DCX_LOCKWINDOWUPDATE_W          0x00000400L
    120 #define DCX_VALIDATE_W                  0x00200000L
    121 
    122 #define RDW_INVALIDATE_W       0x0001
    123 #define RDW_INTERNALPAINT_W    0x0002
    124 #define RDW_ERASE_W            0x0004
    125 #define RDW_VALIDATE_W         0x0008
    126 #define RDW_NOINTERNALPAINT_W  0x0010
    127 #define RDW_NOERASE_W          0x0020
    128 #define RDW_NOCHILDREN_W       0x0040
    129 #define RDW_ALLCHILDREN_W      0x0080
    130 #define RDW_UPDATENOW_W        0x0100
    131 #define RDW_ERASENOW_W         0x0200
    132 #define RDW_FRAME_W            0x0400
    133 #define RDW_NOFRAME_W          0x0800
    134 
    135 typedef struct _RGNDATAHEADER_W {
    136     DWORD       dwSize;
    137     DWORD       iType;
    138     DWORD       nCount;
    139     DWORD       nRgnSize;
    140     RECT        rcBound;
    141 } RGNDATAHEADER_W, *LPRGNDATAHEADER_W;
    142 
    143 typedef struct _RGNDATA_W {
    144     RGNDATAHEADER_W     rdh;
    145     char                Buffer[1];
    146 } RGNDATA_W , *PRGNDATA_W , *LPRGNDATA_W ;
    147 
    148 
    149 /* Xform FLAGS */
    150 #define MWT_IDENTITY_W        1
    151 #define MWT_LEFTMULTIPLY_W    2
    152 #define MWT_RIGHTMULTIPLY_W   3
    153 
    154 /* Mapping Modes */
    155 #define MM_TEXT_W             1
    156 #define MM_LOMETRIC_W         2
    157 #define MM_HIMETRIC_W         3
    158 #define MM_LOENGLISH_W        4
    159 #define MM_HIENGLISH_W        5
    160 #define MM_TWIPS_W            6
    161 #define MM_ISOTROPIC_W        7
    162 #define MM_ANISOTROPIC_W      8
    163 
    164 #define RGN_OR_W              2
    165 
    166 /* Window scrolling */
    167 #define SW_SCROLLCHILDREN_W    0x0001
    168 #define SW_INVALIDATE_W        0x0002
    169 #define SW_ERASE_W             0x0004
    170 
    171 /*********************/
    172 
    173 BOOL    APIENTRY GpiEnableYInversion (HPS hps, LONG lHeight);
    174 LONG    APIENTRY GpiQueryYInversion (HPS hps);
    175 PVOID   APIENTRY GpiAllocateDCData (HPS GpiH, ULONG size);
    176 PVOID   APIENTRY GpiQueryDCData (HPS hps);
    177 HDC     OPEN32API HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID);
    178 void    OPEN32API DeleteHDC (HDC hdc);
    179 BOOL    OPEN32API _O32_EndPaint (HWND hwnd, const PAINTSTRUCT_W *lpps);
    180 int     OPEN32API _O32_GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase);
    181 ULONG   OPEN32API _O32_GetRegionData (HRGN hrgn, ULONG count, PRGNDATA_W pData);
    182 BOOL    OPEN32API _O32_DeleteObject (LHANDLE hgdiobj);
    183 int     OPEN32API _O32_ReleaseDC (HWND hwnd, HDC hdc);
    184 VOID    OPEN32API _O32_SetLastError( DWORD );
    185 BOOL    OPEN32API _O32_SetRectRgn (HRGN dest, int left, int top, int right, int bottom);
    186 int     OPEN32API _O32_CombineRgn (HRGN dest, HRGN src1, HRGN src2, int mode);
    187 HRGN    OPEN32API _O32_CreateRectRgn (int left, int top, int right, int bottom);
    18838
    18939#ifndef DEVESC_SETPS
     
    269119      case MM_ISOTROPIC_W  : flOptions = PU_LOMETRIC ; break;
    270120      default:
    271          _O32_SetLastError (ERROR_INVALID_PARAMETER);
     121         O32_SetLastError (ERROR_INVALID_PARAMETER);
    272122         return FALSE;
    273123   }
     
    294144      if (DevEscape(pHps->hdc ? pHps->hdc : pHps->hps, DEVESC_SETPS, 12, (PBYTE)data, 0, 0) == DEVESC_ERROR)
    295145      {
    296          _O32_SetLastError (ERROR_INVALID_PARAMETER);
     146         O32_SetLastError (ERROR_INVALID_PARAMETER);
    297147         return 0;
    298148      }
     
    614464
    615465      GpiSetBitmap (pHps->hps, NULL);
    616       _O32_DeleteObject (pHps->nullBitmapHandle);
     466      O32_DeleteObject (pHps->nullBitmapHandle);
    617467      GpiDestroyPS(pHps->hps);
    618468
     
    636486   if ( !lpps )
    637487   {
    638       _O32_SetLastError (ERROR_INVALID_PARAMETER);
     488      O32_SetLastError (ERROR_INVALID_PARAMETER);
    639489      return (HDC)NULLHANDLE;
    640490   }
    641491
    642    USHORT sel = RestoreOS2FS();
    643492   Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    644493
     
    649498      if (!pHps)
    650499      {
    651          _O32_SetLastError (ERROR_INVALID_PARAMETER);
    652          SetFS(sel);
     500         O32_SetLastError (ERROR_INVALID_PARAMETER);
    653501         return (HDC)NULLHANDLE;
    654502      }
     
    699547   WINRECT_FROM_PMRECT(lpps->rcPaint, rect);
    700548
    701    SetFS(sel);
    702    _O32_SetLastError(0);
     549   O32_SetLastError(0);
    703550   return (HDC)pHps->hps;
    704551}
     
    711558      return TRUE;
    712559
    713    USHORT sel = RestoreOS2FS();
    714560   Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    715561
     
    727573   else
    728574   {
    729        _O32_EndPaint (HWND_DESKTOP, pPaint);
     575       O32_EndPaint (HWND_DESKTOP, pPaint);
    730576   }
    731577
    732578exit:
    733    SetFS(sel);
    734    _O32_SetLastError(0);
     579   O32_SetLastError(0);
    735580   return TRUE;
    736581}
     
    740585   if (hwnd)
    741586   {
    742       _O32_SetLastError (ERROR_INVALID_HANDLE);
     587      O32_SetLastError (ERROR_INVALID_HANDLE);
    743588      return FALSE;
    744589   }
    745590
    746591   RECTL rectl;
    747    USHORT sel = RestoreOS2FS();
    748592   Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    749593
    750594   BOOL updateRegionExists = WinQueryUpdateRect (hwnd, pRect ? &rectl : NULL);
    751595   if (!pRect) {
    752       SetFS(sel);
    753596      return (updateRegionExists);
    754597   }
     
    762605         if (!pHps)
    763606         {
    764             _O32_SetLastError (ERROR_INVALID_HANDLE);
    765             SetFS(sel);
     607            O32_SetLastError (ERROR_INVALID_HANDLE);
    766608            return FALSE;
    767609         }
     
    787629   }
    788630
    789    SetFS(sel);
    790631   return updateRegionExists;
    791632}
     
    793634int WIN32API GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase)
    794635{
    795    USHORT sel = RestoreOS2FS();
    796636   LONG Complexity;
    797637
    798    Complexity = _O32_GetUpdateRgn (hwnd, hrgn, FALSE);
     638   Complexity = O32_GetUpdateRgn (hwnd, hrgn, FALSE);
    799639   if (erase && (Complexity > NULLREGION_W)) {
    800640       Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
     
    802642   }
    803643
    804    SetFS(sel);
    805644   return Complexity;
    806645}
     
    814653HDC WIN32API GetDCEx (HWND hwnd, HRGN hrgn, ULONG flags)
    815654{
    816    USHORT sel = RestoreOS2FS();
    817655   Win32BaseWindow *wnd = NULL;
    818656   HWND     hWindow;
     
    836674      hWindow = HWND_DESKTOP;
    837675
    838 dprintf (("User32: GetDCEx hwnd %x (%x %x) -> wnd %x", hwnd, hrgn, flags, wnd));
     676   dprintf (("User32: GetDCEx hwnd %x (%x %x) -> wnd %x", hwnd, hrgn, flags, wnd));
    839677
    840678   isWindowOwnDC = (((hWindow == HWND_DESKTOP) ? FALSE : wnd->isOwnDC())
    841679                 && !(flags & DCX_CACHE_W));
     680
    842681   if (isWindowOwnDC)
    843682   {
     
    857696
    858697         pHps->hdcType = TYPE_1;
    859          SetFS(sel);
    860698         return (HDC)hps;
    861699      }
     
    904742         goto error;
    905743
    906       BytesNeeded = _O32_GetRegionData (hrgn, 0, NULL);
     744      BytesNeeded = O32_GetRegionData (hrgn, 0, NULL);
    907745      RgnData = (PRGNDATA_W)_alloca (BytesNeeded);
    908746      if (RgnData == NULL)
    909747          goto error;
    910       _O32_GetRegionData (hrgn, BytesNeeded, RgnData);
     748      O32_GetRegionData (hrgn, BytesNeeded, RgnData);
    911749
    912750      i = RgnData->rdh.nCount;
     
    941779   GpiSetDrawControl (hps, DCTL_DISPLAY, drawingAllowed ? DCTL_ON : DCTL_OFF);
    942780
    943    SetFS(sel);
    944781   return (HDC)pHps->hps;
    945782
     
    960797      if (pHps->hrgnHDC) GpiDestroyRegion(pHps->hps, pHps->hrgnHDC);
    961798
    962       _O32_DeleteObject (pHps->nullBitmapHandle);
    963    }
    964    _O32_SetLastError (ERROR_INVALID_PARAMETER);
    965    SetFS(sel);
     799      O32_DeleteObject (pHps->nullBitmapHandle);
     800   }
     801   O32_SetLastError (ERROR_INVALID_PARAMETER);
    966802   return NULL;
    967803}
     
    979815int WIN32API ReleaseDC (HWND hwnd, HDC hdc)
    980816{
    981    USHORT sel = RestoreOS2FS();
    982817   BOOL isOwnDC = FALSE;
    983818   int rc;
     
    991826      rc = TRUE;
    992827   else
    993       rc = _O32_ReleaseDC (0, hdc);
    994 
    995    SetFS(sel);
     828      rc = O32_ReleaseDC (0, hdc);
     829
    996830   dprintf(("ReleaseDC %x %x", hwnd, hdc));
    997831   return (rc);
     
    1003837       return FALSE;
    1004838
    1005    USHORT sel = RestoreOS2FS();
    1006839   Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
    1007840
     
    1017850#endif
    1018851
    1019    SetFS(sel);
    1020852   return (TRUE);
    1021853}
     
    1031863// RDW_UPDATENOW
    1032864
    1033 ODINFUNCTION4(BOOL,RedrawWindow,HWND,        hwnd,
    1034                                 const RECT*, pRect,
    1035                                 HRGN,        hrgn,
    1036                                 DWORD,       redraw)
     865BOOL WIN32API RedrawWindow(HWND hwnd, const RECT* pRect, HRGN hrgn, DWORD redraw)
    1037866{
    1038867   Win32BaseWindow *wnd;
     
    1040869   if (redraw & (RDW_FRAME_W | RDW_NOFRAME_W))
    1041870   {
    1042       _O32_SetLastError (ERROR_NOT_SUPPORTED);
     871      O32_SetLastError (ERROR_NOT_SUPPORTED);
    1043872      return FALSE;
    1044873   }
    1045 
    1046 //@@@PH   USHORT sel = RestoreOS2FS();
    1047 //@@@PH dprintf(("USER32: RedrawWindow %X, %X %X %X", hwnd, pRect, hrgn, redraw));
    1048874
    1049875   if (hwnd == NULLHANDLE)
     
    1056882         dprintf(("USER32:dc: RedrawWindow can't find desktop window %08xh\n",
    1057883                  hwnd));
    1058          _O32_SetLastError (ERROR_INVALID_PARAMETER);
    1059 //@@@PH         SetFS(sel);
     884         O32_SetLastError (ERROR_INVALID_PARAMETER);
    1060885         return FALSE;
    1061886      }
     
    1070895         dprintf(("USER32:dc: RedrawWindow can't find window %08xh\n",
    1071896                  hwnd));
    1072          _O32_SetLastError (ERROR_INVALID_PARAMETER);
    1073 //@@@PH         SetFS(sel);
     897         O32_SetLastError (ERROR_INVALID_PARAMETER);
    1074898         return FALSE;
    1075899      }
     
    1124948         goto error;
    1125949
    1126       BytesNeeded = _O32_GetRegionData (hrgn, 0, NULL);
     950      BytesNeeded = O32_GetRegionData (hrgn, 0, NULL);
    1127951      RgnData = (PRGNDATA_W)_alloca (BytesNeeded);
    1128952      if (RgnData == NULL)
    1129953          goto error;
    1130       _O32_GetRegionData (hrgn, BytesNeeded, RgnData);
     954      O32_GetRegionData (hrgn, BytesNeeded, RgnData);
    1131955
    1132956      pr = (PRECTL)(RgnData->Buffer);
     
    12071031
    12081032   if (!success)
    1209       _O32_SetLastError (ERROR_INVALID_PARAMETER);
    1210 
    1211 //@@@PH   SetFS(sel);
     1033      O32_SetLastError (ERROR_INVALID_PARAMETER);
     1034
    12121035   return (success);
    12131036}
     
    12151038BOOL WIN32API InvalidateRect (HWND hwnd, const RECT *pRect, BOOL erase)
    12161039{
    1217    USHORT sel = RestoreOS2FS();
    12181040//   Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
    12191041   BOOL result;
     
    12271049                          (erase ? RDW_ERASE_W : 0) |
    12281050                          (hwnd == NULLHANDLE ? RDW_UPDATENOW_W : 0));
    1229    SetFS(sel);
    12301051   return (result);
    12311052}
     
    12331054BOOL WIN32API InvalidateRgn (HWND hwnd, HRGN hrgn, BOOL erase)
    12341055{
    1235    USHORT sel = RestoreOS2FS();
    12361056//   Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
    12371057   BOOL result;
     
    12451065                          (erase ? RDW_ERASE_W : 0) |
    12461066                          (hwnd == NULLHANDLE ? RDW_UPDATENOW_W : 0));
    1247    SetFS(sel);
    12481067   return (result);
    12491068}
     
    12701089         rc = GpiQueryRegionRects (hps, hrgnPM, NULL, &rgnRect, Rcls);
    12711090
    1272          rc = _O32_SetRectRgn (hrgnWin, pRcl->xLeft,
     1091         rc = O32_SetRectRgn (hrgnWin, pRcl->xLeft,
    12731092                                        pRcl->xRight,
    12741093                                        height - pRcl->yTop,
     
    12791098            int i;
    12801099            HRGN temp;
    1281             temp = _O32_CreateRectRgn (0, 0, 1, 1);
     1100            temp = O32_CreateRectRgn (0, 0, 1, 1);
    12821101
    12831102            for (i = 1, pRcl++; rc && (i < rgnRect.crcReturned); i++, pRcl++)
    12841103            {
    1285               rc = _O32_SetRectRgn (temp, pRcl->xLeft,
     1104              rc = O32_SetRectRgn (temp, pRcl->xLeft,
    12861105                                          pRcl->xRight,
    12871106                                          height - pRcl->yTop,
    12881107                                          height - pRcl->yBottom);
    1289               rc &= _O32_CombineRgn (hrgnWin, hrgnWin, temp, RGN_OR_W);
     1108              rc &= O32_CombineRgn (hrgnWin, hrgnWin, temp, RGN_OR_W);
    12901109            }
    1291             _O32_DeleteObject (temp);
     1110            O32_DeleteObject (temp);
    12921111         }
    12931112         delete[] Rcls;
     
    13001119   else
    13011120   {
    1302       rc = _O32_SetRectRgn (hrgnWin, 0, 0, 0, 0);
     1121      rc = O32_SetRectRgn (hrgnWin, 0, 0, 0, 0);
    13031122   }
    13041123
     
    13101129                        const RECT *pClip, HRGN hrgnUpdate, LPRECT pRectUpdate)
    13111130{
    1312    USHORT sel = RestoreOS2FS();
    13131131   BOOL rc = TRUE;
    13141132
     
    13171135   if (!hDC)
    13181136   {
    1319       SetFS(sel);
    13201137      return (FALSE);
    13211138   }
     
    13271144   if ((hwnd == NULLHANDLE) || !wnd)
    13281145   {
    1329       SetFS(sel);
    13301146      return (FALSE);
    13311147   }
     
    14131229   if (lComplexity == RGN_ERROR)
    14141230   {
    1415       SetFS(sel);
    14161231      return (FALSE);
    14171232   }
     
    14311246      rc = setPMRgnIntoWinRgn (hrgn, hrgnUpdate, height);
    14321247
    1433    SetFS(sel);
    14341248   return (rc);
    14351249}
     
    14391253BOOL WIN32API ScrollWindow(HWND hwnd, int dx, int dy, const RECT *pScroll, const RECT *pClip)
    14401254{
    1441  USHORT sel = RestoreOS2FS();
    14421255 Win32BaseWindow *window;
    14431256 APIRET  rc;
     
    14521265    if(!window) {
    14531266        dprintf(("ScrollWindow, window %x not found", hwnd));
    1454         SetFS(sel);
    14551267        return 0;
    14561268    }
     
    14971309                         NULL, scrollFlags);
    14981310
    1499     SetFS(sel);
    15001311    return (rc != RGN_ERROR);
    15011312}
     
    15051316                            HRGN hrgnUpdate, PRECT pRectUpdate, UINT scrollFlag)
    15061317{
    1507     USHORT sel = RestoreOS2FS();
    15081318    Win32BaseWindow *window;
    15091319    APIRET  rc;
     
    15161326    if(!window) {
    15171327        dprintf(("ScrollWindowEx, window %x not found", hwnd));
    1518         SetFS(sel);
    15191328        return 0;
    15201329    }
     
    15391348    if (lComplexity == RGN_ERROR)
    15401349    {
    1541         SetFS(sel);
    15421350        return (0);
    15431351    }
     
    15631371       if (rc == FALSE)
    15641372       {
    1565           SetFS(sel);
    15661373          return (0);
    15671374       }
     
    15841391    }
    15851392
    1586     SetFS(sel);
    15871393    return (regionType);
    15881394}
  • TabularUnified tags/trunk/src/user32/dc.h

    r11667 r11993  
    1 /* $Id: dc.h,v 1.4 1999-09-28 08:00:56 dengert Exp $ */
     1/* $Id: dc.h,v 1.5 1999-10-22 18:11:44 sandervl Exp $ */
    22/*
    33 * public dc functions
     
    1717extern void releaseOwnDC (HDC hps);
    1818
     19
     20#ifdef INCLUDED_BY_DC
     21/*********************/
     22typedef struct
     23{
     24    HDC   hdc;
     25    BOOL  fErase;
     26    RECT  rcPaint;
     27    BOOL  fRestore;
     28    BOOL  IncUpdate;
     29    BYTE  rgbReserved[32];
     30} PAINTSTRUCT_W, *PPAINTSTRUCT_W, *LPPAINTSTRUCT_W;
     31
     32#define PS_SOLID_W         0x00000000
     33#define PS_DASH_W          0x00000001
     34#define PS_DOT_W           0x00000002
     35#define PS_DASHDOT_W       0x00000003
     36#define PS_DASHDOTDOT_W    0x00000004
     37#define PS_NULL_W          0x00000005
     38#define PS_INSIDEFRAME_W   0x00000006
     39#define PS_USERSTYLE_W     0x00000007
     40#define PS_ALTERNATE_W     0x00000008
     41#define PS_STYLE_MASK_W    0x0000000f
     42
     43typedef struct
     44{
     45    UINT   lopnStyle;
     46    POINT  lopnWidth;
     47    ULONG  lopnColor;
     48} LOGPEN_W, *LPLOGPEN_W;
     49
     50typedef struct tagEXTLOGPEN
     51{
     52    DWORD elpPenStyle;
     53    DWORD elpWidth;
     54    DWORD elpBrushStyle;
     55    DWORD elpColor;
     56    DWORD elpNumEntries;
     57    DWORD elpStyleEntry[1];
     58} EXTLOGPEN_W, *PEXTLOGPEN_W, *NPEXTLOGPEN_W, *LPEXTLOGPEN_W;
     59
     60typedef struct
     61{
     62    UINT   lbStyle;
     63    ULONG  lbColor;
     64    INT    lbHatch;
     65} LOGBRUSH_W, *LPLOGBRUSH_W;
     66
     67typedef struct _penobject
     68{
     69   ULONG filler[9];
     70   union {
     71     struct {
     72       PEXTLOGPEN_W      pExtLogPen;
     73       LOGBRUSH_W        logbrush;
     74       LOGPEN_W          logpen;
     75     } ExtPen;
     76     struct {
     77       LOGPEN_W          logpen;
     78     } Pen;
     79   };
     80} tPenObject, *pPenObject;
     81
     82/* DC Graphics Mode */
     83#define GM_COMPATIBLE_W     1
     84#define GM_ADVANCED_W       2
     85
     86#define DCX_WINDOW_W                    0x00000001L
     87#define DCX_CACHE_W                     0x00000002L
     88#define DCX_NORESETATTRS_W              0x00000004L
     89#define DCX_CLIPCHILDREN_W              0x00000008L
     90#define DCX_CLIPSIBLINGS_W              0x00000010L
     91#define DCX_PARENTCLIP_W                0x00000020L
     92#define DCX_EXCLUDERGN_W                0x00000040L
     93#define DCX_INTERSECTRGN_W              0x00000080L
     94#define DCX_EXCLUDEUPDATE_W             0x00000100L
     95#define DCX_INTERSECTUPDATE_W           0x00000200L
     96#define DCX_LOCKWINDOWUPDATE_W          0x00000400L
     97#define DCX_VALIDATE_W                  0x00200000L
     98
     99#define RDW_INVALIDATE_W       0x0001
     100#define RDW_INTERNALPAINT_W    0x0002
     101#define RDW_ERASE_W            0x0004
     102#define RDW_VALIDATE_W         0x0008
     103#define RDW_NOINTERNALPAINT_W  0x0010
     104#define RDW_NOERASE_W          0x0020
     105#define RDW_NOCHILDREN_W       0x0040
     106#define RDW_ALLCHILDREN_W      0x0080
     107#define RDW_UPDATENOW_W        0x0100
     108#define RDW_ERASENOW_W         0x0200
     109#define RDW_FRAME_W            0x0400
     110#define RDW_NOFRAME_W          0x0800
     111
     112typedef struct _RGNDATAHEADER_W {
     113    DWORD       dwSize;
     114    DWORD       iType;
     115    DWORD       nCount;
     116    DWORD       nRgnSize;
     117    RECT        rcBound;
     118} RGNDATAHEADER_W, *LPRGNDATAHEADER_W;
     119
     120typedef struct _RGNDATA_W {
     121    RGNDATAHEADER_W     rdh;
     122    char                Buffer[1];
     123} RGNDATA_W , *PRGNDATA_W , *LPRGNDATA_W ;
     124
     125
     126/* Xform FLAGS */
     127#define MWT_IDENTITY_W        1
     128#define MWT_LEFTMULTIPLY_W    2
     129#define MWT_RIGHTMULTIPLY_W   3
     130
     131/* Mapping Modes */
     132#define MM_TEXT_W             1
     133#define MM_LOMETRIC_W         2
     134#define MM_HIMETRIC_W         3
     135#define MM_LOENGLISH_W        4
     136#define MM_HIENGLISH_W        5
     137#define MM_TWIPS_W            6
     138#define MM_ISOTROPIC_W        7
     139#define MM_ANISOTROPIC_W      8
     140
     141#define RGN_OR_W              2
     142
     143/* Window scrolling */
     144#define SW_SCROLLCHILDREN_W    0x0001
     145#define SW_INVALIDATE_W        0x0002
     146#define SW_ERASE_W             0x0004
     147
     148/*********************/
     149
     150#ifndef OPEN32API
     151#define OPEN32API _System
     152#endif
     153
     154
     155BOOL    APIENTRY _GpiEnableYInversion (HPS hps, LONG lHeight);
     156
     157inline BOOL APIENTRY GpiEnableYInversion (HPS hps, LONG lHeight)
     158{
     159 BOOL yyrc;
     160 USHORT sel = RestoreOS2FS();
     161
     162    yyrc = _GpiEnableYInversion(hps, lHeight);
     163    SetFS(sel);
     164
     165    return yyrc;
     166}
     167
     168//LONG    APIENTRY GpiQueryYInversion (HPS hps);
     169
     170PVOID   APIENTRY _GpiAllocateDCData (HPS GpiH, ULONG size);
     171
     172inline PVOID APIENTRY GpiAllocateDCData (HPS GpiH, ULONG size)
     173{
     174 PVOID yyrc;
     175 USHORT sel = RestoreOS2FS();
     176
     177    yyrc = _GpiAllocateDCData(GpiH, size);
     178    SetFS(sel);
     179
     180    return yyrc;
     181}
     182
     183PVOID   APIENTRY _GpiQueryDCData (HPS hps);
     184
     185inline PVOID APIENTRY GpiQueryDCData (HPS hps)
     186{
     187 PVOID yyrc;
     188 USHORT sel = RestoreOS2FS();
     189
     190    yyrc = _GpiQueryDCData(hps);
     191    SetFS(sel);
     192
     193    return yyrc;
     194}
     195
     196HDC     OPEN32API _HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID a);
     197
     198inline HDC OPEN32API HPSToHDC (HWND hwnd, HPS hps, HDC hdc, PVOID a)
     199{
     200 HDC yyrc;
     201 USHORT sel = RestoreOS2FS();
     202
     203    yyrc = _HPSToHDC(hwnd, hps, hdc, a);
     204    SetFS(sel);
     205
     206    return yyrc;
     207}
     208
     209void    OPEN32API _DeleteHDC (HDC hdc);
     210
     211inline void OPEN32API DeleteHDC (HDC hdc)
     212{
     213 USHORT sel = RestoreOS2FS();
     214
     215    _DeleteHDC(hdc);
     216    SetFS(sel);
     217}
     218
     219BOOL    OPEN32API _O32_EndPaint (HWND hwnd, const PAINTSTRUCT_W *lpps);
     220
     221inline BOOL O32_EndPaint(HWND a, CONST PAINTSTRUCT_W *b)
     222{
     223 BOOL yyrc;
     224 USHORT sel = RestoreOS2FS();
     225
     226    yyrc = _O32_EndPaint(a, b);
     227    SetFS(sel);
     228
     229    return yyrc;
     230}
     231
     232int     OPEN32API _O32_GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase);
     233
     234inline int O32_GetUpdateRgn(HWND a, HRGN b, BOOL c)
     235{
     236 int yyrc;
     237 USHORT sel = RestoreOS2FS();
     238
     239    yyrc = _O32_GetUpdateRgn(a, b, c);
     240    SetFS(sel);
     241
     242    return yyrc;
     243}
     244
     245ULONG   OPEN32API _O32_GetRegionData (HRGN hrgn, ULONG count, PRGNDATA_W pData);
     246
     247inline DWORD O32_GetRegionData(HRGN a, DWORD b, PRGNDATA_W c)
     248{
     249 DWORD yyrc;
     250 USHORT sel = RestoreOS2FS();
     251
     252    yyrc = _O32_GetRegionData(a, b, c);
     253    SetFS(sel);
     254
     255    return yyrc;
     256}
     257
     258BOOL    OPEN32API _O32_DeleteObject (LHANDLE hgdiobj);
     259
     260inline BOOL O32_DeleteObject(HANDLE a)
     261{
     262 BOOL yyrc;
     263 USHORT sel = RestoreOS2FS();
     264
     265    yyrc = _O32_DeleteObject(a);
     266    SetFS(sel);
     267
     268    return yyrc;
     269}
     270
     271int     OPEN32API _O32_ReleaseDC (HWND hwnd, HDC hdc);
     272
     273inline int O32_ReleaseDC(HWND a, HDC b)
     274{
     275 int yyrc;
     276 USHORT sel = RestoreOS2FS();
     277
     278    yyrc = _O32_ReleaseDC(a, b);
     279    SetFS(sel);
     280
     281    return yyrc;
     282}
     283
     284VOID    OPEN32API _O32_SetLastError( DWORD );
     285
     286inline VOID O32_SetLastError(DWORD a)
     287{
     288 USHORT sel = RestoreOS2FS();
     289
     290    _O32_SetLastError(a);
     291    SetFS(sel);
     292}
     293
     294BOOL    OPEN32API _O32_SetRectRgn (HRGN dest, int left, int top, int right, int bottom);
     295
     296inline BOOL O32_SetRectRgn(HRGN a, int b, int c, int d, int e)
     297{
     298 BOOL yyrc;
     299 USHORT sel = RestoreOS2FS();
     300
     301    yyrc = _O32_SetRectRgn(a, b, c, d, e);
     302    SetFS(sel);
     303
     304    return yyrc;
     305}
     306
     307int     OPEN32API _O32_CombineRgn (HRGN dest, HRGN src1, HRGN src2, int mode);
     308
     309inline int O32_CombineRgn(HRGN a, HRGN b, HRGN c, int d)
     310{
     311 int yyrc;
     312 USHORT sel = RestoreOS2FS();
     313
     314    yyrc = _O32_CombineRgn(a, b, c, d);
     315    SetFS(sel);
     316
     317    return yyrc;
     318}
     319
     320HRGN    OPEN32API _O32_CreateRectRgn (int left, int top, int right, int bottom);
     321
     322inline HRGN O32_CreateRectRgn(int a, int b, int c, int d)
     323{
     324 HRGN yyrc;
     325 USHORT sel = RestoreOS2FS();
     326
     327    yyrc = _O32_CreateRectRgn(a, b, c, d);
     328    SetFS(sel);
     329
     330    return yyrc;
     331}
     332
     333BOOL OPEN32API _O32_CreateCaret (HWND hwnd, HBITMAP hbm, int width, int height);
     334
     335inline BOOL O32_CreateCaret(HWND a, HBITMAP b, int c, int d)
     336{
     337 BOOL yyrc;
     338 USHORT sel = RestoreOS2FS();
     339
     340    yyrc = _O32_CreateCaret(a, b, c, d);
     341    SetFS(sel);
     342
     343    return yyrc;
     344}
     345
     346BOOL    APIENTRY  __DestroyCaret (void);
     347
     348inline BOOL APIENTRY _DestroyCaret (void)
     349{
     350 BOOL yyrc;
     351 USHORT sel = RestoreOS2FS();
     352
     353    yyrc = __DestroyCaret();
     354    SetFS(sel);
     355
     356    return yyrc;
     357}
     358
     359UINT    APIENTRY  __GetCaretBlinkTime (void);
     360
     361inline UINT APIENTRY _GetCaretBlinkTime (void)
     362{
     363 UINT yyrc;
     364 USHORT sel = RestoreOS2FS();
     365
     366    yyrc = __GetCaretBlinkTime();
     367    SetFS(sel);
     368
     369    return yyrc;
     370}
     371
     372BOOL    APIENTRY  __HideCaret (HWND hwnd);
     373
     374inline BOOL APIENTRY _HideCaret (HWND hwnd)
     375{
     376 BOOL yyrc;
     377 USHORT sel = RestoreOS2FS();
     378
     379    yyrc = __HideCaret(hwnd);
     380    SetFS(sel);
     381
     382    return yyrc;
     383}
     384 
     385BOOL    APIENTRY  __SetCaretBlinkTime (UINT mSecs);
     386
     387inline BOOL APIENTRY _SetCaretBlinkTime (UINT mSecs)
     388{
     389 BOOL yyrc;
     390 USHORT sel = RestoreOS2FS();
     391
     392    yyrc = __SetCaretBlinkTime(mSecs);
     393    SetFS(sel);
     394
     395    return yyrc;
     396}
     397
     398BOOL    APIENTRY  __ShowCaret (HWND hwnd);
     399
     400inline BOOL APIENTRY _ShowCaret (HWND hwnd)
     401{
     402 BOOL yyrc;
     403 USHORT sel = RestoreOS2FS();
     404
     405    yyrc = __ShowCaret(hwnd);
     406    SetFS(sel);
     407
     408    return yyrc;
     409}
     410
     411#endif //INCLUDED_BY_DC
     412
    19413#endif //__DC_H__
    20414
  • TabularUnified tags/trunk/src/user32/nativerc.cpp

    r11541 r11993  
    1616
    1717//******************************************************************************
    18 // CB: Loads and starts a native OS/2 dialog with Win32 DlgProc
    19 //     (used in COMCTL32)
    20 // full name: NativeDialogBoxIndirectParam
    21 //******************************************************************************
    22 INT WINAPI NativeDlgBoxIP(HMODULE hmodule,
    23                           HINSTANCE hinst, LPCSTR lpszName,
    24                           HWND hwndParent, DLGPROC dlgproc,
    25                           LPARAM lParamInit)
    26 {
    27   BOOL rc;
    28   DLGTEMPLATE *os2dlg;
    29   HRSRC hRes;
    30 /* //CB: synchronize with new dialog.cpp code
    31   dprintf(("NativeDlgBoxIP"));
    32 
    33   hRes = O32_FindResource(hmodule,lpszName,RT_DIALOGA);
    34   if (hRes == 0) return (INT)-1;
    35 
    36   dprintf((" hRes = %d",hRes));
    37 
    38   os2dlg = (DLGTEMPLATE*)O32_LoadResource(hmodule,hRes);
    39   if (os2dlg == NULL) return (INT)-1;
    40 
    41   dprintf((" os2dlg = %d",os2dlg));
    42 
    43   Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc,os2dlg);
    44   rc = O32_DialogBoxIndirectParam(hinst,os2dlg,hwndParent,(DLGPROC_O32)dialog->GetOS2Callback(),lParamInit);
    45   //dialog already destroyed when this returns
    46   dprintf(("NativeDlgBoxIP returned %X\n", rc));
    47 */
    48   return rc;
    49 }
    50 //******************************************************************************
    51 // CB: Loads and starts a native OS/2 dialog with Win32 DlgProc
    52 //     (used in COMCTL32)
    53 // full name: NativeCreateDialogIndirectParam
    54 //******************************************************************************
    55 INT WINAPI NativeCreateDlgIP(HMODULE hmodule,
    56                                 HINSTANCE hinst, LPCSTR lpszName,
    57                                 HWND hwndParent, DLGPROC dlgproc,
    58                                 LPARAM lParamInit)
    59 {
    60   BOOL rc;
    61   DLGTEMPLATE *os2dlg;
    62   HRSRC hRes;
    63 /* //CB: synchronize with new dialog.cpp code
    64   dprintf(("NativeCreateDlgBoxIP"));
    65 
    66   hRes = O32_FindResource(hmodule,lpszName,RT_DIALOGA);
    67   if (hRes == 0) return (INT)-1;
    68 
    69   dprintf((" hRes = %d",hRes));
    70 
    71   os2dlg = (DLGTEMPLATE*)O32_LoadResource(hmodule,hRes);
    72   if (os2dlg == NULL) return (INT)-1;
    73 
    74   dprintf((" os2dlg = %d",os2dlg));
    75 
    76   Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc,os2dlg);
    77   rc = O32_CreateDialogIndirectParam(hinst,os2dlg,hwndParent,(DLGPROC_O32)dialog->GetOS2Callback(),lParamInit);
    78   //dialog already destroyed when this returns
    79   dprintf(("NativeDlgBoxIP returned %X\n", rc));
    80 */
    81   return rc;
    82 }
    83 //******************************************************************************
    8418// CB: loads OS/2 bitmaps
    8519//******************************************************************************
  • TabularUnified tags/trunk/src/user32/open32wbase.h

    r11541 r11993  
    1 /* $Id: open32wbase.h,v 1.1 1999-09-15 23:18:52 sandervl Exp $ */
     1/* $Id: open32wbase.h,v 1.2 1999-10-22 18:11:45 sandervl Exp $ */
    22/*
    33 * Open32 Window fake Base Class for OS/2
     
    1414
    1515extern "C" {
    16 void _System WinSetDAXData (HWND, PVOID);
    1716ULONG _System PIEPS (ULONG, ULONG);
     17void _System _WinSetDAXData (HWND, PVOID);
    1818}
     19
     20inline void _System WinSetDAXData (HWND a, PVOID b)
     21{
     22 USHORT sel = RestoreOS2FS();
     23
     24    _WinSetDAXData(a, b);
     25    SetFS(sel);
     26}
    1927
    2028#define PIEPS(x,y)
  • TabularUnified tags/trunk/src/user32/oslibwin.cpp

    r11979 r11993  
    1 /* $Id: oslibwin.cpp,v 1.33 1999-10-21 12:19:26 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.34 1999-10-22 18:11:45 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    554554    pswpOld->cx = pswp->cx;
    555555    pswpOld->cy = pswp->cy;
     556
     557    dprintf(("window (%d,%d)(%d,%d)  client (%d,%d)(%d,%d)",
     558             x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy));
     559
     560    pwpos->flags            = (UINT)flags;
     561    pwpos->cy               = cy;
     562    pwpos->cx               = cx;
     563    pwpos->x                = x;
     564    pwpos->y                = y;
     565    pwpos->hwndInsertAfter  = hWinAfter;
     566    pwpos->hwnd             = hWindow;
     567}
     568//******************************************************************************
     569//******************************************************************************
     570void OSLibMapSWPtoWINDOWPOSFrame(PSWP pswp, struct tagWINDOWPOS *pwpos, PSWP pswpOld, HWND hParent, HWND hFrame)
     571{
     572   HWND hWindow            = pswp->hwnd;
     573   HWND hWndInsertAfter    = pswp->hwndInsertBehind;
     574   long x                  = pswp->x;
     575   long y                  = pswp->y;
     576   long cx                 = pswp->cx;
     577   long cy                 = pswp->cy;
     578   UINT fuFlags            = (UINT)pswp->fl;
     579   ULONG parentHeight;
     580
     581   HWND   hWinAfter;
     582   ULONG  flags = 0;
     583   SWP    swpClient;
     584   POINTL point;
     585
     586   HWND  hWnd = (hWindow == HWND_DESKTOP) ? HWND_DESKTOP_W: hWindow;
     587
     588    if (hWndInsertAfter == HWND_TOP)
     589        hWinAfter = HWND_TOP_W;
     590    else if (hWndInsertAfter == HWND_BOTTOM)
     591        hWinAfter = HWND_BOTTOM_W;
     592    else
     593        hWinAfter = (HWND) hWndInsertAfter;
     594
     595    //***********************************
     596    // convert PM flags to Windows flags
     597    //***********************************
     598    if (!(fuFlags & SWP_SIZE))       flags |= SWP_NOSIZE_W;
     599    if (!(fuFlags & SWP_MOVE))       flags |= SWP_NOMOVE_W;
     600    if (!(fuFlags & SWP_ZORDER))     flags |= SWP_NOZORDER_W;
     601    if (  fuFlags & SWP_NOREDRAW)    flags |= SWP_NOREDRAW_W;
     602    if (!(fuFlags & SWP_ACTIVATE))   flags |= SWP_NOACTIVATE_W;
     603    if (  fuFlags & SWP_SHOW)        flags |= SWP_SHOWWINDOW_W;
     604    if (  fuFlags & SWP_HIDE)        flags |= SWP_HIDEWINDOW_W;
     605    if (  fuFlags & SWP_NOADJUST)    flags |= SWP_NOSENDCHANGING_W;
     606
     607    WinQueryWindowPos(WinWindowFromID(hFrame, FID_CLIENT), &swpClient);
     608
     609    if(fuFlags & (SWP_MOVE | SWP_SIZE))
     610    {
     611        point.x = x;
     612        point.y = y;
     613        if(hParent)
     614        {
     615                WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1);
     616        }
     617        point.y = OSLibQueryScreenHeight() - point.y - cy;
     618
     619        x  = point.x;
     620        y  = point.y;
     621
     622        if ((pswp->x == pswpOld->x) && (pswp->y == pswpOld->y))
     623            flags |= SWP_NOMOVE_W;
     624
     625        if ((pswp->cx == pswpOld->cx) && (pswp->cy == pswpOld->cy))
     626            flags |= SWP_NOSIZE_W;
     627
     628        if (fuFlags & SWP_SIZE)
     629        {
     630            if (pswp->cy != pswpOld->cy)
     631            {
     632                flags &= ~SWP_NOMOVE_W;
     633            }
     634        }
     635    }
     636
     637    pswpOld->x  = swpClient.x;
     638    pswpOld->y  = pswp->cy - swpClient.y - swpClient.cy;
     639    pswpOld->cx = swpClient.cx;
     640    pswpOld->cy = swpClient.cy;
    556641
    557642    dprintf(("window (%d,%d)(%d,%d)  client (%d,%d)(%d,%d)",
  • TabularUnified tags/trunk/src/user32/oslibwin.h

    r11925 r11993  
    1 /* $Id: oslibwin.h,v 1.18 1999-10-17 16:42:39 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.19 1999-10-22 18:11:46 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    248248BOOL  OSLibWinQueryWindowPos (HWND hwnd, PSWP pswp);
    249249void  OSLibMapSWPtoWINDOWPOS(PSWP pswp, struct tagWINDOWPOS *pwpos, PSWP pswpOld, HWND hParent, HWND hFrame);
     250void  OSLibMapSWPtoWINDOWPOSFrame(PSWP pswp, struct tagWINDOWPOS *pwpos, PSWP pswpOld, HWND hParent, HWND hFrame);
    250251void  OSLibMapWINDOWPOStoSWP(struct tagWINDOWPOS *pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame);
    251252
  • TabularUnified tags/trunk/src/user32/pmframe.cpp

    r11931 r11993  
    1 /* $Id: pmframe.cpp,v 1.8 1999-10-17 19:32:04 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.9 1999-10-22 18:11:46 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    2222#include "pmframe.h"
    2323#include "oslibutil.h"
     24#include "oslibwin.h"
     25#include "caret.h"
    2426
    2527#define PMFRAMELOG
     
    160162MRESULT EXPENTRY Win32FrameProc(HWND hwnd,ULONG msg,MPARAM mp1,MPARAM mp2)
    161163{
    162   Win32BaseWindow *win32wnd;
    163   PFNWP OldFrameProc;
     164 Win32BaseWindow *win32wnd;
     165 PFNWP            OldFrameProc;
     166 MRESULT          rc;
    164167
    165168  SetWin32TIB();
     
    177180  switch(msg)
    178181  {
     182#if 1
     183    case WM_ADJUSTWINDOWPOS:
     184    {
     185      PSWP     pswp = (PSWP)mp1;
     186      SWP      swpOld;
     187      WINDOWPOS wp;
     188      ULONG     parentHeight = 0;
     189      HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE, hwndAfter;
     190
     191        dprintf(("PMFRAME: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     192
     193        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
     194            goto RunDefFrameProc;
     195        if(!win32wnd->CanReceiveSizeMsgs()) {
     196            break;
     197        }
     198
     199        WinQueryWindowPos(hwnd, &swpOld);
     200
     201        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     202            if (win32wnd->isChild()) {
     203                if(win32wnd->getParent()) {
     204                        hParent = win32wnd->getParent()->getOS2WindowHandle();
     205                }
     206                else    goto RunDefFrameProc;
     207            }
     208        }
     209        hwndAfter = pswp->hwndInsertBehind;
     210        hFrame = win32wnd->getOS2FrameWindowHandle();
     211        OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hFrame);
     212
     213        wp.hwnd = win32wnd->getWindowHandle();
     214        if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
     215        {
     216           Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
     217           if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle();
     218        }
     219        if(win32wnd->MsgPosChanging((LPARAM)&wp) == 0)
     220        {//app or default window handler changed wp
     221            dprintf(("OS2: WM_ADJUSTWINDOWPOS, app changed windowpos struct"));
     222            dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     223            OSLibMapWINDOWPOStoSWP(&wp, pswp, &swpOld, hParent, hFrame);
     224            dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     225            pswp->fl |= SWP_NOADJUST;
     226            pswp->hwndInsertBehind = hwndAfter;
     227            pswp->hwnd = hFrame;
     228
     229            RestoreOS2TIB();
     230            return (MRESULT)0xf;
     231        }
     232        break;
     233    }
     234
     235    case WM_WINDOWPOSCHANGED:
     236    {
     237      PSWP      pswp   = (PSWP)mp1;
     238      SWP       swpOld = *(pswp + 1);
     239      WINDOWPOS wp;
     240      ULONG     parentHeight = 0;
     241      HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE;
     242      LONG      yDelta = pswp->cy - swpOld.cy;
     243      LONG      xDelta = pswp->cx - swpOld.cx;
     244
     245        dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     246        RestoreOS2TIB();
     247        rc = OldFrameProc(hwnd,msg,mp1,mp2);
     248        SetWin32TIB();
     249//        dprintf(("After calling frameproc: (%x) %x %x (%d,%d) (%d,%d)", mp2, hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     250
     251        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
     252            break;
     253
     254        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     255            if (win32wnd->isChild()) {
     256                if(win32wnd->getParent()) {
     257                        hParent = win32wnd->getParent()->getOS2WindowHandle();
     258                }
     259                else    break; //parent has just been destroyed
     260            }
     261        }
     262        OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd);
     263
     264        //delta is difference between old and new client height
     265        yDelta = swpOld.cy - win32wnd->getWindowHeight();
     266
     267        win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
     268        win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
     269
     270        if(!win32wnd->CanReceiveSizeMsgs())
     271            break;
     272
     273        wp.hwnd = win32wnd->getWindowHandle();
     274        if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
     275        {
     276           Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
     277           if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle();
     278        }
     279
     280        if (yDelta != 0 || xDelta != 0)
     281        {
     282            HENUM henum = WinBeginEnumWindows(WinWindowFromID(pswp->hwnd, FID_CLIENT));
     283            SWP swp[10];
     284            int i = 0;
     285            HWND hwnd;
     286
     287            while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE)
     288            {
     289#if 0
     290                if (mdiClient )
     291                {
     292                  continue;
     293                }
     294#endif
     295                WinQueryWindowPos(hwnd, &(swp[i]));
     296
     297#ifdef DEBUG
     298                Win32BaseWindow *window = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
     299                dprintf(("ENUMERATE %x delta %d (%d,%d) (%d,%d) %x", (window) ? window->getWindowHandle() : hwnd,
     300                         yDelta, swp[i].x, swp[i].y, swp[i].cx, swp[i].cy, swp[i].fl));
     301#endif
     302
     303                if(swp[i].y != 0) {
     304                    //child window at offset <> 0 from client area -> offset now changes
     305                    swp[i].y  += yDelta;
     306                    swp[i].fl &= ~(SWP_NOREDRAW);
     307                }
     308                //else child window with the same start coorindates as the client area
     309                //The app should resize it.
     310
     311               if (i == 9)
     312                {
     313                    WinSetMultWindowPos(GetThreadHAB(), swp, 10);
     314                    i = 0;
     315                }
     316                else
     317                {
     318                    i++;
     319                }
     320            }
     321
     322            WinEndEnumWindows(henum);
     323
     324            if (i)
     325               WinSetMultWindowPos(GetThreadHAB(), swp, i);
     326        }
     327        if (yDelta != 0)
     328        {
     329            POINT pt;
     330            if(GetCaretPos (&pt) == TRUE)
     331            {
     332                pt.y -= yDelta;
     333                SetCaretPos (pt.x, pt.y);
     334            }
     335        }
     336        win32wnd->MsgPosChanged((LPARAM)&wp);
     337        break;
     338    }
     339#else
    179340    case WM_ADJUSTWINDOWPOS:
    180341    {
     
    185346      if(wndchild && wndchild->isChild())
    186347      {
    187 #if 0
    188        SWP swp = *pswp;
    189 
    190         MRESULT rc = OldFrameProc(hwnd, msg, mp1, mp2);
    191         pswp->x = swp.x;
    192         pswp->y = swp.y;
    193         pswp->fl = swp.fl;
    194 #endif
    195348        dprintf(("PMFRAME: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    196349        RestoreOS2TIB();
     
    199352      goto RunDefFrameProc;
    200353    }
    201 #if 0
    202     case WM_WINDOWPOSCHANGED:
    203     {
    204       PSWP      pswp  = (PSWP)mp1;
    205       dprintf(("PMFRAME: WM_WINDOWPOSCHANGED %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    206       goto RunDefFrameProc;
    207     }
    208 
    209     case WM_FORMATFRAME:
    210     {
    211       PSWP      pswp  = (PSWP)mp1;
    212       dprintf(("PMFRAME: WM_FORMATFRAME %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    213       goto RunDefFrameProc;
    214     }
     354
    215355#endif
    216356
     
    224364
    225365    case WM_MOUSEMOVE:
    226       #ifdef PMFRAMELOG
    227        dprintf(("PMFRAME: WM_MOUSEMOVE"));
    228       #endif
    229366      if (InSizeBox(win32wnd,(POINTS*)&mp1))
    230367      {
  • TabularUnified tags/trunk/src/user32/pmwindow.cpp

    r11979 r11993  
    1 /* $Id: pmwindow.cpp,v 1.39 1999-10-21 12:19:27 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.40 1999-10-22 18:11:47 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    247247        break;
    248248
    249     case WM_ADJUSTWINDOWPOS:
    250     {
    251       PSWP     pswp = (PSWP)mp1;
    252       SWP      swpOld;
    253       WINDOWPOS wp;
    254       ULONG     parentHeight = 0;
    255       HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE, hwndAfter;
    256 
    257         dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    258 
    259         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto RunDefWndProc;;
    260 
    261         //SvL: TODO: Workaround. Why is this happening?
    262         //     When this flag is set the coordinates are 0, even though SWP_SIZE & SWP_MOVE are set.
    263 //        if ((pswp->fl & SWP_NOADJUST)) goto RunDefWndProc;
    264 
    265         if(!win32wnd->CanReceiveSizeMsgs()) goto RunDefWndProc;;
    266 
    267         WinQueryWindowPos(hwnd, &swpOld);
    268 
    269         if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
    270             if (win32wnd->isChild()) {
    271                 if(win32wnd->getParent()) {
    272                         hParent = win32wnd->getParent()->getOS2WindowHandle();
    273                 }
    274                 else    goto RunDefWndProc;;
    275             }
    276         }
    277         hwndAfter = pswp->hwndInsertBehind;
    278         hFrame = win32wnd->getOS2FrameWindowHandle();
    279         OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame);
    280 
    281         wp.hwnd = win32wnd->getWindowHandle();
    282         if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
    283         {
    284            Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
    285            if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle();
    286         }
    287         if(win32wnd->MsgPosChanging((LPARAM)&wp) == 0)
    288         {//app or default window handler changed wp
    289             dprintf(("OS2: WM_ADJUSTWINDOWPOS, app changed windowpos struct"));
    290             dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    291             OSLibMapWINDOWPOStoSWP(&wp, pswp, &swpOld, hParent, hFrame);
    292             dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    293             pswp->fl |= SWP_NOADJUST;
    294             pswp->hwndInsertBehind = hwndAfter;
    295             pswp->hwnd = hFrame;
    296 
    297             WinSetMultWindowPos(GetThreadHAB(), pswp, 1);
    298             return (MRESULT)0;
    299         }
    300         break;
    301     }
    302 
    303     case WM_WINDOWPOSCHANGED:
    304     {
    305       PSWP      pswp   = (PSWP)mp1;
    306       SWP       swpOld = *(pswp + 1);
    307       WINDOWPOS wp;
    308       ULONG     parentHeight = 0;
    309       HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE;
    310       LONG      yDelta = pswp->cy - swpOld.cy;
    311       LONG      xDelta = pswp->cx - swpOld.cx;
    312 
    313         dprintf(("OS2: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    314 
    315         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break;
    316         if(!win32wnd->CanReceiveSizeMsgs()) break;
    317 
    318         if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
    319             if (win32wnd->isChild()) {
    320                 if(win32wnd->getParent()) {
    321                         hParent = win32wnd->getParent()->getOS2WindowHandle();
    322                 }
    323                 else    goto RunDefWndProc; //parent has just been destroyed
    324             }
    325         }
    326         OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hwnd);
    327 
    328         win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
    329         win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    330 
    331         wp.hwnd = win32wnd->getWindowHandle();
    332         if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
    333         {
    334            Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
    335            wp.hwndInsertAfter = wndAfter->getWindowHandle();
    336         }
    337 
    338         if (yDelta != 0 || xDelta != 0)
    339         {
    340             HENUM henum = WinBeginEnumWindows(pswp->hwnd);
    341             SWP swp[10];
    342             int i = 0;
    343             HWND hwnd;
    344 
    345             while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE)
    346             {
    347 #if 0
    348                 if (mdiClient )
    349                 {
    350                   continue;
    351                 }
    352 #endif
    353                 WinQueryWindowPos(hwnd, &(swp[i]));
    354 
    355 #ifdef DEBUG
    356                 Win32BaseWindow *window = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    357                 dprintf(("ENUMERATE %x delta %d (%d,%d) (%d,%d) %x", (window) ? window->getWindowHandle() : hwnd,
    358                          yDelta, swp[i].x, swp[i].y, swp[i].cx, swp[i].cy, swp[i].fl));
    359 #endif
    360 
    361                 if(swp[i].y != 0) {
    362                     //child window at offset <> 0 from client area -> offset now changes
    363                     swp[i].y  += yDelta;
    364                     swp[i].fl &= ~(SWP_NOREDRAW);
    365                 }
    366                 //else child window with the same start coorindates as the client area
    367                 //The app should resize it.
    368 
    369                if (i == 9)
    370                 {
    371                     WinSetMultWindowPos(GetThreadHAB(), swp, 10);
    372                     i = 0;
    373                 }
    374                 else
    375                 {
    376                     i++;
    377                 }
    378             }
    379 
    380             WinEndEnumWindows(henum);
    381 
    382             if (i)
    383                WinSetMultWindowPos(GetThreadHAB(), swp, i);
    384         }
    385         if (yDelta != 0)
    386         {
    387             POINT pt;
    388             if(GetCaretPos (&pt) == TRUE)
    389             {
    390                 pt.y -= yDelta;
    391                 SetCaretPos (pt.x, pt.y);
    392             }
    393         }
    394         win32wnd->MsgPosChanged((LPARAM)&wp);
    395 
    396         goto RunDefWndProc;
    397     }
    398 
    399249    case WM_SIZE:
    400250    {
  • TabularUnified tags/trunk/src/user32/timer.cpp

    r11683 r11993  
    1 /* $Id: timer.cpp,v 1.4 1999-09-29 09:31:18 dengert Exp $ */
     1/* $Id: timer.cpp,v 1.5 1999-10-22 18:11:47 sandervl Exp $ */
    22
    33/*
     
    177177{
    178178    UINT rc;
    179     USHORT sel = RestoreOS2FS();
    180179
    181180    dprintf(("USER32: SetTimer %04x %d %d %08lx", hwnd, id, timeout, (LONG)proc));
    182181
    183182    rc = TIMER_SetTimer (hwnd, id, timeout, proc, FALSE);
    184     SetFS(sel);
    185183    return (rc);
    186184}
     
    192190{
    193191    UINT rc;
    194     USHORT sel = RestoreOS2FS();
    195192
    196193    dprintf(("USER32: SetSystemTimer %04x %d %d %08lx", hwnd, id, timeout, (LONG)proc));
    197194
    198195    rc = TIMER_SetTimer (hwnd, id, timeout, proc, TRUE);
    199     SetFS(sel);
    200196    return (rc);
    201197}
     
    207203{
    208204    BOOL rc;
    209     USHORT sel = RestoreOS2FS();
    210205
    211206    dprintf(("USER32: KillTimer %04x %d", hwnd, id));
    212207
    213208    rc = TIMER_KillTimer (hwnd, id, FALSE);
    214     SetFS(sel);
    215209    return (rc);
    216210}
     
    222216{
    223217    BOOL rc;
    224     USHORT sel = RestoreOS2FS();
    225218
    226219    dprintf(("USER32: KillSystemTimer %04x %d", hwnd, id));
    227220
    228221    rc = TIMER_KillTimer (hwnd, id, TRUE);
    229     SetFS(sel);
    230     return (rc);
    231 }
    232 
     222    return (rc);
     223}
     224
  • TabularUnified tags/trunk/src/user32/user32exp.def

    r11921 r11993  
    576576    GetOS2Callback__15Win32WindowProcFv       @2001
    577577    _GetSysColorPen@4                         @2002
    578     _NativeDlgBoxIP@24                        @2003
    579     _NativeCreateDlgIP@24                     @2004
    580578    _NativeLoadBitmap@8                       @2005
    581579    Win32ToOS2Handle__FUl                     @2006
  • TabularUnified tags/trunk/src/user32/win32wbase.cpp

    r11979 r11993  
    1 /* $Id: win32wbase.cpp,v 1.58 1999-10-21 12:19:28 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.59 1999-10-22 18:11:48 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    137137  fNoSizeMsg       = FALSE;
    138138  fIsDestroyed     = FALSE;
     139  fCreated         = FALSE;
    139140
    140141  windowNameA      = NULL;
     
    558559 POINT maxPos;
    559560 CREATESTRUCTA  *cs = tmpcs;  //pointer to CREATESTRUCT used in CreateWindowExA method
     561 RECT rectWndTmp, rectClientTmp;
    560562
    561563  OS2Hwnd      = hwndClient;
    562564  OS2HwndFrame = hwndFrame;
    563 //  if(!isFrameWindow())
    564 //        OS2HwndFrame = hwndClient;
     565
     566  //make backup copy of rectangles (some calls below result in WM_WINDOWPOSCHANGED with weird values since we haven't
     567  //set our window size just yet)
     568  rectWndTmp   = rectWindow;
     569  rectClientTmp = rectClient;
    565570
    566571  fNoSizeMsg = TRUE;
     
    621626  fakeWinBase.hwndThis     = OS2Hwnd;
    622627  fakeWinBase.pWindowClass = windowClass;
    623 //  SetFakeOpen32();
    624628
    625629  //Set icon from class
     
    649653  if (isChild()) FrameSetBorderSize(this,TRUE);
    650654
     655  //restore rectangles (some calls below result in WM_WINDOWPOSCHANGED with weird values since we haven't
     656  //set our window size just yet)
     657  rectWindow = rectWndTmp;
     658  rectClient = rectClientTmp;
     659
    651660  /* Send the WM_CREATE message
    652661   * Perhaps we shouldn't allow width/height changes as well.
     
    672681  if(SendMessageA(WM_NCCREATE, 0, (LPARAM)cs) )
    673682  {
     683        fCreated = TRUE;
     684
    674685        SendNCCalcSize(FALSE, &rectWindow, NULL, NULL, 0, &rectClient );
    675686
     
    15591570            return result;
    15601571    }
     1572    case WM_NOTIFY:
     1573        return 0; //comctl32 controls expect this
    15611574
    15621575    default:
     1576        if(Msg > WM_USER) {
     1577            return 0;
     1578        }
    15631579        return 1;
    15641580    }
     
    15931609 LRESULT rc;
    15941610 BOOL    fInternalMsgBackup = fInternalMsg;
     1611
     1612  //SvL: Some Wine controls send WM_COMMAND messages when they receive the focus -> apps don't like to
     1613  //     receive those before they get their WM_CREATE message
     1614  //NOTE: May need to refuse more messages
     1615  if(fCreated == FALSE && Msg == WM_COMMAND) {
     1616        dprintf(("SendMessageA BEFORE creation! %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
     1617        return 0;
     1618  }
    15951619
    15961620  if(Msg != WM_GETDLGCODE && Msg != WM_ENTERIDLE) {//sent *very* often
     
    16461670 LRESULT rc;
    16471671 BOOL    fInternalMsgBackup = fInternalMsg;
     1672
     1673  //SvL: Some Wine controls send WM_COMMAND messages when they receive the focus -> apps don't like to
     1674  //     receive those before they get their WM_CREATE message
     1675  //NOTE: May need to refuse more messages
     1676  if(fCreated == FALSE && Msg == WM_COMMAND) {
     1677        dprintf(("SendMessageA BEFORE creation! %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
     1678        return 0;
     1679  }
    16481680
    16491681  if(Msg != WM_GETDLGCODE && Msg != WM_ENTERIDLE) {//sent *very* often
  • TabularUnified tags/trunk/src/user32/win32wbase.h

    r11964 r11993  
    1 /* $Id: win32wbase.h,v 1.31 1999-10-20 13:46:28 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.32 1999-10-22 18:11:48 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    264264        BOOL    fNoSizeMsg;
    265265        BOOL    fIsDestroyed;
     266        BOOL    fCreated;
    266267
    267268        PVOID   pOldFrameProc;
  • TabularUnified tags/trunk/src/user32/window.cpp

    r11975 r11993  
    1 /* $Id: window.cpp,v 1.22 1999-10-20 22:35:54 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.23 1999-10-22 18:11:50 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    801801    point.y = wndto->getWindowHeight() - point.y;
    802802
    803     WORD xinc = point.x - lpPoints->x;
    804     WORD yinc = point.y - lpPoints->y;
    805 
    806     for(int i=1;i<cPoints;i++)
     803    short int xinc = point.x - lpPoints->x;
     804    short int yinc = point.y - lpPoints->y;
     805
     806    for(int i=0;i<cPoints;i++)
    807807    {
    808808        lpPoints[i].x += xinc;
    809809        lpPoints[i].y += yinc;
    810810    }
    811     retval = ((DWORD)yinc << 16) | xinc;
     811    retval = ((LONG)yinc << 16) | xinc;
    812812    return retval;
    813813}
  • TabularUnified tags/trunk/src/user32/winmenu.cpp

    r11621 r11993  
    1 /* $Id: winmenu.cpp,v 1.7 1999-09-24 12:47:51 sandervl Exp $ */
     1/* $Id: winmenu.cpp,v 1.8 1999-10-22 18:11:51 sandervl Exp $ */
    22
    33/*
     
    296296              const RECT *, arg7)
    297297{
    298     dprintf(("USER32:  TrackPopupMenu\n"));
    299     if(hMenu == 0)
    300     {
    301         SetLastError(ERROR_INVALID_PARAMETER);
    302         return 0;
    303     }
    304     return O32_TrackPopupMenu(hMenu, arg2, arg3, arg4, arg5, arg6, arg7);
     298  Win32BaseWindow *window;
     299
     300  window = Win32BaseWindow::GetWindowFromHandle(arg6);
     301  if(!window)
     302  {
     303    dprintf(("TrackPopupMenu, window %x not found", arg6));
     304    return 0;
     305  }
     306  dprintf(("USER32:  TrackPopupMenu\n"));
     307  if(hMenu == 0)
     308  {
     309      SetLastError(ERROR_INVALID_PARAMETER);
     310      return 0;
     311  }
     312  return O32_TrackPopupMenu(hMenu, arg2, arg3, arg4, arg5, window->getOS2WindowHandle(),
     313                            arg7);
    305314}
    306315//******************************************************************************
     
    314323              LPTPMPARAMS, lpPM)
    315324{
    316  RECT *rect = NULL;
    317 
    318     dprintf(("USER32:  TrackPopupMenuEx, not completely implemented\n"));
    319     if(lpPM->cbSize != 0)
    320         rect = &lpPM->rcExclude;
    321 
    322     if(hMenu == 0)
    323     {
    324         SetLastError(ERROR_INVALID_PARAMETER);
    325         return 0;
    326     }
    327     return O32_TrackPopupMenu(hMenu, flags, X, Y, 0, hwnd, rect);
     325  RECT *rect = NULL;
     326  Win32BaseWindow *window;
     327
     328  window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     329  if(!window)
     330  {
     331    dprintf(("TrackPopupMenu, window %x not found", hwnd));
     332    return 0;
     333  }
     334
     335  dprintf(("USER32:  TrackPopupMenuEx, not completely implemented\n"));
     336  if(lpPM->cbSize != 0)
     337      rect = &lpPM->rcExclude;
     338
     339  if(hMenu == 0)
     340  {
     341      SetLastError(ERROR_INVALID_PARAMETER);
     342      return 0;
     343  }
     344  return O32_TrackPopupMenu(hMenu, flags, X, Y, 0, window->getOS2WindowHandle(), rect);
    328345}
    329346//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.