From 10bd1f7d3bae0955cc7244c8c35d5e1151517c94 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sat, 21 Apr 2007 17:02:29 +0000 Subject: [PATCH] remove redundant GTK_WIDGET casts git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/animate.cpp | 2 +- src/gtk/clipbrd.cpp | 2 +- src/gtk/clrpicker.cpp | 2 +- src/gtk/collpane.cpp | 2 +- src/gtk/combobox.cpp | 4 ++-- src/gtk/dnd.cpp | 2 +- src/gtk/filepicker.cpp | 4 ++-- src/gtk/fontpicker.cpp | 2 +- src/gtk/frame.cpp | 4 ++-- src/gtk/hyperlink.cpp | 2 +- src/gtk/menu.cpp | 18 +++++++++--------- src/gtk/popupwin.cpp | 2 +- src/gtk/scrolbar.cpp | 2 +- src/gtk/toplevel.cpp | 4 ++-- src/gtk/window.cpp | 8 ++++---- 15 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/gtk/animate.cpp b/src/gtk/animate.cpp index 2999905883..3d236e57ee 100644 --- a/src/gtk/animate.cpp +++ b/src/gtk/animate.cpp @@ -212,7 +212,7 @@ bool wxAnimationCtrl::Create( wxWindow *parent, wxWindowID id, SetWindowStyle(style); m_widget = gtk_image_new(); - gtk_widget_show( GTK_WIDGET(m_widget) ); + gtk_widget_show(m_widget); m_parent->DoAddChild( this ); diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 143a624fdc..483b6beca4 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -439,7 +439,7 @@ void wxClipboard::AddSupportedTarget(GdkAtom atom) { gtk_selection_add_target ( - GTK_WIDGET(m_clipboardWidget), + m_clipboardWidget, GTKGetClipboardAtom(), atom, 0 // info (same as client data) unused diff --git a/src/gtk/clrpicker.cpp b/src/gtk/clrpicker.cpp index a710f9fa33..e90fb97c5b 100644 --- a/src/gtk/clrpicker.cpp +++ b/src/gtk/clrpicker.cpp @@ -72,7 +72,7 @@ bool wxColourButton::Create( wxWindow *parent, wxWindowID id, m_colour = col; m_widget = gtk_color_button_new_with_color( m_colour.GetColor() ); - gtk_widget_show( GTK_WIDGET(m_widget) ); + gtk_widget_show(m_widget); // GtkColourButton signals g_signal_connect(m_widget, "color-set", diff --git a/src/gtk/collpane.cpp b/src/gtk/collpane.cpp index 3ba9f7e25f..277601c171 100644 --- a/src/gtk/collpane.cpp +++ b/src/gtk/collpane.cpp @@ -225,7 +225,7 @@ bool wxCollapsiblePane::Create(wxWindow *parent, m_pPane = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxNO_BORDER); - gtk_widget_show( GTK_WIDGET(m_widget) ); + gtk_widget_show(m_widget); m_parent->DoAddChild( this ); PostCreation(size); diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 1a10d9b366..807fdf895b 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -426,9 +426,9 @@ int wxComboBox::DoAppend( const wxString &item ) GtkRcStyle *style = CreateWidgetStyle(); if (style) { - gtk_widget_modify_style( GTK_WIDGET( list_item ), style ); + gtk_widget_modify_style(list_item, style); GtkBin *bin = GTK_BIN( list_item ); - GtkWidget *label = GTK_WIDGET( bin->child ); + GtkWidget *label = bin->child; gtk_widget_modify_style( label, style ); gtk_rc_style_unref( style ); } diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index 9fd807bddb..c995a53350 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -778,7 +778,7 @@ void wxDropSource::PrepareIcon( int action, GdkDragContext *context ) m_iconWindow = gtk_window_new (GTK_WINDOW_POPUP); gtk_widget_set_events (m_iconWindow, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); - gtk_widget_set_app_paintable (GTK_WIDGET (m_iconWindow), TRUE); + gtk_widget_set_app_paintable (m_iconWindow, TRUE); gtk_widget_pop_colormap (); diff --git a/src/gtk/filepicker.cpp b/src/gtk/filepicker.cpp index 32d0c62808..01702dd37c 100644 --- a/src/gtk/filepicker.cpp +++ b/src/gtk/filepicker.cpp @@ -81,7 +81,7 @@ bool wxFileButton::Create( wxWindow *parent, wxWindowID id, // NOTE: we deliberately ignore the given label as GtkFileChooserButton // use as label the currently selected file m_widget = gtk_file_chooser_button_new_with_dialog( m_dialog->m_widget ); - gtk_widget_show( GTK_WIDGET(m_widget) ); + gtk_widget_show(m_widget); // we need to know when the dialog has been dismissed clicking OK... // NOTE: the "clicked" signal is not available for a GtkFileChooserButton @@ -230,7 +230,7 @@ bool wxDirButton::Create( wxWindow *parent, wxWindowID id, // use as label the currently selected file m_widget = gtk_file_chooser_button_new_with_dialog( m_dialog->m_widget ); - gtk_widget_show( GTK_WIDGET(m_widget) ); + gtk_widget_show(m_widget); // GtkFileChooserButton signals g_signal_connect(m_widget, "current-folder-changed", diff --git a/src/gtk/fontpicker.cpp b/src/gtk/fontpicker.cpp index 97102051c8..325280de30 100644 --- a/src/gtk/fontpicker.cpp +++ b/src/gtk/fontpicker.cpp @@ -84,7 +84,7 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id, gtk_font_button_set_use_size(GTK_FONT_BUTTON(m_widget), usefont); gtk_font_button_set_use_font(GTK_FONT_BUTTON(m_widget), usefont); - gtk_widget_show( GTK_WIDGET(m_widget) ); + gtk_widget_show(m_widget); // GtkFontButton signals g_signal_connect(m_widget, "font-set", diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 0e3732b33a..feaf71767f 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -133,7 +133,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child ) // These are outside the client area wxFrame* frame = (wxFrame*) parent; gtk_pizza_put( GTK_PIZZA(frame->m_mainWidget), - GTK_WIDGET(child->m_widget), + child->m_widget, child->m_x, child->m_y, child->m_width, @@ -161,7 +161,7 @@ static void wxInsertChildInFrame( wxFrame* parent, wxWindow* child ) { // These are inside the client area gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow), - GTK_WIDGET(child->m_widget), + child->m_widget, child->m_x, child->m_y, child->m_width, diff --git a/src/gtk/hyperlink.cpp b/src/gtk/hyperlink.cpp index 046c601aeb..701aeb934d 100644 --- a/src/gtk/hyperlink.cpp +++ b/src/gtk/hyperlink.cpp @@ -86,7 +86,7 @@ bool wxHyperlinkCtrl::Create(wxWindow *parent, wxWindowID id, } m_widget = gtk_link_button_new("asdfsaf asdfdsaf asdfdsa"); - gtk_widget_show( GTK_WIDGET(m_widget) ); + gtk_widget_show(m_widget); // alignment float x_alignment = 0.5; diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 630bd5d1b3..65006103ee 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -157,12 +157,12 @@ void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long st if (style & wxMB_DOCKABLE) { m_widget = gtk_handle_box_new(); - gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_menubar) ); - gtk_widget_show( GTK_WIDGET(m_menubar) ); + gtk_container_add(GTK_CONTAINER(m_widget), m_menubar); + gtk_widget_show(m_menubar); } else { - m_widget = GTK_WIDGET(m_menubar); + m_widget = m_menubar; } PostCreation(); @@ -823,7 +823,7 @@ void wxMenuItem::SetText( const wxString& str ) gtk_accelerator_parse( (const char*) oldbuf, &accel_key, &accel_mods); if (accel_key != 0) { - gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem), + gtk_widget_remove_accelerator(m_menuItem, m_parentMenu->m_accel, accel_key, accel_mods ); @@ -833,7 +833,7 @@ void wxMenuItem::SetText( const wxString& str ) { // if the accelerator was taken from a stock ID, just get it back from GTK+ stock if (wxGetStockGtkAccelerator(stockid, &accel_mods, &accel_key)) - gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem), + gtk_widget_remove_accelerator( m_menuItem, m_parentMenu->m_accel, accel_key, accel_mods ); @@ -846,7 +846,7 @@ void wxMenuItem::SetText( const wxString& str ) gtk_accelerator_parse( (const char*) buf, &accel_key, &accel_mods); if (accel_key != 0) { - gtk_widget_add_accelerator( GTK_WIDGET(m_menuItem), + gtk_widget_add_accelerator( m_menuItem, "activate", m_parentMenu->m_accel, accel_key, @@ -858,7 +858,7 @@ void wxMenuItem::SetText( const wxString& str ) { // if the accelerator was taken from a stock ID, just get it back from GTK+ stock if (wxGetStockGtkAccelerator(stockid, &accel_mods, &accel_key)) - gtk_widget_remove_accelerator( GTK_WIDGET(m_menuItem), + gtk_widget_remove_accelerator( m_menuItem, m_parentMenu->m_accel, accel_key, accel_mods ); @@ -1164,7 +1164,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos) gtk_accelerator_parse( (const char*) buf, &accel_key, &accel_mods); if (accel_key != 0) { - gtk_widget_add_accelerator (GTK_WIDGET(menuItem), + gtk_widget_add_accelerator (menuItem, "activate", m_accel, accel_key, @@ -1176,7 +1176,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos) { // if the accelerator was taken from a stock ID, just get it back from GTK+ stock if (wxGetStockGtkAccelerator(stockid, &accel_mods, &accel_key)) - gtk_widget_add_accelerator( GTK_WIDGET(menuItem), + gtk_widget_add_accelerator( menuItem, "activate", m_accel, accel_key, diff --git a/src/gtk/popupwin.cpp b/src/gtk/popupwin.cpp index 9bd674d57d..c3a890bd71 100644 --- a/src/gtk/popupwin.cpp +++ b/src/gtk/popupwin.cpp @@ -113,7 +113,7 @@ gtk_dialog_realized_callback( GtkWidget * WXUNUSED(widget), wxPopupWindow *win ) static void wxInsertChildInDialog( wxPopupWindow* parent, wxWindow* child ) { gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow), - GTK_WIDGET(child->m_widget), + child->m_widget, child->m_x, child->m_y, child->m_width, diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index bad705e026..f13b47a756 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -244,7 +244,7 @@ void wxScrollBar::SetRange(int range) GdkWindow *wxScrollBar::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const { - return GTK_WIDGET(GTK_RANGE(m_widget))->window; + return m_widget->window; } // static diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index d25800f41e..a50d28e0f6 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -400,7 +400,7 @@ static void wxInsertChildInTopLevelWindow( wxTopLevelWindowGTK* parent, wxWindow // these are outside the client area wxTopLevelWindowGTK* frame = (wxTopLevelWindowGTK*) parent; gtk_pizza_put( GTK_PIZZA(frame->m_mainWidget), - GTK_WIDGET(child->m_widget), + child->m_widget, child->m_x, child->m_y, child->m_width, @@ -410,7 +410,7 @@ static void wxInsertChildInTopLevelWindow( wxTopLevelWindowGTK* parent, wxWindow { // these are inside the client area gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow), - GTK_WIDGET(child->m_widget), + child->m_widget, child->m_x, child->m_y, child->m_width, diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index f7c8878b37..5546f6cca7 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2161,7 +2161,7 @@ static void wxInsertChildInWindow( wxWindowGTK* parent, wxWindowGTK* child ) child->m_y += gtk_pizza_get_yoffset( pizza ); gtk_pizza_put( GTK_PIZZA(parent->m_wxwindow), - GTK_WIDGET(child->m_widget), + child->m_widget, child->m_x, child->m_y, child->m_width, @@ -2669,7 +2669,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags if (wxDynamicCast(GetParent(), wxToolBar)) { // don't take the x,y values, they're wrong because toolbar sets them - GtkWidget *widget = GTK_WIDGET(m_widget); + GtkWidget *widget = m_widget; gtk_widget_set_size_request (widget, m_width, m_height); } else @@ -3321,7 +3321,7 @@ void wxWindowGTK::RemoveChild(wxWindowBase *child) /* static */ wxLayoutDirection wxWindowGTK::GTKGetLayout(GtkWidget *widget) { - return gtk_widget_get_direction(GTK_WIDGET(widget)) == GTK_TEXT_DIR_RTL + return gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL ? wxLayout_RightToLeft : wxLayout_LeftToRight; } @@ -3331,7 +3331,7 @@ void wxWindowGTK::GTKSetLayout(GtkWidget *widget, wxLayoutDirection dir) { wxASSERT_MSG( dir != wxLayout_Default, _T("invalid layout direction") ); - gtk_widget_set_direction(GTK_WIDGET(widget), + gtk_widget_set_direction(widget, dir == wxLayout_RightToLeft ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); }