b=793501 remove unused event handler parameters r=roc
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 23 Oct 2012 11:33:30 +1300
changeset 111102 ded8c7f9a0d2be789c805017f756dfbf0dd9cd2d
parent 111101 31df6929909f429b5c9c7e20376a7c49cdb2befc
child 111103 9541dbf6e0208e58c0c0794c4a97f25b2f57b987
push id16872
push userktomlinson@mozilla.com
push dateTue, 23 Oct 2012 02:15:22 +0000
treeherdermozilla-inbound@a0158d370785 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs793501
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
b=793501 remove unused event handler parameters r=roc
widget/gtk2/nsWindow.cpp
widget/gtk2/nsWindow.h
--- a/widget/gtk2/nsWindow.cpp
+++ b/widget/gtk2/nsWindow.cpp
@@ -2345,35 +2345,32 @@ nsWindow::OnConfigureEvent(GtkWidget *aW
     // complete.  wtf?
     if (mWidgetListener)
       mWidgetListener->WindowMoved(this, mBounds.x, mBounds.y);
 
     return FALSE;
 }
 
 void
-nsWindow::OnContainerUnrealize(GtkWidget *aWidget)
+nsWindow::OnContainerUnrealize()
 {
     // The GdkWindows are about to be destroyed (but not deleted), so remove
     // their references back to their container widget while the GdkWindow
     // hierarchy is still available.
 
-    NS_ASSERTION(mContainer == MOZ_CONTAINER(aWidget),
-                 "unexpected \"unrealize\" signal");
-
     if (mGdkWindow) {
         DestroyChildWindows();
 
         g_object_set_data(G_OBJECT(mGdkWindow), "nsWindow", NULL);
         mGdkWindow = NULL;
     }
 }
 
 void
-nsWindow::OnSizeAllocate(GtkWidget *aWidget, GtkAllocation *aAllocation)
+nsWindow::OnSizeAllocate(GtkAllocation *aAllocation)
 {
     LOG(("size_allocate [%p] %d %d %d %d\n",
          (void *)this, aAllocation->x, aAllocation->y,
          aAllocation->width, aAllocation->height));
 
     nsIntRect rect(aAllocation->x, aAllocation->y,
                    aAllocation->width, aAllocation->height);
 
@@ -2383,24 +2380,24 @@ nsWindow::OnSizeAllocate(GtkWidget *aWid
     if (!mGdkWindow)
         return;
 
     if (mWidgetListener)
         mWidgetListener->WindowResized(this, rect.width, rect.height);
 }
 
 void
-nsWindow::OnDeleteEvent(GtkWidget *aWidget, GdkEventAny *aEvent)
+nsWindow::OnDeleteEvent()
 {
     if (mWidgetListener)
         mWidgetListener->RequestWindowClose(this);
 }
 
 void
-nsWindow::OnEnterNotifyEvent(GtkWidget *aWidget, GdkEventCrossing *aEvent)
+nsWindow::OnEnterNotifyEvent(GdkEventCrossing *aEvent)
 {
     // This skips NotifyVirtual and NotifyNonlinearVirtual enter notify events
     // when the pointer enters a child window.  If the destination window is a
     // Gecko window then we'll catch the corresponding event on that window,
     // but we won't notice when the pointer directly enters a foreign (plugin)
     // child window without passing over a visible portion of a Gecko window.
     if (aEvent->subwindow != NULL)
         return;
@@ -2436,17 +2433,17 @@ is_top_level_mouse_exit(GdkWindow* aWind
     if (!winAtPt)
         return true;
     GdkWindow* topLevelAtPt = gdk_window_get_toplevel(winAtPt);
     GdkWindow* topLevelWidget = gdk_window_get_toplevel(aWindow);
     return topLevelAtPt != topLevelWidget;
 }
 
 void
-nsWindow::OnLeaveNotifyEvent(GtkWidget *aWidget, GdkEventCrossing *aEvent)
+nsWindow::OnLeaveNotifyEvent(GdkEventCrossing *aEvent)
 {
     // This ignores NotifyVirtual and NotifyNonlinearVirtual leave notify
     // events when the pointer leaves a child window.  If the destination
     // window is a Gecko window then we'll catch the corresponding event on
     // that window.
     //
     // XXXkt However, we will miss toplevel exits when the pointer directly
     // leaves a foreign (plugin) child window without passing over a visible
@@ -2466,17 +2463,17 @@ nsWindow::OnLeaveNotifyEvent(GtkWidget *
 
     LOG(("OnLeaveNotify: %p\n", (void *)this));
 
     nsEventStatus status;
     DispatchEvent(&event, status);
 }
 
 void
-nsWindow::OnMotionNotifyEvent(GtkWidget *aWidget, GdkEventMotion *aEvent)
+nsWindow::OnMotionNotifyEvent(GdkEventMotion *aEvent)
 {
     // see if we can compress this event
     // XXXldb Why skip every other motion event when we have multiple,
     // but not more than that?
     bool synthEvent = false;
 #ifdef MOZ_X11
     XEvent xevent;
 
@@ -2652,17 +2649,17 @@ nsWindow::InitButtonEvent(nsMouseEvent &
 }
 
 static guint ButtonMaskFromGDKButton(guint button)
 {
     return GDK_BUTTON1_MASK << (button - 1);
 }
 
 void
-nsWindow::OnButtonPressEvent(GtkWidget *aWidget, GdkEventButton *aEvent)
+nsWindow::OnButtonPressEvent(GdkEventButton *aEvent)
 {
     LOG(("Button %u press on %p\n", aEvent->button, (void *)this));
 
     nsEventStatus status;
 
     // If you double click in GDK, it will actually generate a second
     // GDK_BUTTON_PRESS before sending the GDK_2BUTTON_PRESS, and this is
     // different than the DOM spec.  GDK puts this in the queue
@@ -2735,17 +2732,17 @@ nsWindow::OnButtonPressEvent(GtkWidget *
                                       nsMouseEvent::eReal);
         InitButtonEvent(contextMenuEvent, aEvent);
         contextMenuEvent.pressure = mLastMotionPressure;
         DispatchEvent(&contextMenuEvent, status);
     }
 }
 
 void
-nsWindow::OnButtonReleaseEvent(GtkWidget *aWidget, GdkEventButton *aEvent)
+nsWindow::OnButtonReleaseEvent(GdkEventButton *aEvent)
 {
     LOG(("Button %u release on %p\n", aEvent->button, (void *)this));
 
     uint16_t domButton;
     switch (aEvent->button) {
     case 1:
         domButton = nsMouseEvent::eLeftButton;
         break;
@@ -2769,17 +2766,17 @@ nsWindow::OnButtonReleaseEvent(GtkWidget
     event.pressure = pressure ? pressure : mLastMotionPressure;
 
     nsEventStatus status;
     DispatchEvent(&event, status);
     mLastMotionPressure = pressure;
 }
 
 void
-nsWindow::OnContainerFocusInEvent(GtkWidget *aWidget, GdkEventFocus *aEvent)
+nsWindow::OnContainerFocusInEvent(GdkEventFocus *aEvent)
 {
     NS_ASSERTION(mWindowType != eWindowType_popup,
                  "Unexpected focus on a popup window");
 
     LOGFOCUS(("OnContainerFocusInEvent [%p]\n", (void *)this));
 
     // Unset the urgency hint, if possible
     GtkWidget* top_window = nullptr;
@@ -2807,17 +2804,17 @@ nsWindow::OnContainerFocusInEvent(GtkWid
         // active.
         gFocusWindow = this;
     }
 
     LOGFOCUS(("Events sent from focus in event [%p]\n", (void *)this));
 }
 
 void
-nsWindow::OnContainerFocusOutEvent(GtkWidget *aWidget, GdkEventFocus *aEvent)
+nsWindow::OnContainerFocusOutEvent(GdkEventFocus *aEvent)
 {
     LOGFOCUS(("OnContainerFocusOutEvent [%p]\n", (void *)this));
 
     if (mWindowType == eWindowType_toplevel || mWindowType == eWindowType_dialog) {
         nsCOMPtr<nsIDragService> dragService = do_GetService(kCDragServiceCID);
         nsCOMPtr<nsIDragSession> dragSession;
         dragService->GetCurrentSession(getter_AddRefs(dragSession));
 
@@ -2900,17 +2897,17 @@ nsWindow::DispatchKeyDownEvent(GdkEventK
     nsKeyEvent downEvent(true, NS_KEY_DOWN, this);
     KeymapWrapper::InitKeyEvent(downEvent, aEvent);
     DispatchEvent(&downEvent, status);
     *aCancelled = (status == nsEventStatus_eConsumeNoDefault);
     return true;
 }
 
 gboolean
-nsWindow::OnKeyPressEvent(GtkWidget *aWidget, GdkEventKey *aEvent)
+nsWindow::OnKeyPressEvent(GdkEventKey *aEvent)
 {
     LOGFOCUS(("OnKeyPressEvent [%p]\n", (void *)this));
 
     // if we are in the middle of composing text, XIM gets to see it
     // before mozilla does.
     bool IMEWasEnabled = false;
     if (mIMModule) {
         IMEWasEnabled = mIMModule->IsEnabled();
@@ -3037,17 +3034,17 @@ nsWindow::OnKeyPressEvent(GtkWidget *aWi
     if (status == nsEventStatus_eConsumeNoDefault) {
         return TRUE;
     }
 
     return FALSE;
 }
 
 gboolean
-nsWindow::OnKeyReleaseEvent(GtkWidget *aWidget, GdkEventKey *aEvent)
+nsWindow::OnKeyReleaseEvent(GdkEventKey *aEvent)
 {
     LOGFOCUS(("OnKeyReleaseEvent [%p]\n", (void *)this));
 
     if (mIMModule && mIMModule->OnKeyEvent(this, aEvent)) {
         return TRUE;
     }
 
     // send the key event as a key up event
@@ -3061,17 +3058,17 @@ nsWindow::OnKeyReleaseEvent(GtkWidget *a
     if (status == nsEventStatus_eConsumeNoDefault) {
         return TRUE;
     }
 
     return FALSE;
 }
 
 void
-nsWindow::OnScrollEvent(GtkWidget *aWidget, GdkEventScroll *aEvent)
+nsWindow::OnScrollEvent(GdkEventScroll *aEvent)
 {
     // check to see if we should rollup
     bool rolledUp =
         check_for_rollup(aEvent->x_root, aEvent->y_root, true, false);
     if (gConsumeRollupEvent && rolledUp)
         return;
 
     WheelEvent wheelEvent(true, NS_WHEEL_WHEEL, this);
@@ -3110,18 +3107,17 @@ nsWindow::OnScrollEvent(GtkWidget *aWidg
 
     wheelEvent.time = aEvent->time;
 
     nsEventStatus status;
     DispatchEvent(&wheelEvent, status);
 }
 
 void
-nsWindow::OnVisibilityNotifyEvent(GtkWidget *aWidget,
-                                  GdkEventVisibility *aEvent)
+nsWindow::OnVisibilityNotifyEvent(GdkEventVisibility *aEvent)
 {
     LOGDRAW(("Visibility event %i on [%p] %p\n",
              aEvent->state, this, aEvent->window));
 
     if (!mGdkWindow)
         return;
 
     switch (aEvent->state) {
@@ -5145,50 +5141,50 @@ configure_event_cb(GtkWidget *widget,
 
 static void
 container_unrealize_cb (GtkWidget *widget)
 {
     nsRefPtr<nsWindow> window = get_window_for_gtk_widget(widget);
     if (!window)
         return;
 
-    window->OnContainerUnrealize(widget);
+    window->OnContainerUnrealize();
 }
 
 static void
 size_allocate_cb (GtkWidget *widget, GtkAllocation *allocation)
 {
     nsRefPtr<nsWindow> window = get_window_for_gtk_widget(widget);
     if (!window)
         return;
 
-    window->OnSizeAllocate(widget, allocation);
+    window->OnSizeAllocate(allocation);
 }
 
 static gboolean
 delete_event_cb(GtkWidget *widget, GdkEventAny *event)
 {
     nsRefPtr<nsWindow> window = get_window_for_gtk_widget(widget);
     if (!window)
         return FALSE;
 
-    window->OnDeleteEvent(widget, event);
+    window->OnDeleteEvent();
 
     return TRUE;
 }
 
 static gboolean
 enter_notify_event_cb(GtkWidget *widget,
                       GdkEventCrossing *event)
 {
     nsRefPtr<nsWindow> window = get_window_for_gdk_window(event->window);
     if (!window)
         return TRUE;
 
-    window->OnEnterNotifyEvent(widget, event);
+    window->OnEnterNotifyEvent(event);
 
     return TRUE;
 }
 
 static gboolean
 leave_notify_event_cb(GtkWidget *widget,
                       GdkEventCrossing *event)
 {
@@ -5205,17 +5201,17 @@ leave_notify_event_cb(GtkWidget *widget,
     if (winAtPt == event->window) {
         return TRUE;
     }
 
     nsRefPtr<nsWindow> window = get_window_for_gdk_window(event->window);
     if (!window)
         return TRUE;
 
-    window->OnLeaveNotifyEvent(widget, event);
+    window->OnLeaveNotifyEvent(event);
 
     return TRUE;
 }
 
 static nsWindow*
 GetFirstNSWindowForGDKWindow(GdkWindow *aGdkWindow)
 {
     nsWindow* window;
@@ -5236,72 +5232,72 @@ static gboolean
 motion_notify_event_cb(GtkWidget *widget, GdkEventMotion *event)
 {
     UpdateLastInputEventTime(event);
 
     nsWindow *window = GetFirstNSWindowForGDKWindow(event->window);
     if (!window)
         return FALSE;
 
-    window->OnMotionNotifyEvent(widget, event);
+    window->OnMotionNotifyEvent(event);
 
 #ifdef MOZ_PLATFORM_MAEMO
     gdk_event_request_motions(event);
 #endif
     return TRUE;
 }
 
 static gboolean
 button_press_event_cb(GtkWidget *widget, GdkEventButton *event)
 {
     UpdateLastInputEventTime(event);
 
     nsWindow *window = GetFirstNSWindowForGDKWindow(event->window);
     if (!window)
         return FALSE;
 
-    window->OnButtonPressEvent(widget, event);
+    window->OnButtonPressEvent(event);
 
     return TRUE;
 }
 
 static gboolean
 button_release_event_cb(GtkWidget *widget, GdkEventButton *event)
 {
     UpdateLastInputEventTime(event);
 
     nsWindow *window = GetFirstNSWindowForGDKWindow(event->window);
     if (!window)
         return FALSE;
 
-    window->OnButtonReleaseEvent(widget, event);
+    window->OnButtonReleaseEvent(event);
 
     return TRUE;
 }
 
 static gboolean
 focus_in_event_cb(GtkWidget *widget, GdkEventFocus *event)
 {
     nsRefPtr<nsWindow> window = get_window_for_gtk_widget(widget);
     if (!window)
         return FALSE;
 
-    window->OnContainerFocusInEvent(widget, event);
+    window->OnContainerFocusInEvent(event);
 
     return FALSE;
 }
 
 static gboolean
 focus_out_event_cb(GtkWidget *widget, GdkEventFocus *event)
 {
     nsRefPtr<nsWindow> window = get_window_for_gtk_widget(widget);
     if (!window)
         return FALSE;
 
-    window->OnContainerFocusOutEvent(widget, event);
+    window->OnContainerFocusOutEvent(event);
 
     return FALSE;
 }
 
 #ifdef MOZ_X11
 // For long-lived popup windows that don't really take focus themselves but
 // may have elements that accept keyboard input when the parent window is
 // active, focus is handled specially.  These windows include noautohide
@@ -5504,56 +5500,56 @@ key_press_event_cb(GtkWidget *widget, Gd
             next_event.xkey.state != (event->state & NS_GDKEVENT_MATCH_MASK)) {
             break;
         }
         XNextEvent(dpy, &next_event);
         event->time = next_event.xkey.time;
     }
 #endif
 
-    return focusWindow->OnKeyPressEvent(widget, event);
+    return focusWindow->OnKeyPressEvent(event);
 }
 
 static gboolean
 key_release_event_cb(GtkWidget *widget, GdkEventKey *event)
 {
     LOG(("key_release_event_cb\n"));
 
     UpdateLastInputEventTime(event);
 
     // find the window with focus and dispatch this event to that widget
     nsWindow *window = get_window_for_gtk_widget(widget);
     if (!window)
         return FALSE;
 
     nsRefPtr<nsWindow> focusWindow = gFocusWindow ? gFocusWindow : window;
 
-    return focusWindow->OnKeyReleaseEvent(widget, event);
+    return focusWindow->OnKeyReleaseEvent(event);
 }
 
 static gboolean
 scroll_event_cb(GtkWidget *widget, GdkEventScroll *event)
 {
     nsWindow *window = GetFirstNSWindowForGDKWindow(event->window);
     if (!window)
         return FALSE;
 
-    window->OnScrollEvent(widget, event);
+    window->OnScrollEvent(event);
 
     return TRUE;
 }
 
 static gboolean
 visibility_notify_event_cb (GtkWidget *widget, GdkEventVisibility *event)
 {
     nsRefPtr<nsWindow> window = get_window_for_gdk_window(event->window);
     if (!window)
         return FALSE;
 
-    window->OnVisibilityNotifyEvent(widget, event);
+    window->OnVisibilityNotifyEvent(event);
 
     return TRUE;
 }
 
 static void
 hierarchy_changed_cb (GtkWidget *widget,
                       GtkWidget *previous_toplevel)
 {
--- a/widget/gtk2/nsWindow.h
+++ b/widget/gtk2/nsWindow.h
@@ -170,43 +170,30 @@ public:
     // event callbacks
 #if defined(MOZ_WIDGET_GTK2)
     gboolean           OnExposeEvent(GdkEventExpose *aEvent);
 #else
     gboolean           OnExposeEvent(cairo_t *cr);
 #endif
     gboolean           OnConfigureEvent(GtkWidget *aWidget,
                                         GdkEventConfigure *aEvent);
-    void               OnContainerUnrealize(GtkWidget *aWidget);
-    void               OnSizeAllocate(GtkWidget *aWidget,
-                                      GtkAllocation *aAllocation);
-    void               OnDeleteEvent(GtkWidget *aWidget,
-                                     GdkEventAny *aEvent);
-    void               OnEnterNotifyEvent(GtkWidget *aWidget,
-                                          GdkEventCrossing *aEvent);
-    void               OnLeaveNotifyEvent(GtkWidget *aWidget,
-                                          GdkEventCrossing *aEvent);
-    void               OnMotionNotifyEvent(GtkWidget *aWidget,
-                                           GdkEventMotion *aEvent);
-    void               OnButtonPressEvent(GtkWidget *aWidget,
-                                          GdkEventButton *aEvent);
-    void               OnButtonReleaseEvent(GtkWidget *aWidget,
-                                            GdkEventButton *aEvent);
-    void               OnContainerFocusInEvent(GtkWidget *aWidget,
-                                               GdkEventFocus *aEvent);
-    void               OnContainerFocusOutEvent(GtkWidget *aWidget,
-                                                GdkEventFocus *aEvent);
-    gboolean           OnKeyPressEvent(GtkWidget *aWidget,
-                                       GdkEventKey *aEvent);
-    gboolean           OnKeyReleaseEvent(GtkWidget *aWidget,
-                                         GdkEventKey *aEvent);
-    void               OnScrollEvent(GtkWidget *aWidget,
-                                     GdkEventScroll *aEvent);
-    void               OnVisibilityNotifyEvent(GtkWidget *aWidget,
-                                               GdkEventVisibility *aEvent);
+    void               OnContainerUnrealize();
+    void               OnSizeAllocate(GtkAllocation *aAllocation);
+    void               OnDeleteEvent();
+    void               OnEnterNotifyEvent(GdkEventCrossing *aEvent);
+    void               OnLeaveNotifyEvent(GdkEventCrossing *aEvent);
+    void               OnMotionNotifyEvent(GdkEventMotion *aEvent);
+    void               OnButtonPressEvent(GdkEventButton *aEvent);
+    void               OnButtonReleaseEvent(GdkEventButton *aEvent);
+    void               OnContainerFocusInEvent(GdkEventFocus *aEvent);
+    void               OnContainerFocusOutEvent(GdkEventFocus *aEvent);
+    gboolean           OnKeyPressEvent(GdkEventKey *aEvent);
+    gboolean           OnKeyReleaseEvent(GdkEventKey *aEvent);
+    void               OnScrollEvent(GdkEventScroll *aEvent);
+    void               OnVisibilityNotifyEvent(GdkEventVisibility *aEvent);
     void               OnWindowStateEvent(GtkWidget *aWidget,
                                           GdkEventWindowState *aEvent);
     void               OnDragDataReceivedEvent(GtkWidget       *aWidget,
                                                GdkDragContext  *aDragContext,
                                                gint             aX,
                                                gint             aY,
                                                GtkSelectionData*aSelectionData,
                                                guint            aInfo,