From: Václav Slavík Date: Sat, 26 Mar 2011 15:49:57 +0000 (+0000) Subject: Use accessor functions instead of deprecated GTK+ macros. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fc9ab22a7692aa822bb3d8e6326dfb73d12a600b Use accessor functions instead of deprecated GTK+ macros. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67312 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/private.h b/include/wx/gtk/private.h index b63479d372..00f2c9f759 100644 --- a/include/wx/gtk/private.h +++ b/include/wx/gtk/private.h @@ -15,6 +15,7 @@ #include #include "wx/gtk/private/string.h" +#include "wx/gtk/private/compat.h" // pango_version_check symbol is quite recent ATM (4/2007)... so we // use our own wrapper which implements a smart trick. diff --git a/include/wx/gtk/private/compat.h b/include/wx/gtk/private/compat.h new file mode 100644 index 0000000000..df26d5e32f --- /dev/null +++ b/include/wx/gtk/private/compat.h @@ -0,0 +1,152 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/gtk/private/compat.h +// Purpose: Compatibility code for older GTK+ versions +// Author: Vaclav Slavik +// Created: 2011-03-25 +// RCS-ID: $Id$ +// Copyright: (c) 2011 Vaclav Slavik +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_GTK_PRIVATE_COMPAT_H_ +#define _WX_GTK_PRIVATE_COMPAT_H_ + +// ---------------------------------------------------------------------------- +// Implementations of new accessors for older GTK+ versions +// ---------------------------------------------------------------------------- + +// GTK+ deprecated direct access to struct members and some other stuff, +// replacing them with simple accessor functions. These aren't available in +// older versions, though, so we have to provide them for compatibility. +// +// Note: wx_ prefix is used to avoid symbol conflicts at runtime + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_has_window(GtkWidget *widget) + { + return !GTK_WIDGET_NO_WINDOW(widget); + } + #define gtk_widget_get_has_window wx_gtk_widget_get_has_window +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_has_grab(GtkWidget *widget) + { + return GTK_WIDGET_HAS_GRAB(widget); + } + #define gtk_widget_get_has_grab wx_gtk_widget_get_has_grab +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_visible(GtkWidget *widget) + { + return GTK_WIDGET_VISIBLE(widget); + } + #define gtk_widget_get_visible wx_gtk_widget_get_visible +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_sensitive(GtkWidget *widget) + { + return GTK_WIDGET_VISIBLE(widget); + } + #define gtk_widget_get_sensitive wx_gtk_widget_get_sensitive +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_is_drawable(GtkWidget *widget) + { + return GTK_WIDGET_DRAWABLE(widget); + } + #define gtk_widget_is_drawable wx_gtk_widget_is_drawable +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_can_focus(GtkWidget *widget) + { + return GTK_WIDGET_CAN_FOCUS(widget); + } + #define gtk_widget_get_can_focus wx_gtk_widget_get_can_focus + + inline void wx_gtk_widset_set_can_focus(GtkWidget *widget, gboolean can) + { + if ( can ) + GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS); + else + GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_FOCUS); + } + #define gtk_widset_set_can_focus wx_gtk_widset_set_can_focus +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_can_default(GtkWidget *widget) + { + return GTK_WIDGET_CAN_DEFAULT(widget); + } + #define gtk_widget_get_can_default wx_gtk_widget_get_can_default + + inline void wx_gtk_widget_set_can_default(GtkWidget *widget, gboolean can) + { + if ( can ) + GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT); + else + GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_DEFAULT); + } + #define gtk_widget_set_can_default wx_gtk_widget_set_can_default +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_has_default(GtkWidget *widget) + { + return GTK_WIDGET_HAS_DEFAULT(widget); + } + #define gtk_widget_has_default wx_gtk_widget_has_default +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline GtkStateType wx_gtk_widget_get_state(GtkWidget *widget) + { + return GTK_WIDGET_STATE(widget); + } + #define gtk_widget_get_state wx_gtk_widget_get_state +#endif + + +#if !GTK_CHECK_VERSION(2,18,0) + inline gboolean wx_gtk_widget_get_double_buffered(GtkWidget *widget) + { + return GTK_WIDGET_DOUBLE_BUFFERED(widget); + } + #define gtk_widget_get_double_buffered wx_gtk_widget_get_double_buffered +#endif + + +#if !GTK_CHECK_VERSION(2,20,0) + inline gboolean wx_gtk_widget_get_realized(GtkWidget *widget) + { + return GTK_WIDGET_REALIZED(widget); + } + #define gtk_widget_get_realized wx_gtk_widget_get_realized +#endif + + +#if !GTK_CHECK_VERSION(2,20,0) + inline gboolean wx_gtk_widget_get_mapped(GtkWidget *widget) + { + return GTK_WIDGET_MAPPED(widget); + } + #define gtk_widget_get_mapped wx_gtk_widget_get_mapped +#endif + + +#endif // _WX_GTK_PRIVATE_COMPAT_H_ + diff --git a/src/aui/dockart.cpp b/src/aui/dockart.cpp index 003b47aa3f..3c88ed6b96 100644 --- a/src/aui/dockart.cpp +++ b/src/aui/dockart.cpp @@ -410,7 +410,7 @@ void wxAuiDefaultDockArt::DrawSash(wxDC& dc, wxWindow *window, int orientation, if (!window) return; if (!window->m_wxwindow) return; - if (!GTK_WIDGET_DRAWABLE(window->m_wxwindow)) return; + if (!gtk_widget_is_drawable(window->m_wxwindow)) return; gtk_paint_handle ( diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp index 691cd520e1..4273049a9d 100644 --- a/src/generic/statusbr.cpp +++ b/src/generic/statusbr.cpp @@ -416,7 +416,7 @@ void wxStatusBarGeneric::OnPaint(wxPaintEvent& WXUNUSED(event) ) GDK_WINDOW_EDGE_SOUTH_EAST; gtk_paint_resize_grip( m_widget->style, GTKGetDrawingWindow(), - (GtkStateType) GTK_WIDGET_STATE (m_widget), + gtk_widget_get_state(m_widget), NULL, m_widget, "statusbar", diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 5255a240ff..68ae2b0eca 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -83,7 +83,7 @@ wxgtk_button_style_set_callback(GtkWidget* widget, GtkStyle*, wxButton* win) { /* the default button has a border around it */ wxWindow* parent = win->GetParent(); - if (parent && parent->m_wxwindow && GTK_WIDGET_CAN_DEFAULT(widget)) + if (parent && parent->m_wxwindow && gtk_widget_get_can_default(widget)) { GtkBorder* border = NULL; gtk_widget_style_get(widget, "default_border", &border, NULL); @@ -181,7 +181,7 @@ wxWindow *wxButton::SetDefault() { wxWindow *oldDefault = wxButtonBase::SetDefault(); - GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT ); + gtk_widget_set_can_default(m_widget, TRUE); gtk_widget_grab_default( m_widget ); // resize for default border @@ -349,11 +349,11 @@ wxSize wxButton::DoGetBestSize() const // extra border around it, but we don't want to take it into account in // our size calculations (otherwise the result is visually ugly), so // always return the size of non default button from here - const bool isDefault = GTK_WIDGET_HAS_DEFAULT(m_widget); + const bool isDefault = gtk_widget_has_default(m_widget); if ( isDefault ) { // temporarily unset default flag - GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_DEFAULT ); + gtk_widget_set_can_default(m_widget, FALSE); } wxSize ret( wxControl::DoGetBestSize() ); @@ -361,7 +361,7 @@ wxSize wxButton::DoGetBestSize() const if ( isDefault ) { // set it back again - GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT ); + gtk_widget_set_can_default(m_widget, TRUE); } if (!HasFlag(wxBU_EXACTFIT)) diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index da2b6d4e67..dcb66b9c9c 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -3028,7 +3028,7 @@ void wxDataViewColumn::OnInternalIdle() if (m_isConnected) return; - if (GTK_WIDGET_REALIZED(GetOwner()->m_treeview)) + if (gtk_widget_get_realized(GetOwner()->m_treeview)) { GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(m_column); if (column->button) @@ -4244,7 +4244,7 @@ wxGtkTreeModelNode *wxDataViewCtrlInternal::FindParentNode( const wxDataViewItem static void wxdataview_selection_changed_callback( GtkTreeSelection* WXUNUSED(selection), wxDataViewCtrl *dv ) { - if (!GTK_WIDGET_REALIZED(dv->m_widget)) + if (!gtk_widget_get_realized(dv->m_widget)) return; wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, dv->GetId() ); @@ -4326,7 +4326,7 @@ void wxDataViewCtrl::AddChildGTK(wxWindowGTK* child) GtkWidget* treeview = GtkGetTreeView(); // Insert widget in GtkTreeView - if (GTK_WIDGET_REALIZED(treeview)) + if (gtk_widget_get_realized(treeview)) gtk_widget_set_parent_window( child->m_widget, gtk_tree_view_get_bin_window( GTK_TREE_VIEW(treeview) ) ); gtk_widget_set_parent( child->m_widget, treeview ); diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index f6a7f3a942..798b1f413f 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -295,7 +295,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) : wxCHECK_RET(widget, "DC needs a widget"); m_gdkwindow = widget->window; - if (GTK_WIDGET_NO_WINDOW(widget)) + if (!gtk_widget_get_has_window(widget)) SetDeviceLocalOrigin(widget->allocation.x, widget->allocation.y); } diff --git a/src/gtk/glcanvas.cpp b/src/gtk/glcanvas.cpp index 30f09a61ef..712fb52e41 100644 --- a/src/gtk/glcanvas.cpp +++ b/src/gtk/glcanvas.cpp @@ -231,11 +231,11 @@ bool wxGLCanvas::Create(wxWindow *parent, // if our parent window is already visible, we had been realized before we // connected to the "realize" signal and hence our m_glContext hasn't been // initialized yet and we have to do it now - if (GTK_WIDGET_REALIZED(m_wxwindow)) + if (gtk_widget_get_realized(m_wxwindow)) gtk_glwindow_realized_callback( m_wxwindow, this ); #endif // WXWIN_COMPATIBILITY_2_8 - if (GTK_WIDGET_MAPPED(m_wxwindow)) + if (gtk_widget_get_mapped(m_wxwindow)) gtk_glwindow_map_callback( m_wxwindow, this ); return true; diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 5c2da5cb53..b17d1a32c6 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -773,7 +773,7 @@ void wxListBox::DoScrollToCell(int n, float alignY, float alignX) wxCHECK_RET( IsValid(n), wxT("invalid index")); //RN: I have no idea why this line is needed... - if (gdk_pointer_is_grabbed () && GTK_WIDGET_HAS_GRAB (m_treeview)) + if (gdk_pointer_is_grabbed () && gtk_widget_has_grab(GTK_WIDGET(m_treeview))) return; GtkTreeIter iter; diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index 887d1a3d9a..96323121c8 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -475,7 +475,7 @@ bool wxRadioBox::IsItemEnabled(unsigned int item) const // don't use GTK_WIDGET_IS_SENSITIVE() here, we want to return true even if // the parent radiobox is disabled - return GTK_WIDGET_SENSITIVE(GTK_WIDGET(button)); + return gtk_widget_is_sensitive(GTK_WIDGET(button)); } bool wxRadioBox::Show(unsigned int item, bool show) @@ -506,7 +506,7 @@ bool wxRadioBox::IsItemShown(unsigned int item) const GtkButton *button = GTK_BUTTON( node->GetData()->button ); - return GTK_WIDGET_VISIBLE(GTK_WIDGET(button)); + return gtk_widget_get_visible(GTK_WIDGET(button)); } unsigned int wxRadioBox::GetCount() const diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index d4b9201cc6..f05a5f947d 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -316,7 +316,7 @@ static int GetBorderWidth(wxSystemMetric index, wxWindow* win) int wxSystemSettingsNative::GetMetric( wxSystemMetric index, wxWindow* win ) { GdkWindow *window = NULL; - if(win && GTK_WIDGET_REALIZED(win->GetHandle())) + if(win && gtk_widget_get_realized(win->GetHandle())) window = win->GetHandle()->window; switch (index) diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index e88d1e2aed..57107f12d3 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -689,7 +689,7 @@ bool wxTextCtrl::Create( wxWindow *parent, gtk_widget_add_events( GTK_WIDGET(m_text), GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK ); - GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS ); + gtk_widget_set_can_focus(m_widget, FALSE); } else { diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 28f4fafcea..fb3696031c 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -80,7 +80,8 @@ extern "C" { static void wxgtk_window_set_urgency_hint (GtkWindow *win, gboolean setting) { - wxASSERT_MSG( GTK_WIDGET_REALIZED(win), wxT("wxgtk_window_set_urgency_hint: GdkWindow not realized") ); + wxASSERT_MSG( gtk_widget_get_realized(GTK_WIDGET(win)), + wxT("wxgtk_window_set_urgency_hint: GdkWindow not realized") ); GdkWindow *window = GTK_WIDGET(win)->window; XWMHints *wm_hints; @@ -713,7 +714,7 @@ bool wxTopLevelWindowGTK::EnableCloseButton( bool enable ) else m_gdkFunc &= ~GDK_FUNC_CLOSE; - if (GTK_WIDGET_REALIZED(m_widget) && (m_widget->window)) + if (gtk_widget_get_realized(m_widget) && (m_widget->window)) gdk_window_set_functions( m_widget->window, (GdkWMFunction)m_gdkFunc ); return true; @@ -820,7 +821,7 @@ bool wxTopLevelWindowGTK::Show( bool show ) bool deferShow = show && !m_isShown && m_deferShow; if (deferShow) { - deferShow = m_deferShowAllowed && !GTK_WIDGET_REALIZED(m_widget); + deferShow = m_deferShowAllowed && !gtk_widget_get_realized(m_widget); if (deferShow) { deferShow = g_signal_handler_find(m_widget, @@ -889,7 +890,7 @@ bool wxTopLevelWindowGTK::Show( bool show ) return true; } - if (show && !GTK_WIDGET_REALIZED(m_widget)) + if (show && !gtk_widget_get_realized(m_widget)) { // size_allocate signals occur in reverse order (bottom to top). // Things work better if the initial wxSizeEvents are sent (from the @@ -1194,7 +1195,7 @@ void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons ) // Setting icons before window is realized can cause a GTK assertion if // another TLW is realized before this one, and it has this one as it's // transient parent. The life demo exibits this problem. - if (GTK_WIDGET_REALIZED(m_widget)) + if (gtk_widget_get_realized(m_widget)) { GList* list = NULL; for (size_t i = icons.GetIconCount(); i--;) @@ -1295,7 +1296,7 @@ bool wxTopLevelWindowGTK::SetShape(const wxRegion& region) wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, wxT("Shaped windows must be created with the wxFRAME_SHAPED style.")); - if ( GTK_WIDGET_REALIZED(m_widget) ) + if ( gtk_widget_get_realized(m_widget) ) { if ( m_wxwindow ) do_shape_combine_region(m_wxwindow->window, region); @@ -1334,7 +1335,7 @@ void wxTopLevelWindowGTK::RequestUserAttention(int flags) m_urgency_hint = -2; - if( GTK_WIDGET_REALIZED(m_widget) && !IsActive() ) + if( gtk_widget_get_realized(m_widget) && !IsActive() ) { new_hint_value = true; diff --git a/src/gtk/win_gtk.cpp b/src/gtk/win_gtk.cpp index 6c420a7a34..2d599c12b7 100644 --- a/src/gtk/win_gtk.cpp +++ b/src/gtk/win_gtk.cpp @@ -52,7 +52,7 @@ static void size_allocate(GtkWidget* widget, GtkAllocation* alloc) int w = alloc->width - 2 * border_x; if (w < 0) w = 0; - if (GTK_WIDGET_REALIZED(widget) && (is_move || is_resize)) + if (gtk_widget_get_realized(widget) && (is_move || is_resize)) { int h = alloc->height - 2 * border_y; if (h < 0) h = 0; @@ -76,7 +76,7 @@ static void size_allocate(GtkWidget* widget, GtkAllocation* alloc) for (const GList* list = pizza->m_fixed.children; list; list = list->next) { const GtkFixedChild* child = static_cast(list->data); - if (GTK_WIDGET_VISIBLE(child->widget)) + if (gtk_widget_get_visible(child->widget)) { GtkAllocation child_alloc; // note that child positions do not take border into @@ -236,7 +236,11 @@ GtkWidget* wxPizza::New(long windowStyle) pizza->m_is_scrollable = (windowStyle & (wxHSCROLL | wxVSCROLL)) != 0; // mask off border styles not useable with wxPizza pizza->m_border_style = int(windowStyle & BORDER_STYLES); +#if GTK_CHECK_VERSION(2,20,0) + gtk_widget_set_has_window(widget, true); +#else gtk_fixed_set_has_window(GTK_FIXED(widget), true); +#endif gtk_widget_add_events(widget, GDK_EXPOSURE_MASK | GDK_SCROLL_MASK | diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index d09edd5c64..25b03e60be 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1618,7 +1618,7 @@ window_scroll_event_hscrollbar(GtkWidget*, GdkEventScroll* gdk_event, wxWindow* GtkRange *range = win->m_scrollBar[wxWindow::ScrollDir_Horz]; if (!range) return FALSE; - if (range && GTK_WIDGET_VISIBLE (range)) + if (range && gtk_widget_get_visible(GTK_WIDGET(range))) { GtkAdjustment *adj = range->adjustment; gdouble delta = adj->step_increment * 3; @@ -1661,7 +1661,7 @@ window_scroll_event(GtkWidget*, GdkEventScroll* gdk_event, wxWindow* win) GtkRange *range = win->m_scrollBar[wxWindow::ScrollDir_Vert]; if (!range) return FALSE; - if (range && GTK_WIDGET_VISIBLE (range)) + if (range && gtk_widget_get_visible(GTK_WIDGET(range))) { GtkAdjustment *adj = range->adjustment; gdouble delta = adj->step_increment * 3; @@ -2539,7 +2539,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags int bottom_border = 0; /* the default button has a border around it */ - if (GTK_WIDGET_CAN_DEFAULT(m_widget)) + if (gtk_widget_get_can_default(m_widget)) { GtkBorder *default_border = NULL; gtk_widget_style_get( m_widget, "default_border", &default_border, NULL ); @@ -2583,7 +2583,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags bool wxWindowGTK::GTKShowFromOnIdle() { - if (IsShown() && m_showOnIdle && !GTK_WIDGET_VISIBLE (m_widget)) + if (IsShown() && m_showOnIdle && !gtk_widget_get_visible (m_widget)) { GtkAllocation alloc; alloc.x = m_x; @@ -2780,7 +2780,7 @@ void wxWindowGTK::DoClientToScreen( int *x, int *y ) const if (!m_wxwindow) { - if (GTK_WIDGET_NO_WINDOW (m_widget)) + if (!gtk_widget_get_has_window(m_widget)) { org_x += m_widget->allocation.x; org_y += m_widget->allocation.y; @@ -2817,7 +2817,7 @@ void wxWindowGTK::DoScreenToClient( int *x, int *y ) const if (!m_wxwindow) { - if (GTK_WIDGET_NO_WINDOW (m_widget)) + if (!gtk_widget_get_has_window(m_widget)) { org_x += m_widget->allocation.x; org_y += m_widget->allocation.y; @@ -3174,7 +3174,7 @@ void wxWindowGTK::SetFocus() GtkWidget *widget = m_wxwindow ? m_wxwindow : m_focusWidget; if ( GTK_IS_CONTAINER(widget) && - !GTK_WIDGET_CAN_FOCUS(widget) ) + !gtk_widget_get_can_focus(widget) ) { wxLogTrace(TRACE_FOCUS, wxT("Setting focus to a child of %s(%p, %s)"), @@ -3192,17 +3192,11 @@ void wxWindowGTK::SetFocus() void wxWindowGTK::SetCanFocus(bool canFocus) { - if ( canFocus ) - GTK_WIDGET_SET_FLAGS(m_widget, GTK_CAN_FOCUS); - else - GTK_WIDGET_UNSET_FLAGS(m_widget, GTK_CAN_FOCUS); + gtk_widget_set_can_focus(m_widget, canFocus); if ( m_wxwindow && (m_widget != m_wxwindow) ) { - if ( canFocus ) - GTK_WIDGET_SET_FLAGS(m_wxwindow, GTK_CAN_FOCUS); - else - GTK_WIDGET_UNSET_FLAGS(m_wxwindow, GTK_CAN_FOCUS); + gtk_widget_set_can_focus(m_wxwindow, canFocus); } } @@ -3227,7 +3221,7 @@ bool wxWindowGTK::Reparent( wxWindowBase *newParentBase ) if (newParent) { - if (GTK_WIDGET_VISIBLE (newParent->m_widget)) + if (gtk_widget_get_visible (newParent->m_widget)) { m_showOnIdle = true; gtk_widget_hide( m_widget ); @@ -3393,10 +3387,10 @@ void wxWindowGTK::RealizeTabOrder() // widget than m_widget, so if the main widget isn't // focusable try the connect widget GtkWidget* w = win->m_widget; - if ( !GTK_WIDGET_CAN_FOCUS(w) ) + if ( !gtk_widget_get_can_focus(w) ) { w = win->GetConnectWidget(); - if ( !GTK_WIDGET_CAN_FOCUS(w) ) + if ( !gtk_widget_get_can_focus(w) ) w = NULL; } @@ -3583,7 +3577,7 @@ void wxWindowGTK::Refresh(bool WXUNUSED(eraseBackground), // Just return if the widget or one of its ancestors isn't mapped GtkWidget *w; for (w = m_wxwindow; w != NULL; w = w->parent) - if (!GTK_WIDGET_MAPPED (w)) + if (!gtk_widget_get_mapped (w)) return; GdkWindow* window = GTKGetDrawingWindow(); @@ -3606,7 +3600,7 @@ void wxWindowGTK::Refresh(bool WXUNUSED(eraseBackground), void wxWindowGTK::Update() { - if (m_widget && GTK_WIDGET_MAPPED(m_widget)) + if (m_widget && gtk_widget_get_mapped(m_widget)) { GdkDisplay* display = gtk_widget_get_display(m_widget); // Flush everything out to the server, and wait for it to finish. @@ -3709,7 +3703,7 @@ void wxWindowGTK::GtkSendPaintEvents() if (!parent) parent = (wxWindow*)this; - if (GTK_WIDGET_MAPPED(parent->m_widget)) + if (gtk_widget_get_mapped(parent->m_widget)) { wxRegionIterator upd( m_nativeUpdateRegion ); while (upd) @@ -3722,7 +3716,7 @@ void wxWindowGTK::GtkSendPaintEvents() gtk_paint_flat_box( parent->m_widget->style, GTKGetDrawingWindow(), - (GtkStateType)GTK_WIDGET_STATE(m_wxwindow), + (GtkStateType)gtk_widget_get_state(m_wxwindow), GTK_SHADOW_NONE, &rect, parent->m_widget, @@ -3767,7 +3761,7 @@ void wxWindowGTK::SetDoubleBuffered( bool on ) bool wxWindowGTK::IsDoubleBuffered() const { - return GTK_WIDGET_DOUBLE_BUFFERED( m_wxwindow ); + return gtk_widget_get_double_buffered( m_wxwindow ); } void wxWindowGTK::ClearBackground() @@ -4449,8 +4443,8 @@ extern "C" // is realized (and so can be frozen): static void wx_frozen_widget_realize(GtkWidget* w, wxWindowGTK* win) { - wxASSERT( w && !GTK_WIDGET_NO_WINDOW(w) ); - wxASSERT( GTK_WIDGET_REALIZED(w) ); + wxASSERT( w && gtk_widget_get_has_window(w) ); + wxASSERT( gtk_widget_get_realized(w) ); g_signal_handlers_disconnect_by_func ( @@ -4469,10 +4463,10 @@ static void wx_frozen_widget_realize(GtkWidget* w, wxWindowGTK* win) void wxWindowGTK::GTKFreezeWidget(GtkWidget *w) { - if ( !w || GTK_WIDGET_NO_WINDOW(w) ) + if ( !w || !gtk_widget_get_has_window(w) ) return; // window-less widget, cannot be frozen - if ( !GTK_WIDGET_REALIZED(w) ) + if ( !gtk_widget_get_realized(w) ) { // we can't thaw unrealized widgets because they don't have GdkWindow, // so set it up to be done immediately after realization: @@ -4494,10 +4488,10 @@ void wxWindowGTK::GTKFreezeWidget(GtkWidget *w) void wxWindowGTK::GTKThawWidget(GtkWidget *w) { - if ( !w || GTK_WIDGET_NO_WINDOW(w) ) + if ( !w || !gtk_widget_get_has_window(w) ) return; // window-less widget, cannot be frozen - if ( !GTK_WIDGET_REALIZED(w) ) + if ( !gtk_widget_get_realized(w) ) { // the widget wasn't realized yet, no need to thaw g_signal_handlers_disconnect_by_func