Bug 393117 - Remove native resize API. r=josh r=mconnor sr+a1.9=pav

This commit is contained in:
cbarrett@mozilla.com 2007-08-24 18:55:28 -07:00
parent 5c53461a8a
commit 89e9e66fb7
10 changed files with 10 additions and 124 deletions

View File

@ -21,7 +21,6 @@
*
* Contributor(s):
* Johnny Stenback <jst@netscape.com> (original author)
* Josh Aas <josh@mozilla.com> (animation API)
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
@ -41,26 +40,22 @@
interface nsIBrowserDOMWindow;
[scriptable, uuid(E3985A99-F9D6-4576-8EF8-9A5DCE42EFFA)]
[scriptable, uuid(847fac33-48a8-4360-bfbc-6bb96245404d)]
interface nsIDOMChromeWindow : nsISupports
{
const unsigned short STATE_MAXIMIZED = 1;
const unsigned short STATE_MINIMIZED = 2;
const unsigned short STATE_NORMAL = 3;
const unsigned short RESIZE_ANIMATION_OFF = 0;
const unsigned short RESIZE_ANIMATION_SLIDE = 1;
attribute unsigned short animatedResize;
attribute DOMString title;
readonly attribute unsigned short windowState;
attribute DOMString title;
readonly attribute unsigned short windowState;
/**
* browserDOMWindow provides access to yet another layer of
* utility functions implemented by chrome script. It will be null
* for DOMWindows not corresponding to browsers.
*/
attribute nsIBrowserDOMWindow browserDOMWindow;
attribute nsIBrowserDOMWindow browserDOMWindow;
void getAttention();

View File

@ -7927,30 +7927,6 @@ nsGlobalChromeWindow::SetTitle(const nsAString& aTitle)
return nsdoc->SetTitle(aTitle);
}
// returns NS_ERROR_NOT_IMPLEMENTED if animation is not implemented on widget
// or platform
NS_IMETHODIMP
nsGlobalChromeWindow::SetAnimatedResize(PRUint16 aAnimation)
{
nsCOMPtr<nsIWidget> widget = GetMainWidget();
if (!widget)
return NS_ERROR_FAILURE;
return widget->SetAnimatedResize(aAnimation);
}
// returns NS_ERROR_NOT_IMPLEMENTED if animation is not implemented on widget
// or platform
NS_IMETHODIMP
nsGlobalChromeWindow::GetAnimatedResize(PRUint16* aAnimation)
{
nsCOMPtr<nsIWidget> widget = GetMainWidget();
if (!widget)
return NS_ERROR_FAILURE;
return widget->GetAnimatedResize(aAnimation);
}
NS_IMETHODIMP
nsGlobalChromeWindow::GetWindowState(PRUint16* aWindowState)
{

View File

@ -744,20 +744,8 @@
// Don't let the new pane content flex to the current window
// height if we're animating
aPaneElement.removeAttribute("flex");
#ifdef XP_MACOSX
try {
window.animatedResize = window.RESIZE_ANIMATION_SLIDE;
// New height is the new pane's size plus the size of the pane selection bar
var newHeight = aPaneElement.contentHeight + (window.innerHeight - oldPane.contentHeight);
window.innerHeight = newHeight;
this._currentHeight = newHeight;
window.animatedResize = window.RESIZE_ANIMATION_OFF;
}
catch (e) { }
#else
aPaneElement.style.opacity = 0.0;
this.animate(oldPane, aPaneElement);
#endif
}
}
break;

View File

@ -95,11 +95,11 @@ typedef nsEventStatus (*PR_CALLBACK EVENT_CALLBACK)(nsGUIEvent *event);
#define NS_NATIVE_PLUGIN_PORT_CG 101
#endif
// B3F10C8D-4C07-4B1E-A1CD-B38696426205
#define NS_IWIDGET_IID \
{ 0xB3F10C8D, 0x4C07, 0x4B1E, \
{ 0xA1, 0xCD, 0xB3, 0x86, 0x96, 0x42, 0x62, 0x05 } }
// f60fa720-a9bc-4fd3-b863-812496fa85e6
#define NS_IWIDGET_IID \
{ 0xf60fa720, 0xa9bc, 0x4fd3, \
{ 0xb8, 0x63, 0x81, 0x24, 0x96, 0xfa, 0x85, 0xe6 } }
// Hide the native window systems real window type so as to avoid
// including native window system types and api's. This is necessary
@ -1016,24 +1016,6 @@ class nsIWidget : public nsISupports {
*/
virtual gfxASurface *GetThebesSurface() = 0;
/**
* Set a flag that makes any window resizes use native window animation.
* Ignored on any OS that doesn't support native animation.
*
* @param aAnimate Whether or not you want resizes to be animated.
* @return NS_ERROR_NOT_IMPLEMENTED if not implemented on widget or platform
*/
NS_IMETHOD SetAnimatedResize(PRUint16 aAnimation) = 0;
/**
* Get a flag that controls native window animation.
* Ignored on any OS that doesn't support native animation.
*
* @param aAnimate Whether or not resizes are animated.
* @return NS_ERROR_NOT_IMPLEMENTED if not implemented on widget or platform
*/
NS_IMETHOD GetAnimatedResize(PRUint16* aAnimation) = 0;
protected:
// keep the list of children. We also keep track of our siblings.
// The ownership model is as follows: parent holds a strong ref to

View File

@ -297,9 +297,6 @@ public:
NS_IMETHOD GetAttention(PRInt32 aCycleCount);
NS_IMETHOD SetAnimatedResize(PRUint16 aAnimation);
NS_IMETHOD GetAnimatedResize(PRUint16* aAnimation);
// nsIPluginWidget
NS_IMETHOD GetPluginClipRect(nsRect& outClipRect, nsPoint& outOrigin, PRBool& outWidgetVisible);
NS_IMETHOD StartDrawPlugin();

View File

@ -1560,18 +1560,6 @@ NS_IMETHODIMP nsChildView::GetAttention(PRInt32 aCycleCount)
}
NS_IMETHODIMP nsChildView::SetAnimatedResize(PRUint16 aAnimation)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChildView::GetAnimatedResize(PRUint16* aAnimation)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
#pragma mark -

View File

@ -190,8 +190,6 @@ public:
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus) ;
NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent);
NS_IMETHOD GetAttention(PRInt32 aCycleCount);
NS_IMETHOD SetAnimatedResize(PRUint16 aAnimation);
NS_IMETHOD GetAnimatedResize(PRUint16* aAnimation);
virtual gfxASurface* GetThebesSurface();
@ -213,8 +211,7 @@ protected:
WindowDelegate* mDelegate; // our delegate for processing window msgs [STRONG]
nsCOMPtr<nsIMenuBar> mMenuBar;
NSWindow* mSheetWindowParent; // if this is a sheet, this is the NSWindow it's attached to
nsChildView* mPopupContentView; // if this is a popup, this is its content widget
PRUint16 mAnimation; // the type of animation we will use when resizing
nsChildView* mPopupContentView; // if this is a popup, this is its content widget
PRPackedBool mIsResizing; // we originated the resize, prevent infinite recursion
PRPackedBool mWindowMadeHere; // true if we created the window, false for embedding

View File

@ -51,8 +51,6 @@
#include "nsIXULWindow.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIDOMChromeWindow.h"
#include "unistd.h"
// defined in nsMenuBarX.mm
extern NSMenu* sApplicationMenu; // Application menu shared by all menubars
@ -92,7 +90,6 @@ nsCocoaWindow::nsCocoaWindow()
, mDelegate(nil)
, mSheetWindowParent(nil)
, mPopupContentView(nil)
, mAnimation(nsIDOMChromeWindow::RESIZE_ANIMATION_OFF)
, mIsResizing(PR_FALSE)
, mWindowMadeHere(PR_FALSE)
, mVisible(PR_FALSE)
@ -772,14 +769,7 @@ NS_IMETHODIMP nsCocoaWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRep
newFrame.size.height = newHeight;
StartResizing();
if (mAnimation == nsIDOMChromeWindow::RESIZE_ANIMATION_SLIDE) {
[[mWindow contentView] setHidden:YES];
[mWindow setFrame:newFrame display:YES animate:YES];
[[mWindow contentView] setHidden:NO];
}
else {
[mWindow setFrame:newFrame display:NO];
}
[mWindow setFrame:newFrame display:NO];
StopResizing();
}
@ -1069,19 +1059,6 @@ NS_IMETHODIMP nsCocoaWindow::GetAttention(PRInt32 aCycleCount)
}
NS_IMETHODIMP nsCocoaWindow::SetAnimatedResize(PRUint16 aAnimation)
{
mAnimation = aAnimation;
return NS_OK;
}
NS_IMETHODIMP nsCocoaWindow::GetAnimatedResize(PRUint16* aAnimation)
{
*aAnimation = mAnimation;
return NS_OK;
}
gfxASurface* nsCocoaWindow::GetThebesSurface()
{
if (mPopupContentView)

View File

@ -846,18 +846,6 @@ nsBaseWidget::SetIcon(const nsAString&)
return NS_OK;
}
NS_IMETHODIMP
nsBaseWidget::SetAnimatedResize(PRUint16 aAnimation)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsBaseWidget::GetAnimatedResize(PRUint16* aAnimation)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/**
* Modifies aFile to point at an icon file with the given name and suffix. The
* suffix may correspond to a file extension with leading '.' if appropriate.

View File

@ -131,8 +131,6 @@ public:
NS_IMETHOD GetAttention(PRInt32 aCycleCount);
NS_IMETHOD GetLastInputEventTime(PRUint32& aTime);
NS_IMETHOD SetIcon(const nsAString &anIconSpec);
NS_IMETHOD SetAnimatedResize(PRUint16 aAnimation);
NS_IMETHOD GetAnimatedResize(PRUint16* aAnimation);
virtual void ConvertToDeviceCoordinates(nscoord &aX,nscoord &aY) {}
virtual void FreeNativeData(void * data, PRUint32 aDataType) {}//~~~