зеркало из https://github.com/mozilla/gecko-dev.git
Bug 474187 - Qt port broken in widget follow up to bug448830 split nsIntRect. r=roc
This commit is contained in:
Родитель
c1dcb1a673
Коммит
b007b3a3bb
|
@ -281,7 +281,7 @@ NS_IMETHODIMP
|
|||
nsNativeThemeQt::GetWidgetBorder(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsMargin* aResult)
|
||||
nsIntMargin* aResult)
|
||||
{
|
||||
(*aResult).top = (*aResult).bottom = (*aResult).left = (*aResult).right = 0;
|
||||
|
||||
|
@ -303,7 +303,7 @@ nsNativeThemeQt::GetWidgetBorder(nsIDeviceContext* aContext,
|
|||
PRBool
|
||||
nsNativeThemeQt::GetWidgetPadding(nsIDeviceContext* ,
|
||||
nsIFrame*, PRUint8 aWidgetType,
|
||||
nsMargin* aResult)
|
||||
nsIntMargin* aResult)
|
||||
{
|
||||
// XXX: Where to get padding values, framewidth?
|
||||
if (aWidgetType == NS_THEME_TEXTFIELD ||
|
||||
|
@ -319,7 +319,7 @@ nsNativeThemeQt::GetWidgetPadding(nsIDeviceContext* ,
|
|||
NS_IMETHODIMP
|
||||
nsNativeThemeQt::GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsSize* aResult, PRBool* aIsOverridable)
|
||||
nsIntSize* aResult, PRBool* aIsOverridable)
|
||||
{
|
||||
(*aResult).width = (*aResult).height = 0;
|
||||
*aIsOverridable = PR_TRUE;
|
||||
|
|
|
@ -71,11 +71,11 @@ public:
|
|||
NS_IMETHOD GetWidgetBorder(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsMargin* aResult);
|
||||
nsIntMargin* aResult);
|
||||
|
||||
NS_IMETHOD GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsSize* aResult,
|
||||
nsIntSize* aResult,
|
||||
PRBool* aIsOverridable);
|
||||
|
||||
NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType,
|
||||
|
@ -92,7 +92,7 @@ public:
|
|||
virtual NS_HIDDEN_(PRBool) GetWidgetPadding(nsIDeviceContext* aContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType,
|
||||
nsMargin* aResult);
|
||||
nsIntMargin* aResult);
|
||||
|
||||
NS_IMETHOD_(PRBool) ThemeDrawsFocusForWidget(nsPresContext* aPresContext,
|
||||
nsIFrame* aFrame, PRUint8 aWidgetType);
|
||||
|
|
|
@ -248,7 +248,7 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsWindow, nsBaseWidget, nsISupportsWeakReference)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
const nsIntRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell,
|
||||
|
@ -264,7 +264,7 @@ nsWindow::Create(nsIWidget *aParent,
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
const nsIntRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell,
|
||||
|
@ -416,7 +416,7 @@ nsWindow::Move(PRInt32 aX, PRInt32 aY)
|
|||
QPoint pos(aX, aY);
|
||||
if (mDrawingArea) {
|
||||
if (mParent && mDrawingArea->windowType() == Qt::Popup) {
|
||||
nsRect oldrect, newrect;
|
||||
nsIntRect oldrect, newrect;
|
||||
oldrect.x = aX;
|
||||
oldrect.y = aY;
|
||||
|
||||
|
@ -586,9 +586,9 @@ nsWindow::SetFocus(PRBool aRaise)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::GetScreenBounds(nsRect &aRect)
|
||||
nsWindow::GetScreenBounds(nsIntRect &aRect)
|
||||
{
|
||||
nsRect origin(0, 0, mBounds.width, mBounds.height);
|
||||
nsIntRect origin(0, 0, mBounds.width, mBounds.height);
|
||||
WidgetToScreen(origin, aRect);
|
||||
LOG(("GetScreenBounds %d %d | %d %d | %d %d\n",
|
||||
aRect.x, aRect.y,
|
||||
|
@ -708,7 +708,7 @@ nsWindow::Invalidate(PRBool aIsSynchronous)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::Invalidate(const nsRect &aRect,
|
||||
nsWindow::Invalidate(const nsIntRect &aRect,
|
||||
PRBool aIsSynchronous)
|
||||
{
|
||||
LOGDRAW(("Invalidate (rect) [%p,%p]: %d %d %d %d (sync: %d)\n", (void *)this,
|
||||
|
@ -774,7 +774,7 @@ nsWindow::SetColorMap(nsColorMap *aColorMap)
|
|||
NS_IMETHODIMP
|
||||
nsWindow::Scroll(PRInt32 aDx,
|
||||
PRInt32 aDy,
|
||||
nsRect *aClipRect)
|
||||
nsIntRect *aClipRect)
|
||||
{
|
||||
if (!mDrawingArea)
|
||||
return NS_OK;
|
||||
|
@ -783,7 +783,7 @@ nsWindow::Scroll(PRInt32 aDx,
|
|||
|
||||
// Update bounds on our child windows
|
||||
for (nsIWidget* kid = mFirstChild; kid; kid = kid->GetNextSibling()) {
|
||||
nsRect bounds;
|
||||
nsIntRect bounds;
|
||||
kid->GetBounds(bounds);
|
||||
bounds.x += aDx;
|
||||
bounds.y += aDy;
|
||||
|
@ -806,7 +806,7 @@ nsWindow::ScrollWidgets(PRInt32 aDx,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::ScrollRect(nsRect &aSrcRect,
|
||||
nsWindow::ScrollRect(nsIntRect &aSrcRect,
|
||||
PRInt32 aDx,
|
||||
PRInt32 aDy)
|
||||
{
|
||||
|
@ -914,7 +914,7 @@ nsWindow::ShowMenuBar(PRBool aShow)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect)
|
||||
nsWindow::WidgetToScreen(const nsIntRect& aOldRect, nsIntRect& aNewRect)
|
||||
{
|
||||
NS_ENSURE_TRUE(mDrawingArea, NS_OK);
|
||||
|
||||
|
@ -930,7 +930,7 @@ nsWindow::WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWindow::ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect)
|
||||
nsWindow::ScreenToWidget(const nsIntRect& aOldRect, nsIntRect& aNewRect)
|
||||
{
|
||||
NS_ENSURE_TRUE(mDrawingArea, NS_OK);
|
||||
|
||||
|
@ -1174,7 +1174,7 @@ nsWindow::OnPaintEvent(QPaintEvent *aEvent)
|
|||
QRect r = aEvent->rect();
|
||||
if (!r.isValid())
|
||||
r = mDrawingArea->rect();
|
||||
nsRect rect(r.x(), r.y(), r.width(), r.height());
|
||||
nsIntRect rect(r.x(), r.y(), r.width(), r.height());
|
||||
event.refPoint.x = aEvent->rect().x();
|
||||
event.refPoint.y = aEvent->rect().y();
|
||||
event.rect = ▭ // was null FIXME
|
||||
|
@ -1225,7 +1225,7 @@ nsWindow::OnMoveEvent(QMoveEvent *aEvent)
|
|||
QPoint pos = aEvent->pos();
|
||||
if (mIsTopLevel) {
|
||||
// Need to translate this into the right coordinates
|
||||
nsRect oldrect, newrect;
|
||||
nsIntRect oldrect, newrect;
|
||||
WidgetToScreen(oldrect, newrect);
|
||||
mBounds.x = newrect.x;
|
||||
mBounds.y = newrect.y;
|
||||
|
@ -1244,7 +1244,7 @@ nsWindow::OnMoveEvent(QMoveEvent *aEvent)
|
|||
nsEventStatus
|
||||
nsWindow::OnResizeEvent(QResizeEvent *e)
|
||||
{
|
||||
nsRect rect;
|
||||
nsIntRect rect;
|
||||
|
||||
// Generate XPFE resize event
|
||||
GetBounds(rect);
|
||||
|
@ -1634,7 +1634,7 @@ nsWindow::showEvent(QShowEvent *)
|
|||
// qDebug("FIXME:>>>>>>Func:%s::%d\n", __PRETTY_FUNCTION__, __LINE__);
|
||||
/*
|
||||
QRect r = mDrawingArea->rect();
|
||||
nsRect rect(r.x(), r.y(), r.width(), r.height());
|
||||
nsIntRect rect(r.x(), r.y(), r.width(), r.height());
|
||||
|
||||
nsCOMPtr<nsIRenderingContext> rc = getter_AddRefs(GetRenderingContext());
|
||||
// Generate XPFE paint event
|
||||
|
@ -1774,7 +1774,7 @@ GetBrandName(nsXPIDLString& brandName)
|
|||
nsresult
|
||||
nsWindow::NativeCreate(nsIWidget *aParent,
|
||||
nsNativeWidget aNativeParent,
|
||||
const nsRect &aRect,
|
||||
const nsIntRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell,
|
||||
|
@ -1899,7 +1899,7 @@ nsWindow::NativeResize(PRInt32 aX, PRInt32 aY,
|
|||
if (mDrawingArea)
|
||||
{
|
||||
if (mParent && mDrawingArea->windowType() == Qt::Popup) {
|
||||
nsRect oldrect, newrect;
|
||||
nsIntRect oldrect, newrect;
|
||||
oldrect.x = aX;
|
||||
oldrect.y = aY;
|
||||
|
||||
|
@ -2190,7 +2190,7 @@ void
|
|||
key_event_to_context_menu_event(nsMouseEvent &aEvent,
|
||||
QKeyEvent *aGdkEvent)
|
||||
{
|
||||
aEvent.refPoint = nsPoint(0, 0);
|
||||
aEvent.refPoint = nsIntPoint(0, 0);
|
||||
aEvent.isShift = PR_FALSE;
|
||||
aEvent.isControl = PR_FALSE;
|
||||
aEvent.isAlt = PR_FALSE;
|
||||
|
@ -2442,7 +2442,7 @@ nsWindow::DispatchDeactivateEvent(void)
|
|||
}
|
||||
|
||||
void
|
||||
nsWindow::DispatchResizeEvent(nsRect &aRect, nsEventStatus &aStatus)
|
||||
nsWindow::DispatchResizeEvent(nsIntRect &aRect, nsEventStatus &aStatus)
|
||||
{
|
||||
nsSizeEvent event(PR_TRUE, NS_SIZE, this);
|
||||
|
||||
|
@ -2531,7 +2531,7 @@ nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight,
|
|||
// XXXvlad what?
|
||||
#if 0
|
||||
if (mParent && mDrawingArea->windowType() == Qt::Popup) {
|
||||
nsRect oldrect, newrect;
|
||||
nsIntRect oldrect, newrect;
|
||||
oldrect.x = aX;
|
||||
oldrect.y = aY;
|
||||
|
||||
|
|
|
@ -121,14 +121,14 @@ public:
|
|||
//
|
||||
|
||||
NS_IMETHOD Create(nsIWidget *aParent,
|
||||
const nsRect &aRect,
|
||||
const nsIntRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell,
|
||||
nsIToolkit *aToolkit,
|
||||
nsWidgetInitData *aInitData);
|
||||
NS_IMETHOD Create(nsNativeWidget aParent,
|
||||
const nsRect &aRect,
|
||||
const nsIntRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell,
|
||||
|
@ -160,7 +160,7 @@ public:
|
|||
NS_IMETHOD SetSizeMode(PRInt32 aMode);
|
||||
NS_IMETHOD Enable(PRBool aState);
|
||||
NS_IMETHOD SetFocus(PRBool aRaise = PR_FALSE);
|
||||
NS_IMETHOD GetScreenBounds(nsRect &aRect);
|
||||
NS_IMETHOD GetScreenBounds(nsIntRect &aRect);
|
||||
NS_IMETHOD SetForegroundColor(const nscolor &aColor);
|
||||
NS_IMETHOD SetBackgroundColor(const nscolor &aColor);
|
||||
NS_IMETHOD SetCursor(nsCursor aCursor);
|
||||
|
@ -172,7 +172,7 @@ public:
|
|||
NS_IMETHOD MakeFullScreen(PRBool aFullScreen);
|
||||
NS_IMETHOD Validate();
|
||||
NS_IMETHOD Invalidate(PRBool aIsSynchronous);
|
||||
NS_IMETHOD Invalidate(const nsRect &aRect,
|
||||
NS_IMETHOD Invalidate(const nsIntRect &aRect,
|
||||
PRBool aIsSynchronous);
|
||||
NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion,
|
||||
PRBool aIsSynchronous);
|
||||
|
@ -180,10 +180,10 @@ public:
|
|||
NS_IMETHOD SetColorMap(nsColorMap *aColorMap);
|
||||
NS_IMETHOD Scroll(PRInt32 aDx,
|
||||
PRInt32 aDy,
|
||||
nsRect *aClipRect);
|
||||
nsIntRect *aClipRect);
|
||||
NS_IMETHOD ScrollWidgets(PRInt32 aDx,
|
||||
PRInt32 aDy);
|
||||
NS_IMETHOD ScrollRect(nsRect &aSrcRect,
|
||||
NS_IMETHOD ScrollRect(nsIntRect &aSrcRect,
|
||||
PRInt32 aDx,
|
||||
PRInt32 aDy);
|
||||
|
||||
|
@ -196,10 +196,10 @@ public:
|
|||
NS_IMETHOD SetIcon(const nsAString& aIconSpec);
|
||||
NS_IMETHOD SetMenuBar(void * aMenuBar) { return NS_ERROR_FAILURE; }
|
||||
NS_IMETHOD ShowMenuBar(PRBool aShow);
|
||||
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 BeginResizingChildren(void);
|
||||
NS_IMETHOD EndResizingChildren(void);
|
||||
NS_IMETHOD GetPreferredSize (PRInt32 &aWidth,
|
||||
|
@ -237,7 +237,7 @@ public:
|
|||
void DispatchLostFocusEvent(void);
|
||||
void DispatchActivateEvent(void);
|
||||
void DispatchDeactivateEvent(void);
|
||||
void DispatchResizeEvent(nsRect &aRect, nsEventStatus &aStatus);
|
||||
void DispatchResizeEvent(nsIntRect &aRect, nsEventStatus &aStatus);
|
||||
|
||||
nsEventStatus DispatchEvent(nsGUIEvent *aEvent) {
|
||||
nsEventStatus status;
|
||||
|
@ -313,7 +313,7 @@ protected:
|
|||
|
||||
nsresult NativeCreate(nsIWidget *aParent,
|
||||
nsNativeWidget aNativeParent,
|
||||
const nsRect &aRect,
|
||||
const nsIntRect &aRect,
|
||||
EVENT_CALLBACK aHandleEventFunction,
|
||||
nsIDeviceContext *aContext,
|
||||
nsIAppShell *aAppShell,
|
||||
|
|
Загрузка…
Ссылка в новой задаче