]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
-DGSEAL_ENABLE
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 11:03:56 +0000 (22:03 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 11:03:56 +0000 (22:03 +1100)
32 files changed:
CMakeLists.txt
contrib/bobtoolz/dialogs/dialogs-gtk.cpp
contrib/brushexport/support.cpp
contrib/camera/dialogs.cpp
contrib/gtkgensurf/gensurf.cpp
contrib/hydratoolz/plugin.cpp
contrib/prtview/ConfigDialog.cpp
libs/gtkutil/accelerator.cpp
libs/gtkutil/clipboard.cpp
libs/gtkutil/cursor.cpp
libs/gtkutil/cursor.h
libs/gtkutil/menu.cpp
libs/gtkutil/nonmodal.h
libs/gtkutil/toolbar.cpp
libs/gtkutil/widget.h
libs/gtkutil/window.cpp
libs/gtkutil/xorrectangle.h
plugins/textool/TexTool.cpp
radiant/camwindow.cpp
radiant/console.cpp
radiant/entityinspector.cpp
radiant/entitylist.cpp
radiant/findtexturedialog.cpp
radiant/gtkmisc.cpp
radiant/mainframe.cpp
radiant/mru.cpp
radiant/patchdialog.cpp
radiant/preferences.cpp
radiant/qe3.cpp
radiant/surfacedialog.cpp
radiant/texwindow.cpp
radiant/xywindow.cpp

index 70c60542638fb01fad595ebb674c50078f35576f..bcb4fbc576d7b8922ff66a39dcf8e70508da32a6 100644 (file)
@@ -63,7 +63,7 @@ find_package(OpenGL REQUIRED)
 
 add_definitions(-DRADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}")
 
-add_definitions(-DGTK_DISABLE_SINGLE_INCLUDES)
+add_definitions(-DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE)
 
 if(NOT WIN32)
     add_definitions(
index 359148dd0612dad3ec41a91eb415655b810fb35a..08bac0970b9099b51009a10b1d240db6963f0f00 100644 (file)
@@ -247,7 +247,7 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default(w, true);
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
                ret = eIDOK;
@@ -257,7 +257,7 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
@@ -273,7 +273,7 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
@@ -296,7 +296,7 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
@@ -323,7 +323,6 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess
 
 EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){
        GtkWidget *window, *w, *vbox, *hbox;
-       GtkWidget *radio1, *radio2;
        GtkWidget *check1, *check2;
        EMessageBoxReturn ret;
        int loop = 1;
@@ -350,11 +349,11 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){
        // ---- vbox ----
 
 
-       radio1 = gtk_radio_button_new_with_label( NULL, "Use Whole Map" );
+       auto radio1 = gtk_radio_button_new_with_label( NULL, "Use Whole Map" );
        gtk_box_pack_start( GTK_BOX( vbox ), radio1, FALSE, FALSE, 2 );
        gtk_widget_show( radio1 );
 
-       radio2 = gtk_radio_button_new_with_label( ( (GtkRadioButton*)radio1 )->group, "Use Selected Brushes" );
+       auto radio2 = gtk_radio_button_new_with_label( gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio1)), "Use Selected Brushes" );
        gtk_box_pack_start( GTK_BOX( vbox ), radio2, FALSE, FALSE, 2 );
        gtk_widget_show( radio2 );
 
@@ -380,7 +379,7 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
@@ -534,7 +533,7 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
@@ -775,7 +774,7 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
        w = ui::Button( "OK" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
@@ -1020,7 +1019,7 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){
        w = ui::Button( "OK" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
@@ -1183,7 +1182,7 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
        gtk_widget_show( w );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
 
        w = ui::Button( "Disable" );
@@ -1273,7 +1272,7 @@ EMessageBoxReturn DoCTFColourChangeBox(){
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
@@ -1552,7 +1551,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
@@ -1839,7 +1838,7 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
@@ -1977,7 +1976,7 @@ EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){
        w = ui::Button( "OK" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
index c74ef620c719c2a76e76f69639f981cc7cba718b..768f213a6f77add162ccd54da793e1cfae97ebfe 100644 (file)
@@ -14,7 +14,7 @@ lookup_widget( GtkWidget       *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" );
index 6d1c30cfe22fd53fc6976274319cc1f73235e0a4..43c2543bb6fd796a4b228fc82b4d17a5bf90de9a 100644 (file)
@@ -134,7 +134,7 @@ static gint ci_new( GtkWidget *widget, gpointer data ){
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
        gtk_widget_show( w );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
 
        w = ui::Button( "Cancel" );
@@ -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() );
        }
 
@@ -416,7 +416,7 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
        gtk_widget_show( w );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
 
        w = ui::Button( "Cancel" );
@@ -563,7 +563,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
        gtk_widget_show( w );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
 
        w = ui::Button( "Cancel" );
@@ -756,7 +756,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() );
        }
 
@@ -903,7 +903,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
        gtk_widget_show( w );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
 
        w = ui::Button( "Cancel" );
@@ -1356,7 +1356,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){
        w = gtk_button_new_with_label( "Close" );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
        gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_close ), NULL );
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
index 4f05ec4afd64cea5718e525f6dd8acf3dddc510e..efb5a881c48d893d35721f6abac3f4e68196af44 100644 (file)
@@ -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();
                }
index 311eab2e96b61b48af8ac29ab9e5f5d557749cc8..a290649f2d21f3524f04316a20705352d074e290 100644 (file)
@@ -117,7 +117,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
                ret = IDOK;
@@ -127,7 +127,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
@@ -143,7 +143,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
@@ -166,7 +166,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
index aa2f7bb668880ad8bbc8fb6923b85af0f91ab451..3a8245900da6c5c3a7f2069eae3bb5afeb210834 100644 (file)
@@ -63,14 +63,18 @@ static int DoColor( PackedColour *c ){
        clr[2] = ( (double)GetBValue( *c ) ) / 255.0;
 
        dlg = gtk_color_selection_dialog_new( "Choose Color" );
-       gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr );
+       gtk_color_selection_set_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dlg)) ), clr );
        gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event",
                                                GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
        gtk_signal_connect( GTK_OBJECT( dlg ), "destroy",
                                                GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
-       gtk_signal_connect( GTK_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->ok_button ), "clicked",
+
+       GtkWidget *ok_button, *cancel_button;
+       g_object_get(dlg, "ok-button", &ok_button, "cancel-button", &cancel_button, nullptr);
+
+       gtk_signal_connect( GTK_OBJECT(ok_button), "clicked",
                                                GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
-       gtk_signal_connect( GTK_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->cancel_button ), "clicked",
+       gtk_signal_connect( GTK_OBJECT(cancel_button), "clicked",
                                                GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) );
        g_object_set_data( G_OBJECT( dlg ), "loop", &loop );
        g_object_set_data( G_OBJECT( dlg ), "ret", &ret );
@@ -81,7 +85,7 @@ static int DoColor( PackedColour *c ){
        while ( loop )
                gtk_main_iteration();
 
-       gtk_color_selection_get_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr );
+       gtk_color_selection_get_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dlg)) ), clr );
 
        gtk_grab_remove( dlg );
        gtk_widget_destroy( dlg );
@@ -126,7 +130,7 @@ static void SetClipText( GtkWidget* label ){
 }
 
 static void OnScroll2d( GtkAdjustment *adj, gpointer data ){
-       portals.width_2d = static_cast<float>( adj->value );
+       portals.width_2d = static_cast<float>( gtk_adjustment_get_value(adj) );
        Set2DText( GTK_WIDGET( data ) );
 
        Portals_shadersChanged();
@@ -134,21 +138,21 @@ static void OnScroll2d( GtkAdjustment *adj, gpointer data ){
 }
 
 static void OnScroll3d( GtkAdjustment *adj, gpointer data ){
-       portals.width_3d = static_cast<float>( adj->value );
+       portals.width_3d = static_cast<float>( gtk_adjustment_get_value(adj) );
        Set3DText( GTK_WIDGET( data ) );
 
        SceneChangeNotify();
 }
 
 static void OnScrollTrans( GtkAdjustment *adj, gpointer data ){
-       portals.trans_3d = static_cast<float>( adj->value );
+       portals.trans_3d = static_cast<float>( gtk_adjustment_get_value(adj) );
        Set3DTransText( GTK_WIDGET( data ) );
 
        SceneChangeNotify();
 }
 
 static void OnScrollClip( GtkAdjustment *adj, gpointer data ){
-       portals.clip_range = static_cast<float>( adj->value );
+       portals.clip_range = static_cast<float>( gtk_adjustment_get_value(adj) );
        SetClipText( GTK_WIDGET( data ) );
 
        SceneChangeNotify();
index c80d982ad07ced3681be8dfc5ff9a10f82c443e9..e6e149a330598a11f0bfe0c71f0beb2f1ff24923 100644 (file)
@@ -239,7 +239,7 @@ bool Buttons_press( ButtonMask& buttons, guint button, guint state ){
                {
                        GtkWindow* toplevel = *i;
                        ASSERT_MESSAGE( window_has_accel( toplevel ), "ERROR" );
-                       ASSERT_MESSAGE( GTK_WIDGET_TOPLEVEL( toplevel ), "disabling accel for non-toplevel window" );
+                       ASSERT_MESSAGE( gtk_widget_is_toplevel( GTK_WIDGET(toplevel) ), "disabling accel for non-toplevel window" );
                        gtk_window_remove_accel_group( toplevel,  global_accel );
 #if 0
                        globalOutputStream() << reinterpret_cast<unsigned int>( toplevel ) << ": disabled global accelerators\n";
@@ -265,7 +265,7 @@ bool Buttons_release( ButtonMask& buttons, guint button, guint state ){
                {
                        GtkWindow* toplevel = *i;
                        ASSERT_MESSAGE( !window_has_accel( toplevel ), "ERROR" );
-                       ASSERT_MESSAGE( GTK_WIDGET_TOPLEVEL( toplevel ), "enabling accel for non-toplevel window" );
+                       ASSERT_MESSAGE( gtk_widget_is_toplevel( GTK_WIDGET(toplevel) ), "enabling accel for non-toplevel window" );
                        gtk_window_add_accel_group( toplevel, global_accel );
 #if 0
                        globalOutputStream() << reinterpret_cast<unsigned int>( toplevel ) << ": enabled global accelerators\n";
@@ -560,7 +560,7 @@ GClosure* global_accel_group_find( Accelerator accelerator ){
                }
                return entry->closure;
        }
-       return 0;
+       return nullptr;
 }
 
 void global_accel_group_connect( const Accelerator& accelerator, const Callback& callback ){
index 0d96b3fbe75c13ed7ed1bdd189ca1056e0a56599..2914875332eacc49cedae042efbe8e0f7a8f990a 100644 (file)
@@ -111,11 +111,11 @@ static void clipboard_clear( GtkClipboard *clipboard, gpointer data ){
 }
 
 static void clipboard_received( GtkClipboard *clipboard, GtkSelectionData *data, gpointer user_data ){
-       if ( data->length < 0 ) {
+       if ( gtk_selection_data_get_length(data) < 0 ) {
                globalErrorStream() << "Error retrieving selection\n";
        }
-       else if ( strcmp( gdk_atom_name( data->type ), clipboard_targets[0].target ) == 0 ) {
-               BufferInputStream istream( reinterpret_cast<const char*>( data->data ), data->length );
+       else if ( strcmp( gdk_atom_name( gtk_selection_data_get_data_type(data) ), clipboard_targets[0].target ) == 0 ) {
+               BufferInputStream istream( reinterpret_cast<const char*>( gtk_selection_data_get_data(data) ), gtk_selection_data_get_length(data) );
                ( *reinterpret_cast<ClipboardPasteFunc*>( user_data ) )( istream );
        }
 }
index 287b97de397e35f4bd9a9e260ef25a093db1d8b8..0fe946f6206b9515b7edc1d400f8b672c06226b3 100644 (file)
@@ -45,12 +45,12 @@ GdkCursor* create_blank_cursor(){
 
 void blank_cursor( GtkWidget* widget ){
        GdkCursor* cursor = create_blank_cursor();
-       gdk_window_set_cursor( widget->window, cursor );
+       gdk_window_set_cursor( gtk_widget_get_window(widget), cursor );
        gdk_cursor_unref( cursor );
 }
 
 void default_cursor( GtkWidget* widget ){
-       gdk_window_set_cursor( widget->window, 0 );
+       gdk_window_set_cursor( gtk_widget_get_window(widget), 0 );
 }
 
 
index 4e7d4facf397df64233fb4b0e64a898a47fbedda..bf4f6ee887f7d53d19219df5622290af23ff39ca 100644 (file)
@@ -155,7 +155,7 @@ void freeze_pointer( GtkWindow* window, MotionDeltaFunction function, void* data
 
        GdkCursor* cursor = create_blank_cursor();
        //GdkGrabStatus status =
-       gdk_pointer_grab( GTK_WIDGET( window )->window, TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
+       gdk_pointer_grab( gtk_widget_get_window(GTK_WIDGET(window)), TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
        gdk_cursor_unref( cursor );
 
        Sys_GetCursorPos( window, &recorded_x, &recorded_y );
index 1cdc373a51024ebb04d59f401c30da6cfae72eac..4f6eb3ae85da3da3194d62163ecccfa4c52d3134 100644 (file)
@@ -24,6 +24,7 @@
 #include <ctype.h>
 #include <gtk/gtk.h>
 #include <uilib/uilib.h>
+#include <debugging/debugging.h>
 
 #include "generic/callback.h"
 
@@ -223,38 +224,11 @@ void accelerator_name( const Accelerator& accelerator, GString* gstring ){
        }
 }
 
-void menu_item_set_accelerator( GtkMenuItem* item, Accelerator accelerator ){
-       GtkAccelLabel* accel_label = GTK_ACCEL_LABEL( gtk_bin_get_child( GTK_BIN( item ) ) );
-
-       g_free( accel_label->accel_string );
-       accel_label->accel_string = 0;
-
-       GString* gstring = g_string_new( accel_label->accel_string );
-       g_string_append( gstring, "   " );
-
-       accelerator_name( accelerator, gstring );
-
-       g_free( accel_label->accel_string );
-       accel_label->accel_string = gstring->str;
-       g_string_free( gstring, FALSE );
-
-       if ( !accel_label->accel_string ) {
-               accel_label->accel_string = g_strdup( "" );
-       }
-
-       gtk_widget_queue_resize( GTK_WIDGET( accel_label ) );
-}
-
 void menu_item_add_accelerator( GtkMenuItem* item, Accelerator accelerator ){
        if ( accelerator.key != 0 ) {
                GClosure* closure = global_accel_group_find( accelerator );
-               if ( closure != 0 ) {
-                       menu_item_set_accelerator( item, closure );
-               }
-               else
-               {
-                       menu_item_set_accelerator( item, accelerator );
-               }
+               ASSERT_NOTNULL(closure);
+               menu_item_set_accelerator( item, closure );
        }
 }
 
index d251ca4c4f73fa6a1101579474b261b299978164..345eaac2ca42c515af47924d09a53651b6f22591 100644 (file)
@@ -58,7 +58,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;
index 7b32ae0ea8d7e21f4c74855ed9879329b0444881..0c19b9ff73702adfd954a5e269eaed44e679c97b 100644 (file)
@@ -35,8 +35,8 @@
 void toolbar_append( GtkToolbar* toolbar, GtkButton* button, const char* description ){
        gtk_widget_show( GTK_WIDGET( button ) );
        gtk_button_set_relief( button, GTK_RELIEF_NONE );
-       GTK_WIDGET_UNSET_FLAGS( GTK_WIDGET( button ), GTK_CAN_FOCUS );
-       GTK_WIDGET_UNSET_FLAGS( GTK_WIDGET( button ), GTK_CAN_DEFAULT );
+       gtk_widget_set_can_focus(GTK_WIDGET( button ), false);
+       gtk_widget_set_can_default(GTK_WIDGET( button ), false);
        gtk_toolbar_append_element( toolbar, GTK_TOOLBAR_CHILD_WIDGET, GTK_WIDGET( button ), "", description, "", 0, 0, 0 );
 }
 
index 4e83e8952de33b7c6d268ffeba90e1093efe5948..bf84eef0fd644f23f1ce85833577a37f0f722788 100644 (file)
@@ -39,7 +39,7 @@ inline void widget_set_visible( GtkWidget* widget, bool shown ){
 }
 
 inline bool widget_is_visible( GtkWidget* widget ){
-       return GTK_WIDGET_VISIBLE( widget ) != FALSE;
+       return gtk_widget_get_visible( widget ) != FALSE;
 }
 
 inline void widget_toggle_visible( GtkWidget* widget ){
@@ -81,7 +81,7 @@ static gboolean notify_visible( GtkWidget* widget, gpointer dummy, ToggleShown*
        return FALSE;
 }
 static gboolean destroy( GtkWidget* widget, ToggleShown* self ){
-       self->m_shownDeferred = GTK_WIDGET_VISIBLE( self->m_widget ) != FALSE;
+       self->m_shownDeferred = gtk_widget_get_visible( self->m_widget ) != FALSE;
        self->m_widget = 0;
        return FALSE;
 }
@@ -101,7 +101,7 @@ bool active() const {
        }
        else
        {
-               return GTK_WIDGET_VISIBLE( m_widget ) != FALSE;
+               return gtk_widget_get_visible( m_widget ) != FALSE;
        }
 }
 void exportActive( const BoolImportCallback& importCallback ){
@@ -138,7 +138,7 @@ typedef ReferenceCaller<GtkWidget, widget_queue_draw> WidgetQueueDrawCaller;
 
 
 inline void widget_make_default( GtkWidget* widget ){
-       GTK_WIDGET_SET_FLAGS( widget, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( widget, true );
        gtk_widget_grab_default( widget );
 }
 
index b7be2d0ef2e46b84d55cda0caa6e81a97fe0418a..07e04e5672905052c4d6f6d985db659133ddbd98 100644 (file)
@@ -34,7 +34,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 );
 }
 
@@ -101,7 +101,7 @@ void destroy_floating_window( GtkWindow* window ){
 }
 
 gint window_realize_remove_sysmenu( GtkWidget* widget, gpointer data ){
-       gdk_window_set_decorations( widget->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU ) );
+       gdk_window_set_decorations( gtk_widget_get_window(widget), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU ) );
        return FALSE;
 }
 
@@ -128,7 +128,7 @@ GtkWindow* create_persistent_floating_window( const char* title, GtkWindow* main
 }
 
 gint window_realize_remove_minmax( GtkWidget* widget, gpointer data ){
-       gdk_window_set_decorations( widget->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
+       gdk_window_set_decorations( gtk_widget_get_window(widget), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
        return FALSE;
 }
 
index 52d4c6e8f01e7d15cee2cd28f5115dbae60e55f9..f5ff5aa536575ff2d76e00611d7deb056fca89cf 100644 (file)
@@ -72,12 +72,12 @@ bool initialised() const {
 }
 void lazy_init(){
        if ( !initialised() ) {
-               m_gc = gdk_gc_new( m_widget->window );
+               m_gc = gdk_gc_new( gtk_widget_get_window(m_widget) );
 
                GdkColor color = { 0, 0xffff, 0xffff, 0xffff, };
-               GdkColormap* colormap = gdk_window_get_colormap( m_widget->window );
+               GdkColormap* colormap = gdk_window_get_colormap( gtk_widget_get_window(m_widget) );
                gdk_colormap_alloc_color( colormap, &color, FALSE, TRUE );
-               gdk_gc_copy( m_gc, m_widget->style->white_gc );
+               gdk_gc_copy( m_gc, gtk_widget_get_style(m_widget)->white_gc );
                gdk_gc_set_foreground( m_gc, &color );
                gdk_gc_set_background( m_gc, &color );
 
@@ -89,7 +89,9 @@ void draw() const {
        const int y = float_to_integer( m_rectangle.y );
        const int w = float_to_integer( m_rectangle.w );
        const int h = float_to_integer( m_rectangle.h );
-       gdk_draw_rectangle( m_widget->window, m_gc, FALSE, x, -( h ) - ( y - m_widget->allocation.height ), w, h );
+       GtkAllocation allocation;
+       gtk_widget_get_allocation(m_widget, &allocation);
+       gdk_draw_rectangle( gtk_widget_get_window(m_widget), m_gc, FALSE, x, -( h ) - ( y - allocation.height ), w, h );
 }
 
 public:
@@ -101,7 +103,7 @@ XORRectangle( ui::Widget widget ) : m_widget( widget ), m_gc( 0 ){
        }
 }
 void set( rectangle_t rectangle ){
-       if ( GTK_WIDGET_REALIZED( m_widget ) ) {
+       if ( gtk_widget_get_realized( m_widget ) ) {
                lazy_init();
                draw();
                m_rectangle = rectangle;
index 39ef3d4e15c7fe0c84237d988f7a9f67a7649f0d..162eb8a8510142840405b3c64e8ce23efb4cc9eb 100644 (file)
@@ -87,7 +87,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
                ret = IDOK;
@@ -97,7 +97,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
@@ -113,7 +113,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
@@ -136,7 +136,7 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
                gtk_signal_connect( GTK_OBJECT( w ), "clicked",
                                                        GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDYES ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
index 542d019d8d80a457311a5c389b839a8f5e73981e..a04f1ecf1e22ef7938d3fe0c6cadc7d906994a1c 100644 (file)
@@ -824,7 +824,7 @@ gboolean mousecontrol_button_press( ui::Widget 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 ) ) {
                self.m_XORRectangle.set( rectangle_from_area( area.min, area.max, self.getCamera().width, self.getCamera().height ) );
        }
 }
@@ -850,7 +850,9 @@ void selection_motion( gdouble x, gdouble y, guint state, void* data ){
 }
 
 inline WindowVector windowvector_for_widget_centre( ui::Widget widget ){
-       return WindowVector( static_cast<float>( GTK_WIDGET(widget)->allocation.width / 2 ), static_cast<float>(GTK_WIDGET(widget)->allocation.height / 2 ) );
+       GtkAllocation allocation;
+       gtk_widget_get_allocation(widget, &allocation);
+       return WindowVector( static_cast<float>( allocation.width / 2 ), static_cast<float>(allocation.height / 2 ) );
 }
 
 gboolean selection_button_press_freemove( ui::Widget widget, GdkEventButton* event, WindowObserver* observer ){
@@ -1162,7 +1164,7 @@ CamWnd::CamWnd() :
        gtk_widget_ref( m_gl_widget );
 
        gtk_widget_set_events( m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK );
-       GTK_WIDGET_SET_FLAGS( m_gl_widget, GTK_CAN_FOCUS );
+       gtk_widget_set_can_focus( m_gl_widget, true );
 
        m_sizeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "size_allocate", G_CALLBACK( camera_size_allocate ), this );
        m_exposeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "expose_event", G_CALLBACK( camera_expose ), this );
index 42e6ac7f8555194b9e04806383910734535c315c..ad169054100d48e0947597ceed1888a44c8ed41d 100644 (file)
@@ -212,7 +212,7 @@ std::size_t Sys_Print( int level, const char* buf, std::size_t length ){
                        if ( contains_newline ) {
                                gtk_text_view_scroll_mark_onscreen( GTK_TEXT_VIEW( g_console ), end );
 
-                               if ( !ScreenUpdates_Enabled() && GTK_WIDGET_REALIZED( g_console ) ) {
+                               if ( !ScreenUpdates_Enabled() && gtk_widget_get_realized( g_console ) ) {
                                        ScreenUpdates_process();
                                }
                        }
index 9708bd4266983e60cc3f93649d0ab26784eb2aab..f1860238a6f75dea4a3392750359721aa969f61f 100644 (file)
@@ -863,7 +863,7 @@ void SurfaceFlags_setEntityClass( EntityClass* eclass ){
                for ( int i = 0; i < g_spawnflag_count; ++i )
                {
                        ui::Widget widget = ui::Widget(GTK_WIDGET( g_entitySpawnflagsCheck[i] ));
-                       gtk_label_set_text( GTK_LABEL( GTK_BIN( widget )->child ), " " );
+                       gtk_label_set_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN(widget)) ), " " );
                        gtk_widget_hide( widget );
                        gtk_widget_ref( widget );
                        gtk_container_remove( GTK_CONTAINER( g_spawnflagsTable ), widget );
@@ -886,7 +886,7 @@ void SurfaceFlags_setEntityClass( EntityClass* eclass ){
                                                          (GtkAttachOptions)( GTK_FILL ), 0, 0 );
                        gtk_widget_unref( widget );
 
-                       gtk_label_set_text( GTK_LABEL( GTK_BIN( widget )->child ), str.c_str() );
+                       gtk_label_set_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN(widget)) ), str.c_str() );
                }
        }
 }
@@ -902,7 +902,7 @@ void EntityClassList_selectEntityClass( EntityClass* eclass ){
                        GtkTreeView* view = g_entityClassList;
                        GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
                        gtk_tree_selection_select_path( gtk_tree_view_get_selection( view ), path );
-                       if ( GTK_WIDGET_REALIZED( view ) ) {
+                       if ( gtk_widget_get_realized( GTK_WIDGET(view) ) ) {
                                gtk_tree_view_scroll_to_cell( view, path, 0, FALSE, 0, 0 );
                        }
                        gtk_tree_path_free( path );
@@ -1220,7 +1220,7 @@ static gint EntityClassList_keypress( ui::Widget widget, GdkEventKey* event, gpo
                        if ( toupper( text[0] ) == (int)code ) {
                                GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
                                gtk_tree_selection_select_path( gtk_tree_view_get_selection( view ), path );
-                               if ( GTK_WIDGET_REALIZED( view ) ) {
+                               if ( gtk_widget_get_realized( GTK_WIDGET(view) ) ) {
                                        gtk_tree_view_scroll_to_cell( view, path, 0, FALSE, 0, 0 );
                                }
                                gtk_tree_path_free( path );
index 936dd520acb754c082aa9b6c48f2c326607ea853..a9b9a6681b0b918b5838fd3f53bf2d14ee409109 100644 (file)
@@ -73,7 +73,7 @@ EntityList() :
 }
 
 bool visible() const {
-       return GTK_WIDGET_VISIBLE( m_window );
+       return gtk_widget_get_visible( m_window );
 }
 };
 
index 125461737c618ad6c47bdf36319785e4385f091b..abd0fb840d8d9f3d65168b22799ddac3de6d9afa 100644 (file)
@@ -221,7 +221,7 @@ void FindTextureDialog::updateTextures( const char* name ){
 }
 
 bool FindTextureDialog::isOpen(){
-       return GTK_WIDGET_VISIBLE( g_FindTextureDialog.GetWidget() ) == TRUE;
+       return gtk_widget_get_visible( g_FindTextureDialog.GetWidget() ) == TRUE;
 }
 
 void FindTextureDialog::setFindStr( const char* name ){
index efa03ca70fb9ce083c4d1ed4a50ae50e0edf2dff..d9cd7ed008cfcfe0e7fdb551b8771fbb82eede39 100644 (file)
@@ -107,10 +107,12 @@ bool color_dialog( ui::Widget parent, Vector3& color, const char* title ){
        clr[2] = color[2];
 
        dlg = ui::Widget(gtk_color_selection_dialog_new( title ));
-       gtk_color_selection_set_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), clr );
+       gtk_color_selection_set_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG( dlg )) ), clr );
        g_signal_connect( G_OBJECT( dlg ), "delete_event", G_CALLBACK( dialog_delete_callback ), &dialog );
-       g_signal_connect( G_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->ok_button ), "clicked", G_CALLBACK( dialog_button_ok ), &dialog );
-       g_signal_connect( G_OBJECT( GTK_COLOR_SELECTION_DIALOG( dlg )->cancel_button ), "clicked", G_CALLBACK( dialog_button_cancel ), &dialog );
+       GtkWidget *ok_button, *cancel_button;
+       g_object_get(dlg, "ok-button", &ok_button, "cancel-button", &cancel_button, nullptr);
+       g_signal_connect( ok_button, "clicked", G_CALLBACK( dialog_button_ok ), &dialog );
+       g_signal_connect( cancel_button, "clicked", G_CALLBACK( dialog_button_cancel ), &dialog );
 
        if ( parent ) {
                gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( parent ) );
@@ -119,7 +121,7 @@ bool color_dialog( ui::Widget parent, Vector3& color, const char* title ){
        bool ok = modal_dialog_show( GTK_WINDOW( dlg ), dialog ) == eIDOK;
        if ( ok ) {
                GdkColor gdkcolor;
-               gtk_color_selection_get_current_color( GTK_COLOR_SELECTION( GTK_COLOR_SELECTION_DIALOG( dlg )->colorsel ), &gdkcolor );
+               gtk_color_selection_get_current_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG( dlg )) ), &gdkcolor );
                clr[0] = gdkcolor.red / 65535.0;
                clr[1] = gdkcolor.green / 65535.0;
                clr[2] = gdkcolor.blue / 65535.0;
index b75225ebf65c7832a30bc27be3f2c577b3055ec8..90facfdef3cbe12839b6c407da810a96f396064e 100644 (file)
@@ -1600,7 +1600,7 @@ void EverySecondTimer_disable(){
 }
 
 gint window_realize_remove_decoration( ui::Widget widget, gpointer data ){
-       gdk_window_set_decorations( GTK_WIDGET(widget)->window, (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
+       gdk_window_set_decorations( gtk_widget_get_window(widget), (GdkWMDecoration)( GDK_DECOR_ALL | GDK_DECOR_MENU | GDK_DECOR_MINIMIZE | GDK_DECOR_MAXIMIZE ) );
        return FALSE;
 }
 
@@ -1672,7 +1672,7 @@ bool ScreenUpdates_Enabled(){
 }
 
 void ScreenUpdates_process(){
-       if ( redrawRequired() && GTK_WIDGET_VISIBLE( g_wait.m_window ) ) {
+       if ( redrawRequired() && gtk_widget_get_visible( g_wait.m_window ) ) {
                process_gui();
        }
 }
@@ -1694,7 +1694,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( g_wait.m_window ) ) {
                gtk_label_set_text( g_wait.m_label, message );
                ScreenUpdates_process();
        }
@@ -1714,7 +1714,7 @@ void ScreenUpdates_Enable(){
 
                //gtk_window_present(MainFrame_getWindow());
        }
-       else if ( GTK_WIDGET_VISIBLE( g_wait.m_window ) ) {
+       else if ( gtk_widget_get_visible( g_wait.m_window ) ) {
                gtk_label_set_text( g_wait.m_label, g_wait_stack.back().c_str() );
                ScreenUpdates_process();
        }
@@ -2460,7 +2460,7 @@ WindowFocusPrinter g_mainframeFocusPrinter( "mainframe" );
 class MainWindowActive
 {
 static gboolean notify( ui::Window window, gpointer dummy, MainWindowActive* self ){
-       if ( g_wait.m_window && gtk_window_is_active( window ) && !GTK_WIDGET_VISIBLE( g_wait.m_window ) ) {
+       if ( g_wait.m_window && gtk_window_is_active( window ) && !gtk_widget_get_visible( g_wait.m_window ) ) {
                gtk_widget_show( GTK_WIDGET( g_wait.m_window ) );
        }
 
@@ -2999,7 +2999,7 @@ void MainFrame::SaveWindowInfo(){
 
        g_layout_globals.m_position = m_position_tracker.getPosition();
 
-       g_layout_globals.nState = gdk_window_get_state( GTK_WIDGET( m_window )->window );
+       g_layout_globals.nState = gdk_window_get_state( gtk_widget_get_window(GTK_WIDGET( m_window )) );
 }
 
 void MainFrame::Shutdown(){
index 67690be118b7eecb1622a83cd408aa148e66f5f1..aadb1d78da84de1e7d4b610c437125464d962dde 100644 (file)
@@ -159,7 +159,7 @@ void MRU_Activate( std::size_t index ){
                        MRU_SetText( i, MRU_GetText( i + 1 ) );
 
                if ( MRU_used == 0 ) {
-                       gtk_label_set_text( GTK_LABEL( GTK_BIN( MRU_items[0] )->child ), "Recent Files" );
+                       gtk_label_set_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN( MRU_items[0] )) ), "Recent Files" );
                        gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), FALSE );
                }
                else
index bbe466c10e633165171d6c446853100cbfd8d4ac..9e7dd8b310eef7055c7944b933a65c7ec44489a1 100644 (file)
@@ -257,7 +257,7 @@ PatchInspector() :
 }
 
 bool visible(){
-       return GTK_WIDGET_VISIBLE( GetWidget() );
+       return gtk_widget_get_visible( GetWidget() );
 }
 
 //  void UpdateInfo();
@@ -458,14 +458,14 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
        td.scale[0] = td.scale[1] = 0;
        td.shift[0] = td.shift[1] = 0;
 
-       if ( adj->value == 0 ) {
+       if ( gtk_adjustment_get_value(adj) == 0 ) {
                return;
        }
 
        if ( adj == g_object_get_data( G_OBJECT( g_PatchInspector.GetWidget() ), "hshift_adj" ) ) {
                g_pi_globals.shift[0] = static_cast<float>( atof( gtk_entry_get_text( GTK_ENTRY( data ) ) ) );
 
-               if ( adj->value > 0 ) {
+               if ( gtk_adjustment_get_value(adj) > 0 ) {
                        td.shift[0] = g_pi_globals.shift[0];
                }
                else{
@@ -475,7 +475,7 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
        else if ( adj == g_object_get_data( G_OBJECT( g_PatchInspector.GetWidget() ), "vshift_adj" ) ) {
                g_pi_globals.shift[1] = static_cast<float>( atof( gtk_entry_get_text( GTK_ENTRY( data ) ) ) );
 
-               if ( adj->value > 0 ) {
+               if ( gtk_adjustment_get_value(adj) > 0 ) {
                        td.shift[1] = g_pi_globals.shift[1];
                }
                else{
@@ -487,7 +487,7 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
                if ( g_pi_globals.scale[0] == 0.0f ) {
                        return;
                }
-               if ( adj->value > 0 ) {
+               if ( gtk_adjustment_get_value(adj) > 0 ) {
                        td.scale[0] = g_pi_globals.scale[0];
                }
                else{
@@ -499,7 +499,7 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
                if ( g_pi_globals.scale[1] == 0.0f ) {
                        return;
                }
-               if ( adj->value > 0 ) {
+               if ( gtk_adjustment_get_value(adj) > 0 ) {
                        td.scale[1] = g_pi_globals.scale[1];
                }
                else{
@@ -509,7 +509,7 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
        else if ( adj == g_object_get_data( G_OBJECT( g_PatchInspector.GetWidget() ), "rotate_adj" ) ) {
                g_pi_globals.rotate = static_cast<float>( atof( gtk_entry_get_text( GTK_ENTRY( data ) ) ) );
 
-               if ( adj->value > 0 ) {
+               if ( gtk_adjustment_get_value(adj) > 0 ) {
                        td.rotate = g_pi_globals.rotate;
                }
                else{
@@ -517,7 +517,7 @@ static void OnSpinChanged( GtkAdjustment *adj, gpointer data ){
                }
        }
 
-       adj->value = 0;
+       gtk_adjustment_set_value(adj, 0);
 
        // will scale shift rotate the patch accordingly
 
@@ -898,13 +898,13 @@ ui::Window PatchInspector::BuildDialog(){
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
                                                        g_object_set_data( G_OBJECT( window ), "hshift_adj", adj );
 
-                                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
+                                                       auto spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
-                                                       GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
+                                                       gtk_widget_set_can_focus( spin, false );
                                                }
                                                {
                                                        GtkEntry* entry = ui::Entry();
@@ -919,13 +919,13 @@ ui::Window PatchInspector::BuildDialog(){
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
                                                        g_object_set_data( G_OBJECT( window ), "vshift_adj", adj );
 
-                                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
+                                                       auto spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 1, 2,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
-                                                       GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
+                                                       gtk_widget_set_can_focus( spin, false );
                                                }
                                                {
                                                        GtkEntry* entry = ui::Entry();
@@ -940,13 +940,13 @@ ui::Window PatchInspector::BuildDialog(){
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
                                                        g_object_set_data( G_OBJECT( window ), "hscale_adj", adj );
 
-                                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
+                                                       auto spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 2, 3,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
-                                                       GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
+                                                       gtk_widget_set_can_focus( spin, false );
                                                }
                                                {
                                                        GtkEntry* entry = ui::Entry();
@@ -961,13 +961,13 @@ ui::Window PatchInspector::BuildDialog(){
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
                                                        g_object_set_data( G_OBJECT( window ), "vscale_adj", adj );
 
-                                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
+                                                       auto spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 3, 4,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
-                                                       GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
+                                                       gtk_widget_set_can_focus( spin, false );
                                                }
                                                {
                                                        GtkEntry* entry = ui::Entry();
@@ -982,13 +982,13 @@ ui::Window PatchInspector::BuildDialog(){
                                                        g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( OnSpinChanged ), entry );
                                                        g_object_set_data( G_OBJECT( window ), "rotate_adj", adj );
 
-                                                       GtkSpinButton* spin = ui::SpinButton( adj, 1, 0 );
+                                                       auto spin = ui::SpinButton( adj, 1, 0 );
                                                        gtk_widget_show( GTK_WIDGET( spin ) );
                                                        gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 4, 5,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_widget_set_usize( GTK_WIDGET( spin ), 10, -2 );
-                                                       GTK_WIDGET_UNSET_FLAGS( spin, GTK_CAN_FOCUS );
+                                                       gtk_widget_set_can_focus( spin, false );
                                                }
                                        }
                                        GtkHBox* hbox2 = ui::HBox( TRUE, 5 );
index 00723ab75a268d5ee18e54d1774da1ef1d642ded..326702fb3739e75d062ae171457c47de440da87e 100644 (file)
@@ -614,7 +614,7 @@ void PreferencesDialog_addSettingsPage( const PreferenceGroupCallback& callback
 }
 
 void Widget_updateDependency( ui::Widget self, ui::Widget toggleButton ){
-       gtk_widget_set_sensitive( self, gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( toggleButton ) ) && GTK_WIDGET_IS_SENSITIVE( toggleButton ) );
+       gtk_widget_set_sensitive( self, gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( toggleButton ) ) && gtk_widget_is_sensitive( toggleButton ) );
 }
 
 void ToggleButton_toggled_Widget_updateDependency( ui::Widget toggleButton, ui::Widget self ){
index d97a65efb6d5419049806328dd823303fca0a5c3..f458a079708dff9f36f3f3cd977d75c18d87a117 100644 (file)
@@ -333,14 +333,14 @@ bool g_bWaitCursor = false;
 void Sys_BeginWait( void ){
        ScreenUpdates_Disable( "Processing...", "Please Wait" );
        GdkCursor *cursor = gdk_cursor_new( GDK_WATCH );
-       gdk_window_set_cursor( GTK_WIDGET( MainFrame_getWindow() )->window, cursor );
+       gdk_window_set_cursor( gtk_widget_get_window(MainFrame_getWindow()), cursor );
        gdk_cursor_unref( cursor );
        g_bWaitCursor = true;
 }
 
 void Sys_EndWait( void ){
        ScreenUpdates_Enable();
-       gdk_window_set_cursor( GTK_WIDGET( MainFrame_getWindow() )->window, 0 );
+       gdk_window_set_cursor(gtk_widget_get_window(MainFrame_getWindow()), 0 );
        g_bWaitCursor = false;
 }
 
index 245eb06d3fbcf4e407a03e648934eb0378b678ff..a6ee307e14e6b59a998f2b72e99031eb1f83819c 100644 (file)
@@ -106,7 +106,7 @@ void queueDraw(){
 
 inline void spin_button_set_step( GtkSpinButton* spin, gfloat step ){
 #if 1
-       gtk_spin_button_get_adjustment( spin )->step_increment = step;
+    gtk_adjustment_set_step_increment(gtk_spin_button_get_adjustment( spin ), step);
 #else
        GValue gvalue = GValue_default();
        g_value_init( &gvalue, G_TYPE_DOUBLE );
@@ -210,7 +210,7 @@ void destroyWindow(){
        Destroy();
 }
 bool visible() const {
-       return GTK_WIDGET_VISIBLE( GetWidget() );
+       return gtk_widget_get_visible( GetWidget() );
 }
 void queueDraw(){
        if ( visible() ) {
@@ -1043,7 +1043,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                // --> Dunno, but this stuff may be necessary... (Looks like it!)
                                gtk_widget_ref( TexTool::g_textoolWin );
                                gtk_widget_set_events( TexTool::g_textoolWin, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK );
-                               GTK_WIDGET_SET_FLAGS( TexTool::g_textoolWin, GTK_CAN_FOCUS );
+                               gtk_widget_set_can_focus( TexTool::g_textoolWin, true );
                                // <-- end stuff...
                                gtk_widget_show( TexTool::g_textoolWin );
                                gtk_widget_set_usize( TexTool::g_textoolWin, -1, 240 ); //Yeah!
@@ -1104,7 +1104,7 @@ void spin_button_set_value_no_signal( GtkSpinButton* spin, gdouble value ){
 
 void spin_button_set_step_increment( GtkSpinButton* spin, gdouble value ){
        GtkAdjustment* adjust = gtk_spin_button_get_adjustment( spin );
-       adjust->step_increment = value;
+       gtk_adjustment_set_step_increment(adjust, value);
 }
 
 void SurfaceInspector::Update(){
index f9f2b8708c3b19777d90bd283727b6b686ac2873..ab5581136354b3249c1ab7449343475e555b6245 100644 (file)
@@ -166,7 +166,7 @@ void value_changed( gdouble value ){
        }
 }
 static void adjustment_value_changed( GtkAdjustment *adjustment, DeferredAdjustment* self ){
-       self->value_changed( adjustment->value );
+       self->value_changed( gtk_adjustment_get_value(adjustment) );
 }
 };
 
@@ -1357,7 +1357,7 @@ void TextureBrowser_scrollChanged( void* data, gdouble value ){
 }
 
 static void TextureBrowser_verticalScroll( GtkAdjustment *adjustment, TextureBrowser* textureBrowser ){
-       textureBrowser->m_scrollAdjustment.value_changed( adjustment->value );
+       textureBrowser->m_scrollAdjustment.value_changed( gtk_adjustment_get_value(adjustment) );
 }
 
 void TextureBrowser_updateScroll( TextureBrowser& textureBrowser ){
@@ -1368,12 +1368,12 @@ void TextureBrowser_updateScroll( TextureBrowser& textureBrowser ){
 
                GtkAdjustment *vadjustment = gtk_range_get_adjustment( GTK_RANGE( textureBrowser.m_texture_scroll ) );
 
-               vadjustment->value = -TextureBrowser_getOriginY( textureBrowser );
-               vadjustment->page_size = textureBrowser.height;
-               vadjustment->page_increment = textureBrowser.height / 2;
-               vadjustment->step_increment = 20;
-               vadjustment->lower = 0;
-               vadjustment->upper = totalHeight;
+               gtk_adjustment_set_value(vadjustment, -TextureBrowser_getOriginY( textureBrowser ));
+               gtk_adjustment_set_page_size(vadjustment, textureBrowser.height);
+               gtk_adjustment_set_page_increment(vadjustment, textureBrowser.height / 2);
+               gtk_adjustment_set_step_increment(vadjustment, 20);
+               gtk_adjustment_set_lower(vadjustment, 0);
+               gtk_adjustment_set_upper(vadjustment, totalHeight);
 
                g_signal_emit_by_name( G_OBJECT( vadjustment ), "changed" );
        }
@@ -1995,7 +1995,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                gtk_widget_ref( g_TextureBrowser.m_gl_widget );
 
                gtk_widget_set_events( g_TextureBrowser.m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK );
-               GTK_WIDGET_SET_FLAGS( g_TextureBrowser.m_gl_widget, GTK_CAN_FOCUS );
+               gtk_widget_set_can_focus( g_TextureBrowser.m_gl_widget, true );
 
                gtk_table_attach_defaults( GTK_TABLE( table ), g_TextureBrowser.m_gl_widget, 1, 2, 1, 2 );
                gtk_widget_show( g_TextureBrowser.m_gl_widget );
index a4e91441b8f1cb43268bd64a4f0750d1bb0f52df..a20214da55c26c96343f07e48fc7fd82cfc7f0ec 100644 (file)
@@ -707,7 +707,7 @@ bool XYWnd::chaseMouseMotion( int pointx, int pointy ){
 Shader* XYWnd::m_state_selected = 0;
 
 void xy_update_xor_rectangle( XYWnd& self, rect_t area ){
-       if ( GTK_WIDGET_VISIBLE( self.GetWidget() ) ) {
+       if ( gtk_widget_get_visible( self.GetWidget() ) ) {
                self.m_XORRectangle.set( rectangle_from_area( area.min, area.max, self.Width(), self.Height() ) );
        }
 }
@@ -831,7 +831,7 @@ XYWnd::XYWnd() :
        gtk_widget_ref( m_gl_widget );
 
        gtk_widget_set_events( m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK );
-       GTK_WIDGET_SET_FLAGS( m_gl_widget, GTK_CAN_FOCUS );
+       gtk_widget_set_can_focus( m_gl_widget, true );
 
        m_sizeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "size_allocate", G_CALLBACK( xywnd_size_allocate ), this );
        m_exposeHandler = g_signal_connect( G_OBJECT( m_gl_widget ), "expose_event", G_CALLBACK( xywnd_expose ), this );
@@ -946,12 +946,12 @@ void XYWnd::Clipper_Crosshair_OnMouseMoved( int x, int y ){
        if ( ClipMode() && GlobalClipPoints_Find( mousePosition, (VIEWTYPE)m_viewType, m_fScale ) != 0 ) {
                GdkCursor *cursor;
                cursor = gdk_cursor_new( GDK_CROSSHAIR );
-               gdk_window_set_cursor( GTK_WIDGET(m_gl_widget)->window, cursor );
+               gdk_window_set_cursor( gtk_widget_get_window(m_gl_widget), cursor );
                gdk_cursor_unref( cursor );
        }
        else
        {
-               gdk_window_set_cursor( GTK_WIDGET(m_gl_widget)->window, 0 );
+               gdk_window_set_cursor( gtk_widget_get_window(m_gl_widget), 0 );
        }
 }
 
@@ -1062,7 +1062,7 @@ void XYWnd::NewBrushDrag( int x, int y ){
 
 void entitycreate_activated( ui::Widget item ){
        scene::Node* world_node = Map_FindWorldspawn( g_map );
-       const char* entity_name = gtk_label_get_text( GTK_LABEL( GTK_BIN( item )->child ) );
+       const char* entity_name = gtk_label_get_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN( item )) ) );
 
        if ( !( world_node && string_equal( entity_name, "worldspawn" ) ) ) {
                g_pParentWnd->ActiveXY()->OnEntityCreate( entity_name );