From 2fc149e1f3be431d193edf1dbeffcd8a3192a783 Mon Sep 17 00:00:00 2001 From: "pavlov%netscape.com" Date: Wed, 14 Mar 2001 01:14:23 +0000 Subject: [PATCH] make getRect pass out an nsrect& --- gfx/idl/gfxIImageFrame.idl | 4 +++- gfx/idl/gfxtypes.idl | 1 - gfx/public/gfxIImageFrame.idl | 4 +++- gfx/public/gfxtypes.idl | 1 - gfx/src/shared/gfxImageFrame.cpp | 8 ++++---- gfx2/public/gfxIImageFrame.idl | 4 +++- gfx2/public/gfxtypes.idl | 1 - gfx2/src/gfxImageFrame.cpp | 8 ++++---- 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/gfx/idl/gfxIImageFrame.idl b/gfx/idl/gfxIImageFrame.idl index 027f6c80a7c0..e3893a7f5af4 100644 --- a/gfx/idl/gfxIImageFrame.idl +++ b/gfx/idl/gfxIImageFrame.idl @@ -31,6 +31,7 @@ %} interface gfxIImageFrame; +native nsRectRef(nsRect &); /** * gfxIImageFrame interface @@ -92,8 +93,9 @@ interface gfxIImageFrame : nsISupports /** * The rectangle this frame ocupies. + * @param rect this is really an out parameter. */ - [noscript] readonly attribute nsRect rect; + [noscript] void getRect(in nsRectRef rect); /** * The image data format the image was created with. diff --git a/gfx/idl/gfxtypes.idl b/gfx/idl/gfxtypes.idl index 7e5d05f88b2e..2b5d9dec9ed6 100644 --- a/gfx/idl/gfxtypes.idl +++ b/gfx/idl/gfxtypes.idl @@ -33,5 +33,4 @@ typedef PRInt32 nscoord; [ptr] native nsRect(nsRect); -[ref] native nsRectRef(nsRect); diff --git a/gfx/public/gfxIImageFrame.idl b/gfx/public/gfxIImageFrame.idl index 027f6c80a7c0..e3893a7f5af4 100644 --- a/gfx/public/gfxIImageFrame.idl +++ b/gfx/public/gfxIImageFrame.idl @@ -31,6 +31,7 @@ %} interface gfxIImageFrame; +native nsRectRef(nsRect &); /** * gfxIImageFrame interface @@ -92,8 +93,9 @@ interface gfxIImageFrame : nsISupports /** * The rectangle this frame ocupies. + * @param rect this is really an out parameter. */ - [noscript] readonly attribute nsRect rect; + [noscript] void getRect(in nsRectRef rect); /** * The image data format the image was created with. diff --git a/gfx/public/gfxtypes.idl b/gfx/public/gfxtypes.idl index 7e5d05f88b2e..2b5d9dec9ed6 100644 --- a/gfx/public/gfxtypes.idl +++ b/gfx/public/gfxtypes.idl @@ -33,5 +33,4 @@ typedef PRInt32 nscoord; [ptr] native nsRect(nsRect); -[ref] native nsRectRef(nsRect); diff --git a/gfx/src/shared/gfxImageFrame.cpp b/gfx/src/shared/gfxImageFrame.cpp index b6759c49b6e0..599cb1f9ffaa 100644 --- a/gfx/src/shared/gfxImageFrame.cpp +++ b/gfx/src/shared/gfxImageFrame.cpp @@ -152,14 +152,14 @@ NS_IMETHODIMP gfxImageFrame::GetHeight(nscoord *aHeight) return NS_OK; } -/* readonly attribute nsRect rect; */ -NS_IMETHODIMP gfxImageFrame::GetRect(nsRect **aRect) +/* void getRect(in nsRectRef rect); */ +NS_IMETHODIMP gfxImageFrame::GetRect(nsRect &aRect) { if (!mInitalized) return NS_ERROR_NOT_INITIALIZED; - nsRect rect(mOffset.x, mOffset.y, mSize.width, mSize.height); - *aRect = ▭ + aRect.SetRect(mOffset.x, mOffset.y, mSize.width, mSize.height); + return NS_OK; } diff --git a/gfx2/public/gfxIImageFrame.idl b/gfx2/public/gfxIImageFrame.idl index 027f6c80a7c0..e3893a7f5af4 100644 --- a/gfx2/public/gfxIImageFrame.idl +++ b/gfx2/public/gfxIImageFrame.idl @@ -31,6 +31,7 @@ %} interface gfxIImageFrame; +native nsRectRef(nsRect &); /** * gfxIImageFrame interface @@ -92,8 +93,9 @@ interface gfxIImageFrame : nsISupports /** * The rectangle this frame ocupies. + * @param rect this is really an out parameter. */ - [noscript] readonly attribute nsRect rect; + [noscript] void getRect(in nsRectRef rect); /** * The image data format the image was created with. diff --git a/gfx2/public/gfxtypes.idl b/gfx2/public/gfxtypes.idl index 7e5d05f88b2e..2b5d9dec9ed6 100644 --- a/gfx2/public/gfxtypes.idl +++ b/gfx2/public/gfxtypes.idl @@ -33,5 +33,4 @@ typedef PRInt32 nscoord; [ptr] native nsRect(nsRect); -[ref] native nsRectRef(nsRect); diff --git a/gfx2/src/gfxImageFrame.cpp b/gfx2/src/gfxImageFrame.cpp index b6759c49b6e0..599cb1f9ffaa 100644 --- a/gfx2/src/gfxImageFrame.cpp +++ b/gfx2/src/gfxImageFrame.cpp @@ -152,14 +152,14 @@ NS_IMETHODIMP gfxImageFrame::GetHeight(nscoord *aHeight) return NS_OK; } -/* readonly attribute nsRect rect; */ -NS_IMETHODIMP gfxImageFrame::GetRect(nsRect **aRect) +/* void getRect(in nsRectRef rect); */ +NS_IMETHODIMP gfxImageFrame::GetRect(nsRect &aRect) { if (!mInitalized) return NS_ERROR_NOT_INITIALIZED; - nsRect rect(mOffset.x, mOffset.y, mSize.width, mSize.height); - *aRect = ▭ + aRect.SetRect(mOffset.x, mOffset.y, mSize.width, mSize.height); + return NS_OK; }