[OS/2] Bug 473906: follow-up to Bug 448830 - Split nsInt(Rect|Size|Point|Margin), r=weilbacher

This commit is contained in:
Walter Meinl 2009-01-17 10:08:00 +01:00
Родитель 1f3929b993
Коммит f09156eae0
5 изменённых файлов: 42 добавлений и 42 удалений

Просмотреть файл

@ -4115,7 +4115,7 @@ void nsPluginInstanceOwner::Paint(const nsRect& aDirtyRect, HPS aHPS)
nsPluginWindow * window;
GetWindow(window);
nsIntRect relDirtyRect = nsRect::ToOutsidePixels(aDirtyRect, mOwner->PresContext()->AppUnitsPerDevicePixel());
nsIntRect relDirtyRect = nsRect::ToOutsidePixels(aDirtyRect, mOwner->PresContext()->AppUnitsPerDevPixel());
// we got dirty rectangle in relative window coordinates, but we
// need it in absolute units and in the (left, top, right, bottom) form

Просмотреть файл

@ -93,16 +93,16 @@ void nsFrameWindow::SetWindowListVisibility( PRBool bState)
// Called in the PM thread.
void nsFrameWindow::RealDoCreate( HWND hwndP, nsWindow *aParent,
const nsRect &aRect,
const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell,
nsWidgetInitData *aInitData, HWND hwndO)
{
nsRect rect = aRect;
nsIntRect rect = aRect;
if( aParent) // Offset rect by position of owner
{
nsRect clientRect;
nsIntRect clientRect;
aParent->GetBounds(rect);
aParent->GetClientBounds(clientRect);
rect.x += aRect.x + clientRect.x;
@ -190,7 +190,7 @@ void nsFrameWindow::RealDoCreate( HWND hwndP, nsWindow *aParent,
// Frames have a minimum height based on the pieces they are created with,
// such as titlebar, menubar, frame borders, etc. We need this minimum
// height so we can correctly set the frame position (coordinate flipping).
nsRect frameRect = rect;
nsIntRect frameRect = rect;
long minheight;
if ( fcfFlags & FCF_SIZEBORDER) {
@ -270,7 +270,7 @@ void nsFrameWindow::UpdateClientSize()
mSizeBorder.height = (mBounds.height - mSizeClient.height) / 2;
}
nsresult nsFrameWindow::GetClientBounds( nsRect &aRect)
nsresult nsFrameWindow::GetClientBounds( nsIntRect &aRect)
{
RECTL rcl = { 0, 0, mBounds.width, mBounds.height };
WinCalcFrameRect( mFrameWnd, &rcl, TRUE); // provided == frame rect

Просмотреть файл

@ -64,7 +64,7 @@ class nsFrameWindow : public nsWindow
// So we can create the frame, parent the client & position it right
virtual void RealDoCreate( HWND hwndP, nsWindow *aParent,
const nsRect &aRect,
const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell,
@ -84,7 +84,7 @@ class nsFrameWindow : public nsWindow
void SetWindowListVisibility( PRBool bState);
// We have client
NS_IMETHOD GetClientBounds( nsRect &aRect);
NS_IMETHOD GetClientBounds( nsIntRect &aRect);
friend MRESULT EXPENTRY fnwpFrame( HWND, ULONG, MPARAM, MPARAM);
static BOOL fHiddenWindowCreated;

Просмотреть файл

@ -367,7 +367,7 @@ NS_METHOD nsWindow::EndResizingChildren(void)
return NS_OK;
}
NS_METHOD nsWindow::WidgetToScreen(const nsRect &aOldRect, nsRect &aNewRect)
NS_METHOD nsWindow::WidgetToScreen(const nsIntRect &aOldRect, nsIntRect &aNewRect)
{
POINTL point = { aOldRect.x, aOldRect.y };
NS2PM( point);
@ -381,7 +381,7 @@ NS_METHOD nsWindow::WidgetToScreen(const nsRect &aOldRect, nsRect &aNewRect)
return NS_OK;
}
NS_METHOD nsWindow::ScreenToWidget( const nsRect &aOldRect, nsRect &aNewRect)
NS_METHOD nsWindow::ScreenToWidget( const nsIntRect &aOldRect, nsIntRect &aNewRect)
{
POINTL point = { aOldRect.x,
WinQuerySysValue( HWND_DESKTOP, SV_CYSCREEN) - aOldRect.y - 1 };
@ -401,7 +401,7 @@ NS_METHOD nsWindow::ScreenToWidget( const nsRect &aOldRect, nsRect &aNewRect)
// Initialize an event to dispatch
//
//-------------------------------------------------------------------------
void nsWindow::InitEvent(nsGUIEvent& event, nsPoint* aPoint)
void nsWindow::InitEvent(nsGUIEvent& event, nsIntPoint* aPoint)
{
// if no point was supplied, calculate it
if (nsnull == aPoint) {
@ -794,7 +794,7 @@ MRESULT EXPENTRY fnwpNSWindow( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
// Create(nsNativeWidget...)
//-------------------------------------------------------------------------
void nsWindow::DoCreate( HWND hwndP, nsWindow *aParent,
const nsRect &aRect,
const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell,
@ -859,7 +859,7 @@ void nsWindow::DoCreate( HWND hwndP, nsWindow *aParent,
void nsWindow::RealDoCreate( HWND hwndP,
nsWindow *aParent,
const nsRect &aRect,
const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell,
@ -1003,7 +1003,7 @@ void nsWindow::RealDoCreate( HWND hwndP,
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::Create(nsIWidget *aParent,
const nsRect &aRect,
const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell,
@ -1027,7 +1027,7 @@ NS_METHOD nsWindow::Create(nsIWidget *aParent,
//-------------------------------------------------------------------------
NS_METHOD nsWindow::Create(nsNativeWidget aParent,
const nsRect &aRect,
const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell,
@ -1554,7 +1554,7 @@ NS_METHOD nsWindow::SetFocus(PRBool aRaise)
// Get this component dimension
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::GetBounds(nsRect &aRect)
NS_METHOD nsWindow::GetBounds(nsIntRect &aRect)
{
if (mFrameWnd) {
SWP swp;
@ -1575,7 +1575,7 @@ NS_METHOD nsWindow::GetBounds(nsRect &aRect)
// Get this component dimension
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::GetClientBounds(nsRect &aRect)
NS_METHOD nsWindow::GetClientBounds(nsIntRect &aRect)
{
// nsFrameWindow overrides this...
@ -1588,7 +1588,7 @@ NS_METHOD nsWindow::GetClientBounds(nsRect &aRect)
//get the bounds, but don't take into account the client size
void nsWindow::GetNonClientBounds(nsRect &aRect)
void nsWindow::GetNonClientBounds(nsIntRect &aRect)
{
if (mWnd) {
RECTL r;
@ -2078,7 +2078,7 @@ NS_METHOD nsWindow::Invalidate(PRBool aIsSynchronous)
// Invalidate this component visible area
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::Invalidate(const nsRect &aRect, PRBool aIsSynchronous)
NS_METHOD nsWindow::Invalidate(const nsIntRect &aRect, PRBool aIsSynchronous)
{
if (mWnd)
{
@ -2237,7 +2237,7 @@ void nsWindow::ScrollChildWindows(PRInt32 aX, PRInt32 aY)
{
nsIWidget *child = GetFirstChild();
while (child) {
nsRect rect;
nsIntRect rect;
child->GetBounds(rect);
child->Resize(rect.x + aX, rect.y + aY, rect.width, rect.height, PR_FALSE);
child = child->GetNextSibling();
@ -2249,7 +2249,7 @@ void nsWindow::ScrollChildWindows(PRInt32 aX, PRInt32 aY)
//
//-------------------------------------------------------------------------
//XXX Scroll is obsolete and should go away soon
NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsIntRect *aClipRect)
{
RECTL rcl;
@ -2300,7 +2300,7 @@ NS_IMETHODIMP nsWindow::ScrollWidgets(PRInt32 aDx, PRInt32 aDy)
return NS_OK;
}
NS_IMETHODIMP nsWindow::ScrollRect(nsRect &aRect, PRInt32 aDx, PRInt32 aDy)
NS_IMETHODIMP nsWindow::ScrollRect(nsIntRect &aRect, PRInt32 aDx, PRInt32 aDy)
{
RECTL rcl;
@ -2343,7 +2343,7 @@ BOOL nsWindow::CallMethod(MethodInfo *info)
NS_ASSERTION(info->nArgs == 7, "Wrong number of arguments to CallMethod Create");
DoCreate( (HWND) info->args[0],
(nsWindow*) info->args[1],
(const nsRect&)*(nsRect*) (info->args[2]),
(const nsIntRect&)*(nsIntRect*) (info->args[2]),
(EVENT_CALLBACK) (info->args[3]),
(nsIDeviceContext*) (info->args[4]),
(nsIAppShell*) (info->args[5]),
@ -2430,7 +2430,7 @@ PRBool nsWindow::OnKey(MPARAM mp1, MPARAM mp2)
// Now dispatch a keyup/keydown event. This one is *not* meant to
// have the unicode charcode in.
nsPoint point(0,0);
nsIntPoint point(0,0);
nsKeyEvent event(PR_TRUE, (fsFlags & KC_KEYUP) ? NS_KEY_UP : NS_KEY_DOWN,
this);
InitEvent(event, &point);
@ -2644,7 +2644,7 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc)
{
PRECTL pCursorRect = (PRECTL)mp1;
nsCompositionEvent event(PR_TRUE, NS_COMPOSITION_QUERY, this);
nsPoint point;
nsIntPoint point;
point.x = 0;
point.y = 0;
InitEvent(event,&point);
@ -2739,7 +2739,7 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc)
}
nsKeyEvent event(PR_TRUE, NS_KEY_PRESS, this);
nsPoint point(0,0);
nsIntPoint point(0,0);
InitEvent( event, &point);
event.keyCode = NS_VK_INSERT;
@ -3086,7 +3086,7 @@ PRBool nsWindow::OnPaint()
InitEvent(event);
// build XP rect from in-ex window rect
nsRect rect;
nsIntRect rect;
rect.x = rcl.xLeft;
rect.y = GetClientHeight() - rcl.yTop;
rect.width = rcl.xRight - rcl.xLeft;
@ -3194,7 +3194,7 @@ PRBool nsWindow::DispatchResizeEvent( PRInt32 aX, PRInt32 aY)
{
// call the event callback
nsSizeEvent event(PR_TRUE, NS_SIZE, this);
nsRect rect( 0, 0, aX, aY);
nsIntRect rect( 0, 0, aX, aY);
InitEvent( event);
event.windowSize = ▭ // this is the *client* rectangle
@ -3236,7 +3236,7 @@ PRBool nsWindow::DispatchMouseEvent(PRUint32 aEventType, MPARAM mp1, MPARAM mp2,
ptl.y = (SHORT)SHORT2FROMMP(mp1);
}
PM2NS(ptl);
nsPoint pt( ptl.x, ptl.y);
nsIntPoint pt( ptl.x, ptl.y);
InitEvent( event, &pt);
USHORT usFlags = SHORT2FROMMP( mp2);

Просмотреть файл

@ -109,14 +109,14 @@ class nsWindow : public nsBaseWidget,
// Creation from native (eh?) or widget parent, destroy
NS_IMETHOD Create( nsIWidget *aParent,
const nsRect &aRect,
const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
nsIToolkit *aToolkit = nsnull,
nsWidgetInitData *aInitData = nsnull);
NS_IMETHOD Create( nsNativeWidget aParent,
const nsRect &aRect,
const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell = nsnull,
@ -142,11 +142,11 @@ class nsWindow : public nsBaseWidget,
PRInt32 aWidth,
PRInt32 aHeight,
PRBool aRepaint);
NS_IMETHOD GetClientBounds( nsRect &aRect);
NS_IMETHOD GetClientBounds( nsIntRect &aRect);
NS_IMETHOD Enable( PRBool aState);
NS_IMETHOD IsEnabled(PRBool *aState);
NS_IMETHOD SetFocus(PRBool aRaise);
NS_IMETHOD GetBounds(nsRect &aRect);
NS_IMETHOD GetBounds(nsIntRect &aRect);
NS_IMETHOD IsVisible( PRBool &aState);
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate);
@ -162,8 +162,8 @@ class nsWindow : public nsBaseWidget,
NS_IMETHOD BeginResizingChildren();
NS_IMETHOD EndResizingChildren();
NS_IMETHOD WidgetToScreen( const nsRect &aOldRect, nsRect &aNewRect);
NS_IMETHOD ScreenToWidget( const nsRect &aOldRect, nsRect &aNewRect);
NS_IMETHOD WidgetToScreen( const nsIntRect &aOldRect, nsIntRect &aNewRect);
NS_IMETHOD ScreenToWidget( const nsIntRect &aOldRect, nsIntRect &aNewRect);
NS_IMETHOD DispatchEvent( struct nsGUIEvent *event, nsEventStatus &aStatus);
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent);
@ -180,12 +180,12 @@ class nsWindow : public nsBaseWidget,
NS_IMETHOD SetMenuBar(void * aMenuBar) { return NS_ERROR_FAILURE; }
NS_IMETHOD ShowMenuBar(PRBool aShow) { return NS_ERROR_FAILURE; }
NS_IMETHOD Invalidate( PRBool aIsSynchronous);
NS_IMETHOD Invalidate( const nsRect & aRect, PRBool aIsSynchronous);
NS_IMETHOD Invalidate( const nsIntRect & aRect, PRBool aIsSynchronous);
NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous);
NS_IMETHOD Update();
NS_IMETHOD Scroll( PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect);
NS_IMETHOD Scroll( PRInt32 aDx, PRInt32 aDy, nsIntRect *aClipRect);
NS_IMETHOD ScrollWidgets(PRInt32 aDx, PRInt32 aDy);
NS_IMETHOD ScrollRect(nsRect &aRect, PRInt32 aDx, PRInt32 aDy);
NS_IMETHOD ScrollRect(nsIntRect &aRect, PRInt32 aDx, PRInt32 aDy);
// Get a HWND or a HPS.
virtual void *GetNativeData( PRUint32 aDataType);
@ -284,13 +284,13 @@ protected:
nsRefPtr<gfxOS2Surface> mThebesSurface;
// Implementation ------------------------------
void DoCreate( HWND hwndP, nsWindow *wndP, const nsRect &rect,
void DoCreate( HWND hwndP, nsWindow *wndP, const nsIntRect &rect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext, nsIAppShell *aAppShell,
nsIToolkit *aToolkit, nsWidgetInitData *aInitData);
virtual void RealDoCreate( HWND hwndP, nsWindow *aParent,
const nsRect &aRect,
const nsIntRect &aRect,
EVENT_CALLBACK aHandleEventFunction,
nsIDeviceContext *aContext,
nsIAppShell *aAppShell,
@ -304,7 +304,7 @@ protected:
PRBool ConvertStatus( nsEventStatus aStatus)
{ return aStatus == nsEventStatus_eConsumeNoDefault; }
void InitEvent( nsGUIEvent &event, nsPoint *pt = 0);
void InitEvent( nsGUIEvent &event, nsIntPoint *pt = 0);
virtual PRBool DispatchWindowEvent(nsGUIEvent* event);
virtual PRBool DispatchWindowEvent(nsGUIEvent*event, nsEventStatus &aStatus);
PRBool DispatchStandardEvent( PRUint32 aMsg);
@ -314,7 +314,7 @@ protected:
PRBool aIsContextMenuKey = PR_FALSE,
PRInt16 aButton = nsMouseEvent::eLeftButton);
virtual PRBool DispatchResizeEvent( PRInt32 aClientX, PRInt32 aClientY);
void GetNonClientBounds(nsRect &aRect);
void GetNonClientBounds(nsIntRect &aRect);
void DeferPosition( HWND, HWND, long, long, long, long, ULONG);
void ConstrainZLevel(HWND *aAfter);