summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 17:02:45 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-22 17:02:45 +0000
commit38ab46563875871094169fb1152a8b21ebbf841f (patch)
tree1c14d216e0c5ac5621285ea4146b1ec706958bb4 /views
parent9cd6def3b735220b4dd0d00ec5c8633a2dfa8acd (diff)
downloadchromium_src-38ab46563875871094169fb1152a8b21ebbf841f.zip
chromium_src-38ab46563875871094169fb1152a8b21ebbf841f.tar.gz
chromium_src-38ab46563875871094169fb1152a8b21ebbf841f.tar.bz2
Reland r41641 "Make DevTools open docked by default..."
- Fix DevToolsSanityTest time out. The timeout is because the tests wait for Browser closed notification. However, docked DevTools does not have its own Browser object and hence the wait times out. BUG=none TEST=none Review URL: http://codereview.chromium.org/1025005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42226 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/widget_gtk.cc327
-rw-r--r--views/widget/widget_gtk.h149
-rw-r--r--views/window/window_gtk.cc4
-rw-r--r--views/window/window_gtk.h2
4 files changed, 101 insertions, 381 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 4513a01..6ad0c4c 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -319,72 +319,75 @@ void WidgetGtk::Init(GtkWidget* parent,
MessageLoopForUI::current()->AddObserver(this);
- // TODO(beng): make these take this rather than NULL.
g_signal_connect_after(G_OBJECT(window_contents_), "size_allocate",
- G_CALLBACK(CallSizeAllocate), NULL);
+ G_CALLBACK(&OnSizeAllocateThunk), this);
g_signal_connect(window_contents_, "expose_event",
- G_CALLBACK(CallPaint), NULL);
+ G_CALLBACK(&OnPaintThunk), this);
g_signal_connect(window_contents_, "enter_notify_event",
- G_CALLBACK(CallEnterNotify), NULL);
+ G_CALLBACK(&OnEnterNotifyThunk), this);
g_signal_connect(window_contents_, "leave_notify_event",
- G_CALLBACK(CallLeaveNotify), NULL);
+ G_CALLBACK(&OnLeaveNotifyThunk), this);
g_signal_connect(window_contents_, "motion_notify_event",
- G_CALLBACK(CallMotionNotify), NULL);
+ G_CALLBACK(&OnMotionNotifyThunk), this);
g_signal_connect(window_contents_, "button_press_event",
- G_CALLBACK(CallButtonPress), NULL);
+ G_CALLBACK(&OnButtonPressThunk), this);
g_signal_connect(window_contents_, "button_release_event",
- G_CALLBACK(CallButtonRelease), NULL);
+ G_CALLBACK(&OnButtonReleaseThunk), this);
g_signal_connect(window_contents_, "grab_broken_event",
- G_CALLBACK(CallGrabBrokeEvent), NULL);
+ G_CALLBACK(&OnGrabBrokeEventThunk), this);
g_signal_connect(window_contents_, "grab_notify",
- G_CALLBACK(CallGrabNotify), NULL);
+ G_CALLBACK(&OnGrabNotifyThunk), this);
g_signal_connect(window_contents_, "key_press_event",
- G_CALLBACK(CallKeyPress), NULL);
+ G_CALLBACK(&OnKeyPressThunk), this);
g_signal_connect(window_contents_, "key_release_event",
- G_CALLBACK(CallKeyRelease), NULL);
+ G_CALLBACK(&OnKeyReleaseThunk), this);
g_signal_connect(window_contents_, "scroll_event",
- G_CALLBACK(CallScroll), NULL);
+ G_CALLBACK(&OnScrollThunk), this);
g_signal_connect(window_contents_, "visibility_notify_event",
- G_CALLBACK(CallVisibilityNotify), NULL);
+ G_CALLBACK(&OnVisibilityNotifyThunk), this);
// In order to receive notification when the window is no longer the front
// window, we need to install these on the widget.
// NOTE: this doesn't work with focus follows mouse.
g_signal_connect(widget_, "focus_in_event",
- G_CALLBACK(CallFocusIn), NULL);
+ G_CALLBACK(&OnFocusInThunk), this);
g_signal_connect(widget_, "focus_out_event",
- G_CALLBACK(CallFocusOut), NULL);
+ G_CALLBACK(&OnFocusOutThunk), this);
g_signal_connect(widget_, "destroy",
- G_CALLBACK(CallDestroy), NULL);
+ G_CALLBACK(&OnDestroyThunk), this);
+ g_signal_connect(widget_, "show",
+ G_CALLBACK(&OnShowThunk), this);
+ g_signal_connect(widget_, "hide",
+ G_CALLBACK(&OnHideThunk), this);
if (transparent_) {
g_signal_connect(widget_, "expose_event",
- G_CALLBACK(CallWindowPaint), this);
+ G_CALLBACK(&OnWindowPaintThunk), this);
}
// Drag and drop.
gtk_drag_dest_set(window_contents_, static_cast<GtkDestDefaults>(0),
NULL, 0, GDK_ACTION_COPY);
g_signal_connect(window_contents_, "drag_motion",
- G_CALLBACK(CallDragMotion), this);
+ G_CALLBACK(&OnDragMotionThunk), this);
g_signal_connect(window_contents_, "drag_data_received",
- G_CALLBACK(CallDragDataReceived), this);
+ G_CALLBACK(&OnDragDataReceivedThunk), this);
g_signal_connect(window_contents_, "drag_drop",
- G_CALLBACK(CallDragDrop), this);
+ G_CALLBACK(&OnDragDropThunk), this);
g_signal_connect(window_contents_, "drag_leave",
- G_CALLBACK(CallDragLeave), this);
+ G_CALLBACK(&OnDragLeaveThunk), this);
g_signal_connect(window_contents_, "drag_data_get",
- G_CALLBACK(CallDragDataGet), this);
+ G_CALLBACK(&OnDragDataGetThunk), this);
g_signal_connect(window_contents_, "drag_end",
- G_CALLBACK(CallDragEnd), this);
+ G_CALLBACK(&OnDragEndThunk), this);
g_signal_connect(window_contents_, "drag_failed",
- G_CALLBACK(CallDragFailed), this);
+ G_CALLBACK(&OnDragFailedThunk), this);
tooltip_manager_.reset(new TooltipManagerGtk(this));
// Register for tooltips.
g_object_set(G_OBJECT(window_contents_), "has-tooltip", TRUE, NULL);
g_signal_connect(window_contents_, "query_tooltip",
- G_CALLBACK(CallQueryTooltip), this);
+ G_CALLBACK(&OnQueryTooltipThunk), this);
if (type_ == TYPE_CHILD) {
if (parent) {
@@ -704,11 +707,13 @@ void WidgetGtk::OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) {
root_view_->SchedulePaint();
}
-void WidgetGtk::OnPaint(GtkWidget* widget, GdkEventExpose* event) {
+gboolean WidgetGtk::OnPaint(GtkWidget* widget, GdkEventExpose* event) {
root_view_->OnPaint(event);
+ return false; // False indicates other widgets should get the event as well.
}
-void WidgetGtk::OnDragDataGet(GdkDragContext* context,
+void WidgetGtk::OnDragDataGet(GtkWidget* widget,
+ GdkDragContext* context,
GtkSelectionData* data,
guint info,
guint time) {
@@ -719,7 +724,8 @@ void WidgetGtk::OnDragDataGet(GdkDragContext* context,
drag_data_->WriteFormatToSelection(info, data);
}
-void WidgetGtk::OnDragDataReceived(GdkDragContext* context,
+void WidgetGtk::OnDragDataReceived(GtkWidget* widget,
+ GdkDragContext* context,
gint x,
gint y,
GtkSelectionData* data,
@@ -729,7 +735,8 @@ void WidgetGtk::OnDragDataReceived(GdkDragContext* context,
drop_target_->OnDragDataReceived(context, x, y, data, info, time);
}
-gboolean WidgetGtk::OnDragDrop(GdkDragContext* context,
+gboolean WidgetGtk::OnDragDrop(GtkWidget* widget,
+ GdkDragContext* context,
gint x,
gint y,
guint time) {
@@ -739,7 +746,7 @@ gboolean WidgetGtk::OnDragDrop(GdkDragContext* context,
return FALSE;
}
-void WidgetGtk::OnDragEnd(GdkDragContext* context) {
+void WidgetGtk::OnDragEnd(GtkWidget* widget, GdkDragContext* context) {
if (!drag_data_) {
// This indicates we didn't start a drag operation, and should never
// happen.
@@ -750,12 +757,14 @@ void WidgetGtk::OnDragEnd(GdkDragContext* context) {
MessageLoop::current()->Quit();
}
-gboolean WidgetGtk::OnDragFailed(GdkDragContext* context,
+gboolean WidgetGtk::OnDragFailed(GtkWidget* widget,
+ GdkDragContext* context,
GtkDragResult result) {
return FALSE;
}
-void WidgetGtk::OnDragLeave(GdkDragContext* context,
+void WidgetGtk::OnDragLeave(GtkWidget* widget,
+ GdkDragContext* context,
guint time) {
if (ignore_drag_leave_) {
ignore_drag_leave_ = false;
@@ -767,7 +776,8 @@ void WidgetGtk::OnDragLeave(GdkDragContext* context,
}
}
-gboolean WidgetGtk::OnDragMotion(GdkDragContext* context,
+gboolean WidgetGtk::OnDragMotion(GtkWidget* widget,
+ GdkDragContext* context,
gint x,
gint y,
guint time) {
@@ -895,13 +905,19 @@ gboolean WidgetGtk::OnKeyRelease(GtkWidget* widget, GdkEventKey* event) {
return root_view_->ProcessKeyEvent(key_event);
}
-gboolean WidgetGtk::OnQueryTooltip(gint x,
+gboolean WidgetGtk::OnQueryTooltip(GtkWidget* widget,
+ gint x,
gint y,
gboolean keyboard_mode,
GtkTooltip* tooltip) {
return tooltip_manager_->ShowTooltip(x, y, keyboard_mode, tooltip);
}
+gboolean WidgetGtk::OnVisibilityNotify(GtkWidget* widget,
+ GdkEventVisibility* event) {
+ return false;
+}
+
gboolean WidgetGtk::OnGrabBrokeEvent(GtkWidget* widget, GdkEvent* event) {
HandleGrabBroke();
return false; // To let other widgets get the event.
@@ -912,7 +928,8 @@ void WidgetGtk::OnGrabNotify(GtkWidget* widget, gboolean was_grabbed) {
HandleGrabBroke();
}
-void WidgetGtk::OnDestroy() {
+void WidgetGtk::OnDestroy(GtkWidget* object) {
+ // Note that this handler is hooked to GtkObject::destroy.
widget_ = window_contents_ = NULL;
if (delete_on_destroy_) {
// Delays the deletion of this WidgetGtk as we want its children to have
@@ -921,6 +938,12 @@ void WidgetGtk::OnDestroy() {
}
}
+void WidgetGtk::OnShow(GtkWidget* widget) {
+}
+
+void WidgetGtk::OnHide(GtkWidget* widget) {
+}
+
void WidgetGtk::DoGrab() {
has_capture_ = true;
gtk_grab_add(window_contents_);
@@ -945,7 +968,7 @@ RootView* WidgetGtk::CreateRootView() {
return new RootView(this);
}
-void WidgetGtk::OnWindowPaint(GtkWidget* widget, GdkEventExpose* event) {
+gboolean WidgetGtk::OnWindowPaint(GtkWidget* widget, GdkEventExpose* event) {
// NOTE: for reasons I don't understand this code is never hit. It should
// be hit when transparent_, but we never get the expose-event for the
// window in this case, even though a stand alone test case triggers it. I'm
@@ -962,6 +985,7 @@ void WidgetGtk::OnWindowPaint(GtkWidget* widget, GdkEventExpose* event) {
cairo_rectangle(cr, 0, 0, width, height);
cairo_fill(cr);
cairo_destroy(cr);
+ return false;
}
bool WidgetGtk::ProcessMousePressed(GdkEventButton* event) {
@@ -1051,235 +1075,6 @@ void WidgetGtk::SetRootViewForWidget(GtkWidget* widget, RootView* root_view) {
}
// static
-gboolean WidgetGtk::CallButtonPress(GtkWidget* widget, GdkEventButton* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnButtonPress(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallButtonRelease(GtkWidget* widget,
- GdkEventButton* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnButtonRelease(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallDragDrop(GtkWidget* widget,
- GdkDragContext* context,
- gint x,
- gint y,
- guint time,
- WidgetGtk* host) {
- return host->OnDragDrop(context, x, y, time);
-}
-
-// static
-gboolean WidgetGtk::CallDragFailed(GtkWidget* widget,
- GdkDragContext* context,
- GtkDragResult result,
- WidgetGtk* host) {
- return host->OnDragFailed(context, result);
-}
-
-// static
-gboolean WidgetGtk::CallDragMotion(GtkWidget* widget,
- GdkDragContext* context,
- gint x,
- gint y,
- guint time,
- WidgetGtk* host) {
- return host->OnDragMotion(context, x, y, time);
-}
-
-// static
-gboolean WidgetGtk::CallEnterNotify(GtkWidget* widget,
- GdkEventCrossing* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnEnterNotify(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallFocusIn(GtkWidget* widget, GdkEventFocus* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnFocusIn(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallFocusOut(GtkWidget* widget, GdkEventFocus* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnFocusOut(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallGrabBrokeEvent(GtkWidget* widget, GdkEvent* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnGrabBrokeEvent(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallKeyPress(GtkWidget* widget, GdkEventKey* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnKeyPress(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallKeyRelease(GtkWidget* widget, GdkEventKey* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnKeyRelease(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallLeaveNotify(GtkWidget* widget,
- GdkEventCrossing* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnLeaveNotify(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallMotionNotify(GtkWidget* widget, GdkEventMotion* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnMotionNotify(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallPaint(GtkWidget* widget, GdkEventExpose* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (widget_gtk)
- widget_gtk->OnPaint(widget, event);
- return false; // False indicates other widgets should get the event as well.
-}
-
-// static
-gboolean WidgetGtk::CallQueryTooltip(GtkWidget* widget,
- gint x,
- gint y,
- gboolean keyboard_mode,
- GtkTooltip* tooltip,
- WidgetGtk* host) {
- return host->OnQueryTooltip(static_cast<int>(x), static_cast<int>(y),
- keyboard_mode, tooltip);
-}
-
-// static
-gboolean WidgetGtk::CallScroll(GtkWidget* widget, GdkEventScroll* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnScroll(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallVisibilityNotify(GtkWidget* widget,
- GdkEventVisibility* event) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return false;
-
- return widget_gtk->OnVisibilityNotify(widget, event);
-}
-
-// static
-gboolean WidgetGtk::CallWindowPaint(GtkWidget* widget,
- GdkEventExpose* event,
- WidgetGtk* widget_gtk) {
- widget_gtk->OnWindowPaint(widget, event);
- return false; // False indicates other widgets should get the event as well.
-}
-
-// static
-void WidgetGtk::CallDestroy(GtkObject* object) {
- WidgetGtk* widget_gtk = GetViewForNative(GTK_WIDGET(object));
- if (widget_gtk)
- widget_gtk->OnDestroy();
-}
-
-// static
-void WidgetGtk::CallDragDataGet(GtkWidget* widget,
- GdkDragContext* context,
- GtkSelectionData* data,
- guint info,
- guint time,
- WidgetGtk* host) {
- host->OnDragDataGet(context, data, info, time);
-}
-
-// static
-void WidgetGtk::CallDragDataReceived(GtkWidget* widget,
- GdkDragContext* context,
- gint x,
- gint y,
- GtkSelectionData* data,
- guint info,
- guint time,
- WidgetGtk* host) {
- return host->OnDragDataReceived(context, x, y, data, info, time);
-}
-
-// static
-void WidgetGtk::CallDragEnd(GtkWidget* widget,
- GdkDragContext* context,
- WidgetGtk* host) {
- host->OnDragEnd(context);
-}
-
-// static
-void WidgetGtk::CallDragLeave(GtkWidget* widget,
- GdkDragContext* context,
- guint time,
- WidgetGtk* host) {
- host->OnDragLeave(context, time);
-}
-
-// static
-void WidgetGtk::CallGrabNotify(GtkWidget* widget, gboolean was_grabbed) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return;
-
- return widget_gtk->OnGrabNotify(widget, was_grabbed);
-}
-
-// static
-void WidgetGtk::CallSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) {
- WidgetGtk* widget_gtk = GetViewForNative(widget);
- if (!widget_gtk)
- return;
-
- widget_gtk->OnSizeAllocate(widget, allocation);
-}
-
-// static
Window* WidgetGtk::GetWindowImpl(GtkWidget* widget) {
GtkWidget* parent = widget;
while (parent) {
diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h
index b317367..075d873 100644
--- a/views/widget/widget_gtk.h
+++ b/views/widget/widget_gtk.h
@@ -8,6 +8,7 @@
#include <gtk/gtk.h>
#include "app/active_window_watcher_x.h"
+#include "app/gtk_signal.h"
#include "base/message_loop.h"
#include "gfx/size.h"
#include "views/focus/focus_manager.h"
@@ -224,52 +225,41 @@ class WidgetGtk
static int GetFlagsForEventButton(const GdkEventButton& event);
// Event handlers:
- virtual void OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation);
- virtual void OnPaint(GtkWidget* widget, GdkEventExpose* event);
- virtual void OnDragDataGet(GdkDragContext* context,
- GtkSelectionData* data,
- guint info,
- guint time);
- virtual void OnDragDataReceived(GdkDragContext* context,
- gint x,
- gint y,
- GtkSelectionData* data,
- guint info,
- guint time);
- virtual gboolean OnDragDrop(GdkDragContext* context,
- gint x,
- gint y,
- guint time);
- virtual void OnDragEnd(GdkDragContext* context);
- virtual gboolean OnDragFailed(GdkDragContext* context,
- GtkDragResult result);
- virtual void OnDragLeave(GdkDragContext* context,
- guint time);
- virtual gboolean OnDragMotion(GdkDragContext* context,
- gint x,
- gint y,
- guint time);
- virtual gboolean OnEnterNotify(GtkWidget* widget, GdkEventCrossing* event);
- virtual gboolean OnLeaveNotify(GtkWidget* widget, GdkEventCrossing* event);
- virtual gboolean OnMotionNotify(GtkWidget* widget, GdkEventMotion* event);
- virtual gboolean OnButtonPress(GtkWidget* widget, GdkEventButton* event);
- virtual gboolean OnButtonRelease(GtkWidget* widget, GdkEventButton* event);
- virtual gboolean OnFocusIn(GtkWidget* widget, GdkEventFocus* event);
- virtual gboolean OnFocusOut(GtkWidget* widget, GdkEventFocus* event);
- virtual gboolean OnKeyPress(GtkWidget* widget, GdkEventKey* event);
- virtual gboolean OnKeyRelease(GtkWidget* widget, GdkEventKey* event);
- virtual gboolean OnQueryTooltip(gint x,
- gint y,
- gboolean keyboard_mode,
- GtkTooltip* tooltip);
- virtual gboolean OnScroll(GtkWidget* widget, GdkEventScroll* event);
- virtual gboolean OnVisibilityNotify(GtkWidget* widget,
- GdkEventVisibility* event) {
- return false;
- }
- virtual gboolean OnGrabBrokeEvent(GtkWidget* widget, GdkEvent* event);
- virtual void OnGrabNotify(GtkWidget* widget, gboolean was_grabbed);
- virtual void OnDestroy();
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnButtonPress, GdkEventButton*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, void, OnSizeAllocate, GtkAllocation*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnPaint, GdkEventExpose*);
+ CHROMEGTK_CALLBACK_4(WidgetGtk, void, OnDragDataGet,
+ GdkDragContext*, GtkSelectionData*, guint, guint);
+ CHROMEGTK_CALLBACK_6(WidgetGtk, void, OnDragDataReceived,
+ GdkDragContext*, gint, gint, GtkSelectionData*,
+ guint, guint);
+ CHROMEGTK_CALLBACK_4(WidgetGtk, gboolean, OnDragDrop,
+ GdkDragContext*, gint, gint, guint);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, void, OnDragEnd, GdkDragContext*);
+ CHROMEGTK_CALLBACK_2(WidgetGtk, gboolean, OnDragFailed,
+ GdkDragContext*, GtkDragResult);
+ CHROMEGTK_CALLBACK_2(WidgetGtk, void, OnDragLeave,
+ GdkDragContext*, guint);
+ CHROMEGTK_CALLBACK_4(WidgetGtk, gboolean, OnDragMotion,
+ GdkDragContext*, gint, gint, guint);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnEnterNotify, GdkEventCrossing*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnLeaveNotify, GdkEventCrossing*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnMotionNotify, GdkEventMotion*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnButtonRelease, GdkEventButton*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnFocusIn, GdkEventFocus*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnFocusOut, GdkEventFocus*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnKeyPress, GdkEventKey*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnKeyRelease, GdkEventKey*);
+ CHROMEGTK_CALLBACK_4(WidgetGtk, gboolean, OnQueryTooltip,
+ gint, gint, gboolean, GtkTooltip*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnScroll, GdkEventScroll*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnVisibilityNotify,
+ GdkEventVisibility*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnGrabBrokeEvent, GdkEvent*);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, void, OnGrabNotify, gboolean);
+ CHROMEGTK_CALLBACK_0(WidgetGtk, void, OnDestroy);
+ CHROMEGTK_CALLBACK_0(WidgetGtk, void, OnShow);
+ CHROMEGTK_CALLBACK_0(WidgetGtk, void, OnHide);
void set_mouse_down(bool mouse_down) { is_mouse_down_ = mouse_down; }
@@ -298,7 +288,7 @@ class WidgetGtk
virtual RootView* CreateRootView();
- void OnWindowPaint(GtkWidget* widget, GdkEventExpose* event);
+ CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnWindowPaint, GdkEventExpose*);
// Process a mouse click.
bool ProcessMousePressed(GdkEventButton* event);
@@ -308,71 +298,6 @@ class WidgetGtk
static void SetRootViewForWidget(GtkWidget* widget, RootView* root_view);
- // A set of static signal handlers that bridge.
- static gboolean CallButtonPress(GtkWidget* widget, GdkEventButton* event);
- static gboolean CallButtonRelease(GtkWidget* widget, GdkEventButton* event);
- static gboolean CallDragDrop(GtkWidget* widget,
- GdkDragContext* context,
- gint x,
- gint y,
- guint time,
- WidgetGtk* host);
- static gboolean CallDragFailed(GtkWidget* widget,
- GdkDragContext* context,
- GtkDragResult result,
- WidgetGtk* host);
- static gboolean CallDragMotion(GtkWidget* widget,
- GdkDragContext* context,
- gint x,
- gint y,
- guint time,
- WidgetGtk* host);
- static gboolean CallEnterNotify(GtkWidget* widget, GdkEventCrossing* event);
- static gboolean CallFocusIn(GtkWidget* widget, GdkEventFocus* event);
- static gboolean CallFocusOut(GtkWidget* widget, GdkEventFocus* event);
- static gboolean CallGrabBrokeEvent(GtkWidget* widget, GdkEvent* event);
- static gboolean CallKeyPress(GtkWidget* widget, GdkEventKey* event);
- static gboolean CallKeyRelease(GtkWidget* widget, GdkEventKey* event);
- static gboolean CallLeaveNotify(GtkWidget* widget, GdkEventCrossing* event);
- static gboolean CallMotionNotify(GtkWidget* widget, GdkEventMotion* event);
- static gboolean CallPaint(GtkWidget* widget, GdkEventExpose* event);
- static gboolean CallQueryTooltip(GtkWidget* widget,
- gint x,
- gint y,
- gboolean keyboard_mode,
- GtkTooltip* tooltip,
- WidgetGtk* host);
- static gboolean CallScroll(GtkWidget* widget, GdkEventScroll* event);
- static gboolean CallVisibilityNotify(GtkWidget* widget,
- GdkEventVisibility* event);
- static gboolean CallWindowPaint(GtkWidget* widget,
- GdkEventExpose* event,
- WidgetGtk* widget_gtk);
- static void CallDestroy(GtkObject* object);
- static void CallDragDataGet(GtkWidget* widget,
- GdkDragContext* context,
- GtkSelectionData* data,
- guint info,
- guint time,
- WidgetGtk* host);
- static void CallDragDataReceived(GtkWidget* widget,
- GdkDragContext* context,
- gint x,
- gint y,
- GtkSelectionData* data,
- guint info,
- guint time,
- WidgetGtk* host);
- static void CallDragEnd(GtkWidget* widget,
- GdkDragContext* context,
- WidgetGtk* host);
- static void CallDragLeave(GtkWidget* widget,
- GdkDragContext* context,
- guint time,
- WidgetGtk* host);
- static void CallGrabNotify(GtkWidget* widget, gboolean was_grabbed);
- static void CallSizeAllocate(GtkWidget* widget, GtkAllocation* allocation);
-
// Returns the first ancestor of |widget| that is a window.
static Window* GetWindowImpl(GtkWidget* widget);
diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc
index a7ef80d..4b0a682 100644
--- a/views/window/window_gtk.cc
+++ b/views/window/window_gtk.cc
@@ -477,9 +477,9 @@ void WindowGtk::SizeWindowToDefault(GtkWindow* parent) {
SetBounds(bounds, NULL);
}
-void WindowGtk::OnDestroy() {
+void WindowGtk::OnDestroy(GtkWidget* widget) {
non_client_view_->WindowClosing();
- WidgetGtk::OnDestroy();
+ WidgetGtk::OnDestroy(widget);
}
} // namespace views
diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h
index a9457af..865ac81 100644
--- a/views/window/window_gtk.h
+++ b/views/window/window_gtk.h
@@ -79,7 +79,7 @@ class WindowGtk : public WidgetGtk, public Window {
// Initializes the window to the passed in bounds.
void Init(GtkWindow* parent, const gfx::Rect& bounds);
- virtual void OnDestroy();
+ virtual void OnDestroy(GtkWidget* widget);
private:
static gboolean CallConfigureEvent(GtkWidget* widget,