Bug 513162 - Widget additions for setting custom chrome margins. r=vlad.

This commit is contained in:
Jim Mathies 2010-06-24 21:01:07 -05:00
Родитель 58df14c00b
Коммит 0d99fdfec8
3 изменённых файлов: 51 добавлений и 15 удалений

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

@ -514,34 +514,50 @@ class nsIWidget : public nsISupports {
/**
* Get this widget's outside dimensions relative to its parent widget
*
* @param aRect on return it holds the x, y, width and height of this widget
*
* @param aRect On return it holds the x, y, width and height of
* this widget.
*/
NS_IMETHOD GetBounds(nsIntRect &aRect) = 0;
/**
* Get this widget's outside dimensions in global coordinates. (One might think this
* could be accomplished by stringing together other methods in this interface, but
* then one would bloody one's nose on different coordinate system handling by different
* platforms.) This includes any title bar on the window.
*
*
* @param aRect on return it holds the x, y, width and height of this widget
* Get this widget's outside dimensions in global coordinates. This
* includes any title bar on the window.
*
* @param aRect On return it holds the x, y, width and height of
* this widget.
*/
NS_IMETHOD GetScreenBounds(nsIntRect &aRect) = 0;
/**
* Get this widget's client area dimensions, if the window has a 3D border appearance
* this returns the area inside the border, The x and y are always zero
*
* @param aRect on return it holds the x. y, width and height of the client area of this widget
* Get this widget's client area dimensions, if the window has a 3D
* border appearance this returns the area inside the border. Origin
* is always zero.
*
* @param aRect On return it holds the x. y, width and height of
* the client area of this widget.
*/
NS_IMETHOD GetClientBounds(nsIntRect &aRect) = 0;
/**
* Get the non-client area dimensions of the window.
*
*/
NS_IMETHOD GetNonClientMargins(nsIntMargin &margins) = 0;
/**
* Sets the non-client area dimensions of the window. Pass -1 to restore
* the system default frame size for that border. Pass zero to remove
* a border, or pass a specific value adjust a border. Units are in
* pixels. (DPI dependent)
*
* Platform notes:
* Windows: shrinking top non-client height will remove application
* icon and window title text. Glass desktops will refuse to set
* dimensions between zero and size < system default.
*
*/
NS_IMETHOD SetNonClientMargins(nsIntMargin &margins) = 0;
/**
* Get the client offset from the window origin.
*

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

@ -783,6 +783,12 @@ NS_METHOD nsBaseWidget::SetWindowClass(const nsAString& xulWinType)
return NS_ERROR_NOT_IMPLEMENTED;
}
//-------------------------------------------------------------------------
//
// Bounds
//
//-------------------------------------------------------------------------
/**
* If the implementation of nsWindow supports borders this method MUST be overridden
*
@ -825,6 +831,18 @@ NS_METHOD nsBaseWidget::SetBounds(const nsIntRect &aRect)
return NS_OK;
}
NS_IMETHODIMP
nsBaseWidget::GetNonClientMargins(nsIntMargin &margins)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsBaseWidget::SetNonClientMargins(nsIntMargin &margins)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_METHOD nsBaseWidget::EnableDragDrop(PRBool aEnable)
{
return NS_OK;

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

@ -148,6 +148,8 @@ public:
virtual ViewWrapper* GetAttachedViewPtr();
NS_IMETHOD SetAttachedViewPtr(ViewWrapper* aViewWrapper);
NS_IMETHOD ResizeClient(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint);
NS_IMETHOD GetNonClientMargins(nsIntMargin &margins);
NS_IMETHOD SetNonClientMargins(nsIntMargin &margins);
/**
* Use this when GetLayerManager() returns a BasicLayerManager