mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Fixed user32.dll so it will compile
svn path=/trunk/; revision=1320
This commit is contained in:
parent
9a1e13b7d8
commit
5c58f80d97
11 changed files with 38 additions and 46 deletions
|
@ -20,9 +20,6 @@
|
|||
#include <user32/widgets.h>
|
||||
#include <user32/debug.h>
|
||||
|
||||
#define MAX(x,y) x > y ? x : y
|
||||
#define MIN(x,y) x < y ? x : y
|
||||
|
||||
#define BUFLIMIT_MULTI 65534 /* maximum buffer size (not including '\0')
|
||||
FIXME: BTW, new specs say 65535 (do you dare ???) */
|
||||
#define BUFLIMIT_SINGLE 766 /* maximum buffer size (not including '\0') */
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
#define MAX_DOS_DRIVES 26
|
||||
|
||||
#define MAX(x,y) x > y ? x : y
|
||||
#define MIN(x,y) x < y ? x : y
|
||||
#define abs(x) ((x) < 0 ? -(x) : (x))
|
||||
|
||||
#define WM_LBTRACKPOINT 0x0131
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
*/
|
||||
|
||||
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -13,9 +13,6 @@
|
|||
#include <user32/syscolor.h>
|
||||
#include <user32/debug.h>
|
||||
|
||||
#define MAX(x,y) x > y ? x : y
|
||||
#define MIN(x,y) x < y ? x : y
|
||||
|
||||
static HBITMAP hUpArrow = 0;
|
||||
static HBITMAP hDnArrow = 0;
|
||||
static HBITMAP hLfArrow = 0;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <user32/win.h>
|
||||
|
||||
WINBOOL
|
||||
STDCALL
|
||||
|
@ -149,10 +150,10 @@ IntersectRect(
|
|||
SetRectEmpty( lprcDst );
|
||||
return FALSE;
|
||||
}
|
||||
lprcDst->left = max( lprcSrc1->left, lprcSrc2->left );
|
||||
lprcDst->right = min( lprcSrc1->right, lprcSrc2->right );
|
||||
lprcDst->top = max( lprcSrc1->top, lprcSrc2->top );
|
||||
lprcDst->bottom = min( lprcSrc1->bottom, lprcSrc2->bottom );
|
||||
lprcDst->left = MAX( lprcSrc1->left, lprcSrc2->left );
|
||||
lprcDst->right = MIN( lprcSrc1->right, lprcSrc2->right );
|
||||
lprcDst->top = MAX( lprcSrc1->top, lprcSrc2->top );
|
||||
lprcDst->bottom = MIN( lprcSrc1->bottom, lprcSrc2->bottom );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -180,10 +181,10 @@ WINBOOL STDCALL UnionRect( LPRECT lprcDst, const RECT *lprcSrc1,
|
|||
*lprcDst = *lprcSrc1;
|
||||
else
|
||||
{
|
||||
lprcDst->left = min( lprcSrc1->left, lprcSrc2->left );
|
||||
lprcDst->right = max( lprcSrc1->right, lprcSrc2->right );
|
||||
lprcDst->top = min( lprcSrc1->top, lprcSrc2->top );
|
||||
lprcDst->bottom = max( lprcSrc1->bottom, lprcSrc2->bottom );
|
||||
lprcDst->left = MIN( lprcSrc1->left, lprcSrc2->left );
|
||||
lprcDst->right = MAX( lprcSrc1->right, lprcSrc2->right );
|
||||
lprcDst->top = MIN( lprcSrc1->top, lprcSrc2->top );
|
||||
lprcDst->bottom = MAX( lprcSrc1->bottom, lprcSrc2->bottom );
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
@ -152,10 +152,10 @@ WINBOOL DCE_GetVisRect( WND *wndPtr, WINBOOL clientArea, RECT *lprect )
|
|||
(lprect->bottom <= wndPtr->rectClient.top) )
|
||||
goto fail;
|
||||
|
||||
lprect->left = max( lprect->left, wndPtr->rectClient.left );
|
||||
lprect->right = min( lprect->right, wndPtr->rectClient.right );
|
||||
lprect->top = max( lprect->top, wndPtr->rectClient.top );
|
||||
lprect->bottom = min( lprect->bottom, wndPtr->rectClient.bottom );
|
||||
lprect->left = MAX( lprect->left, wndPtr->rectClient.left );
|
||||
lprect->right = MIN( lprect->right, wndPtr->rectClient.right );
|
||||
lprect->top = MAX( lprect->top, wndPtr->rectClient.top );
|
||||
lprect->bottom = MIN( lprect->bottom, wndPtr->rectClient.bottom );
|
||||
}
|
||||
OffsetRect( lprect, -xoffset, -yoffset );
|
||||
return TRUE;
|
||||
|
|
|
@ -583,9 +583,9 @@ void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
|
|||
GetTextExtentPointW( hdc, lpitem->text, wcslen(lpitem->text), &szSize );
|
||||
lpitem->rect.right += LOWORD(szSize.cx);
|
||||
if (TWEAK_WineLook == WIN31_LOOK)
|
||||
lpitem->rect.bottom += max( HIWORD(szSize.cy), SYSMETRICS_CYMENU );
|
||||
lpitem->rect.bottom += MAX( HIWORD(szSize.cy), SYSMETRICS_CYMENU );
|
||||
else
|
||||
lpitem->rect.bottom += max(HIWORD(szSize.cy), sysMetrics[SM_CYMENU]- 1);
|
||||
lpitem->rect.bottom += MAX(HIWORD(szSize.cy), sysMetrics[SM_CYMENU]- 1);
|
||||
lpitem->xTab = 0;
|
||||
|
||||
if (menuBar) lpitem->rect.right += MENU_BAR_ITEMS_SPACE;
|
||||
|
@ -645,24 +645,24 @@ void MENU_PopupMenuCalcSize( LPPOPUPMENU lppop, HWND hwndOwner )
|
|||
|
||||
MENU_CalcItemSize( hdc, lpitem, hwndOwner, orgX, orgY, FALSE );
|
||||
if (lpitem->fType & MF_MENUBARBREAK) orgX++;
|
||||
maxX = max( maxX, lpitem->rect.right );
|
||||
maxX = MAX( maxX, lpitem->rect.right );
|
||||
orgY = lpitem->rect.bottom;
|
||||
if (IS_STRING_ITEM(lpitem->fType) && lpitem->xTab)
|
||||
{
|
||||
maxTab = max( maxTab, lpitem->xTab );
|
||||
maxTabWidth = max(maxTabWidth,lpitem->rect.right-lpitem->xTab);
|
||||
maxTab = MAX( maxTab, lpitem->xTab );
|
||||
maxTabWidth = MAX(maxTabWidth,lpitem->rect.right-lpitem->xTab);
|
||||
}
|
||||
}
|
||||
|
||||
/* Finish the column (set all items to the largest width found) */
|
||||
maxX = max( maxX, maxTab + maxTabWidth );
|
||||
maxX = MAX( maxX, maxTab + maxTabWidth );
|
||||
for (lpitem = &lppop->items[start]; start < i; start++, lpitem++)
|
||||
{
|
||||
lpitem->rect.right = maxX;
|
||||
if (IS_STRING_ITEM(lpitem->fType) && lpitem->xTab)
|
||||
lpitem->xTab = maxTab;
|
||||
}
|
||||
lppop->Height = max( lppop->Height, orgY );
|
||||
lppop->Height = MAX( lppop->Height, orgY );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <user32/nc.h>
|
||||
#include <user32/syscolor.h>
|
||||
#include <user32/debug.h>
|
||||
#include <user32/win.h>
|
||||
|
||||
// GetBitmapDimensionEx in NC_DrawMaxButton95 returns TRUE on invalid bitmap
|
||||
|
||||
|
@ -1784,23 +1785,23 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam )
|
|||
SetRect(&mouseRect, 0, 0, SYSMETRICS_CXSCREEN, SYSMETRICS_CYSCREEN);
|
||||
if (ON_LEFT_BORDER(hittest))
|
||||
{
|
||||
mouseRect.left = max( mouseRect.left, sizingRect.right-maxTrack.x );
|
||||
mouseRect.right = min( mouseRect.right, sizingRect.right-minTrack.x );
|
||||
mouseRect.left = MAX( mouseRect.left, sizingRect.right-maxTrack.x );
|
||||
mouseRect.right = MIN( mouseRect.right, sizingRect.right-minTrack.x );
|
||||
}
|
||||
else if (ON_RIGHT_BORDER(hittest))
|
||||
{
|
||||
mouseRect.left = max( mouseRect.left, sizingRect.left+minTrack.x );
|
||||
mouseRect.right = min( mouseRect.right, sizingRect.left+maxTrack.x );
|
||||
mouseRect.left = MAX( mouseRect.left, sizingRect.left+minTrack.x );
|
||||
mouseRect.right = MIN( mouseRect.right, sizingRect.left+maxTrack.x );
|
||||
}
|
||||
if (ON_TOP_BORDER(hittest))
|
||||
{
|
||||
mouseRect.top = max( mouseRect.top, sizingRect.bottom-maxTrack.y );
|
||||
mouseRect.bottom = min( mouseRect.bottom,sizingRect.bottom-minTrack.y);
|
||||
mouseRect.top = MAX( mouseRect.top, sizingRect.bottom-maxTrack.y );
|
||||
mouseRect.bottom = MIN( mouseRect.bottom,sizingRect.bottom-minTrack.y);
|
||||
}
|
||||
else if (ON_BOTTOM_BORDER(hittest))
|
||||
{
|
||||
mouseRect.top = max( mouseRect.top, sizingRect.top+minTrack.y );
|
||||
mouseRect.bottom = min( mouseRect.bottom, sizingRect.top+maxTrack.y );
|
||||
mouseRect.top = MAX( mouseRect.top, sizingRect.top+minTrack.y );
|
||||
mouseRect.bottom = MIN( mouseRect.bottom, sizingRect.top+maxTrack.y );
|
||||
}
|
||||
if (wndPtr->dwStyle & WS_CHILD)
|
||||
{
|
||||
|
@ -1858,10 +1859,10 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam )
|
|||
case VK_RIGHT: pt.x += 8; break;
|
||||
}
|
||||
|
||||
pt.x = max( pt.x, mouseRect.left );
|
||||
pt.x = min( pt.x, mouseRect.right );
|
||||
pt.y = max( pt.y, mouseRect.top );
|
||||
pt.y = min( pt.y, mouseRect.bottom );
|
||||
pt.x = MAX( pt.x, mouseRect.left );
|
||||
pt.x = MIN( pt.x, mouseRect.right );
|
||||
pt.y = MAX( pt.y, mouseRect.top );
|
||||
pt.y = MIN( pt.y, mouseRect.bottom );
|
||||
|
||||
dx = pt.x - capturePoint.x;
|
||||
dy = pt.y - capturePoint.y;
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <user32/debug.h>
|
||||
|
||||
#define MAKEINTRESOURCEA(x) "x"
|
||||
#define MAX(x,y) x > y ? x : y
|
||||
|
||||
static HBITMAP hUpArrow = 0;
|
||||
static HBITMAP hDnArrow = 0;
|
||||
|
|
|
@ -415,9 +415,9 @@ void WINPOS_GetMinMaxInfo( WND *wndPtr, POINT *maxSize, POINT *maxPos,
|
|||
/* Some sanity checks */
|
||||
|
||||
|
||||
MinMax.ptMaxTrackSize.x = max( MinMax.ptMaxTrackSize.x,
|
||||
MinMax.ptMaxTrackSize.x = MAX( MinMax.ptMaxTrackSize.x,
|
||||
MinMax.ptMinTrackSize.x );
|
||||
MinMax.ptMaxTrackSize.y = max( MinMax.ptMaxTrackSize.y,
|
||||
MinMax.ptMaxTrackSize.y = MAX( MinMax.ptMaxTrackSize.y,
|
||||
MinMax.ptMinTrackSize.y );
|
||||
|
||||
if (maxSize) *maxSize = MinMax.ptMaxSize;
|
||||
|
@ -885,8 +885,8 @@ LONG WINPOS_HandleWindowPosChanging( WND *wndPtr, WINDOWPOS *winpos )
|
|||
((wndPtr->dwStyle & (WS_POPUP | WS_CHILD)) == 0))
|
||||
{
|
||||
WINPOS_GetMinMaxInfo( wndPtr, &maxSize, NULL, NULL, NULL );
|
||||
winpos->cx = min( winpos->cx, maxSize.x );
|
||||
winpos->cy = min( winpos->cy, maxSize.y );
|
||||
winpos->cx = MIN( winpos->cx, maxSize.x );
|
||||
winpos->cy = MIN( winpos->cy, maxSize.y );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ LRESULT CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message,WPARAM wParam, LPARAM l
|
|||
lRet = DrawTextA( hdc, lpmb->lpszText, -1, &rect,
|
||||
DT_LEFT | DT_EXPANDTABS | DT_WORDBREAK | DT_CALCRECT);
|
||||
theight = rect.bottom - rect.top;
|
||||
tiheight = 16 + max(iheight, theight);
|
||||
tiheight = 16 + MAX(iheight, theight);
|
||||
ReleaseDC(hItem, hdc);
|
||||
|
||||
/* Position the text */
|
||||
|
|
Loading…
Reference in a new issue