From 3c39a9912ef87ee6236bac4c6a1e11c7ea09d549 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 31 Aug 2004 00:02:02 +0000 Subject: [PATCH] Get rid of the non-standard CONV_POINT and CONV_RECT functions. --- controls/combo.c | 10 ++- controls/edit.c | 20 +++++- controls/listbox.c | 6 +- dlls/commdlg/fontdlg16.c | 21 +++--- dlls/gdi/enhmetafile.c | 22 ++++--- dlls/gdi/gdi16.c | 102 ++++++++++++++++++++++++----- dlls/gdi/mfdrv/graphics.c | 15 ++++- dlls/gdi/mfdrv/text.c | 8 ++- dlls/gdi/pen.c | 3 +- dlls/user/hook16.c | 10 ++- dlls/user/user16.c | 132 ++++++++++++++++++++++++++++++++++---- dlls/user/wnd16.c | 112 ++++++++++++++++++++++++++------ include/wine/wingdi16.h | 29 --------- windows/cursoricon.c | 20 ------ windows/defwnd.c | 12 +++- windows/nonclient.c | 25 -------- windows/sysparams.c | 8 ++- windows/winpos.c | 63 ++++++++++++++---- windows/winproc.c | 111 +++++++++++++++++++++++--------- 19 files changed, 524 insertions(+), 205 deletions(-) diff --git a/controls/combo.c b/controls/combo.c index a6f68bc3e79..473c31127a2 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -2133,9 +2133,13 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, lParam = (LPARAM)MapSL(lParam); if( lParam ) { - RECT r; - CBGetDroppedControlRect( lphc, &r ); - CONV_RECT32TO16( &r, (LPRECT16)lParam ); + RECT r; + RECT16 *r16 = (RECT16 *)lParam; + CBGetDroppedControlRect( lphc, &r ); + r16->left = r.left; + r16->top = r.top; + r16->right = r.right; + r16->bottom = r.bottom; } return CB_OKAY; case CB_GETDROPPEDCONTROLRECT: diff --git a/controls/edit.c b/controls/edit.c index cd2b2850d0b..83fba06f856 100644 --- a/controls/edit.c +++ b/controls/edit.c @@ -460,7 +460,13 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, case EM_GETRECT16: if (lParam) - CONV_RECT32TO16(&es->format_rect, MapSL(lParam)); + { + RECT16 *r16 = MapSL(lParam); + r16->left = es->format_rect.left; + r16->top = es->format_rect.top; + r16->right = es->format_rect.right; + r16->bottom = es->format_rect.bottom; + } break; case EM_GETRECT: if (lParam) @@ -470,7 +476,11 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, case EM_SETRECT16: if ((es->style & ES_MULTILINE) && lParam) { RECT rc; - CONV_RECT16TO32(MapSL(lParam), &rc); + RECT16 *r16 = MapSL(lParam); + rc.left = r16->left; + rc.top = r16->top; + rc.right = r16->right; + rc.bottom = r16->bottom; EDIT_SetRectNP(es, &rc); EDIT_UpdateText(es, NULL, TRUE); } @@ -485,7 +495,11 @@ static LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, case EM_SETRECTNP16: if ((es->style & ES_MULTILINE) && lParam) { RECT rc; - CONV_RECT16TO32(MapSL(lParam), &rc); + RECT16 *r16 = MapSL(lParam); + rc.left = r16->left; + rc.top = r16->top; + rc.right = r16->right; + rc.bottom = r16->bottom; EDIT_SetRectNP(es, &rc); } break; diff --git a/controls/listbox.c b/controls/listbox.c index 9c422a70271..0c4d39b8f5a 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -2721,8 +2721,12 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg, case LB_GETITEMRECT16: { RECT rect; + RECT16 *r16 = MapSL(lParam); ret = LISTBOX_GetItemRect( descr, (INT16)wParam, &rect ); - CONV_RECT32TO16( &rect, MapSL(lParam) ); + r16->left = rect.left; + r16->top = rect.top; + r16->right = rect.right; + r16->bottom = rect.bottom; } return ret; diff --git a/dlls/commdlg/fontdlg16.c b/dlls/commdlg/fontdlg16.c index b1ab2b3388b..d289ede1cbd 100644 --- a/dlls/commdlg/fontdlg16.c +++ b/dlls/commdlg/fontdlg16.c @@ -320,15 +320,18 @@ BOOL16 CALLBACK FormatCharDlgProc16(HWND16 hDlg16, UINT16 message, { DRAWITEMSTRUCT16* dis16 = MapSL(lParam); DRAWITEMSTRUCT dis; - dis.CtlType = dis16->CtlType; - dis.CtlID = dis16->CtlID; - dis.itemID = dis16->itemID; - dis.itemAction = dis16->itemAction; - dis.itemState = dis16->itemState; - dis.hwndItem = HWND_32(dis16->hwndItem); - dis.hDC = HDC_32(dis16->hDC); - dis.itemData = dis16->itemData; - CONV_RECT16TO32( &dis16->rcItem, &dis.rcItem ); + dis.CtlType = dis16->CtlType; + dis.CtlID = dis16->CtlID; + dis.itemID = dis16->itemID; + dis.itemAction = dis16->itemAction; + dis.itemState = dis16->itemState; + dis.hwndItem = HWND_32(dis16->hwndItem); + dis.hDC = HDC_32(dis16->hDC); + dis.itemData = dis16->itemData; + dis.rcItem.left = dis16->rcItem.left; + dis.rcItem.top = dis16->rcItem.top; + dis.rcItem.right = dis16->rcItem.right; + dis.rcItem.bottom = dis16->rcItem.bottom; res = CFn_WMDrawItem(hDlg, wParam, (LPARAM)&dis); } break; diff --git a/dlls/gdi/enhmetafile.c b/dlls/gdi/enhmetafile.c index efe6b0ce755..dee64b8b2fa 100644 --- a/dlls/gdi/enhmetafile.c +++ b/dlls/gdi/enhmetafile.c @@ -947,13 +947,14 @@ BOOL WINAPI PlayEnhMetaFileRecord( /* NB POINTS array doesn't start at pPolyPoly->apts it's actually pPolyPoly->aPolyCounts + pPolyPoly->nPolys */ - POINT *pts = HeapAlloc( GetProcessHeap(), 0, - pPolyPoly->cpts * sizeof(POINT) ); + POINT16 *pts16 = (POINT16 *)(pPolyPoly->aPolyCounts + pPolyPoly->nPolys); + POINT *pts = HeapAlloc( GetProcessHeap(), 0, pPolyPoly->cpts * sizeof(POINT) ); DWORD i; for(i = 0; i < pPolyPoly->cpts; i++) - CONV_POINT16TO32((POINT16*) (pPolyPoly->aPolyCounts + - pPolyPoly->nPolys) + i, pts + i); - + { + pts[i].x = pts16[i].x; + pts[i].y = pts16[i].y; + } PolyPolygon(hdc, pts, (INT*)pPolyPoly->aPolyCounts, pPolyPoly->nPolys); HeapFree( GetProcessHeap(), 0, pts ); break; @@ -964,13 +965,14 @@ BOOL WINAPI PlayEnhMetaFileRecord( /* NB POINTS array doesn't start at pPolyPoly->apts it's actually pPolyPoly->aPolyCounts + pPolyPoly->nPolys */ - POINT *pts = HeapAlloc( GetProcessHeap(), 0, - pPolyPoly->cpts * sizeof(POINT) ); + POINT16 *pts16 = (POINT16 *)(pPolyPoly->aPolyCounts + pPolyPoly->nPolys); + POINT *pts = HeapAlloc( GetProcessHeap(), 0, pPolyPoly->cpts * sizeof(POINT) ); DWORD i; for(i = 0; i < pPolyPoly->cpts; i++) - CONV_POINT16TO32((POINT16*) (pPolyPoly->aPolyCounts + - pPolyPoly->nPolys) + i, pts + i); - + { + pts[i].x = pts16[i].x; + pts[i].y = pts16[i].y; + } PolyPolyline(hdc, pts, pPolyPoly->aPolyCounts, pPolyPoly->nPolys); HeapFree( GetProcessHeap(), 0, pts ); break; diff --git a/dlls/gdi/gdi16.c b/dlls/gdi/gdi16.c index 3a9eba39d15..a1f8f34e064 100644 --- a/dlls/gdi/gdi16.c +++ b/dlls/gdi/gdi16.c @@ -486,7 +486,11 @@ BOOL16 WINAPI Polygon16( HDC16 hdc, const POINT16* pt, INT16 count ) count*sizeof(POINT) ); if (!pt32) return FALSE; - for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i])); + for (i=count;i--;) + { + pt32[i].x = pt[i].x; + pt32[i].y = pt[i].y; + } ret = Polygon(HDC_32(hdc),pt32,count); HeapFree( GetProcessHeap(), 0, pt32 ); return ret; @@ -504,7 +508,11 @@ BOOL16 WINAPI Polyline16( HDC16 hdc, const POINT16* pt, INT16 count ) count*sizeof(POINT) ); if (!pt32) return FALSE; - for (i=count;i--;) CONV_POINT16TO32(&(pt[i]),&(pt32[i])); + for (i=count;i--;) + { + pt32[i].x = pt[i].x; + pt32[i].y = pt[i].y; + } ret = Polyline(HDC_32(hdc),pt32,count); HeapFree( GetProcessHeap(), 0, pt32 ); return ret; @@ -1414,7 +1422,10 @@ INT16 WINAPI GetRgnBox16( HRGN16 hrgn, LPRECT16 rect ) { RECT r; INT16 ret = GetRgnBox( HRGN_32(hrgn), &r ); - CONV_RECT32TO16( &r, rect ); + rect->left = r.left; + rect->top = r.top; + rect->right = r.right; + rect->bottom = r.bottom; return ret; } @@ -1554,7 +1565,10 @@ UINT16 WINAPI SetBoundsRect16( HDC16 hdc, const RECT16* rect, UINT16 flags ) if (rect) { RECT rect32; - CONV_RECT16TO32( rect, &rect32 ); + rect32.left = rect->left; + rect32.top = rect->top; + rect32.right = rect->right; + rect32.bottom = rect->bottom; return SetBoundsRect( HDC_32( hdc ), &rect32, flags ); } else return SetBoundsRect( HDC_32( hdc ), NULL, flags ); @@ -1568,7 +1582,13 @@ UINT16 WINAPI GetBoundsRect16( HDC16 hdc, LPRECT16 rect, UINT16 flags) { RECT rect32; UINT ret = GetBoundsRect( HDC_32( hdc ), &rect32, flags ); - if (rect) CONV_RECT32TO16( &rect32, rect ); + if (rect) + { + rect->left = rect32.left; + rect->top = rect32.top; + rect->right = rect32.right; + rect->bottom = rect32.bottom; + } return ret; } @@ -1842,7 +1862,13 @@ BOOL16 WINAPI ExtTextOut16( HDC16 hdc, INT16 x, INT16 y, UINT16 flags, if(lpdx32 == NULL) return FALSE; for (i=count;i--;) lpdx32[i]=lpDx[i]; } - if (lprect) CONV_RECT16TO32(lprect,&rect32); + if (lprect) + { + rect32.left = lprect->left; + rect32.top = lprect->top; + rect32.right = lprect->right; + rect32.bottom = lprect->bottom; + } ret = ExtTextOutA(HDC_32(hdc),x,y,flags,lprect?&rect32:NULL,str,count,lpdx32); if (lpdx32) HeapFree( GetProcessHeap(), 0, lpdx32 ); return ret; @@ -2202,7 +2228,10 @@ BOOL16 WINAPI PolyPolygon16( HDC16 hdc, const POINT16* pt, const INT16* counts, pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT)*nrpts); if(pt32 == NULL) return FALSE; for (i=nrpts;i--;) - CONV_POINT16TO32(&(pt[i]),&(pt32[i])); + { + pt32[i].x = pt[i].x; + pt32[i].y = pt[i].y; + } counts32 = (LPINT)HeapAlloc( GetProcessHeap(), 0, polygons*sizeof(INT) ); if(counts32 == NULL) { HeapFree( GetProcessHeap(), 0, pt32 ); @@ -2230,7 +2259,11 @@ HRGN16 WINAPI CreatePolyPolygonRgn16( const POINT16 *points, for (i = 0; i < nbpolygons; i++) npts += count[i]; points32 = HeapAlloc( GetProcessHeap(), 0, npts * sizeof(POINT) ); - for (i = 0; i < npts; i++) CONV_POINT16TO32( &(points[i]), &(points32[i]) ); + for (i = 0; i < npts; i++) + { + points32[i].x = points[i].x; + points32[i].y = points[i].y; + } count32 = HeapAlloc( GetProcessHeap(), 0, nbpolygons * sizeof(INT) ); for (i = 0; i < nbpolygons; i++) count32[i] = count[i]; @@ -2257,7 +2290,11 @@ void WINAPI SetObjectOwner16( HGDIOBJ16 handle, HANDLE16 owner ) BOOL16 WINAPI RectVisible16( HDC16 hdc, const RECT16* rect16 ) { RECT rect; - CONV_RECT16TO32( rect16, &rect ); + + rect.left = rect16->left; + rect.top = rect16->top; + rect.right = rect16->right; + rect.bottom = rect16->bottom; return RectVisible( HDC_32(hdc), &rect ); } @@ -2270,7 +2307,10 @@ BOOL16 WINAPI RectInRegion16( HRGN16 hrgn, const RECT16 *rect ) { RECT r32; - CONV_RECT16TO32(rect, &r32); + r32.left = rect->left; + r32.top = rect->top; + r32.right = rect->right; + r32.bottom = rect->bottom; return RectInRegion( HRGN_32(hrgn), &r32 ); } @@ -2398,7 +2438,11 @@ BOOL16 WINAPI OffsetViewportOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt) { POINT pt32; BOOL16 ret = OffsetViewportOrgEx( HDC_32(hdc), x, y, &pt32 ); - if (pt) CONV_POINT32TO16( &pt32, pt ); + if (pt) + { + pt->x = pt32.x; + pt->y = pt32.y; + } return ret; } @@ -2410,7 +2454,11 @@ BOOL16 WINAPI OffsetWindowOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt ) { POINT pt32; BOOL16 ret = OffsetWindowOrgEx( HDC_32(hdc), x, y, &pt32 ); - if (pt) CONV_POINT32TO16( &pt32, pt ); + if (pt) + { + pt->x = pt32.x; + pt->y = pt32.y; + } return ret; } @@ -2451,7 +2499,11 @@ BOOL16 WINAPI SetViewportOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt ) { POINT pt32; BOOL16 ret = SetViewportOrgEx( HDC_32(hdc), x, y, &pt32 ); - if (pt) CONV_POINT32TO16( &pt32, pt ); + if (pt) + { + pt->x = pt32.x; + pt->y = pt32.y; + } return ret; } @@ -2475,7 +2527,11 @@ BOOL16 WINAPI SetWindowOrgEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt ) { POINT pt32; BOOL16 ret = SetWindowOrgEx( HDC_32(hdc), x, y, &pt32 ); - if (pt) CONV_POINT32TO16( &pt32, pt ); + if (pt) + { + pt->x = pt32.x; + pt->y = pt32.y; + } return ret; } @@ -2488,7 +2544,11 @@ BOOL16 WINAPI MoveToEx16( HDC16 hdc, INT16 x, INT16 y, LPPOINT16 pt ) POINT pt32; if (!MoveToEx( HDC_32(hdc), x, y, &pt32 )) return FALSE; - if (pt) CONV_POINT32TO16( &pt32, pt ); + if (pt) + { + pt->x = pt32.x; + pt->y = pt32.y; + } return TRUE; } @@ -2531,7 +2591,11 @@ BOOL16 WINAPI PolyBezier16( HDC16 hdc, const POINT16* lppt, INT16 cPoints ) LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0, cPoints*sizeof(POINT) ); if(!pt32) return FALSE; - for (i=cPoints;i--;) CONV_POINT16TO32(&(lppt[i]),&(pt32[i])); + for (i=cPoints;i--;) + { + pt32[i].x = lppt[i].x; + pt32[i].y = lppt[i].y; + } ret= PolyBezier(HDC_32(hdc), pt32, cPoints); HeapFree( GetProcessHeap(), 0, pt32 ); return ret; @@ -2548,7 +2612,11 @@ BOOL16 WINAPI PolyBezierTo16( HDC16 hdc, const POINT16* lppt, INT16 cPoints ) LPPOINT pt32 = (LPPOINT)HeapAlloc( GetProcessHeap(), 0, cPoints*sizeof(POINT) ); if(!pt32) return FALSE; - for (i=cPoints;i--;) CONV_POINT16TO32(&(lppt[i]),&(pt32[i])); + for (i=cPoints;i--;) + { + pt32[i].x = lppt[i].x; + pt32[i].y = lppt[i].y; + } ret= PolyBezierTo(HDC_32(hdc), pt32, cPoints); HeapFree( GetProcessHeap(), 0, pt32 ); return ret; diff --git a/dlls/gdi/mfdrv/graphics.c b/dlls/gdi/mfdrv/graphics.c index 4442c224d42..933d8ff9b12 100644 --- a/dlls/gdi/mfdrv/graphics.c +++ b/dlls/gdi/mfdrv/graphics.c @@ -156,7 +156,11 @@ MFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count ) pt16 = (LPPOINT16)HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count ); if(!pt16) return FALSE; - for (i=count;i--;) CONV_POINT32TO16(&(pt[i]),&(pt16[i])); + for (i=count;i--;) + { + pt16[i].x = pt[i].x; + pt16[i].y = pt[i].y; + } ret = MFDRV_MetaPoly(dev, META_POLYLINE, pt16, count); HeapFree( GetProcessHeap(), 0, pt16 ); @@ -176,7 +180,11 @@ MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) pt16 = (LPPOINT16) HeapAlloc( GetProcessHeap(), 0, sizeof(POINT16)*count ); if(!pt16) return FALSE; - for (i=count;i--;) CONV_POINT32TO16(&(pt[i]),&(pt16[i])); + for (i=count;i--;) + { + pt16[i].x = pt[i].x; + pt16[i].y = pt[i].y; + } ret = MFDRV_MetaPoly(dev, META_POLYGON, pt16, count); HeapFree( GetProcessHeap(), 0, pt16 ); @@ -215,7 +223,8 @@ MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygon /* convert all points */ for (j = totalpoint16; j--;){ - CONV_POINT32TO16(&(pt[j]),&(pt16[j])); + pt16[j].x = pt[j].x; + pt16[j].y = pt[j].y; } len = sizeof(METARECORD) + sizeof(WORD) + polygons*sizeof(INT16) + totalpoint16*sizeof(POINT16); diff --git a/dlls/gdi/mfdrv/text.c b/dlls/gdi/mfdrv/text.c index 6ddbfd9a450..738079cb4a7 100644 --- a/dlls/gdi/mfdrv/text.c +++ b/dlls/gdi/mfdrv/text.c @@ -130,7 +130,13 @@ MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, TRACE("mapped %s -> %s\n", debugstr_wn(str, count), debugstr_an(ascii, len)); - if (lprect) CONV_RECT32TO16(lprect,&rect16); + if (lprect) + { + rect16.left = lprect->left; + rect16.top = lprect->top; + rect16.right = lprect->right; + rect16.bottom = lprect->bottom; + } if(lpDx) { lpdx16 = HeapAlloc( GetProcessHeap(), 0, sizeof(INT16)*len ); diff --git a/dlls/gdi/pen.c b/dlls/gdi/pen.c index f15cc44f90b..ac7817d8d91 100644 --- a/dlls/gdi/pen.c +++ b/dlls/gdi/pen.c @@ -156,7 +156,8 @@ static INT PEN_GetObject16( HGDIOBJ handle, void *obj, INT count, LPVOID buffer logpen.lopnStyle = pen->logpen.lopnStyle; logpen.lopnColor = pen->logpen.lopnColor; - CONV_POINT32TO16( &pen->logpen.lopnWidth, &logpen.lopnWidth ); + logpen.lopnWidth.x = pen->logpen.lopnWidth.x; + logpen.lopnWidth.y = pen->logpen.lopnWidth.y; if (count > sizeof(logpen)) count = sizeof(logpen); memcpy( buffer, &logpen, count ); return count; diff --git a/dlls/user/hook16.c b/dlls/user/hook16.c index a2e7a0a447d..8bcef5ccc6e 100644 --- a/dlls/user/hook16.c +++ b/dlls/user/hook16.c @@ -283,7 +283,10 @@ static LRESULT CALLBACK call_WH_CBT( INT code, WPARAM wp, LPARAM lp ) RECT *rect32 = (RECT *)lp; RECT16 rect16; - CONV_RECT32TO16( rect32, &rect16 ); + rect16.left = rect32->left; + rect16.top = rect32->top; + rect16.right = rect32->right; + rect16.bottom = rect32->bottom; lp = MapLS( &rect16 ); ret = call_hook_16( WH_CBT, code, wp, lp ); UnMapLS( lp ); @@ -571,7 +574,10 @@ LRESULT WINAPI CallNextHookEx16( HHOOK hhook, INT16 code, WPARAM16 wparam, LPARA RECT16 *rect16 = MapSL(lparam); RECT rect32; - CONV_RECT16TO32( rect16, &rect32 ); + rect32.left = rect16->left; + rect32.top = rect16->top; + rect32.right = rect16->right; + rect32.bottom = rect16->bottom; ret = CallNextHookEx( hhook, code, wparam, (LPARAM)&rect32 ); break; } diff --git a/dlls/user/user16.c b/dlls/user/user16.c index 486fd516df3..debca1b2b58 100644 --- a/dlls/user/user16.c +++ b/dlls/user/user16.c @@ -97,6 +97,23 @@ static BOOL CALLBACK draw_state_callback( HDC hdc, LPARAM lparam, WPARAM wparam, return LOWORD(ret); } + +/*********************************************************************** + * ClipCursor (USER.16) + */ +BOOL16 WINAPI ClipCursor16( const RECT16 *rect ) +{ + RECT rect32; + + if (!rect) return ClipCursor( NULL ); + rect32.left = rect->left; + rect32.top = rect->top; + rect32.right = rect->right; + rect32.bottom = rect->bottom; + return ClipCursor( &rect32 ); +} + + /*********************************************************************** * SetCursor (USER.69) */ @@ -153,7 +170,11 @@ void WINAPI InvertRect16( HDC16 hdc, const RECT16 *rect ) INT16 WINAPI FrameRect16( HDC16 hdc, const RECT16 *rect16, HBRUSH16 hbrush ) { RECT rect; - CONV_RECT16TO32( rect16, &rect ); + + rect.left = rect16->left; + rect.top = rect16->top; + rect.right = rect16->right; + rect.bottom = rect16->bottom; return FrameRect( HDC_32(hdc), &rect, HBRUSH_32(hbrush) ); } @@ -177,9 +198,16 @@ INT16 WINAPI DrawText16( HDC16 hdc, LPCSTR str, INT16 count, LPRECT16 rect, UINT if (rect) { RECT rect32; - CONV_RECT16TO32( rect, &rect32 ); + + rect32.left = rect->left; + rect32.top = rect->top; + rect32.right = rect->right; + rect32.bottom = rect->bottom; ret = DrawTextA( HDC_32(hdc), str, count, &rect32, flags ); - CONV_RECT32TO16( &rect32, rect ); + rect->left = rect32.left; + rect->top = rect32.top; + rect->right = rect32.right; + rect->bottom = rect32.bottom; } else ret = DrawTextA( HDC_32(hdc), str, count, NULL, flags); return ret; @@ -197,6 +225,15 @@ DWORD WINAPI IconSize16(void) } +/*********************************************************************** + * AdjustWindowRect (USER.102) + */ +BOOL16 WINAPI AdjustWindowRect16( LPRECT16 rect, DWORD style, BOOL16 menu ) +{ + return AdjustWindowRectEx16( rect, style, menu, 0 ); +} + + /********************************************************************** * CreateMenu (USER.151) */ @@ -400,12 +437,30 @@ BOOL16 WINAPI ScrollDC16( HDC16 hdc, INT16 dx, INT16 dy, const RECT16 *rect, RECT rect32, clipRect32, rcUpdate32; BOOL16 ret; - if (rect) CONV_RECT16TO32( rect, &rect32 ); - if (cliprc) CONV_RECT16TO32( cliprc, &clipRect32 ); + if (rect) + { + rect32.left = rect->left; + rect32.top = rect->top; + rect32.right = rect->right; + rect32.bottom = rect->bottom; + } + if (cliprc) + { + clipRect32.left = cliprc->left; + clipRect32.top = cliprc->top; + clipRect32.right = cliprc->right; + clipRect32.bottom = cliprc->bottom; + } ret = ScrollDC( HDC_32(hdc), dx, dy, rect ? &rect32 : NULL, cliprc ? &clipRect32 : NULL, HRGN_32(hrgnUpdate), &rcUpdate32 ); - if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate ); + if (rcUpdate) + { + rcUpdate->left = rcUpdate32.left; + rcUpdate->top = rcUpdate32.top; + rcUpdate->right = rcUpdate32.right; + rcUpdate->bottom = rcUpdate32.bottom; + } return ret; } @@ -504,6 +559,23 @@ UINT16 WINAPI RealizePalette16( HDC16 hdc ) } +/*********************************************************************** + * GetClipCursor (USER.309) + */ +void WINAPI GetClipCursor16( RECT16 *rect ) +{ + if (rect) + { + RECT rect32; + GetClipCursor( &rect32 ); + rect->left = rect32.left; + rect->top = rect32.top; + rect->right = rect32.right; + rect->bottom = rect32.bottom; + } +} + + /*********************************************************************** * SignalProc (USER.314) */ @@ -759,6 +831,28 @@ HICON16 WINAPI CreateIconFromResourceEx16(LPBYTE bits, UINT16 cbSize, width, height, cFlag)); } + +/*********************************************************************** + * AdjustWindowRectEx (USER.454) + */ +BOOL16 WINAPI AdjustWindowRectEx16( LPRECT16 rect, DWORD style, BOOL16 menu, DWORD exStyle ) +{ + RECT rect32; + BOOL ret; + + rect32.left = rect->left; + rect32.top = rect->top; + rect32.right = rect->right; + rect32.bottom = rect->bottom; + ret = AdjustWindowRectEx( &rect32, style, menu, exStyle ); + rect->left = rect32.left; + rect->top = rect32.top; + rect->right = rect32.right; + rect->bottom = rect32.bottom; + return ret; +} + + /*********************************************************************** * DestroyIcon (USER.457) */ @@ -924,7 +1018,11 @@ DWORD WINAPI DragObject16( HWND16 hwndScope, HWND16 hWnd, UINT16 wObj, void WINAPI DrawFocusRect16( HDC16 hdc, const RECT16* rc ) { RECT rect32; - CONV_RECT16TO32( rc, &rect32 ); + + rect32.left = rc->left; + rect32.top = rc->top; + rect32.right = rc->right; + rect32.bottom = rc->bottom; DrawFocusRect( HDC_32(hdc), &rect32 ); } @@ -937,9 +1035,15 @@ BOOL16 WINAPI DrawFrameControl16( HDC16 hdc, LPRECT16 rc, UINT16 uType, UINT16 u RECT rect32; BOOL ret; - CONV_RECT16TO32( rc, &rect32 ); + rect32.left = rc->left; + rect32.top = rc->top; + rect32.right = rc->right; + rect32.bottom = rc->bottom; ret = DrawFrameControl( HDC_32(hdc), &rect32, uType, uState ); - CONV_RECT32TO16( &rect32, rc ); + rc->left = rect32.left; + rc->top = rect32.top; + rc->right = rect32.right; + rc->bottom = rect32.bottom; return ret; } @@ -951,9 +1055,15 @@ BOOL16 WINAPI DrawEdge16( HDC16 hdc, LPRECT16 rc, UINT16 edge, UINT16 flags ) RECT rect32; BOOL ret; - CONV_RECT16TO32( rc, &rect32 ); + rect32.left = rc->left; + rect32.top = rc->top; + rect32.right = rc->right; + rect32.bottom = rc->bottom; ret = DrawEdge( HDC_32(hdc), &rect32, edge, flags ); - CONV_RECT32TO16( &rect32, rc ); + rc->left = rect32.left; + rc->top = rect32.top; + rc->right = rect32.right; + rc->bottom = rect32.bottom; return ret; } diff --git a/dlls/user/wnd16.c b/dlls/user/wnd16.c index 17a8bbe535d..15ca5d5c3d5 100644 --- a/dlls/user/wnd16.c +++ b/dlls/user/wnd16.c @@ -164,7 +164,8 @@ HWND16 WINAPI WindowFromPoint16( POINT16 pt ) { POINT pt32; - CONV_POINT16TO32( &pt, &pt32 ); + pt32.x = pt.x; + pt32.y = pt.y; return HWND_16( WindowFromPoint( pt32 ) ); } @@ -447,8 +448,20 @@ void WINAPI ScrollWindow16( HWND16 hwnd, INT16 dx, INT16 dy, const RECT16 *rect, { RECT rect32, clipRect32; - if (rect) CONV_RECT16TO32( rect, &rect32 ); - if (clipRect) CONV_RECT16TO32( clipRect, &clipRect32 ); + if (rect) + { + rect32.left = rect->left; + rect32.top = rect->top; + rect32.right = rect->right; + rect32.bottom = rect->bottom; + } + if (clipRect) + { + clipRect32.left = clipRect->left; + clipRect32.top = clipRect->top; + clipRect32.right = clipRect->right; + clipRect32.bottom = clipRect->bottom; + } ScrollWindow( WIN_Handle32(hwnd), dx, dy, rect ? &rect32 : NULL, clipRect ? &clipRect32 : NULL ); } @@ -846,7 +859,10 @@ BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase ) if (!rect) return GetUpdateRect( WIN_Handle32(hwnd), NULL, erase ); ret = GetUpdateRect( WIN_Handle32(hwnd), &r, erase ); - CONV_RECT32TO16( &r, rect ); + rect->left = r.left; + rect->top = r.top; + rect->right = r.right; + rect->bottom = r.bottom; return ret; } @@ -857,7 +873,9 @@ BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase ) HWND16 WINAPI ChildWindowFromPoint16( HWND16 hwndParent, POINT16 pt ) { POINT pt32; - CONV_POINT16TO32( &pt, &pt32 ); + + pt32.x = pt.x; + pt32.y = pt.y; return HWND_16( ChildWindowFromPoint( WIN_Handle32(hwndParent), pt32 )); } @@ -1085,7 +1103,10 @@ BOOL16 WINAPI RedrawWindow16( HWND16 hwnd, const RECT16 *rectUpdate, if (rectUpdate) { RECT r; - CONV_RECT16TO32( rectUpdate, &r ); + r.left = rectUpdate->left; + r.top = rectUpdate->top; + r.right = rectUpdate->right; + r.bottom = rectUpdate->bottom; return RedrawWindow(WIN_Handle32(hwnd), &r, HRGN_32(hrgnUpdate), flags); } return RedrawWindow(WIN_Handle32(hwnd), NULL, HRGN_32(hrgnUpdate), flags); @@ -1112,12 +1133,30 @@ INT16 WINAPI ScrollWindowEx16( HWND16 hwnd, INT16 dx, INT16 dy, RECT rect32, clipRect32, rcUpdate32; BOOL16 ret; - if (rect) CONV_RECT16TO32( rect, &rect32 ); - if (clipRect) CONV_RECT16TO32( clipRect, &clipRect32 ); + if (rect) + { + rect32.left = rect->left; + rect32.top = rect->top; + rect32.right = rect->right; + rect32.bottom = rect->bottom; + } + if (clipRect) + { + clipRect32.left = clipRect->left; + clipRect32.top = clipRect->top; + clipRect32.right = clipRect->right; + clipRect32.bottom = clipRect->bottom; + } ret = ScrollWindowEx( WIN_Handle32(hwnd), dx, dy, rect ? &rect32 : NULL, clipRect ? &clipRect32 : NULL, HRGN_32(hrgnUpdate), (rcUpdate) ? &rcUpdate32 : NULL, flags ); - if (rcUpdate) CONV_RECT32TO16( &rcUpdate32, rcUpdate ); + if (rcUpdate) + { + rcUpdate->left = rcUpdate32.left; + rcUpdate->top = rcUpdate32.top; + rcUpdate->right = rcUpdate32.right; + rcUpdate->bottom = rcUpdate32.bottom; + } return ret; } @@ -1131,7 +1170,10 @@ void WINAPI FillWindow16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc, HBRUSH16 hb RECT16 rc16; GetClientRect( WIN_Handle32(hwnd), &rect ); DPtoLP( HDC_32(hdc), (LPPOINT)&rect, 2 ); - CONV_RECT32TO16( &rect, &rc16 ); + rc16.left = rect.left; + rc16.top = rect.top; + rc16.right = rect.right; + rc16.bottom = rect.bottom; PaintRect16( hwndParent, hwnd, hdc, hbrush, &rc16 ); } @@ -1193,9 +1235,14 @@ BOOL16 WINAPI GetWindowPlacement16( HWND16 hwnd, WINDOWPLACEMENT16 *wp16 ) wp16->length = sizeof(*wp16); wp16->flags = wpl.flags; wp16->showCmd = wpl.showCmd; - CONV_POINT32TO16( &wpl.ptMinPosition, &wp16->ptMinPosition ); - CONV_POINT32TO16( &wpl.ptMaxPosition, &wp16->ptMaxPosition ); - CONV_RECT32TO16( &wpl.rcNormalPosition, &wp16->rcNormalPosition ); + wp16->ptMinPosition.x = wpl.ptMinPosition.x; + wp16->ptMinPosition.y = wpl.ptMinPosition.y; + wp16->ptMaxPosition.x = wpl.ptMaxPosition.x; + wp16->ptMaxPosition.y = wpl.ptMaxPosition.y; + wp16->rcNormalPosition.left = wpl.rcNormalPosition.left; + wp16->rcNormalPosition.top = wpl.rcNormalPosition.top; + wp16->rcNormalPosition.right = wpl.rcNormalPosition.right; + wp16->rcNormalPosition.bottom = wpl.rcNormalPosition.bottom; return TRUE; } @@ -1229,7 +1276,9 @@ BOOL16 WINAPI SetWindowPlacement16( HWND16 hwnd, const WINDOWPLACEMENT16 *wp16 ) HWND16 WINAPI ChildWindowFromPointEx16( HWND16 hwndParent, POINT16 pt, UINT16 uFlags) { POINT pt32; - CONV_POINT16TO32( &pt, &pt32 ); + + pt32.x = pt.x; + pt32.y = pt.y; return HWND_16( ChildWindowFromPointEx( WIN_Handle32(hwndParent), pt32, uFlags )); } @@ -1254,7 +1303,13 @@ BOOL16 WINAPI TrackPopupMenu16( HMENU16 hMenu, UINT16 wFlags, INT16 x, INT16 y, INT16 nReserved, HWND16 hwnd, const RECT16 *lpRect ) { RECT r; - if (lpRect) CONV_RECT16TO32( lpRect, &r ); + if (lpRect) + { + r.left = lpRect->left; + r.top = lpRect->top; + r.right = lpRect->right; + r.bottom = lpRect->bottom; + } return TrackPopupMenu( HMENU_32(hMenu), wFlags, x, y, nReserved, WIN_Handle32(hwnd), lpRect ? &r : NULL ); } @@ -1446,7 +1501,9 @@ void WINAPI ScrollChildren16(HWND16 hwnd, UINT16 uMsg, WPARAM16 wParam, LPARAM l BOOL16 WINAPI DragDetect16( HWND16 hwnd, POINT16 pt ) { POINT pt32; - CONV_POINT16TO32( &pt, &pt32 ); + + pt32.x = pt.x; + pt32.y = pt.y; return DragDetect( WIN_Handle32(hwnd), pt32 ); } @@ -1513,8 +1570,13 @@ BOOL16 WINAPI DrawCaptionTemp16( HWND16 hwnd, HDC16 hdc, const RECT16 *rect, { RECT rect32; - if (rect) CONV_RECT16TO32(rect,&rect32); - + if (rect) + { + rect32.left = rect->left; + rect32.top = rect->top; + rect32.right = rect->right; + rect32.bottom = rect->bottom; + } return DrawCaptionTempA( WIN_Handle32(hwnd), HDC_32(hdc), rect ? &rect32 : NULL, HFONT_32(hFont), HICON_32(hIcon), str, uFlags & 0x1f ); @@ -1528,8 +1590,13 @@ BOOL16 WINAPI DrawCaption16( HWND16 hwnd, HDC16 hdc, const RECT16 *rect, UINT16 { RECT rect32; - if (rect) CONV_RECT16TO32( rect, &rect32 ); - + if (rect) + { + rect32.left = rect->left; + rect32.top = rect->top; + rect32.right = rect->right; + rect32.bottom = rect->bottom; + } return DrawCaption(WIN_Handle32(hwnd), HDC_32(hdc), rect ? &rect32 : NULL, flags); } @@ -1544,7 +1611,10 @@ BOOL16 WINAPI GetMenuItemRect16( HWND16 hwnd, HMENU16 hMenu, UINT16 uItem, BOOL res; if (!rect) return FALSE; res = GetMenuItemRect( WIN_Handle32(hwnd), HMENU_32(hMenu), uItem, &r32 ); - CONV_RECT32TO16( &r32, rect ); + rect->left = r32.left; + rect->top = r32.top; + rect->right = r32.right; + rect->bottom = r32.bottom; return res; } diff --git a/include/wine/wingdi16.h b/include/wine/wingdi16.h index f2b4955a179..6e0fec6c04d 100644 --- a/include/wine/wingdi16.h +++ b/include/wine/wingdi16.h @@ -617,33 +617,4 @@ BOOL16 WINAPI WidenPath16(HDC16); INT16 WINAPI WriteDialog16(HPJOB16,LPSTR,INT16); INT16 WINAPI WriteSpool16(HPJOB16,LPSTR,INT16); - -inline static void CONV_POINT16TO32( const POINT16 *p16, POINT *p32 ) -{ - p32->x = p16->x; - p32->y = p16->y; -} - -inline static void CONV_POINT32TO16( const POINT *p32, POINT16 *p16 ) -{ - p16->x = (INT16)p32->x; - p16->y = (INT16)p32->y; -} - -inline static void CONV_RECT16TO32( const RECT16 *r16, RECT *r32 ) -{ - r32->left = r16->left; - r32->top = r16->top; - r32->right = r16->right; - r32->bottom = r16->bottom; -} - -inline static void CONV_RECT32TO16( const RECT *r32, RECT16 *r16 ) -{ - r16->left = (INT16)r32->left; - r16->top = (INT16)r32->top; - r16->right = (INT16)r32->right; - r16->bottom = (INT16)r32->bottom; -} - #endif /* __WINE_WINE_WINGDI16_H */ diff --git a/windows/cursoricon.c b/windows/cursoricon.c index ded5ab52b01..c5bc5f89d47 100644 --- a/windows/cursoricon.c +++ b/windows/cursoricon.c @@ -1410,17 +1410,6 @@ HCURSOR WINAPI GetCursor(void) } -/*********************************************************************** - * ClipCursor (USER.16) - */ -BOOL16 WINAPI ClipCursor16( const RECT16 *rect ) -{ - if (!rect) SetRectEmpty( &CURSOR_ClipRect ); - else CONV_RECT16TO32( rect, &CURSOR_ClipRect ); - return TRUE; -} - - /*********************************************************************** * ClipCursor (USER32.@) */ @@ -1432,15 +1421,6 @@ BOOL WINAPI ClipCursor( const RECT *rect ) } -/*********************************************************************** - * GetClipCursor (USER.309) - */ -void WINAPI GetClipCursor16( RECT16 *rect ) -{ - if (rect) CONV_RECT32TO16( &CURSOR_ClipRect, rect ); -} - - /*********************************************************************** * GetClipCursor (USER32.@) */ diff --git a/windows/defwnd.c b/windows/defwnd.c index ac4882ea532..1cf5590a9c7 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -742,9 +742,17 @@ LRESULT WINAPI DefWindowProc16( HWND16 hwnd16, UINT16 msg, WPARAM16 wParam, case WM_NCCALCSIZE: { RECT rect32; - CONV_RECT16TO32( MapSL(lParam), &rect32 ); + RECT16 *rect16 = MapSL(lParam); + + rect32.left = rect16->left; + rect32.top = rect16->top; + rect32.right = rect16->right; + rect32.bottom = rect16->bottom; result = NC_HandleNCCalcSize( hwnd, &rect32 ); - CONV_RECT32TO16( &rect32, MapSL(lParam) ); + rect16->left = rect32.left; + rect16->top = rect32.top; + rect16->right = rect32.right; + rect16->bottom = rect32.bottom; } break; diff --git a/windows/nonclient.c b/windows/nonclient.c index 4b6ac9c794f..edc671a2fed 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -336,15 +336,6 @@ BOOL WINAPI DrawCaptionTempW (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont, } -/*********************************************************************** - * AdjustWindowRect (USER.102) - */ -BOOL16 WINAPI AdjustWindowRect16( LPRECT16 rect, DWORD style, BOOL16 menu ) -{ - return AdjustWindowRectEx16( rect, style, menu, 0 ); -} - - /*********************************************************************** * AdjustWindowRect (USER32.@) */ @@ -354,22 +345,6 @@ BOOL WINAPI AdjustWindowRect( LPRECT rect, DWORD style, BOOL menu ) } -/*********************************************************************** - * AdjustWindowRectEx (USER.454) - */ -BOOL16 WINAPI AdjustWindowRectEx16( LPRECT16 rect, DWORD style, - BOOL16 menu, DWORD exStyle ) -{ - RECT rect32; - BOOL ret; - - CONV_RECT16TO32( rect, &rect32 ); - ret = AdjustWindowRectEx( &rect32, style, menu, exStyle ); - CONV_RECT32TO16( &rect32, rect ); - return ret; -} - - /*********************************************************************** * AdjustWindowRectEx (USER32.@) */ diff --git a/windows/sysparams.c b/windows/sysparams.c index bd672613fd1..5a86bf57c37 100644 --- a/windows/sysparams.c +++ b/windows/sysparams.c @@ -2223,7 +2223,13 @@ BOOL16 WINAPI SystemParametersInfo16( UINT16 uAction, UINT16 uParam, RECT tmp; ret = SystemParametersInfoA( uAction, uParam, lpvParam ? &tmp : NULL, fuWinIni ); if (ret && lpvParam) - CONV_RECT32TO16( &tmp, (RECT16 *)lpvParam ); + { + RECT16 *r16 = (RECT16 *)lpvParam; + r16->left = tmp.left; + r16->top = tmp.top; + r16->right = tmp.right; + r16->bottom = tmp.bottom; + } break; } diff --git a/windows/winpos.c b/windows/winpos.c index 5908de9b88c..3e0f8f69d9c 100644 --- a/windows/winpos.c +++ b/windows/winpos.c @@ -642,17 +642,31 @@ static LPINTERNALPOS WINPOS_InitInternalPos( WND* wnd, POINT pt, const RECT *res SetPropA( wnd->hwndSelf, atomInternalPos, (HANDLE)lpPos ); lpPos->hwndIconTitle = 0; /* defer until needs to be shown */ - CONV_RECT32TO16( &wnd->rectWindow, &lpPos->rectNormal ); - *(UINT*)&lpPos->ptIconPos = *(UINT*)&lpPos->ptMaxPos = 0xFFFFFFFF; + lpPos->rectNormal.left = wnd->rectWindow.left; + lpPos->rectNormal.top = wnd->rectWindow.top; + lpPos->rectNormal.right = wnd->rectWindow.right; + lpPos->rectNormal.bottom = wnd->rectWindow.bottom; + lpPos->ptIconPos.x = lpPos->ptIconPos.y = -1; + lpPos->ptMaxPos.x = lpPos->ptMaxPos.y = -1; } if( wnd->dwStyle & WS_MINIMIZE ) - CONV_POINT32TO16( &pt, &lpPos->ptIconPos ); + { + lpPos->ptIconPos.x = pt.x; + lpPos->ptIconPos.y = pt.y; + } else if( wnd->dwStyle & WS_MAXIMIZE ) - CONV_POINT32TO16( &pt, &lpPos->ptMaxPos ); + { + lpPos->ptMaxPos.x = pt.x; + lpPos->ptMaxPos.y = pt.y; + } else if( restoreRect ) - CONV_RECT32TO16( restoreRect, &lpPos->rectNormal ); - + { + lpPos->rectNormal.left = restoreRect->left; + lpPos->rectNormal.top = restoreRect->top; + lpPos->rectNormal.right = restoreRect->right; + lpPos->rectNormal.bottom = restoreRect->bottom; + } return lpPos; } @@ -772,7 +786,10 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos, lpPos = (LPINTERNALPOS)GetPropA( hwnd, atomInternalPos ); if( lpPos && !EMPTYPOINT(lpPos->ptMaxPos) ) - CONV_POINT16TO32( &lpPos->ptMaxPos, &MinMax.ptMaxPosition ); + { + MinMax.ptMaxPosition.x = lpPos->ptMaxPos.x; + MinMax.ptMaxPosition.y = lpPos->ptMaxPos.y; + } else { MinMax.ptMaxPosition.x = -xinc; @@ -883,9 +900,14 @@ BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl ) wndpl->flags = WPF_RESTORETOMAXIMIZED; else wndpl->flags = 0; - CONV_POINT16TO32( &lpPos->ptIconPos, &wndpl->ptMinPosition ); - CONV_POINT16TO32( &lpPos->ptMaxPos, &wndpl->ptMaxPosition ); - CONV_RECT16TO32( &lpPos->rectNormal, &wndpl->rcNormalPosition ); + wndpl->ptMinPosition.x = lpPos->ptIconPos.x; + wndpl->ptMinPosition.y = lpPos->ptIconPos.y; + wndpl->ptMaxPosition.x = lpPos->ptMaxPos.x; + wndpl->ptMaxPosition.y = lpPos->ptMaxPos.y; + wndpl->rcNormalPosition.left = lpPos->rectNormal.left; + wndpl->rcNormalPosition.top = lpPos->rectNormal.top; + wndpl->rcNormalPosition.right = lpPos->rectNormal.right; + wndpl->rcNormalPosition.bottom = lpPos->rectNormal.bottom; WIN_ReleaseWndPtr(pWnd); return TRUE; } @@ -902,10 +924,23 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f LPINTERNALPOS lpPos = (LPINTERNALPOS)WINPOS_InitInternalPos( pWnd, *(LPPOINT)&pWnd->rectWindow.left, &pWnd->rectWindow ); - if( flags & PLACE_MIN ) CONV_POINT32TO16( &wndpl->ptMinPosition, &lpPos->ptIconPos ); - if( flags & PLACE_MAX ) CONV_POINT32TO16( &wndpl->ptMaxPosition, &lpPos->ptMaxPos ); - if( flags & PLACE_RECT) CONV_RECT32TO16( &wndpl->rcNormalPosition, &lpPos->rectNormal ); - + if( flags & PLACE_MIN ) + { + lpPos->ptIconPos.x = wndpl->ptMinPosition.x; + lpPos->ptIconPos.y = wndpl->ptMinPosition.y; + } + if( flags & PLACE_MAX ) + { + lpPos->ptMaxPos.x = wndpl->ptMaxPosition.x; + lpPos->ptMaxPos.y = wndpl->ptMaxPosition.y; + } + if( flags & PLACE_RECT) + { + lpPos->rectNormal.left = wndpl->rcNormalPosition.left; + lpPos->rectNormal.top = wndpl->rcNormalPosition.top; + lpPos->rectNormal.right = wndpl->rcNormalPosition.right; + lpPos->rectNormal.bottom = wndpl->rcNormalPosition.bottom; + } if( pWnd->dwStyle & WS_MINIMIZE ) { WINPOS_ShowIconTitle( pWnd->hwndSelf, FALSE ); diff --git a/windows/winproc.c b/windows/winproc.c index f8eaa6572e9..9fbb4cc9056 100644 --- a/windows/winproc.c +++ b/windows/winproc.c @@ -1392,16 +1392,19 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT*)HeapAlloc(GetProcessHeap(), 0, sizeof(*dis)); if (!dis) return -1; - dis->CtlType = dis16->CtlType; - dis->CtlID = dis16->CtlID; - dis->itemID = dis16->itemID; - dis->itemAction = dis16->itemAction; - dis->itemState = dis16->itemState; - dis->hwndItem = (dis->CtlType == ODT_MENU) ? (HWND)HMENU_32(dis16->hwndItem) - : WIN_Handle32( dis16->hwndItem ); - dis->hDC = HDC_32(dis16->hDC); - dis->itemData = dis16->itemData; - CONV_RECT16TO32( &dis16->rcItem, &dis->rcItem ); + dis->CtlType = dis16->CtlType; + dis->CtlID = dis16->CtlID; + dis->itemID = dis16->itemID; + dis->itemAction = dis16->itemAction; + dis->itemState = dis16->itemState; + dis->hwndItem = (dis->CtlType == ODT_MENU) ? (HWND)HMENU_32(dis16->hwndItem) + : WIN_Handle32( dis16->hwndItem ); + dis->hDC = HDC_32(dis16->hDC); + dis->itemData = dis16->itemData; + dis->rcItem.left = dis16->rcItem.left; + dis->rcItem.top = dis16->rcItem.top; + dis->rcItem.right = dis16->rcItem.right; + dis->rcItem.bottom = dis16->rcItem.bottom; *plparam = (LPARAM)dis; } return 1; @@ -1477,13 +1480,22 @@ INT WINPROC_MapMsg16To32A( HWND hwnd, UINT16 msg16, WPARAM16 wParam16, UINT *pms sizeof(*nc) + sizeof(LPARAM) ); if (!nc) return -1; nc16 = MapSL(*plparam); - CONV_RECT16TO32( &nc16->rgrc[0], &nc->rgrc[0] ); + nc->rgrc[0].left = nc16->rgrc[0].left; + nc->rgrc[0].top = nc16->rgrc[0].top; + nc->rgrc[0].right = nc16->rgrc[0].right; + nc->rgrc[0].bottom = nc16->rgrc[0].bottom; if (wParam16) { nc->lppos = (WINDOWPOS *)HeapAlloc( GetProcessHeap(), 0, sizeof(*nc->lppos) ); - CONV_RECT16TO32( &nc16->rgrc[1], &nc->rgrc[1] ); - CONV_RECT16TO32( &nc16->rgrc[2], &nc->rgrc[2] ); + nc->rgrc[1].left = nc16->rgrc[1].left; + nc->rgrc[1].top = nc16->rgrc[1].top; + nc->rgrc[1].right = nc16->rgrc[1].right; + nc->rgrc[1].bottom = nc16->rgrc[1].bottom; + nc->rgrc[2].left = nc16->rgrc[2].left; + nc->rgrc[2].top = nc16->rgrc[2].top; + nc->rgrc[2].right = nc16->rgrc[2].right; + nc->rgrc[2].bottom = nc16->rgrc[2].bottom; if (nc->lppos) WINDOWPOS16to32( MapSL(nc16->lppos), nc->lppos ); } *(LPARAM *)(nc + 1) = *plparam; /* Store the previous lParam */ @@ -1703,11 +1715,20 @@ LRESULT WINPROC_UnmapMsg16To32A( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar NCCALCSIZE_PARAMS *nc = (NCCALCSIZE_PARAMS *)lParam; lParam = *(LPARAM *)(nc + 1); nc16 = MapSL(lParam); - CONV_RECT32TO16( &nc->rgrc[0], &nc16->rgrc[0] ); + nc16->rgrc[0].left = nc->rgrc[0].left; + nc16->rgrc[0].top = nc->rgrc[0].top; + nc16->rgrc[0].right = nc->rgrc[0].right; + nc16->rgrc[0].bottom = nc->rgrc[0].bottom; if (wParam) { - CONV_RECT32TO16( &nc->rgrc[1], &nc16->rgrc[1] ); - CONV_RECT32TO16( &nc->rgrc[2], &nc16->rgrc[2] ); + nc16->rgrc[1].left = nc->rgrc[1].left; + nc16->rgrc[1].top = nc->rgrc[1].top; + nc16->rgrc[1].right = nc->rgrc[1].right; + nc16->rgrc[1].bottom = nc->rgrc[1].bottom; + nc16->rgrc[2].left = nc->rgrc[2].left; + nc16->rgrc[2].top = nc->rgrc[2].top; + nc16->rgrc[2].right = nc->rgrc[2].right; + nc16->rgrc[2].bottom = nc->rgrc[2].bottom; if (nc->lppos) { WINDOWPOS32to16( nc->lppos, MapSL(nc16->lppos)); @@ -2220,15 +2241,18 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, DRAWITEMSTRUCT *dis32 = (DRAWITEMSTRUCT *)*plparam; DRAWITEMSTRUCT16 *dis = HeapAlloc( GetProcessHeap(), 0, sizeof(DRAWITEMSTRUCT16) ); if (!dis) return -1; - dis->CtlType = (UINT16)dis32->CtlType; - dis->CtlID = (UINT16)dis32->CtlID; - dis->itemID = (UINT16)dis32->itemID; - dis->itemAction = (UINT16)dis32->itemAction; - dis->itemState = (UINT16)dis32->itemState; - dis->hwndItem = HWND_16( dis32->hwndItem ); - dis->hDC = HDC_16(dis32->hDC); - dis->itemData = dis32->itemData; - CONV_RECT32TO16( &dis32->rcItem, &dis->rcItem ); + dis->CtlType = (UINT16)dis32->CtlType; + dis->CtlID = (UINT16)dis32->CtlID; + dis->itemID = (UINT16)dis32->itemID; + dis->itemAction = (UINT16)dis32->itemAction; + dis->itemState = (UINT16)dis32->itemState; + dis->hwndItem = HWND_16( dis32->hwndItem ); + dis->hDC = HDC_16(dis32->hDC); + dis->itemData = dis32->itemData; + dis->rcItem.left = dis32->rcItem.left; + dis->rcItem.top = dis32->rcItem.top; + dis->rcItem.right = dis32->rcItem.right; + dis->rcItem.bottom = dis32->rcItem.bottom; *plparam = MapLS( dis ); } return 1; @@ -2318,12 +2342,21 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, NCCALCSIZE_PARAMS16 *nc = HeapAlloc( GetProcessHeap(), 0, sizeof(*nc) + sizeof(LPARAM)); if (!nc) return -1; - CONV_RECT32TO16( &nc32->rgrc[0], &nc->rgrc[0] ); + nc->rgrc[0].left = nc32->rgrc[0].left; + nc->rgrc[0].top = nc32->rgrc[0].top; + nc->rgrc[0].right = nc32->rgrc[0].right; + nc->rgrc[0].bottom = nc32->rgrc[0].bottom; if (wParam32) { WINDOWPOS16 *wp; - CONV_RECT32TO16( &nc32->rgrc[1], &nc->rgrc[1] ); - CONV_RECT32TO16( &nc32->rgrc[2], &nc->rgrc[2] ); + nc->rgrc[1].left = nc32->rgrc[1].left; + nc->rgrc[1].top = nc32->rgrc[1].top; + nc->rgrc[1].right = nc32->rgrc[1].right; + nc->rgrc[1].bottom = nc32->rgrc[1].bottom; + nc->rgrc[2].left = nc32->rgrc[2].left; + nc->rgrc[2].top = nc32->rgrc[2].top; + nc->rgrc[2].right = nc32->rgrc[2].right; + nc->rgrc[2].bottom = nc32->rgrc[2].bottom; if (!(wp = HeapAlloc( GetProcessHeap(), 0, sizeof(WINDOWPOS16) ))) { HeapFree( GetProcessHeap(), 0, nc ); @@ -2541,10 +2574,15 @@ void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, case CB_GETDROPPEDCONTROLRECT: case LB_GETITEMRECT: { + RECT *r32; RECT16 *rect = MapSL(p16->lParam); UnMapLS( p16->lParam ); p16->lParam = *(LPARAM *)(rect + 1); - CONV_RECT16TO32( rect, (RECT *)(p16->lParam)); + r32 = (RECT *)p16->lParam; + r32->left = rect->left; + r32->top = rect->top; + r32->right = rect->right; + r32->bottom = rect->bottom; HeapFree( GetProcessHeap(), 0, rect ); } break; @@ -2615,13 +2653,22 @@ void WINPROC_UnmapMsg32ATo16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, UnMapLS( p16->lParam ); p16->lParam = *(LPARAM *)(nc + 1); nc32 = (NCCALCSIZE_PARAMS *)(p16->lParam); - CONV_RECT16TO32( &nc->rgrc[0], &nc32->rgrc[0] ); + nc32->rgrc[0].left = nc->rgrc[0].left; + nc32->rgrc[0].top = nc->rgrc[0].top; + nc32->rgrc[0].right = nc->rgrc[0].right; + nc32->rgrc[0].bottom = nc->rgrc[0].bottom; if (p16->wParam) { WINDOWPOS16 *pos = MapSL(nc->lppos); UnMapLS( nc->lppos ); - CONV_RECT16TO32( &nc->rgrc[1], &nc32->rgrc[1] ); - CONV_RECT16TO32( &nc->rgrc[2], &nc32->rgrc[2] ); + nc32->rgrc[1].left = nc->rgrc[1].left; + nc32->rgrc[1].top = nc->rgrc[1].top; + nc32->rgrc[1].right = nc->rgrc[1].right; + nc32->rgrc[1].bottom = nc->rgrc[1].bottom; + nc32->rgrc[2].left = nc->rgrc[2].left; + nc32->rgrc[2].top = nc->rgrc[2].top; + nc32->rgrc[2].right = nc->rgrc[2].right; + nc32->rgrc[2].bottom = nc->rgrc[2].bottom; WINDOWPOS16to32( pos, nc32->lppos ); HeapFree( GetProcessHeap(), 0, pos ); }