diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 07:24:49 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 07:24:49 +0000 |
commit | d33a47ce26330b024214b0ecfb8b2c5cda218233 (patch) | |
tree | cf2e53aa1f65c379095199c252c20630553c775d /views | |
parent | 7b7bbbe82533e74b60a924dc4d563f6d3f07482c (diff) | |
download | chromium_src-d33a47ce26330b024214b0ecfb8b2c5cda218233.zip chromium_src-d33a47ce26330b024214b0ecfb8b2c5cda218233.tar.gz chromium_src-d33a47ce26330b024214b0ecfb8b2c5cda218233.tar.bz2 |
Revert "Make DevTools open docked by default for chrome os."
This reverts commit r41641 because all the devtools interactive_ui_tests
are failing.
TBR=xiyuan
Review URL: http://codereview.chromium.org/1007004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/widget_gtk.cc | 327 | ||||
-rw-r--r-- | views/widget/widget_gtk.h | 149 | ||||
-rw-r--r-- | views/window/window_gtk.cc | 4 | ||||
-rw-r--r-- | views/window/window_gtk.h | 2 |
4 files changed, 381 insertions, 101 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 2c4c80a..ac78404 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -317,75 +317,72 @@ 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(&OnSizeAllocateThunk), this); + G_CALLBACK(CallSizeAllocate), NULL); g_signal_connect(window_contents_, "expose_event", - G_CALLBACK(&OnPaintThunk), this); + G_CALLBACK(CallPaint), NULL); g_signal_connect(window_contents_, "enter_notify_event", - G_CALLBACK(&OnEnterNotifyThunk), this); + G_CALLBACK(CallEnterNotify), NULL); g_signal_connect(window_contents_, "leave_notify_event", - G_CALLBACK(&OnLeaveNotifyThunk), this); + G_CALLBACK(CallLeaveNotify), NULL); g_signal_connect(window_contents_, "motion_notify_event", - G_CALLBACK(&OnMotionNotifyThunk), this); + G_CALLBACK(CallMotionNotify), NULL); g_signal_connect(window_contents_, "button_press_event", - G_CALLBACK(&OnButtonPressThunk), this); + G_CALLBACK(CallButtonPress), NULL); g_signal_connect(window_contents_, "button_release_event", - G_CALLBACK(&OnButtonReleaseThunk), this); + G_CALLBACK(CallButtonRelease), NULL); g_signal_connect(window_contents_, "grab_broken_event", - G_CALLBACK(&OnGrabBrokeEventThunk), this); + G_CALLBACK(CallGrabBrokeEvent), NULL); g_signal_connect(window_contents_, "grab_notify", - G_CALLBACK(&OnGrabNotifyThunk), this); + G_CALLBACK(CallGrabNotify), NULL); g_signal_connect(window_contents_, "key_press_event", - G_CALLBACK(&OnKeyPressThunk), this); + G_CALLBACK(CallKeyPress), NULL); g_signal_connect(window_contents_, "key_release_event", - G_CALLBACK(&OnKeyReleaseThunk), this); + G_CALLBACK(CallKeyRelease), NULL); g_signal_connect(window_contents_, "scroll_event", - G_CALLBACK(&OnScrollThunk), this); + G_CALLBACK(CallScroll), NULL); g_signal_connect(window_contents_, "visibility_notify_event", - G_CALLBACK(&OnVisibilityNotifyThunk), this); + G_CALLBACK(CallVisibilityNotify), NULL); // 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(&OnFocusInThunk), this); + G_CALLBACK(CallFocusIn), NULL); g_signal_connect(widget_, "focus_out_event", - G_CALLBACK(&OnFocusOutThunk), this); + G_CALLBACK(CallFocusOut), NULL); g_signal_connect(widget_, "destroy", - G_CALLBACK(&OnDestroyThunk), this); - g_signal_connect(widget_, "show", - G_CALLBACK(&OnShowThunk), this); - g_signal_connect(widget_, "hide", - G_CALLBACK(&OnHideThunk), this); + G_CALLBACK(CallDestroy), NULL); if (transparent_) { g_signal_connect(widget_, "expose_event", - G_CALLBACK(&OnWindowPaintThunk), this); + G_CALLBACK(CallWindowPaint), 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(&OnDragMotionThunk), this); + G_CALLBACK(CallDragMotion), this); g_signal_connect(window_contents_, "drag_data_received", - G_CALLBACK(&OnDragDataReceivedThunk), this); + G_CALLBACK(CallDragDataReceived), this); g_signal_connect(window_contents_, "drag_drop", - G_CALLBACK(&OnDragDropThunk), this); + G_CALLBACK(CallDragDrop), this); g_signal_connect(window_contents_, "drag_leave", - G_CALLBACK(&OnDragLeaveThunk), this); + G_CALLBACK(CallDragLeave), this); g_signal_connect(window_contents_, "drag_data_get", - G_CALLBACK(&OnDragDataGetThunk), this); + G_CALLBACK(CallDragDataGet), this); g_signal_connect(window_contents_, "drag_end", - G_CALLBACK(&OnDragEndThunk), this); + G_CALLBACK(CallDragEnd), this); g_signal_connect(window_contents_, "drag_failed", - G_CALLBACK(&OnDragFailedThunk), this); + G_CALLBACK(CallDragFailed), 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(&OnQueryTooltipThunk), this); + G_CALLBACK(CallQueryTooltip), this); if (type_ == TYPE_CHILD) { if (parent) { @@ -705,13 +702,11 @@ void WidgetGtk::OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) { root_view_->SchedulePaint(); } -gboolean WidgetGtk::OnPaint(GtkWidget* widget, GdkEventExpose* event) { +void 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(GtkWidget* widget, - GdkDragContext* context, +void WidgetGtk::OnDragDataGet(GdkDragContext* context, GtkSelectionData* data, guint info, guint time) { @@ -722,8 +717,7 @@ void WidgetGtk::OnDragDataGet(GtkWidget* widget, drag_data_->WriteFormatToSelection(info, data); } -void WidgetGtk::OnDragDataReceived(GtkWidget* widget, - GdkDragContext* context, +void WidgetGtk::OnDragDataReceived(GdkDragContext* context, gint x, gint y, GtkSelectionData* data, @@ -733,8 +727,7 @@ void WidgetGtk::OnDragDataReceived(GtkWidget* widget, drop_target_->OnDragDataReceived(context, x, y, data, info, time); } -gboolean WidgetGtk::OnDragDrop(GtkWidget* widget, - GdkDragContext* context, +gboolean WidgetGtk::OnDragDrop(GdkDragContext* context, gint x, gint y, guint time) { @@ -744,7 +737,7 @@ gboolean WidgetGtk::OnDragDrop(GtkWidget* widget, return FALSE; } -void WidgetGtk::OnDragEnd(GtkWidget* widget, GdkDragContext* context) { +void WidgetGtk::OnDragEnd(GdkDragContext* context) { if (!drag_data_) { // This indicates we didn't start a drag operation, and should never // happen. @@ -755,14 +748,12 @@ void WidgetGtk::OnDragEnd(GtkWidget* widget, GdkDragContext* context) { MessageLoop::current()->Quit(); } -gboolean WidgetGtk::OnDragFailed(GtkWidget* widget, - GdkDragContext* context, +gboolean WidgetGtk::OnDragFailed(GdkDragContext* context, GtkDragResult result) { return FALSE; } -void WidgetGtk::OnDragLeave(GtkWidget* widget, - GdkDragContext* context, +void WidgetGtk::OnDragLeave(GdkDragContext* context, guint time) { if (ignore_drag_leave_) { ignore_drag_leave_ = false; @@ -774,8 +765,7 @@ void WidgetGtk::OnDragLeave(GtkWidget* widget, } } -gboolean WidgetGtk::OnDragMotion(GtkWidget* widget, - GdkDragContext* context, +gboolean WidgetGtk::OnDragMotion(GdkDragContext* context, gint x, gint y, guint time) { @@ -903,19 +893,13 @@ gboolean WidgetGtk::OnKeyRelease(GtkWidget* widget, GdkEventKey* event) { return root_view_->ProcessKeyEvent(key_event); } -gboolean WidgetGtk::OnQueryTooltip(GtkWidget* widget, - gint x, +gboolean WidgetGtk::OnQueryTooltip(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. @@ -926,8 +910,7 @@ void WidgetGtk::OnGrabNotify(GtkWidget* widget, gboolean was_grabbed) { HandleGrabBroke(); } -void WidgetGtk::OnDestroy(GtkWidget* object) { - // Note that this handler is hooked to GtkObject::destroy. +void WidgetGtk::OnDestroy() { widget_ = window_contents_ = NULL; if (delete_on_destroy_) { // Delays the deletion of this WidgetGtk as we want its children to have @@ -936,12 +919,6 @@ void WidgetGtk::OnDestroy(GtkWidget* object) { } } -void WidgetGtk::OnShow(GtkWidget* widget) { -} - -void WidgetGtk::OnHide(GtkWidget* widget) { -} - void WidgetGtk::DoGrab() { has_capture_ = true; gtk_grab_add(window_contents_); @@ -966,7 +943,7 @@ RootView* WidgetGtk::CreateRootView() { return new RootView(this); } -gboolean WidgetGtk::OnWindowPaint(GtkWidget* widget, GdkEventExpose* event) { +void 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 @@ -982,7 +959,6 @@ gboolean WidgetGtk::OnWindowPaint(GtkWidget* widget, GdkEventExpose* event) { cairo_set_source_rgba(cr, 0, 0, 0, 0); cairo_rectangle(cr, 0, 0, width, height); cairo_fill(cr); - return false; } bool WidgetGtk::ProcessMousePressed(GdkEventButton* event) { @@ -1072,6 +1048,235 @@ 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 075d873..b317367 100644 --- a/views/widget/widget_gtk.h +++ b/views/widget/widget_gtk.h @@ -8,7 +8,6 @@ #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" @@ -225,41 +224,52 @@ class WidgetGtk static int GetFlagsForEventButton(const GdkEventButton& event); // Event handlers: - 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); + 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(); void set_mouse_down(bool mouse_down) { is_mouse_down_ = mouse_down; } @@ -288,7 +298,7 @@ class WidgetGtk virtual RootView* CreateRootView(); - CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnWindowPaint, GdkEventExpose*); + void OnWindowPaint(GtkWidget* widget, GdkEventExpose* event); // Process a mouse click. bool ProcessMousePressed(GdkEventButton* event); @@ -298,6 +308,71 @@ 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 1c7fd88..171f222 100644 --- a/views/window/window_gtk.cc +++ b/views/window/window_gtk.cc @@ -476,9 +476,9 @@ void WindowGtk::SizeWindowToDefault(GtkWindow* parent) { SetBounds(bounds, NULL); } -void WindowGtk::OnDestroy(GtkWidget* widget) { +void WindowGtk::OnDestroy() { non_client_view_->WindowClosing(); - WidgetGtk::OnDestroy(widget); + WidgetGtk::OnDestroy(); } } // namespace views diff --git a/views/window/window_gtk.h b/views/window/window_gtk.h index 865ac81..a9457af 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(GtkWidget* widget); + virtual void OnDestroy(); private: static gboolean CallConfigureEvent(GtkWidget* widget, |