diff --git a/widget/src/beos/nsWindow.cpp b/widget/src/beos/nsWindow.cpp index 4b9e86f033d1..11be418ac815 100644 --- a/widget/src/beos/nsWindow.cpp +++ b/widget/src/beos/nsWindow.cpp @@ -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 diff --git a/widget/src/beos/nsWindow.h b/widget/src/beos/nsWindow.h index e9e64eb92f4d..ad6cfce7a9fa 100644 --- a/widget/src/beos/nsWindow.h +++ b/widget/src/beos/nsWindow.h @@ -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); diff --git a/widget/src/cocoa/nsChildView.h b/widget/src/cocoa/nsChildView.h index f629e8a43211..015e25ab013b 100644 --- a/widget/src/cocoa/nsChildView.h +++ b/widget/src/cocoa/nsChildView.h @@ -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); diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index 90d1b253d7c5..cd2f5687fa01 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -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 diff --git a/widget/src/gtk/nsWidget.cpp b/widget/src/gtk/nsWidget.cpp index d73c8cbc1c01..537e6722ab84 100644 --- a/widget/src/gtk/nsWidget.cpp +++ b/widget/src/gtk/nsWidget.cpp @@ -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; diff --git a/widget/src/gtk/nsWidget.h b/widget/src/gtk/nsWidget.h index 4a770f51d046..7718f9e024ed 100644 --- a/widget/src/gtk/nsWidget.h +++ b/widget/src/gtk/nsWidget.h @@ -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); diff --git a/widget/src/mac/nsWindow.cpp b/widget/src/mac/nsWindow.cpp index 85edb55eac6d..98121d795b86 100644 --- a/widget/src/mac/nsWindow.cpp +++ b/widget/src/mac/nsWindow.cpp @@ -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 diff --git a/widget/src/mac/nsWindow.h b/widget/src/mac/nsWindow.h index 91a2419ee26c..bdf451699e12 100644 --- a/widget/src/mac/nsWindow.h +++ b/widget/src/mac/nsWindow.h @@ -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); diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index 06c3861589d0..80230f4e5ebc 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -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 diff --git a/widget/src/os2/nsWindow.h b/widget/src/os2/nsWindow.h index 7b5950f88cd6..83fc21e47416 100644 --- a/widget/src/os2/nsWindow.h +++ b/widget/src/os2/nsWindow.h @@ -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); diff --git a/widget/src/photon/nsWidget.h b/widget/src/photon/nsWidget.h index a8840c904f76..3641abd25191 100644 --- a/widget/src/photon/nsWidget.h +++ b/widget/src/photon/nsWidget.h @@ -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); diff --git a/widget/src/qt/nsCommonWidget.cpp b/widget/src/qt/nsCommonWidget.cpp index 6742356a921c..52825f3e1cf2 100644 --- a/widget/src/qt/nsCommonWidget.cpp +++ b/widget/src/qt/nsCommonWidget.cpp @@ -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 diff --git a/widget/src/qt/nsCommonWidget.h b/widget/src/qt/nsCommonWidget.h index 3ce0d8d70f83..8d6929d50647 100644 --- a/widget/src/qt/nsCommonWidget.h +++ b/widget/src/qt/nsCommonWidget.h @@ -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 diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index ce17599bf04d..04d9afb9ddeb 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -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 diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index fcd00bee437b..bd73346694e3 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -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); diff --git a/widget/src/xlib/nsWidget.cpp b/widget/src/xlib/nsWidget.cpp index 139dc3dd1f6b..219dc3a474bd 100644 --- a/widget/src/xlib/nsWidget.cpp +++ b/widget/src/xlib/nsWidget.cpp @@ -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) { } diff --git a/widget/src/xlib/nsWidget.h b/widget/src/xlib/nsWidget.h index 79f42066c44f..ef9fe21956e3 100644 --- a/widget/src/xlib/nsWidget.h +++ b/widget/src/xlib/nsWidget.h @@ -178,7 +178,8 @@ protected: nsCOMPtr 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,