From ff33df7d45136d8b9b5153578959b30300791583 Mon Sep 17 00:00:00 2001 From: Garux Date: Tue, 19 May 2020 23:46:54 +0300 Subject: [PATCH] replace GTK_WIDGET_VISIBLE -> gtk_widget_get_visible() --- contrib/camera/dialogs.cpp | 4 ++-- contrib/gtkgensurf/gensurf.cpp | 2 +- contrib/meshtex/GenericDialog.cpp | 6 +++--- libs/gtkutil/nonmodal.h | 2 +- libs/gtkutil/window.cpp | 2 +- radiant/camwindow.cpp | 2 +- radiant/entityinspector.cpp | 2 +- radiant/entitylist.cpp | 2 +- radiant/findtexturedialog.cpp | 2 +- radiant/gtktheme.cpp | 2 +- radiant/mainframe.cpp | 8 ++++---- radiant/patchdialog.cpp | 2 +- radiant/surfacedialog.cpp | 2 +- radiant/xywindow.cpp | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/contrib/camera/dialogs.cpp b/contrib/camera/dialogs.cpp index 86d21af8..4c60ec7f 100644 --- a/contrib/camera/dialogs.cpp +++ b/contrib/camera/dialogs.cpp @@ -314,7 +314,7 @@ static gint ci_pathlist_changed( GtkWidget *widget, gpointer data ){ } // start edit mode - if ( g_pCameraInspectorWnd && GTK_WIDGET_VISIBLE( g_pCameraInspectorWnd ) ) { + if ( g_pCameraInspectorWnd && gtk_widget_get_visible( g_pCameraInspectorWnd ) ) { DoStartEdit( GetCurrentCam() ); } @@ -759,7 +759,7 @@ static gint ci_camlist_changed( GtkWidget *widget, gpointer data ){ // start edit mode g_iActiveTarget = -1; - if ( g_pCameraInspectorWnd && GTK_WIDGET_VISIBLE( g_pCameraInspectorWnd ) ) { + if ( g_pCameraInspectorWnd && gtk_widget_get_visible( g_pCameraInspectorWnd ) ) { DoStartEdit( GetCurrentCam() ); } diff --git a/contrib/gtkgensurf/gensurf.cpp b/contrib/gtkgensurf/gensurf.cpp index b28416e2..cecc8ab2 100644 --- a/contrib/gtkgensurf/gensurf.cpp +++ b/contrib/gtkgensurf/gensurf.cpp @@ -409,7 +409,7 @@ void WriteIniFile( const char *file ){ } void UpdatePreview( bool DataChange ){ - if ( g_pWndPreview && GTK_WIDGET_VISIBLE( g_pWndPreview ) ) { + if ( g_pWndPreview && gtk_widget_get_visible( g_pWndPreview ) ) { if ( DataChange ) { GenerateXYZ(); } diff --git a/contrib/meshtex/GenericDialog.cpp b/contrib/meshtex/GenericDialog.cpp index d007828d..b70f9823 100644 --- a/contrib/meshtex/GenericDialog.cpp +++ b/contrib/meshtex/GenericDialog.cpp @@ -98,7 +98,7 @@ void GenericDialog::Raise() { // Don't bother if not visible. - if (GTK_WIDGET_VISIBLE(_dialog)) + if (gtk_widget_get_visible(_dialog)) { gdk_window_raise(_dialog->window); } @@ -116,7 +116,7 @@ GenericDialog::Show(const std::string& triggerCommand) // use of this information. _triggerCommand = triggerCommand; // Show the window if it is currently hidden. - if (!GTK_WIDGET_VISIBLE(_dialog)) + if (!gtk_widget_get_visible(_dialog)) { gtk_widget_show(_dialog); } @@ -131,7 +131,7 @@ void GenericDialog::Hide() { // Bail out if the window is already invisible. - if (!GTK_WIDGET_VISIBLE(_dialog)) + if (!gtk_widget_get_visible(_dialog)) { return; } diff --git a/libs/gtkutil/nonmodal.h b/libs/gtkutil/nonmodal.h index 7ff27d35..1dc675f5 100644 --- a/libs/gtkutil/nonmodal.h +++ b/libs/gtkutil/nonmodal.h @@ -60,7 +60,7 @@ static gboolean focus_in( GtkEntry* entry, GdkEventFocus *event, NonModalEntry* } static gboolean focus_out( GtkEntry* entry, GdkEventFocus *event, NonModalEntry* self ){ - if ( self->m_editing && GTK_WIDGET_VISIBLE( entry ) ) { + if ( self->m_editing && gtk_widget_get_visible( GTK_WIDGET( entry ) ) ) { self->m_apply(); } self->m_editing = false; diff --git a/libs/gtkutil/window.cpp b/libs/gtkutil/window.cpp index 74b724fd..aae9d2c6 100644 --- a/libs/gtkutil/window.cpp +++ b/libs/gtkutil/window.cpp @@ -39,7 +39,7 @@ inline void CHECK_RESTORE( GtkWidget* w ){ } inline void CHECK_MINIMIZE( GtkWidget* w ){ - g_object_set_data( G_OBJECT( w ), "was_mapped", gint_to_pointer( GTK_WIDGET_VISIBLE( w ) ) ); + g_object_set_data( G_OBJECT( w ), "was_mapped", gint_to_pointer( gtk_widget_get_visible( w ) ) ); //gtk_widget_hide( w ); //fix for gtk 2.24 + the whole scheme isn't needed with gtk 2.16, 2.24; they do it all alone } diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 907aeed8..811836ac 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -1223,7 +1223,7 @@ gboolean mousecontrol_button_press( GtkWidget* widget, GdkEventButton* event, Ca #endif void camwnd_update_xor_rectangle( CamWnd& self, rect_t area ){ - if ( GTK_WIDGET_VISIBLE( self.m_gl_widget ) ) { + if ( gtk_widget_get_visible( self.m_gl_widget ) ) { if ( glwidget_make_current( self.m_gl_widget ) != FALSE ) { if ( Map_Valid( g_map ) && ScreenUpdates_Enabled() ) { GlobalOpenGL_debugAssertNoErrors(); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index 4e8eddff..2f39e469 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -1487,7 +1487,7 @@ void EntityInspector_destroyWindow( GtkWidget* widget, gpointer data ){ } static gint EntityInspector_hideWindowKB( GtkWidget* widget, GdkEventKey* event, gpointer data ){ - //if ( event->keyval == GDK_KEY_Escape && GTK_WIDGET_VISIBLE( GTK_WIDGET( widget ) ) ) { + //if ( event->keyval == GDK_KEY_Escape && gtk_widget_get_visible( widget ) ) { if ( event->keyval == GDK_KEY_Escape ) { //GroupDialog_showPage( g_page_entity ); gtk_widget_hide( GTK_WIDGET( GroupDialog_getWindow() ) ); diff --git a/radiant/entitylist.cpp b/radiant/entitylist.cpp index 186a838a..864d8e21 100644 --- a/radiant/entitylist.cpp +++ b/radiant/entitylist.cpp @@ -87,7 +87,7 @@ EntityList() : } bool visible() const { - return GTK_WIDGET_VISIBLE( GTK_WIDGET( m_window ) ); + return gtk_widget_get_visible( GTK_WIDGET( m_window ) ); } }; diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index 4b270ac5..c332eb36 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -238,7 +238,7 @@ void FindTextureDialog::updateTextures( const char* name ){ } bool FindTextureDialog::isOpen(){ - return GTK_WIDGET_VISIBLE( g_FindTextureDialog.GetWidget() ) == TRUE; + return gtk_widget_get_visible( GTK_WIDGET( g_FindTextureDialog.GetWidget() ) ) == TRUE; } void FindTextureDialog::setFindStr( const char* name ){ diff --git a/radiant/gtktheme.cpp b/radiant/gtktheme.cpp index c8930af1..1c5c9b80 100644 --- a/radiant/gtktheme.cpp +++ b/radiant/gtktheme.cpp @@ -56,7 +56,7 @@ GtkWidget* lookup_widget( GtkWidget* widget, const gchar* widget_name ) { if( GTK_IS_MENU( widget ) ) parent = gtk_menu_get_attach_widget( GTK_MENU( widget ) ); else - parent = widget->parent; + parent = gtk_widget_get_parent( widget ); if( !parent ) parent = (GtkWidget*)g_object_get_data( G_OBJECT( widget ), "GladeParentKey" ); if( parent == NULL ) diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 6919320e..9d975e5f 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -1911,7 +1911,7 @@ bool ScreenUpdates_Enabled(){ } void ScreenUpdates_process(){ - if ( redrawRequired() && GTK_WIDGET_VISIBLE( g_wait.m_window ) ) { + if ( redrawRequired() && gtk_widget_get_visible( GTK_WIDGET( g_wait.m_window ) ) ) { process_gui(); } } @@ -1936,7 +1936,7 @@ void ScreenUpdates_Disable( const char* message, const char* title ){ ScreenUpdates_process(); } } - else if ( GTK_WIDGET_VISIBLE( g_wait.m_window ) ) { + else if ( gtk_widget_get_visible( GTK_WIDGET( g_wait.m_window ) ) ) { gtk_label_set_text( g_wait.m_label, message ); ScreenUpdates_process(); } @@ -1956,7 +1956,7 @@ void ScreenUpdates_Enable(){ //gtk_window_present(MainFrame_getWindow()); } - else if ( GTK_WIDGET_VISIBLE( g_wait.m_window ) ) { + else if ( gtk_widget_get_visible( GTK_WIDGET( g_wait.m_window ) ) ) { gtk_label_set_text( g_wait.m_label, g_wait_stack.back().c_str() ); ScreenUpdates_process(); } @@ -2743,7 +2743,7 @@ WindowFocusPrinter g_mainframeFocusPrinter( "mainframe" ); class MainWindowActive { static gboolean notify( GtkWindow* window, gpointer dummy, MainWindowActive* self ){ - if ( g_wait.m_window != 0 && gtk_window_is_active( window ) && !GTK_WIDGET_VISIBLE( g_wait.m_window ) ) { + if ( g_wait.m_window != 0 && gtk_window_is_active( window ) && !gtk_widget_get_visible( GTK_WIDGET( g_wait.m_window ) ) ) { gtk_widget_show( GTK_WIDGET( g_wait.m_window ) ); } diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 02c9a5fb..d7dbafbf 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -265,7 +265,7 @@ PatchInspector() : } bool visible(){ - return GTK_WIDGET_VISIBLE( GetWidget() ); + return gtk_widget_get_visible( GTK_WIDGET( GetWidget() ) ); } // void UpdateInfo(); diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 2e4ea048..ff5c181d 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -218,7 +218,7 @@ void destroyWindow(){ Destroy(); } bool visible() const { - return GTK_WIDGET_VISIBLE( const_cast( GetWidget() ) ); + return gtk_widget_get_visible( GTK_WIDGET( GetWidget() ) ); } void queueDraw(){ if ( visible() ) { diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index d52b2711..1224375d 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -463,7 +463,7 @@ Shader* XYWnd::m_state_selected = 0; #define OVERLAY_GL_FRONT_DRAW_HACK #endif bool XYWnd::overlayStart(){ - if ( GTK_WIDGET_VISIBLE( m_gl_widget ) ) { + if ( gtk_widget_get_visible( m_gl_widget ) ) { if ( glwidget_make_current( m_gl_widget ) != FALSE ) { if ( Map_Valid( g_map ) && ScreenUpdates_Enabled() ) { GlobalOpenGL_debugAssertNoErrors();