зеркало из https://github.com/mozilla/gecko-dev.git
Partial fix for bug 331630. Remove nsEventStatus_eConsumeDoDefault from widget code. r+sr=roc@ocallahan.org
This commit is contained in:
Родитель
4d34bb7b87
Коммит
b5cce40ba9
|
@ -369,29 +369,6 @@ NS_METHOD nsWindow::ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect)
|
|||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Convert nsEventStatus value to a windows boolean
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
PRBool nsWindow::ConvertStatus(nsEventStatus aStatus)
|
||||
{
|
||||
switch(aStatus)
|
||||
{
|
||||
case nsEventStatus_eIgnore:
|
||||
return PR_FALSE;
|
||||
case nsEventStatus_eConsumeNoDefault:
|
||||
return PR_TRUE;
|
||||
case nsEventStatus_eConsumeDoDefault:
|
||||
return PR_FALSE;
|
||||
default:
|
||||
NS_ASSERTION(0, "Illegal nsEventStatus enumeration value");
|
||||
break;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Initialize an event to dispatch
|
||||
|
|
|
@ -210,7 +210,8 @@ protected:
|
|||
PRBool DispatchKeyEvent(PRUint32 aEventType, PRUint32 aCharCode,
|
||||
PRUint32 aKeyCode, PRUint32 aFlags = 0);
|
||||
PRBool DispatchFocus(PRUint32 aEventType);
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus);
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus)
|
||||
{ return aStatus == nsEventStatus_eConsumeNoDefault; }
|
||||
PRBool DispatchStandardEvent(PRUint32 aMsg);
|
||||
|
||||
PRBool DispatchWindowEvent(nsGUIEvent* event);
|
||||
|
|
|
@ -216,7 +216,8 @@ public:
|
|||
NS_IMETHOD BeginResizingChildren(void);
|
||||
NS_IMETHOD EndResizingChildren(void);
|
||||
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus);
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus)
|
||||
{ return aStatus == nsEventStatus_eConsumeNoDefault; }
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
|
||||
virtual PRBool DispatchMouseEvent(nsMouseEvent &aEvent);
|
||||
|
||||
|
|
|
@ -1579,25 +1579,6 @@ NS_IMETHODIMP nsChildView::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect)
|
|||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
PRBool nsChildView::ConvertStatus(nsEventStatus aStatus)
|
||||
{
|
||||
switch (aStatus)
|
||||
{
|
||||
case nsEventStatus_eIgnore: return(PR_FALSE);
|
||||
case nsEventStatus_eConsumeNoDefault: return(PR_TRUE); // don't do default processing
|
||||
case nsEventStatus_eConsumeDoDefault: return(PR_FALSE);
|
||||
default:
|
||||
NS_ASSERTION(0, "Illegal nsEventStatus enumeration value");
|
||||
break;
|
||||
}
|
||||
return(PR_FALSE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Invokes callback and ProcessEvent method on Event Listener object
|
||||
|
|
|
@ -1422,22 +1422,6 @@ void nsWidget::InitEvent(nsGUIEvent& event, nsPoint* aPoint)
|
|||
gdk_event_free(ge);
|
||||
}
|
||||
|
||||
PRBool nsWidget::ConvertStatus(nsEventStatus aStatus)
|
||||
{
|
||||
switch(aStatus) {
|
||||
case nsEventStatus_eIgnore:
|
||||
return(PR_FALSE);
|
||||
case nsEventStatus_eConsumeNoDefault:
|
||||
return(PR_TRUE);
|
||||
case nsEventStatus_eConsumeDoDefault:
|
||||
return(PR_FALSE);
|
||||
default:
|
||||
NS_ASSERTION(0, "Illegal nsEventStatus enumeration value");
|
||||
break;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool nsWidget::DispatchWindowEvent(nsGUIEvent* event)
|
||||
{
|
||||
nsEventStatus status;
|
||||
|
|
|
@ -182,7 +182,8 @@ public:
|
|||
|
||||
// Utility functions
|
||||
|
||||
PRBool ConvertStatus(nsEventStatus aStatus);
|
||||
PRBool ConvertStatus(nsEventStatus aStatus)
|
||||
{ return aStatus == nsEventStatus_eConsumeNoDefault; }
|
||||
PRBool DispatchMouseEvent(nsMouseEvent& aEvent);
|
||||
PRBool DispatchStandardEvent(PRUint32 aMsg);
|
||||
PRBool DispatchFocus(nsGUIEvent &aEvent);
|
||||
|
|
|
@ -1768,25 +1768,6 @@ scrollChildren:
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
PRBool nsWindow::ConvertStatus(nsEventStatus aStatus)
|
||||
{
|
||||
switch (aStatus)
|
||||
{
|
||||
case nsEventStatus_eIgnore: return(PR_FALSE);
|
||||
case nsEventStatus_eConsumeNoDefault: return(PR_TRUE); // don't do default processing
|
||||
case nsEventStatus_eConsumeDoDefault: return(PR_FALSE);
|
||||
default:
|
||||
NS_ERROR("Illegal nsEventStatus enumeration value");
|
||||
break;
|
||||
}
|
||||
return(PR_FALSE);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Invokes callback and ProcessEvent method on Event Listener object
|
||||
|
|
|
@ -174,7 +174,8 @@ public:
|
|||
NS_IMETHOD BeginResizingChildren(void);
|
||||
NS_IMETHOD EndResizingChildren(void);
|
||||
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus);
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus)
|
||||
{ return aStatus == nsEventStatus_eConsumeNoDefault; }
|
||||
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
|
||||
virtual PRBool DispatchMouseEvent(nsMouseEvent &aEvent);
|
||||
|
||||
|
|
|
@ -404,28 +404,6 @@ NS_METHOD nsWindow::ScreenToWidget( const nsRect &aOldRect, nsRect &aNewRect)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Convert nsEventStatus value to a windows boolean
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
PRBool nsWindow::ConvertStatus(nsEventStatus aStatus)
|
||||
{
|
||||
switch(aStatus) {
|
||||
case nsEventStatus_eIgnore:
|
||||
return PR_FALSE;
|
||||
case nsEventStatus_eConsumeNoDefault:
|
||||
return PR_TRUE;
|
||||
case nsEventStatus_eConsumeDoDefault:
|
||||
return PR_FALSE;
|
||||
default:
|
||||
NS_ASSERTION(0, "Illegal nsEventStatus enumeration value");
|
||||
break;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Initialize an event to dispatch
|
||||
|
|
|
@ -314,7 +314,8 @@ protected:
|
|||
|
||||
virtual void SubclassWindow(BOOL bState);
|
||||
|
||||
PRBool ConvertStatus( nsEventStatus aStatus);
|
||||
PRBool ConvertStatus( nsEventStatus aStatus)
|
||||
{ return aStatus == nsEventStatus_eConsumeNoDefault; }
|
||||
void InitEvent( nsGUIEvent &event, nsPoint *pt = 0);
|
||||
virtual PRBool DispatchWindowEvent(nsGUIEvent* event);
|
||||
virtual PRBool DispatchWindowEvent(nsGUIEvent*event, nsEventStatus &aStatus);
|
||||
|
|
|
@ -239,15 +239,7 @@ public:
|
|||
|
||||
inline PRBool ConvertStatus(nsEventStatus aStatus)
|
||||
{
|
||||
switch(aStatus) {
|
||||
case nsEventStatus_eIgnore:
|
||||
case nsEventStatus_eConsumeDoDefault:
|
||||
return(PR_FALSE);
|
||||
case nsEventStatus_eConsumeNoDefault:
|
||||
return(PR_TRUE);
|
||||
}
|
||||
NS_ASSERTION(0, "Illegal nsEventStatus enumeration value");
|
||||
return PR_FALSE;
|
||||
return aStatus == nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
|
||||
PRBool DispatchMouseEvent(nsMouseEvent& aEvent);
|
||||
|
|
|
@ -1504,25 +1504,6 @@ NS_METHOD nsCommonWidget::SetCursor(nsCursor aCursor)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
bool nsCommonWidget::ignoreEvent(nsEventStatus aStatus) const
|
||||
{
|
||||
switch(aStatus) {
|
||||
case nsEventStatus_eIgnore:
|
||||
return(PR_FALSE);
|
||||
|
||||
case nsEventStatus_eConsumeNoDefault:
|
||||
return(PR_TRUE);
|
||||
|
||||
case nsEventStatus_eConsumeDoDefault:
|
||||
return(PR_FALSE);
|
||||
|
||||
default:
|
||||
NS_ASSERTION(0,"Illegal nsEventStatus enumeration value");
|
||||
break;
|
||||
}
|
||||
return(PR_FALSE);
|
||||
}
|
||||
|
||||
NS_METHOD nsCommonWidget::SetModal(PRBool aModal)
|
||||
{
|
||||
#ifdef DEBUG_WIDGETS
|
||||
|
|
|
@ -167,7 +167,8 @@ protected:
|
|||
virtual void NativeResize(PRInt32, PRInt32, PRBool);
|
||||
virtual void NativeShow(PRBool);
|
||||
|
||||
bool ignoreEvent(nsEventStatus aStatus) const;
|
||||
static bool ignoreEvent(nsEventStatus aStatus)
|
||||
{ return aStatus == nsEventStatus_eConsumeNoDefault; }
|
||||
|
||||
/**
|
||||
* Has to be called in subclasses after they created
|
||||
|
|
|
@ -1069,28 +1069,6 @@ LPARAM nsWindow::lParamToClient(LPARAM lParam)
|
|||
return MAKELPARAM(pt.x, pt.y);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Convert nsEventStatus value to a windows boolean
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
PRBool nsWindow::ConvertStatus(nsEventStatus aStatus)
|
||||
{
|
||||
switch (aStatus) {
|
||||
case nsEventStatus_eIgnore:
|
||||
return PR_FALSE;
|
||||
case nsEventStatus_eConsumeNoDefault:
|
||||
return PR_TRUE;
|
||||
case nsEventStatus_eConsumeDoDefault:
|
||||
return PR_FALSE;
|
||||
default:
|
||||
NS_ASSERTION(0, "Illegal nsEventStatus enumeration value");
|
||||
break;
|
||||
}
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Initialize an event to dispatch
|
||||
|
|
|
@ -336,7 +336,9 @@ protected:
|
|||
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
static LRESULT CALLBACK DefaultWindowProc(HWND hWns, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus);
|
||||
// Convert nsEventStatus value to a windows boolean
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus)
|
||||
{ return aStatus == nsEventStatus_eConsumeNoDefault; }
|
||||
|
||||
PRBool DispatchStandardEvent(PRUint32 aMsg);
|
||||
PRBool DispatchAppCommandEvent(PRUint32 aEventCommand);
|
||||
|
|
|
@ -1235,22 +1235,6 @@ NS_IMETHODIMP nsWidget::DispatchEvent(nsGUIEvent * aEvent,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool nsWidget::ConvertStatus(nsEventStatus aStatus)
|
||||
{
|
||||
switch(aStatus) {
|
||||
case nsEventStatus_eIgnore:
|
||||
return(PR_FALSE);
|
||||
case nsEventStatus_eConsumeNoDefault:
|
||||
return(PR_TRUE);
|
||||
case nsEventStatus_eConsumeDoDefault:
|
||||
return(PR_FALSE);
|
||||
default:
|
||||
NS_WARNING("Illegal nsEventStatus enumeration value\n");
|
||||
break;
|
||||
}
|
||||
return(PR_FALSE);
|
||||
}
|
||||
|
||||
void nsWidget::WidgetPut(nsWidget *aWidget)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -178,7 +178,8 @@ protected:
|
|||
|
||||
nsCOMPtr<nsIRegion> mUpdateArea;
|
||||
// private event functions
|
||||
PRBool ConvertStatus(nsEventStatus aStatus);
|
||||
static PRBool ConvertStatus(nsEventStatus aStatus)
|
||||
{ return aStatus == nsEventStatus_eConsumeNoDefault; }
|
||||
|
||||
// create the native window for this class
|
||||
virtual void CreateNativeWindow(Window aParent, nsRect aRect,
|
||||
|
|
Загрузка…
Ссылка в новой задаче