summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 17:47:41 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-10 17:47:41 +0000
commite5a2acec061119fab8f5b0a05e79702ae03670dc (patch)
tree24cfd3e9144b9116a060187e5525d21e74363117 /views
parent4f0872bb0ff3bfaca9f765c64a6d76598daf4ed4 (diff)
downloadchromium_src-e5a2acec061119fab8f5b0a05e79702ae03670dc.zip
chromium_src-e5a2acec061119fab8f5b0a05e79702ae03670dc.tar.gz
chromium_src-e5a2acec061119fab8f5b0a05e79702ae03670dc.tar.bz2
Remove redundant casts in g_signal_connect() throughout all gtk code we have.
BUG=none TEST=none Review URL: http://codereview.chromium.org/600033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38629 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/button/native_button_gtk.cc8
-rw-r--r--views/controls/combobox/native_combobox_gtk.cc2
-rw-r--r--views/controls/menu/native_menu_gtk.cc5
-rw-r--r--views/controls/native/native_view_host_gtk.cc4
-rw-r--r--views/controls/native_control_gtk.cc2
-rw-r--r--views/controls/scrollbar/native_scroll_bar_gtk.cc5
-rw-r--r--views/controls/tabbed_pane/native_tabbed_pane_gtk.cc2
-rw-r--r--views/widget/widget_gtk.cc48
8 files changed, 37 insertions, 39 deletions
diff --git a/views/controls/button/native_button_gtk.cc b/views/controls/button/native_button_gtk.cc
index 79314a8..c42bfbf 100644
--- a/views/controls/button/native_button_gtk.cc
+++ b/views/controls/button/native_button_gtk.cc
@@ -93,7 +93,7 @@ gfx::Size NativeButtonGtk::GetPreferredSize() {
void NativeButtonGtk::CreateNativeControl() {
GtkWidget* widget = gtk_button_new();
- g_signal_connect(G_OBJECT(widget), "clicked",
+ g_signal_connect(widget, "clicked",
G_CALLBACK(CallClicked), this);
// Any push button can become the default button.
@@ -137,7 +137,7 @@ Checkbox* NativeCheckboxGtk::checkbox() {
void NativeCheckboxGtk::CreateNativeControl() {
GtkWidget* widget = gtk_check_button_new();
- g_signal_connect(G_OBJECT(widget), "clicked",
+ g_signal_connect(widget, "clicked",
G_CALLBACK(CallClicked), this);
NativeControlCreated(widget);
}
@@ -189,9 +189,9 @@ RadioButton* NativeRadioButtonGtk::radio_button() {
void NativeRadioButtonGtk::CreateNativeControl() {
GtkWidget* widget = gtk_radio_button_new(NULL);
- g_signal_connect(G_OBJECT(widget), "clicked",
+ g_signal_connect(widget, "clicked",
G_CALLBACK(CallClicked), this);
- g_signal_connect(G_OBJECT(widget), "toggled",
+ g_signal_connect(widget, "toggled",
G_CALLBACK(CallToggled), this);
NativeControlCreated(widget);
}
diff --git a/views/controls/combobox/native_combobox_gtk.cc b/views/controls/combobox/native_combobox_gtk.cc
index a4ff24ce..581fea3 100644
--- a/views/controls/combobox/native_combobox_gtk.cc
+++ b/views/controls/combobox/native_combobox_gtk.cc
@@ -110,7 +110,7 @@ void NativeComboboxGtk::CreateNativeControl() {
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(widget), cell, TRUE);
gtk_cell_layout_set_attributes(
GTK_CELL_LAYOUT(widget), cell, "text", 0, NULL);
- g_signal_connect(G_OBJECT(widget), "changed",
+ g_signal_connect(widget, "changed",
G_CALLBACK(CallChanged), this);
NativeControlCreated(widget);
diff --git a/views/controls/menu/native_menu_gtk.cc b/views/controls/menu/native_menu_gtk.cc
index c1c2d22..144111a 100644
--- a/views/controls/menu/native_menu_gtk.cc
+++ b/views/controls/menu/native_menu_gtk.cc
@@ -100,7 +100,7 @@ void NativeMenuGtk::RunMenuAt(const gfx::Point& point, int alignment) {
// Listen for "hide" signal so that we know when to return from the blocking
// RunMenuAt call.
gint handle_id =
- g_signal_connect(G_OBJECT(menu_), "hide", G_CALLBACK(OnMenuHidden), this);
+ g_signal_connect(menu_, "hide", G_CALLBACK(OnMenuHidden), this);
// Block until menu is no longer shown by running a nested message loop.
MessageLoopForUI::current()->Run(NULL);
@@ -228,8 +228,7 @@ GtkWidget* NativeMenuGtk::AddMenuItemAt(int index,
}
g_object_set_data(G_OBJECT(menu_item), kPositionString,
reinterpret_cast<void*>(index));
- g_signal_connect(G_OBJECT(menu_item), "activate", G_CALLBACK(CallActivate),
- this);
+ g_signal_connect(menu_item, "activate", G_CALLBACK(CallActivate), this);
gtk_widget_show(menu_item);
gtk_menu_append(menu_, menu_item);
diff --git a/views/controls/native/native_view_host_gtk.cc b/views/controls/native/native_view_host_gtk.cc
index e8862e0..9b390e9 100644
--- a/views/controls/native/native_view_host_gtk.cc
+++ b/views/controls/native/native_view_host_gtk.cc
@@ -111,13 +111,13 @@ void NativeViewHostGtk::NativeViewAttached() {
gtk_container_add(GTK_CONTAINER(fixed_), host_->native_view());
if (!destroy_signal_id_) {
- destroy_signal_id_ = g_signal_connect(G_OBJECT(host_->native_view()),
+ destroy_signal_id_ = g_signal_connect(host_->native_view(),
"destroy", G_CALLBACK(CallDestroy),
this);
}
if (!focus_signal_id_) {
- focus_signal_id_ = g_signal_connect(G_OBJECT(host_->native_view()),
+ focus_signal_id_ = g_signal_connect(host_->native_view(),
"focus-in-event",
G_CALLBACK(CallFocusIn), this);
}
diff --git a/views/controls/native_control_gtk.cc b/views/controls/native_control_gtk.cc
index 66e6994..6857d48 100644
--- a/views/controls/native_control_gtk.cc
+++ b/views/controls/native_control_gtk.cc
@@ -75,7 +75,7 @@ void NativeControlGtk::NativeControlCreated(GtkWidget* native_control) {
gtk_widget_set_sensitive(native_view(), IsEnabled());
// Listen for focus change event to update the FocusManager focused view.
- g_signal_connect(G_OBJECT(native_control), "focus-in-event",
+ g_signal_connect(native_control, "focus-in-event",
G_CALLBACK(CallFocusIn), this);
}
diff --git a/views/controls/scrollbar/native_scroll_bar_gtk.cc b/views/controls/scrollbar/native_scroll_bar_gtk.cc
index 616ff7f..30d714a 100644
--- a/views/controls/scrollbar/native_scroll_bar_gtk.cc
+++ b/views/controls/scrollbar/native_scroll_bar_gtk.cc
@@ -104,7 +104,7 @@ void NativeScrollBarGtk::CreateNativeControl() {
gtk_range_set_update_policy(GTK_RANGE(widget), GTK_UPDATE_CONTINUOUS);
- g_signal_connect(G_OBJECT(adj), "value-changed",
+ g_signal_connect(adj, "value-changed",
G_CALLBACK(CallValueChanged), this);
NativeControlCreated(widget);
@@ -148,8 +148,7 @@ void NativeScrollBarGtk::Update(int viewport_size,
step, page,
viewport_size);
gtk_range_set_adjustment(GTK_RANGE(native_view()), GTK_ADJUSTMENT(adj));
- g_signal_connect(G_OBJECT(adj), "value-changed",
- G_CALLBACK(CallValueChanged), this);
+ g_signal_connect(adj, "value-changed", G_CALLBACK(CallValueChanged), this);
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc
index eb8f5f2..110a688 100644
--- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc
+++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc
@@ -113,7 +113,7 @@ gfx::NativeView NativeTabbedPaneGtk::GetTestingHandle() const {
void NativeTabbedPaneGtk::CreateNativeControl() {
GtkWidget* widget = gtk_notebook_new();
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(widget), GTK_POS_TOP);
- g_signal_connect(G_OBJECT(widget), "switch-page",
+ g_signal_connect(widget, "switch-page",
G_CALLBACK(CallSwitchPage), this);
NativeControlCreated(widget);
}
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 961dd85..3f9b3c4 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -302,68 +302,68 @@ void WidgetGtk::Init(GtkWidget* parent,
// TODO(beng): make these take this rather than NULL.
g_signal_connect_after(G_OBJECT(window_contents_), "size_allocate",
G_CALLBACK(CallSizeAllocate), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "expose_event",
+ g_signal_connect(window_contents_, "expose_event",
G_CALLBACK(CallPaint), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "enter_notify_event",
+ g_signal_connect(window_contents_, "enter_notify_event",
G_CALLBACK(CallEnterNotify), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "leave_notify_event",
+ g_signal_connect(window_contents_, "leave_notify_event",
G_CALLBACK(CallLeaveNotify), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "motion_notify_event",
+ g_signal_connect(window_contents_, "motion_notify_event",
G_CALLBACK(CallMotionNotify), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "button_press_event",
+ g_signal_connect(window_contents_, "button_press_event",
G_CALLBACK(CallButtonPress), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "button_release_event",
+ g_signal_connect(window_contents_, "button_release_event",
G_CALLBACK(CallButtonRelease), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "grab_broken_event",
+ g_signal_connect(window_contents_, "grab_broken_event",
G_CALLBACK(CallGrabBrokeEvent), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "grab_notify",
+ g_signal_connect(window_contents_, "grab_notify",
G_CALLBACK(CallGrabNotify), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "key_press_event",
+ g_signal_connect(window_contents_, "key_press_event",
G_CALLBACK(CallKeyPress), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "key_release_event",
+ g_signal_connect(window_contents_, "key_release_event",
G_CALLBACK(CallKeyRelease), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "scroll_event",
+ g_signal_connect(window_contents_, "scroll_event",
G_CALLBACK(CallScroll), NULL);
- g_signal_connect(G_OBJECT(window_contents_), "visibility_notify_event",
+ g_signal_connect(window_contents_, "visibility_notify_event",
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(G_OBJECT(widget_), "focus_in_event",
+ g_signal_connect(widget_, "focus_in_event",
G_CALLBACK(CallFocusIn), NULL);
- g_signal_connect(G_OBJECT(widget_), "focus_out_event",
+ g_signal_connect(widget_, "focus_out_event",
G_CALLBACK(CallFocusOut), NULL);
- g_signal_connect(G_OBJECT(widget_), "destroy",
+ g_signal_connect(widget_, "destroy",
G_CALLBACK(CallDestroy), NULL);
if (transparent_) {
- g_signal_connect(G_OBJECT(widget_), "expose_event",
+ g_signal_connect(widget_, "expose_event",
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(G_OBJECT(window_contents_), "drag_motion",
+ g_signal_connect(window_contents_, "drag_motion",
G_CALLBACK(CallDragMotion), this);
- g_signal_connect(G_OBJECT(window_contents_), "drag_data_received",
+ g_signal_connect(window_contents_, "drag_data_received",
G_CALLBACK(CallDragDataReceived), this);
- g_signal_connect(G_OBJECT(window_contents_), "drag_drop",
+ g_signal_connect(window_contents_, "drag_drop",
G_CALLBACK(CallDragDrop), this);
- g_signal_connect(G_OBJECT(window_contents_), "drag_leave",
+ g_signal_connect(window_contents_, "drag_leave",
G_CALLBACK(CallDragLeave), this);
- g_signal_connect(G_OBJECT(window_contents_), "drag_data_get",
+ g_signal_connect(window_contents_, "drag_data_get",
G_CALLBACK(CallDragDataGet), this);
- g_signal_connect(G_OBJECT(window_contents_), "drag_end",
+ g_signal_connect(window_contents_, "drag_end",
G_CALLBACK(CallDragEnd), this);
- g_signal_connect(G_OBJECT(window_contents_), "drag_failed",
+ g_signal_connect(window_contents_, "drag_failed",
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(G_OBJECT(window_contents_), "query_tooltip",
+ g_signal_connect(window_contents_, "query_tooltip",
G_CALLBACK(CallQueryTooltip), this);
if (type_ == TYPE_CHILD) {