From: TimePath Date: Wed, 17 Feb 2016 22:33:02 +0000 (+1100) Subject: -DGTK_DISABLE_DEPRECATED X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=52b70827f0aee75fdb26c7a7a9f504ada3a3f0b5;p=xonotic%2Fnetradiant.git -DGTK_DISABLE_DEPRECATED --- diff --git a/CMakeLists.txt b/CMakeLists.txt index bcb4fbc5..37ca39a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,12 @@ find_package(OpenGL REQUIRED) add_definitions(-DRADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}") -add_definitions(-DGTK_DISABLE_SINGLE_INCLUDES -DGSEAL_ENABLE) +add_definitions( + -DGTK_DISABLE_SINGLE_INCLUDES + -DGSEAL_ENABLE + #-DGDK_DISABLE_DEPRECATED + #-DGTK_DISABLE_DEPRECATED +) if(NOT WIN32) add_definitions( diff --git a/contrib/bkgrnd2d/dialog.cpp b/contrib/bkgrnd2d/dialog.cpp index 0764daca..a787c8fa 100644 --- a/contrib/bkgrnd2d/dialog.cpp +++ b/contrib/bkgrnd2d/dialog.cpp @@ -320,11 +320,11 @@ void InitBackgroundDialog(){ // GTK_STOCK_CLOSE, // GTK_RESPONSE_CLOSE, NULL ); - gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "delete_event", - GTK_SIGNAL_FUNC( close_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "response", - GTK_SIGNAL_FUNC( response_callback ), NULL ); -// gtk_signal_connect( GTK_OBJECT (pDialogWnd), "expose_event", GTK_SIGNAL_FUNC( ci_expose ), NULL ); + g_signal_connect( GTK_OBJECT( pDialogWnd ), "delete_event", + G_CALLBACK( close_callback ), NULL ); + g_signal_connect( GTK_OBJECT( pDialogWnd ), "response", + G_CALLBACK( response_callback ), NULL ); +// g_signal_connect( GTK_OBJECT (pDialogWnd), "expose_event", G_CALLBACK( ci_expose ), NULL ); pTooltips = gtk_tooltips_new(); diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index 08bac097..f4c28b97 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -60,23 +60,23 @@ void Update_TextureReseter(){ gboolean check; check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbTexChange ) ); - gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editTexNew ), check ); - gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editTexOld ), check ); + gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editTexNew ), check ); + gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editTexOld ), check ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleHor ) ); - gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editScaleHor ), check ); + gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editScaleHor ), check ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleVert ) ); - gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editScaleVert ), check ); + gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editScaleVert ), check ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftHor ) ); - gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editShiftHor ), check ); + gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editShiftHor ), check ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftVert ) ); - gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editShiftVert ), check ); + gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editShiftVert ), check ); check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbRotation ) ); - gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editRotation ), check ); + gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editRotation ), check ); } static void dialog_button_callback( GtkWidget *widget, gpointer data ){ @@ -106,9 +106,8 @@ static void dialog_button_callback_settex( GtkWidget *widget, gpointer data ){ TwinWidget* tw = (TwinWidget*)data; GtkEntry* entry = GTK_ENTRY( tw->one ); - GtkCombo* combo = GTK_COMBO( tw->two ); - - const gchar* tex = gtk_entry_get_text( GTK_ENTRY( combo->entry ) ); + auto* combo = tw->two; + const gchar* tex = gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo)); gtk_entry_set_text( entry, tex ); } @@ -215,10 +214,10 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess int loop = 1; window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", - GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", - GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", + G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", + G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), lpCaption ); gtk_container_border_width( GTK_CONTAINER( window ), 10 ); g_object_set_data( G_OBJECT( window ), "loop", &loop ); @@ -245,8 +244,8 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess if ( type == eMB_OK ) { 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default(w, true); gtk_widget_grab_default( w ); gtk_widget_show( w ); @@ -255,38 +254,38 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess else if ( type == eMB_OKCANCEL ) { 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; } else if ( type == eMB_YESNOCANCEL ) { w = ui::Button( "Yes" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "No" ); 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( eIDNO ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; } @@ -294,16 +293,16 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess { w = ui::Button( "Yes" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "No" ); 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( eIDNO ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) ); gtk_widget_show( w ); ret = eIDNO; } @@ -329,8 +328,8 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){ window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Intersect" ); gtk_container_border_width( GTK_CONTAINER( window ), 10 ); @@ -377,7 +376,7 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); @@ -385,7 +384,7 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){ w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -427,8 +426,8 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Polygon Builder" ); gtk_container_border_width( GTK_CONTAINER( window ), 10 ); @@ -531,7 +530,7 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); @@ -539,7 +538,7 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -601,8 +600,8 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Stair Builder" ); @@ -672,19 +671,19 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ gtk_box_pack_start( GTK_BOX( hbox ), radioNorth, FALSE, FALSE, 3 ); gtk_widget_show( radioNorth ); - radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioNorth ) ); + radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNorth ) ); radioSouth = gtk_radio_button_new_with_label( radioDirection, "South" ); gtk_box_pack_start( GTK_BOX( hbox ), radioSouth, FALSE, FALSE, 2 ); gtk_widget_show( radioSouth ); - radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioSouth ) ); + radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioSouth ) ); radioEast = gtk_radio_button_new_with_label( radioDirection, "East" ); gtk_box_pack_start( GTK_BOX( hbox ), radioEast, FALSE, FALSE, 1 ); gtk_widget_show( radioEast ); - radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioEast ) ); + radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioEast ) ); radioWest = gtk_radio_button_new_with_label( radioDirection, "West" ); gtk_box_pack_start( GTK_BOX( hbox ), radioWest, FALSE, FALSE, 0 ); @@ -710,13 +709,13 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){ gtk_box_pack_start( GTK_BOX( hbox ), radioOldStyle, FALSE, FALSE, 0 ); gtk_widget_show( radioOldStyle ); - radioStyle = gtk_radio_button_group( GTK_RADIO_BUTTON( radioOldStyle ) ); + radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioOldStyle ) ); radioBobStyle = gtk_radio_button_new_with_label( radioStyle, "Bob's Style" ); gtk_box_pack_start( GTK_BOX( hbox ), radioBobStyle, FALSE, FALSE, 0 ); gtk_widget_show( radioBobStyle ); - radioStyle = gtk_radio_button_group( GTK_RADIO_BUTTON( radioBobStyle ) ); + radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioBobStyle ) ); radioCornerStyle = gtk_radio_button_new_with_label( radioStyle, "Corner Style" ); gtk_box_pack_start( GTK_BOX( hbox ), radioCornerStyle, FALSE, FALSE, 0 ); @@ -773,14 +772,14 @@ 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -857,8 +856,8 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Door Builder" ); @@ -870,10 +869,10 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ gtk_widget_realize( window ); char buffer[256]; - GList *listMainTextures = NULL; - GList *listTrimTextures = NULL; - LoadGList( GetFilename( buffer, "plugins/bt/door-tex.txt" ), &listMainTextures ); - LoadGList( GetFilename( buffer, "plugins/bt/door-tex-trim.txt" ), &listTrimTextures ); + GtkListStore *listMainTextures = gtk_list_store_new( 1, G_TYPE_STRING ); + GtkListStore *listTrimTextures = gtk_list_store_new( 1, G_TYPE_STRING ); + LoadGList( GetFilename( buffer, "plugins/bt/door-tex.txt" ), listMainTextures ); + LoadGList( GetFilename( buffer, "plugins/bt/door-tex-trim.txt" ), listTrimTextures ); vbox = ui::VBox( FALSE, 10 ); gtk_container_add( GTK_CONTAINER( window ), vbox ); @@ -949,17 +948,16 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ // djbob: lists added - comboMain = gtk_combo_new(); + comboMain = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listMainTextures)); + gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0); gtk_box_pack_start( GTK_BOX( hbox ), comboMain, FALSE, FALSE, 0 ); - gtk_combo_set_popdown_strings( GTK_COMBO( comboMain ), listMainTextures ); - gtk_combo_set_use_arrows( GTK_COMBO( comboMain ), 1 ); gtk_widget_show( comboMain ); tw1.one = textFrontBackTex; - tw1.two = comboMain; + tw1.two = GTK_COMBO_BOX(comboMain); buttonSetMain = ui::Button( "Set As Main Texture" ); - gtk_signal_connect( GTK_OBJECT( buttonSetMain ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw1 ); + g_signal_connect( GTK_OBJECT( buttonSetMain ), "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw1 ); gtk_box_pack_start( GTK_BOX( hbox ), buttonSetMain, FALSE, FALSE, 0 ); gtk_widget_show( buttonSetMain ); @@ -969,17 +967,16 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 ); gtk_widget_show( hbox ); - comboTrim = gtk_combo_new(); + comboTrim = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listTrimTextures)); + gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0); gtk_box_pack_start( GTK_BOX( hbox ), comboTrim, FALSE, FALSE, 0 ); - gtk_combo_set_popdown_strings( GTK_COMBO( comboTrim ), listTrimTextures ); - gtk_combo_set_use_arrows( GTK_COMBO( comboMain ), 1 ); gtk_widget_show( comboTrim ); tw2.one = textTrimTex; - tw2.two = comboTrim; + tw2.two = GTK_COMBO_BOX(comboTrim); buttonSetTrim = ui::Button( "Set As Trim Texture" ); - gtk_signal_connect( GTK_OBJECT( buttonSetTrim ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw2 ); + g_signal_connect( GTK_OBJECT( buttonSetTrim ), "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw2 ); gtk_box_pack_start( GTK_BOX( hbox ), buttonSetTrim, FALSE, FALSE, 0 ); gtk_widget_show( buttonSetTrim ); @@ -998,7 +995,7 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){ gtk_box_pack_start( GTK_BOX( hbox ), radioNS, FALSE, FALSE, 0 ); gtk_widget_show( radioNS ); - radioOrientation = gtk_radio_button_group( GTK_RADIO_BUTTON( radioNS ) ); + radioOrientation = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNS ) ); radioEW = gtk_radio_button_new_with_label( radioOrientation, "East - West" ); gtk_box_pack_start( GTK_BOX( hbox ), radioEW, FALSE, FALSE, 0 ); @@ -1018,14 +1015,14 @@ 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -1072,8 +1069,8 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){ window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" ); gtk_container_border_width( GTK_CONTAINER( window ), 10 ); @@ -1179,7 +1176,7 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){ w = ui::Button( "Enable" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_show( w ); gtk_widget_set_can_default( w, true ); @@ -1187,12 +1184,12 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){ w = ui::Button( "Disable" ); 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( eIDNO ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -1243,8 +1240,8 @@ EMessageBoxReturn DoCTFColourChangeBox(){ window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "CTF Colour Changer" ); gtk_container_border_width( GTK_CONTAINER( window ), 10 ); @@ -1270,7 +1267,7 @@ EMessageBoxReturn DoCTFColourChangeBox(){ w = ui::Button( "Red->Blue" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); @@ -1278,12 +1275,12 @@ EMessageBoxReturn DoCTFColourChangeBox(){ w = ui::Button( "Blue->Red" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -1314,8 +1311,8 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" ); gtk_container_border_width( GTK_CONTAINER( window ), 10 ); @@ -1361,7 +1358,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ // ---- frame ---- dlgTexReset.cbTexChange = ui::CheckButton( "Enabled" ); - gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbTexChange ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL ); + g_signal_connect( GTK_OBJECT( dlgTexReset.cbTexChange ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL ); gtk_widget_show( dlgTexReset.cbTexChange ); gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbTexChange, 0, 1, 0, 1, (GtkAttachOptions) ( GTK_FILL ), @@ -1409,7 +1406,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ // ---- frame ---- dlgTexReset.cbScaleHor = ui::CheckButton( "Enabled" ); - gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleHor ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL ); + g_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleHor ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL ); gtk_widget_show( dlgTexReset.cbScaleHor ); gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleHor, 0, 1, 0, 1, (GtkAttachOptions) ( GTK_FILL ), @@ -1430,7 +1427,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ dlgTexReset.cbScaleVert = ui::CheckButton( "Enabled" ); - gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleVert ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL ); + g_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleVert ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL ); gtk_widget_show( dlgTexReset.cbScaleVert ); gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleVert, 0, 1, 1, 2, (GtkAttachOptions) ( GTK_FILL ), @@ -1465,7 +1462,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ // ---- frame ---- dlgTexReset.cbShiftHor = ui::CheckButton( "Enabled" ); - gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftHor ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL ); + g_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftHor ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL ); gtk_widget_show( dlgTexReset.cbShiftHor ); gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftHor, 0, 1, 0, 1, (GtkAttachOptions) ( GTK_FILL ), @@ -1486,7 +1483,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ dlgTexReset.cbShiftVert = ui::CheckButton( "Enabled" ); - gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftVert ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL ); + g_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftVert ), "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL ); gtk_widget_show( dlgTexReset.cbShiftVert ); gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftVert, 0, 1, 1, 2, (GtkAttachOptions) ( GTK_FILL ), @@ -1549,7 +1546,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ w = ui::Button( "Use Selected Brushes" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); @@ -1557,12 +1554,12 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){ w = ui::Button( "Use All Brushes" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -1650,8 +1647,8 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){ window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Train Thing" ); gtk_container_border_width( GTK_CONTAINER( window ), 10 ); @@ -1836,7 +1833,7 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); @@ -1844,7 +1841,7 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){ w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -1913,8 +1910,8 @@ EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){ window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), "Make Chain" ); @@ -1975,14 +1972,14 @@ 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.h b/contrib/bobtoolz/dialogs/dialogs-gtk.h index ae354904..75db2d18 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.h +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.h @@ -20,6 +20,7 @@ #if !defined( INCLUDED_DIALOGS_GTK_H ) #define INCLUDED_DIALOGS_GTK_H +#include #include "qerplugin.h" struct BuildStairsRS { @@ -94,7 +95,7 @@ typedef struct _GtkWidget GtkWidget; struct TwinWidget { GtkWidget* one; - GtkWidget* two; + GtkComboBox* two; }; EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMessageBoxType type ); diff --git a/contrib/bobtoolz/lists.cpp b/contrib/bobtoolz/lists.cpp index 81079839..c2b1ed9e 100644 --- a/contrib/bobtoolz/lists.cpp +++ b/contrib/bobtoolz/lists.cpp @@ -24,6 +24,7 @@ #endif #include +#include #include "misc.h" @@ -54,7 +55,7 @@ bool LoadExclusionList( char* filename, std::list* exclusionList ){ return FALSE; } -bool LoadGList( char* filename, GList** loadlist ){ +bool LoadGList( char* filename, GtkListStore* loadlist ){ FILE* eFile = fopen( filename, "r" ); if ( eFile ) { char buffer[256]; @@ -67,7 +68,9 @@ bool LoadGList( char* filename, GList** loadlist ){ if ( strlen( buffer ) > 0 ) { char* buffer2 = new char[strlen( buffer ) + 1]; strcpy( buffer2, buffer ); - *loadlist = g_list_append( *loadlist, buffer2 ); + GtkTreeIter iter; + gtk_list_store_append(loadlist, &iter); + gtk_list_store_set(loadlist, &iter, 0, buffer2, -1); } else{ cnt++; diff --git a/contrib/bobtoolz/lists.h b/contrib/bobtoolz/lists.h index 827c9cbc..00e50266 100644 --- a/contrib/bobtoolz/lists.h +++ b/contrib/bobtoolz/lists.h @@ -18,8 +18,9 @@ */ #include +#include #include "str.h" typedef struct _GList GList; bool LoadExclusionList( char* filename, std::list* exclusionList ); -bool LoadGList( char* filename, GList** loadlist ); +bool LoadGList( char* filename, GtkListStore* loadlist ); diff --git a/contrib/brushexport/interface.cpp b/contrib/brushexport/interface.cpp index e9688ac2..a2405aa5 100644 --- a/contrib/brushexport/interface.cpp +++ b/contrib/brushexport/interface.cpp @@ -7,7 +7,7 @@ #define GLADE_HOOKUP_OBJECT( component,widget,name ) \ g_object_set_data_full( G_OBJECT( component ), name, \ - gtk_widget_ref( widget ), (GDestroyNotify) gtk_widget_unref ) + g_object_ref( widget ), (GDestroyNotify) g_object_unref ) #define GLADE_HOOKUP_OBJECT_NO_REF( component,widget,name ) \ g_object_set_data( G_OBJECT( component ), name, widget ) diff --git a/contrib/camera/dialogs.cpp b/contrib/camera/dialogs.cpp index 43c2543b..460f8abf 100644 --- a/contrib/camera/dialogs.cpp +++ b/contrib/camera/dialogs.cpp @@ -71,8 +71,8 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ // create the window window = ui::Window( ui::window_type::TOP ); gtk_window_set_title( GTK_WINDOW( window ), "New Camera" ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); g_object_set_data( G_OBJECT( window ), "loop", &loop ); @@ -105,17 +105,17 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ fixed = gtk_radio_button_new_with_label( targetTypeRadio, "Fixed" ); gtk_box_pack_start( GTK_BOX( vbox2 ), fixed, FALSE, FALSE, 3 ); gtk_widget_show( fixed ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( fixed ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( fixed ) ); interpolated = gtk_radio_button_new_with_label( targetTypeRadio, "Interpolated" ); gtk_box_pack_start( GTK_BOX( vbox2 ), interpolated, FALSE, FALSE, 3 ); gtk_widget_show( interpolated ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( interpolated ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( interpolated ) ); spline = gtk_radio_button_new_with_label( targetTypeRadio, "Spline" ); gtk_box_pack_start( GTK_BOX( vbox2 ), spline, FALSE, FALSE, 3 ); gtk_widget_show( spline ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( spline ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( spline ) ); // -------------------------- // @@ -131,7 +131,7 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); gtk_widget_set_can_default( w, true ); @@ -139,7 +139,7 @@ static gint ci_new( GtkWidget *widget, gpointer data ){ w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -364,8 +364,8 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){ // create the window window = ui::Window( ui::window_type::TOP ); gtk_window_set_title( GTK_WINDOW( window ), "Rename Path" ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); g_object_set_data( G_OBJECT( window ), "loop", &loop ); @@ -413,7 +413,7 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){ 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); gtk_widget_set_can_default( w, true ); @@ -421,7 +421,7 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){ w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -483,8 +483,8 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ // create the window window = ui::Window( ui::window_type::TOP ); gtk_window_set_title( GTK_WINDOW( window ), "Add Target" ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); g_object_set_data( G_OBJECT( window ), "loop", &loop ); @@ -534,17 +534,17 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ fixed = gtk_radio_button_new_with_label( targetTypeRadio, "Fixed" ); gtk_box_pack_start( GTK_BOX( vbox2 ), fixed, FALSE, FALSE, 3 ); gtk_widget_show( fixed ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( fixed ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( fixed ) ); interpolated = gtk_radio_button_new_with_label( targetTypeRadio, "Interpolated" ); gtk_box_pack_start( GTK_BOX( vbox2 ), interpolated, FALSE, FALSE, 3 ); gtk_widget_show( interpolated ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( interpolated ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( interpolated ) ); spline = gtk_radio_button_new_with_label( targetTypeRadio, "Spline" ); gtk_box_pack_start( GTK_BOX( vbox2 ), spline, FALSE, FALSE, 3 ); gtk_widget_show( spline ); - targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( spline ) ); + targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( spline ) ); // -------------------------- // @@ -560,7 +560,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); gtk_widget_set_can_default( w, true ); @@ -568,7 +568,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){ w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -831,8 +831,8 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ // create the window window = ui::Window( ui::window_type::TOP ); gtk_window_set_title( GTK_WINDOW( window ), "Add Event" ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) ); g_object_set_data( G_OBJECT( window ), "loop", &loop ); @@ -866,7 +866,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ eventWidget[i] = gtk_radio_button_new_with_label( eventTypeRadio, camEventStr[i] ); gtk_box_pack_start( GTK_BOX( vbox2 ), eventWidget[i], FALSE, FALSE, 3 ); gtk_widget_show( eventWidget[i] ); - eventTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( eventWidget[i] ) ); + eventTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( eventWidget[i] ) ); if ( camEventFlags[i][1] == false ) { gtk_widget_set_sensitive( eventWidget[i], FALSE ); } @@ -900,7 +900,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) ); gtk_widget_show( w ); gtk_widget_set_can_default( w, true ); @@ -908,7 +908,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){ w = ui::Button( "Cancel" ); 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( eIDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) ); gtk_widget_show( w ); ret = eIDCANCEL; @@ -997,9 +997,9 @@ GtkWidget *CreateCameraInspectorDialog( void ){ // create the window window = ui::Window( ui::window_type::TOP ); gtk_window_set_title( GTK_WINDOW( window ), "Camera Inspector" ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( ci_close ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "expose_event", GTK_SIGNAL_FUNC( ci_expose ), NULL ); - // gtk_signal_connect( GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", G_CALLBACK( ci_close ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "expose_event", G_CALLBACK( ci_expose ), NULL ); + // g_signal_connect( GTK_OBJECT (window), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) ); // don't use show, as you don't want to have it displayed on startup ;-) @@ -1065,8 +1065,8 @@ GtkWidget *CreateCameraInspectorDialog( void ){ RefreshCamListCombo(); - gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( g_pCamListCombo )->entry ), FALSE ); - gtk_signal_connect( GTK_OBJECT( GTK_COMBO( g_pCamListCombo )->entry ), "changed", GTK_SIGNAL_FUNC( ci_camlist_changed ), NULL ); + gtk_editable_set_editable( GTK_EDITABLE( GTK_COMBO( g_pCamListCombo )->entry ), FALSE ); + g_signal_connect( GTK_OBJECT( GTK_COMBO( g_pCamListCombo )->entry ), "changed", G_CALLBACK( ci_camlist_changed ), NULL ); // -------------------------- // @@ -1097,8 +1097,8 @@ GtkWidget *CreateCameraInspectorDialog( void ){ RefreshPathListCombo(); - gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( g_pPathListCombo )->entry ), FALSE ); - gtk_signal_connect( GTK_OBJECT( GTK_COMBO( g_pPathListCombo )->entry ), "changed", GTK_SIGNAL_FUNC( ci_pathlist_changed ), NULL ); + gtk_editable_set_editable( GTK_EDITABLE( GTK_COMBO( g_pPathListCombo )->entry ), FALSE ); + g_signal_connect( GTK_OBJECT( GTK_COMBO( g_pPathListCombo )->entry ), "changed", G_CALLBACK( ci_pathlist_changed ), NULL ); // -------------------------- // @@ -1109,16 +1109,16 @@ GtkWidget *CreateCameraInspectorDialog( void ){ g_pEditModeEditRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, "Edit Points" ); gtk_box_pack_start( GTK_BOX( hbox ), g_pEditModeEditRadioButton, FALSE, FALSE, 3 ); gtk_widget_show( g_pEditModeEditRadioButton ); - g_pEditTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) ); + g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) ); - gtk_signal_connect( GTK_OBJECT( g_pEditModeEditRadioButton ), "clicked", GTK_SIGNAL_FUNC( ci_editmode_edit ), NULL ); + g_signal_connect( GTK_OBJECT( g_pEditModeEditRadioButton ), "clicked", G_CALLBACK( ci_editmode_edit ), NULL ); g_pEditModeAddRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, "Add Points" ); gtk_box_pack_start( GTK_BOX( hbox ), g_pEditModeAddRadioButton, FALSE, FALSE, 3 ); gtk_widget_show( g_pEditModeAddRadioButton ); - g_pEditTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) ); + g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) ); - gtk_signal_connect( GTK_OBJECT( g_pEditModeAddRadioButton ), "clicked", GTK_SIGNAL_FUNC( ci_editmode_add ), NULL ); + g_signal_connect( GTK_OBJECT( g_pEditModeAddRadioButton ), "clicked", G_CALLBACK( ci_editmode_add ), NULL ); // see if we should use a different default if ( g_iEditMode == 1 ) { @@ -1143,23 +1143,23 @@ GtkWidget *CreateCameraInspectorDialog( void ){ w = ui::Button( "Rename..." ); gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_rename ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_rename ), NULL ); gtk_widget_show( w ); w = ui::Button( "Add Target..." ); gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add_target ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_add_target ), NULL ); gtk_widget_show( w ); // not available in splines library /*w = gtk_button_new_with_label( "Delete Selected" ); gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_delete_selected ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_delete_selected ), NULL ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Select All" ); gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_select_all ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_select_all ), NULL ); gtk_widget_show( w );*/ // -------------------------- // @@ -1220,7 +1220,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){ gtk_widget_show( hbox ); g_pTimeLine = ui::Adjustment( 0, 0, 30000, 100, 250, 0 ); - gtk_signal_connect( GTK_OBJECT( g_pTimeLine ), "value_changed", GTK_SIGNAL_FUNC( ci_timeline_changed ), NULL ); + g_signal_connect( GTK_OBJECT( g_pTimeLine ), "value_changed", G_CALLBACK( ci_timeline_changed ), NULL ); w = ui::HScale( g_pTimeLine ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_widget_show( w ); @@ -1253,14 +1253,14 @@ GtkWidget *CreateCameraInspectorDialog( void ){ gtk_widget_show( hbox ); w = ui::ScrolledWindow(); - gtk_widget_set_usize( w, 0, 150 ); + gtk_widget_set_size_request( w, 0, 150 ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( w ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 ); gtk_widget_show( w ); g_pEventsList = gtk_clist_new( 3 ); gtk_container_add( GTK_CONTAINER( w ), g_pEventsList ); - //gtk_signal_connect( GTK_OBJECT(g_pEventsList), "select_row", GTK_SIGNAL_FUNC (proplist_select_row), NULL); + //g_signal_connect( GTK_OBJECT(g_pEventsList), "select_row", G_CALLBACK (proplist_select_row), NULL); gtk_clist_set_selection_mode( GTK_CLIST( g_pEventsList ), GTK_SELECTION_BROWSE ); gtk_clist_column_titles_hide( GTK_CLIST( g_pEventsList ) ); gtk_clist_set_column_auto_resize( GTK_CLIST( g_pEventsList ), 0, TRUE ); @@ -1274,12 +1274,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){ w = ui::Button( "Add..." ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_add ), NULL ); gtk_widget_show( w ); w = ui::Button( "Del" ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_del ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_del ), NULL ); gtk_widget_show( w ); // -------------------------- // @@ -1301,12 +1301,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){ w = gtk_button_new_with_label( "New..." ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_new ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_new ), NULL ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Load..." ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_load ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_load ), NULL ); gtk_widget_show( w ); // -------------------------- // @@ -1319,12 +1319,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){ w = gtk_button_new_with_label( "Save..." ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_save ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_save ), NULL ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Unload" ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_unload ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_unload ), NULL ); gtk_widget_show( w ); hbox = gtk_hbox_new( FALSE, 5 ); @@ -1333,12 +1333,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){ w = gtk_button_new_with_label( "Apply" ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_apply ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_apply ), NULL ); gtk_widget_show( w ); w = gtk_button_new_with_label( "Preview" ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_preview ), NULL ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_preview ), NULL ); gtk_widget_show( w ); // -------------------------- // @@ -1355,7 +1355,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 ); + g_signal_connect( GTK_OBJECT( w ), "clicked", G_CALLBACK( ci_close ), NULL ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); diff --git a/contrib/gtkgensurf/gendlgs.cpp b/contrib/gtkgensurf/gendlgs.cpp index f817f925..2ff5c718 100644 --- a/contrib/gtkgensurf/gendlgs.cpp +++ b/contrib/gtkgensurf/gendlgs.cpp @@ -1400,7 +1400,7 @@ GtkWidget* create_main_dialog(){ radio = gtk_radio_button_new_with_label( group, games[i] ); gtk_widget_show( radio ); gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 ); - group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) ); + group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) ); game_radios[i] = radio; g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_game ), GINT_TO_POINTER( i ) ); } @@ -1421,7 +1421,7 @@ GtkWidget* create_main_dialog(){ radio = gtk_radio_button_new_with_label( group, waveforms[i] ); gtk_widget_show( radio ); gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 ); - group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) ); + group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) ); wave_radios[i] = radio; g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_wave ), GINT_TO_POINTER( i ) ); } @@ -1442,7 +1442,7 @@ GtkWidget* create_main_dialog(){ radio = gtk_radio_button_new_with_label( group, orientations[i] ); gtk_widget_show( radio ); gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 ); - group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) ); + group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) ); plane_radios[i] = radio; g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_plane ), GINT_TO_POINTER( i ) ); } @@ -1492,7 +1492,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "wavelength", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &WaveLength ); @@ -1501,7 +1501,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "amplitude", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Amplitude ); @@ -1510,7 +1510,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "roughness", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Roughness ); @@ -1521,7 +1521,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table2 ), spin, 1, 2, 3, 4, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( spin, 60, -2 ); + gtk_widget_set_size_request( spin, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "random", spin ); vbox = ui::VBox( FALSE, 5 ); @@ -1592,7 +1592,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "hmin", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hll ); @@ -1601,7 +1601,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "hmax", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hur ); @@ -1610,7 +1610,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "vmin", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vll ); @@ -1619,7 +1619,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 2, 3, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "vmax", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vur ); @@ -1655,7 +1655,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( spin, 60, -2 ); + gtk_widget_set_size_request( spin, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "nh", spin ); adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 ); @@ -1665,7 +1665,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( spin, 60, -2 ); + gtk_widget_set_size_request( spin, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "nv", spin ); check = ui::CheckButton( "Use Bezier patches" ); @@ -1685,7 +1685,7 @@ GtkWidget* create_main_dialog(){ spin = ui::SpinButton( adj, 1, 0 ); gtk_widget_show( spin ); gtk_box_pack_start( GTK_BOX( vbox ), spin, FALSE, TRUE, 0 ); - gtk_widget_set_usize( spin, 60, -2 ); + gtk_widget_set_size_request( spin, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "sp", spin ); // ^Fishman - End of Snap to grid code. @@ -1747,7 +1747,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "z01", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z01 ); @@ -1756,7 +1756,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "z00", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z00 ); @@ -1765,7 +1765,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "z11", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z11 ); @@ -1774,7 +1774,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "z10", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z10 ); @@ -1830,14 +1830,14 @@ GtkWidget* create_main_dialog(){ button = ui::Button( "Browse..." ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_file_browse", button ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( bitmap_browse ), NULL ); button = ui::Button( "Reload" ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_reload", button ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( bitmap_reload ), NULL ); @@ -1875,7 +1875,7 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); gtk_widget_show( entry ); gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_black", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.black_value ); @@ -1888,7 +1888,7 @@ GtkWidget* create_main_dialog(){ entry = ui::Entry(); gtk_widget_show( entry ); gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 ); - gtk_widget_set_usize( entry, 50, -2 ); + gtk_widget_set_size_request( entry, 50, -1 ); g_object_set_data( G_OBJECT( dlg ), "bmp_white", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.white_value ); @@ -1947,7 +1947,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND ), (GtkAttachOptions) ( GTK_EXPAND ), 0, 0 ); - gtk_widget_set_usize( spin, 60, -2 ); + gtk_widget_set_size_request( spin, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "fix_value", spin ); g_signal_connect( G_OBJECT( spin ), "focus_out_event", G_CALLBACK( fix_value_entryfocusout ), NULL ); @@ -1956,7 +1956,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 60, -2 ); + gtk_widget_set_size_request( entry, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "fix_range", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( fix_range_entryfocusout ), NULL ); @@ -1965,7 +1965,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_EXPAND ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 60, -2 ); + gtk_widget_set_size_request( entry, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "fix_rate", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( fix_rate_entryfocusout ), NULL ); @@ -1974,7 +1974,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1, (GtkAttachOptions) ( GTK_EXPAND ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "fix_free", button ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( fix_free ), NULL ); @@ -1983,7 +1983,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2, (GtkAttachOptions) ( GTK_EXPAND ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "fix_freeall", button ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( fix_freeall ), NULL ); @@ -2028,7 +2028,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 60, -2 ); + gtk_widget_set_size_request( entry, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texture1", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 0 ) ); @@ -2037,7 +2037,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 60, -2 ); + gtk_widget_set_size_request( entry, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texture2", entry ); g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 1 ) ); @@ -2046,7 +2046,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 60, -2 ); + gtk_widget_set_size_request( entry, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texture3", entry ); hbox2 = ui::HBox( FALSE, 5 ); @@ -2086,7 +2086,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 0, 1, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 60, -2 ); + gtk_widget_set_size_request( entry, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texoffsetx", entry ); entry = ui::Entry(); @@ -2094,7 +2094,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 60, -2 ); + gtk_widget_set_size_request( entry, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texoffsety", entry ); entry = ui::Entry(); @@ -2102,7 +2102,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 2, 3, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 60, -2 ); + gtk_widget_set_size_request( entry, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texscalex", entry ); entry = ui::Entry(); @@ -2110,7 +2110,7 @@ GtkWidget* create_main_dialog(){ gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( GTK_FILL ), 0, 0 ); - gtk_widget_set_usize( entry, 60, -2 ); + gtk_widget_set_size_request( entry, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "texscaley", entry ); @@ -2141,7 +2141,7 @@ GtkWidget* create_main_dialog(){ button = ui::Button( "OK" ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); g_object_set_data( G_OBJECT( dlg ), "go", button ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_go ), NULL ); diff --git a/contrib/gtkgensurf/view.cpp b/contrib/gtkgensurf/view.cpp index 84912c3d..7054d5d6 100644 --- a/contrib/gtkgensurf/view.cpp +++ b/contrib/gtkgensurf/view.cpp @@ -373,8 +373,8 @@ void CreateViewWindow(){ g_pWndPreview = dlg = ui::Window( ui::window_type::TOP ); gtk_window_set_title( GTK_WINDOW( dlg ), "GtkGenSurf Preview" ); - gtk_signal_connect( GTK_OBJECT( dlg ), "delete_event", GTK_SIGNAL_FUNC( preview_close ), NULL ); - gtk_signal_connect( GTK_OBJECT( dlg ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( dlg ), "delete_event", G_CALLBACK( preview_close ), NULL ); + g_signal_connect( GTK_OBJECT( dlg ), "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pWnd ) ); gtk_window_set_default_size( GTK_WINDOW( dlg ), 300, 400 ); @@ -394,14 +394,14 @@ void CreateViewWindow(){ gtk_box_pack_start( GTK_BOX( hbox ), label, FALSE, TRUE, 0 ); adj = ui::Adjustment( 30, -90, 90, 1, 10, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( preview_spin ), &elevation ); + g_signal_connect( adj, "value_changed", G_CALLBACK( preview_spin ), &elevation ); spin = ui::SpinButton( adj, 1, 0 ); gtk_widget_show( spin ); gtk_box_pack_start( GTK_BOX( hbox ), spin, FALSE, TRUE, 0 ); g_signal_connect( G_OBJECT( spin ), "focus_out_event", G_CALLBACK( doublevariable_spinfocusout ), &elevation ); adj = ui::Adjustment( 30, 0, 359, 1, 10, 0 ); - gtk_signal_connect( adj, "value_changed", GTK_SIGNAL_FUNC( preview_spin ), &azimuth ); + g_signal_connect( adj, "value_changed", G_CALLBACK( preview_spin ), &azimuth ); spin = ui::SpinButton( adj, 1, 0 ); gtk_widget_show( spin ); gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE ); @@ -422,10 +422,10 @@ void CreateViewWindow(){ g_pPreviewWidget = g_UIGtkTable.m_pfn_glwidget_new( FALSE, NULL ); gtk_widget_set_events( g_pPreviewWidget, GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK ); - gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "expose_event", GTK_SIGNAL_FUNC( expose ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "motion_notify_event", GTK_SIGNAL_FUNC( motion ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "button_press_event", - GTK_SIGNAL_FUNC( button_press ), NULL ); + g_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "expose_event", G_CALLBACK( expose ), NULL ); + g_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "motion_notify_event", G_CALLBACK( motion ), NULL ); + g_signal_connect( GTK_OBJECT( g_pPreviewWidget ), "button_press_event", + G_CALLBACK( button_press ), NULL ); gtk_widget_show( g_pPreviewWidget ); gtk_container_add( GTK_CONTAINER( frame ), g_pPreviewWidget ); diff --git a/contrib/hydratoolz/plugin.cpp b/contrib/hydratoolz/plugin.cpp index a290649f..934bd208 100644 --- a/contrib/hydratoolz/plugin.cpp +++ b/contrib/hydratoolz/plugin.cpp @@ -85,10 +85,10 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ int mode = ( uType & MB_TYPEMASK ), ret, loop = 1; window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", - GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", - GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", + G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", + G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), lpCaption ); gtk_container_border_width( GTK_CONTAINER( window ), 10 ); gtk_object_set_data( GTK_OBJECT( window ), "loop", &loop ); @@ -115,8 +115,8 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ if ( mode == MB_OK ) { 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( IDOK ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); @@ -125,38 +125,38 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ else if ( mode == MB_OKCANCEL ) { 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( IDOK ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( IDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); ret = IDCANCEL; } else if ( mode == MB_YESNOCANCEL ) { w = ui::Button( "Yes" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "No" ); 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( IDNO ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( IDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); ret = IDCANCEL; } @@ -164,16 +164,16 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ { w = ui::Button( "Yes" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "No" ); 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( IDNO ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); ret = IDNO; } diff --git a/contrib/prtview/AboutDialog.cpp b/contrib/prtview/AboutDialog.cpp index 19838042..ba700871 100644 --- a/contrib/prtview/AboutDialog.cpp +++ b/contrib/prtview/AboutDialog.cpp @@ -55,10 +55,10 @@ void DoAboutDlg(){ dlg = ui::Window( ui::window_type::TOP ); gtk_window_set_title( GTK_WINDOW( dlg ), "About Portal Viewer" ); - 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 ); + g_signal_connect( GTK_OBJECT( dlg ), "delete_event", + G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( dlg ), "destroy", + G_CALLBACK( gtk_widget_destroy ), NULL ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); @@ -84,9 +84,9 @@ void DoAboutDlg(){ button = ui::Button( "OK" ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", - GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); - gtk_widget_set_usize( button, 60, -2 ); + g_signal_connect( GTK_OBJECT( button ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); + gtk_widget_set_size_request( button, 60, -1 ); gtk_grab_add( dlg ); gtk_widget_show( dlg ); diff --git a/contrib/prtview/ConfigDialog.cpp b/contrib/prtview/ConfigDialog.cpp index 3a824590..8a3e28a3 100644 --- a/contrib/prtview/ConfigDialog.cpp +++ b/contrib/prtview/ConfigDialog.cpp @@ -64,18 +64,18 @@ static int DoColor( PackedColour *c ){ dlg = gtk_color_selection_dialog_new( "Choose Color" ); 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 ); + g_signal_connect( GTK_OBJECT( dlg ), "delete_event", + G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( dlg ), "destroy", + G_CALLBACK( gtk_widget_destroy ), NULL ); 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(cancel_button), "clicked", - GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); + g_signal_connect( GTK_OBJECT(ok_button), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); + g_signal_connect( GTK_OBJECT(cancel_button), "clicked", + G_CALLBACK( 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 ); @@ -252,10 +252,10 @@ void DoConfigDialog(){ dlg = ui::Window( ui::window_type::TOP ); gtk_window_set_title( GTK_WINDOW( dlg ), "Portal Viewer Configuration" ); - 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 ); + g_signal_connect( GTK_OBJECT( dlg ), "delete_event", + G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( dlg ), "destroy", + G_CALLBACK( gtk_widget_destroy ), NULL ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); @@ -286,7 +286,7 @@ void DoConfigDialog(){ lw3label = ui::Label( "" ); gtk_widget_show( lw3label ); gtk_box_pack_start( GTK_BOX( hbox ), lw3label, FALSE, TRUE, 0 ); - gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScroll3d ), lw3label ); + g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScroll3d ), lw3label ); table = ui::Table( 2, 4, FALSE ); gtk_widget_show( table ); @@ -299,42 +299,42 @@ void DoConfigDialog(){ gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 0, 1, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor3d ), NULL ); + g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( OnColor3d ), NULL ); button = ui::Button( "Depth Color" ); gtk_widget_show( button ); gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColorFog ), NULL ); + g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( OnColorFog ), NULL ); aa3check = ui::CheckButton( "Anti-Alias (May not work on some video cards)" ); gtk_widget_show( aa3check ); gtk_table_attach( GTK_TABLE( table ), aa3check, 1, 4, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_signal_connect( GTK_OBJECT( aa3check ), "toggled", GTK_SIGNAL_FUNC( OnAntiAlias3d ), NULL ); + g_signal_connect( GTK_OBJECT( aa3check ), "toggled", G_CALLBACK( OnAntiAlias3d ), NULL ); depthcheck = ui::CheckButton( "Depth Cue" ); gtk_widget_show( depthcheck ); gtk_table_attach( GTK_TABLE( table ), depthcheck, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_signal_connect( GTK_OBJECT( depthcheck ), "toggled", GTK_SIGNAL_FUNC( OnFog ), NULL ); + g_signal_connect( GTK_OBJECT( depthcheck ), "toggled", G_CALLBACK( OnFog ), NULL ); linescheck = ui::CheckButton( "Lines" ); gtk_widget_show( linescheck ); gtk_table_attach( GTK_TABLE( table ), linescheck, 2, 3, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_signal_connect( GTK_OBJECT( linescheck ), "toggled", GTK_SIGNAL_FUNC( OnLines ), NULL ); + g_signal_connect( GTK_OBJECT( linescheck ), "toggled", G_CALLBACK( OnLines ), NULL ); polyscheck = ui::CheckButton( "Polygons" ); gtk_widget_show( polyscheck ); gtk_table_attach( GTK_TABLE( table ), polyscheck, 3, 4, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_signal_connect( GTK_OBJECT( polyscheck ), "toggled", GTK_SIGNAL_FUNC( OnPoly ), NULL ); + g_signal_connect( GTK_OBJECT( polyscheck ), "toggled", G_CALLBACK( OnPoly ), NULL ); zlist = gtk_option_menu_new(); gtk_widget_show( zlist ); @@ -346,20 +346,20 @@ void DoConfigDialog(){ item = ui::MenuItem( "Z-Buffer Test and Write (recommended for solid or no polygons)" ); gtk_widget_show( item ); - gtk_signal_connect( GTK_OBJECT( item ), "activate", - GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 0 ) ); + g_signal_connect( GTK_OBJECT( item ), "activate", + G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 0 ) ); gtk_menu_append( GTK_MENU( menu ), item ); item = ui::MenuItem( "Z-Buffer Test Only (recommended for transparent polygons)" ); gtk_widget_show( item ); - gtk_signal_connect( GTK_OBJECT( item ), "activate", - GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 1 ) ); + g_signal_connect( GTK_OBJECT( item ), "activate", + G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 1 ) ); gtk_menu_append( GTK_MENU( menu ), item ); item = ui::MenuItem( "Z-Buffer Off" ); gtk_widget_show( item ); - gtk_signal_connect( GTK_OBJECT( item ), "activate", - GTK_SIGNAL_FUNC( OnSelchangeZbuffer ), GINT_TO_POINTER( 2 ) ); + g_signal_connect( GTK_OBJECT( item ), "activate", + G_CALLBACK( OnSelchangeZbuffer ), GINT_TO_POINTER( 2 ) ); gtk_menu_append( GTK_MENU( menu ), item ); table = ui::Table( 2, 2, FALSE ); @@ -382,7 +382,7 @@ void DoConfigDialog(){ (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( translabel ), 0.0, 0.0 ); - gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScrollTrans ), translabel ); + g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScrollTrans ), translabel ); adj = ui::Adjustment( portals.clip_range, 1, 128, 1, 1, 0 ); clipslider = ui::HScale( adj ); @@ -398,7 +398,7 @@ void DoConfigDialog(){ (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( cliplabel ), 0.0, 0.0 ); - gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScrollClip ), cliplabel ); + g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScrollClip ), cliplabel ); hbox = ui::HBox( TRUE, 5 ); gtk_widget_show( hbox ); @@ -407,12 +407,12 @@ void DoConfigDialog(){ show3check = ui::CheckButton( "Show" ); gtk_widget_show( show3check ); gtk_box_pack_start( GTK_BOX( hbox ), show3check, TRUE, TRUE, 0 ); - gtk_signal_connect( GTK_OBJECT( show3check ), "toggled", GTK_SIGNAL_FUNC( OnConfig3d ), NULL ); + g_signal_connect( GTK_OBJECT( show3check ), "toggled", G_CALLBACK( OnConfig3d ), NULL ); portalcheck = ui::CheckButton( "Portal cubic clipper" ); gtk_widget_show( portalcheck ); gtk_box_pack_start( GTK_BOX( hbox ), portalcheck, TRUE, TRUE, 0 ); - gtk_signal_connect( GTK_OBJECT( portalcheck ), "toggled", GTK_SIGNAL_FUNC( OnClip ), NULL ); + g_signal_connect( GTK_OBJECT( portalcheck ), "toggled", G_CALLBACK( OnClip ), NULL ); frame = ui::Frame( "2D View" ); gtk_widget_show( frame ); @@ -436,7 +436,7 @@ void DoConfigDialog(){ lw2label = ui::Label( "" ); gtk_widget_show( lw2label ); gtk_box_pack_start( GTK_BOX( hbox ), lw2label, FALSE, TRUE, 0 ); - gtk_signal_connect( GTK_OBJECT(adj), "value_changed", GTK_SIGNAL_FUNC( OnScroll2d ), lw2label ); + g_signal_connect( GTK_OBJECT(adj), "value_changed", G_CALLBACK( OnScroll2d ), lw2label ); hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); @@ -445,13 +445,13 @@ void DoConfigDialog(){ button = ui::Button( "Color" ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( OnColor2d ), NULL ); - gtk_widget_set_usize( button, 60, -2 ); + g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( OnColor2d ), NULL ); + gtk_widget_set_size_request( button, 60, -1 ); aa2check = ui::CheckButton( "Anti-Alias (May not work on some video cards)" ); gtk_widget_show( aa2check ); gtk_box_pack_start( GTK_BOX( hbox ), aa2check, TRUE, TRUE, 0 ); - gtk_signal_connect( GTK_OBJECT( aa2check ), "toggled", GTK_SIGNAL_FUNC( OnAntiAlias2d ), NULL ); + g_signal_connect( GTK_OBJECT( aa2check ), "toggled", G_CALLBACK( OnAntiAlias2d ), NULL ); hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); @@ -460,7 +460,7 @@ void DoConfigDialog(){ show2check = ui::CheckButton( "Show" ); gtk_widget_show( show2check ); gtk_box_pack_start( GTK_BOX( hbox ), show2check, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( show2check ), "toggled", GTK_SIGNAL_FUNC( OnConfig2d ), NULL ); + g_signal_connect( GTK_OBJECT( show2check ), "toggled", G_CALLBACK( OnConfig2d ), NULL ); hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); @@ -469,9 +469,9 @@ void DoConfigDialog(){ button = ui::Button( "OK" ); gtk_widget_show( button ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", - GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); - gtk_widget_set_usize( button, 60, -2 ); + g_signal_connect( GTK_OBJECT( button ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); + gtk_widget_set_size_request( button, 60, -1 ); // initialize dialog gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( show2check ), portals.show_2d ); diff --git a/contrib/prtview/LoadPortalFileDialog.cpp b/contrib/prtview/LoadPortalFileDialog.cpp index a2a9fbbf..ff63a885 100644 --- a/contrib/prtview/LoadPortalFileDialog.cpp +++ b/contrib/prtview/LoadPortalFileDialog.cpp @@ -76,12 +76,12 @@ static void change_clicked( GtkWidget *widget, gpointer data ){ int loop = 1; file_sel = gtk_file_selection_new( "Locate portal (.prt) file" ); - gtk_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->ok_button ), "clicked", - GTK_SIGNAL_FUNC( file_sel_callback ), GINT_TO_POINTER( IDOK ) ); - gtk_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->cancel_button ), "clicked", - GTK_SIGNAL_FUNC( file_sel_callback ), GINT_TO_POINTER( IDCANCEL ) ); - gtk_signal_connect( GTK_OBJECT( file_sel ), "delete_event", - GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->ok_button ), "clicked", + G_CALLBACK( file_sel_callback ), GINT_TO_POINTER( IDOK ) ); + g_signal_connect( GTK_OBJECT( GTK_FILE_SELECTION( file_sel )->cancel_button ), "clicked", + G_CALLBACK( file_sel_callback ), GINT_TO_POINTER( IDCANCEL ) ); + g_signal_connect( GTK_OBJECT( file_sel ), "delete_event", + G_CALLBACK( dialog_delete_callback ), NULL ); gtk_file_selection_hide_fileop_buttons( GTK_FILE_SELECTION( file_sel ) ); g_object_set_data( G_OBJECT( file_sel ), "loop", &loop ); @@ -110,10 +110,10 @@ int DoLoadPortalFileDialog(){ dlg = ui::Window( ui::window_type::TOP ); gtk_window_set_title( GTK_WINDOW( dlg ), "Load .prt" ); - 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 ); + g_signal_connect( GTK_OBJECT( dlg ), "delete_event", + G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( dlg ), "destroy", + G_CALLBACK( gtk_widget_destroy ), NULL ); g_object_set_data( G_OBJECT( dlg ), "loop", &loop ); g_object_set_data( G_OBJECT( dlg ), "ret", &ret ); @@ -124,7 +124,7 @@ int DoLoadPortalFileDialog(){ entry = ui::Entry(); gtk_widget_show( entry ); - gtk_entry_set_editable( GTK_ENTRY( entry ), FALSE ); + gtk_editable_set_editable( GTK_EDITABLE( entry ), FALSE ); gtk_box_pack_start( GTK_BOX( vbox ), entry, FALSE, FALSE, 0 ); hbox = ui::HBox( FALSE, 5 ); @@ -142,8 +142,8 @@ int DoLoadPortalFileDialog(){ button = ui::Button( "Change" ); gtk_widget_show( button ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", GTK_SIGNAL_FUNC( change_clicked ), entry ); - gtk_widget_set_usize( button, 60, -2 ); + g_signal_connect( GTK_OBJECT( button ), "clicked", G_CALLBACK( change_clicked ), entry ); + gtk_widget_set_size_request( button, 60, -1 ); hbox = ui::HBox( FALSE, 5 ); gtk_widget_show( hbox ); @@ -152,16 +152,16 @@ int DoLoadPortalFileDialog(){ button = ui::Button( "Cancel" ); gtk_widget_show( button ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", - GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); - gtk_widget_set_usize( button, 60, -2 ); + g_signal_connect( GTK_OBJECT( button ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); + gtk_widget_set_size_request( button, 60, -1 ); button = ui::Button( "OK" ); gtk_widget_show( button ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); - gtk_signal_connect( GTK_OBJECT( button ), "clicked", - GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); - gtk_widget_set_usize( button, 60, -2 ); + g_signal_connect( GTK_OBJECT( button ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); + gtk_widget_set_size_request( button, 60, -1 ); strcpy( portals.fn, GlobalRadiant().getMapName() ); char* fn = strrchr( portals.fn, '.' ); diff --git a/include/itoolbar.h b/include/itoolbar.h index 62d82b6e..7e5daad3 100644 --- a/include/itoolbar.h +++ b/include/itoolbar.h @@ -33,7 +33,6 @@ enum EType eSpace, eButton, eToggleButton, - eRadioButton, }; virtual const char* getImage() const = 0; diff --git a/libs/gtkutil/button.cpp b/libs/gtkutil/button.cpp index d565c974..08744ff4 100644 --- a/libs/gtkutil/button.cpp +++ b/libs/gtkutil/button.cpp @@ -42,6 +42,14 @@ void button_connect_callback( GtkButton* button, const Callback& callback ){ #endif } +void button_connect_callback( GtkToolButton* button, const Callback& callback ){ +#if 1 + g_signal_connect_swapped( G_OBJECT( button ), "clicked", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() ); +#else + g_signal_connect_closure( G_OBJECT( button ), "clicked", create_cclosure( G_CALLBACK( clicked_closure_callback ), callback ), FALSE ); +#endif +} + guint toggle_button_connect_callback( GtkToggleButton* button, const Callback& callback ){ #if 1 guint handler = g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() ); @@ -52,6 +60,16 @@ guint toggle_button_connect_callback( GtkToggleButton* button, const Callback& c return handler; } +guint toggle_button_connect_callback( GtkToggleToolButton* button, const Callback& callback ){ +#if 1 + guint handler = g_signal_connect_swapped( G_OBJECT( button ), "toggled", G_CALLBACK( callback.getThunk() ), callback.getEnvironment() ); +#else + guint handler = g_signal_connect_closure( G_OBJECT( button ), "toggled", create_cclosure( G_CALLBACK( clicked_closure_callback ), callback ), TRUE ); +#endif + g_object_set_data( G_OBJECT( button ), "handler", gint_to_pointer( handler ) ); + return handler; +} + void button_set_icon( GtkButton* button, const char* icon ){ GtkImage* image = new_local_image( icon ); gtk_widget_show( GTK_WIDGET( image ) ); @@ -70,10 +88,17 @@ void toggle_button_set_active_no_signal( GtkToggleButton* button, gboolean activ g_signal_handler_unblock( G_OBJECT( button ), handler_id ); } +void toggle_button_set_active_no_signal( GtkToggleToolButton* button, gboolean active ){ + guint handler_id = gpointer_to_int( g_object_get_data( G_OBJECT( button ), "handler" ) ); + g_signal_handler_block( G_OBJECT( button ), handler_id ); + gtk_toggle_tool_button_set_active( button, active ); + g_signal_handler_unblock( G_OBJECT( button ), handler_id ); +} + void radio_button_print_state( GtkRadioButton* button ){ globalOutputStream() << "toggle button: "; - for ( GSList* radio = gtk_radio_button_group( button ); radio != 0; radio = g_slist_next( radio ) ) + for ( GSList* radio = gtk_radio_button_get_group( button ); radio != 0; radio = g_slist_next( radio ) ) { globalOutputStream() << gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio->data ) ); } @@ -81,7 +106,7 @@ void radio_button_print_state( GtkRadioButton* button ){ } GtkToggleButton* radio_button_get_nth( GtkRadioButton* radio, int index ){ - GSList *group = gtk_radio_button_group( radio ); + GSList *group = gtk_radio_button_get_group( radio ); return GTK_TOGGLE_BUTTON( g_slist_nth_data( group, g_slist_length( group ) - index - 1 ) ); } @@ -109,7 +134,7 @@ void radio_button_set_active_no_signal( GtkRadioButton* radio, int index ){ int radio_button_get_active( GtkRadioButton* radio ){ //radio_button_print_state(radio); - GSList *group = gtk_radio_button_group( radio ); + GSList *group = gtk_radio_button_get_group( radio ); int index = g_slist_length( group ) - 1; for (; group != 0; group = g_slist_next( group ) ) { diff --git a/libs/gtkutil/button.h b/libs/gtkutil/button.h index 15a9f2e8..1ffb025c 100644 --- a/libs/gtkutil/button.h +++ b/libs/gtkutil/button.h @@ -22,6 +22,7 @@ #if !defined( INCLUDED_GTKUTIL_BUTTON_H ) #define INCLUDED_GTKUTIL_BUTTON_H +#include #include "generic/callbackfwd.h" typedef struct _GtkButton GtkButton; @@ -32,10 +33,13 @@ typedef gint gboolean; typedef unsigned int guint; void button_connect_callback( GtkButton* button, const Callback& callback ); +void button_connect_callback( GtkToolButton* button, const Callback& callback ); guint toggle_button_connect_callback( GtkToggleButton* button, const Callback& callback ); +guint toggle_button_connect_callback( GtkToggleToolButton* button, const Callback& callback ); void button_set_icon( GtkButton* button, const char* icon ); void toggle_button_set_active_no_signal( GtkToggleButton* item, gboolean active ); +void toggle_button_set_active_no_signal( GtkToggleToolButton* item, gboolean active ); void radio_button_set_active( GtkRadioButton* radio, int index ); void radio_button_set_active_no_signal( GtkRadioButton* radio, int index ); diff --git a/libs/gtkutil/glwidget.cpp b/libs/gtkutil/glwidget.cpp index 1c9c275b..3f9b9a00 100644 --- a/libs/gtkutil/glwidget.cpp +++ b/libs/gtkutil/glwidget.cpp @@ -187,7 +187,7 @@ GtkWidget* g_shared = 0; gint glwidget_context_created( GtkWidget* widget, gpointer data ){ if ( ++g_context_count == 1 ) { g_shared = widget; - gtk_widget_ref( g_shared ); + g_object_ref( g_shared ); glwidget_make_current( g_shared ); GlobalOpenGL().contextValid = true; @@ -203,7 +203,7 @@ gint glwidget_context_destroyed( GtkWidget* widget, gpointer data ){ GLWidget_sharedContextDestroyed(); - gtk_widget_unref( g_shared ); + g_object_unref( g_shared ); g_shared = 0; } return FALSE; diff --git a/libs/gtkutil/image.cpp b/libs/gtkutil/image.cpp index 4b91bd25..dd723bfe 100644 --- a/libs/gtkutil/image.cpp +++ b/libs/gtkutil/image.cpp @@ -69,10 +69,7 @@ GtkImage* image_new_missing(){ GtkImage* new_image( const char* filename ){ { - GtkImage* image = image_new_from_file_with_mask( filename ); - if ( image != 0 ) { - return image; - } + if ( auto image = image_new_from_file_with_mask( filename ) ) return image; } return image_new_missing(); diff --git a/libs/gtkutil/menu.cpp b/libs/gtkutil/menu.cpp index 4f6eb3ae..7ef18911 100644 --- a/libs/gtkutil/menu.cpp +++ b/libs/gtkutil/menu.cpp @@ -128,9 +128,9 @@ GtkCheckMenuItem* create_check_menu_item_with_mnemonic( GtkMenu* menu, const cha GtkRadioMenuItem* new_radio_menu_item_with_mnemonic( GSList** group, const char* mnemonic, const Callback& callback ){ GtkRadioMenuItem* item = GTK_RADIO_MENU_ITEM( gtk_radio_menu_item_new_with_mnemonic( *group, mnemonic ) ); if ( *group == 0 ) { - gtk_check_menu_item_set_state( GTK_CHECK_MENU_ITEM( item ), TRUE ); + gtk_check_menu_item_set_active( GTK_CHECK_MENU_ITEM( item ), TRUE ); } - *group = gtk_radio_menu_item_group( item ); + *group = gtk_radio_menu_item_get_group( item ); gtk_widget_show( GTK_WIDGET( item ) ); check_menu_item_connect_callback( GTK_CHECK_MENU_ITEM( item ), callback ); return item; diff --git a/libs/gtkutil/nonmodal.h b/libs/gtkutil/nonmodal.h index 345eaac2..4baf54b5 100644 --- a/libs/gtkutil/nonmodal.h +++ b/libs/gtkutil/nonmodal.h @@ -150,7 +150,7 @@ public: NonModalRadio( const Callback& changed ) : m_changed( changed ){ } void connect( GtkRadioButton* radio ){ - GSList* group = gtk_radio_button_group( radio ); + GSList* group = gtk_radio_button_get_group( radio ); for (; group != 0; group = g_slist_next( group ) ) { toggle_button_connect_callback( GTK_TOGGLE_BUTTON( group->data ), m_changed ); diff --git a/libs/gtkutil/toolbar.cpp b/libs/gtkutil/toolbar.cpp index 0c19b9ff..c0659401 100644 --- a/libs/gtkutil/toolbar.cpp +++ b/libs/gtkutil/toolbar.cpp @@ -21,52 +21,48 @@ #include "toolbar.h" -#include #include #include "generic/callback.h" #include "accelerator.h" #include "button.h" -#include "closure.h" -#include "pointer.h" +#include "image.h" -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_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 ); +void toolbar_append( GtkToolbar* toolbar, GtkToolItem* button, const char* description ){ + gtk_widget_show_all(GTK_WIDGET(button)); + gtk_widget_set_tooltip_text(GTK_WIDGET(button), description); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button)); } -GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){ - GtkButton* button = ui::Button(); - button_set_icon( button, icon ); - button_connect_callback( button, callback ); - toolbar_append( toolbar, button, description ); +GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){ + auto button = GTK_TOOL_BUTTON(gtk_tool_button_new(GTK_WIDGET(new_local_image(icon)), nullptr)); + button_connect_callback(button, callback); + toolbar_append(toolbar, GTK_TOOL_ITEM(button), description); return button; } -GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){ - GtkToggleButton* button = GTK_TOGGLE_BUTTON( gtk_toggle_button_new() ); - button_set_icon( GTK_BUTTON( button ), icon ); - toggle_button_connect_callback( button, callback ); - toolbar_append( toolbar, GTK_BUTTON( button ), description ); +GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ){ + auto button = GTK_TOGGLE_TOOL_BUTTON(gtk_toggle_tool_button_new()); + toggle_button_connect_callback(button, callback); + gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button), GTK_WIDGET(new_local_image(icon))); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), description); + toolbar_append(toolbar, GTK_TOOL_ITEM(button), description); return button; } -GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Command& command ){ +GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Command& command ){ return toolbar_append_button( toolbar, description, icon, command.m_callback ); } -void toggle_button_set_active_callback( GtkToggleButton& button, bool active ){ +void toggle_button_set_active_callback( GtkToggleToolButton& button, bool active ){ toggle_button_set_active_no_signal( &button, active ); } -typedef ReferenceCaller1 ToggleButtonSetActiveCaller; +using ToggleButtonSetActiveCaller = ReferenceCaller1; -GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle ){ - GtkToggleButton* button = toolbar_append_toggle_button( toolbar, description, icon, toggle.m_command.m_callback ); +GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle ){ + auto button = toolbar_append_toggle_button( toolbar, description, icon, toggle.m_command.m_callback ); toggle.m_exportCallback( ToggleButtonSetActiveCaller( *button ) ); return button; } diff --git a/libs/gtkutil/toolbar.h b/libs/gtkutil/toolbar.h index 6b9e32fb..687fa0a3 100644 --- a/libs/gtkutil/toolbar.h +++ b/libs/gtkutil/toolbar.h @@ -22,6 +22,7 @@ #if !defined( INCLUDED_GTKUTIL_TOOLBAR_H ) #define INCLUDED_GTKUTIL_TOOLBAR_H +#include #include "generic/callbackfwd.h" typedef struct _GtkButton GtkButton; @@ -30,9 +31,9 @@ typedef struct _GtkToolbar GtkToolbar; class Command; class Toggle; -GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ); -GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Command& command ); -GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ); -GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle ); +GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ); +GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const Command& command ); +GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Callback& callback ); +GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const Toggle& toggle ); #endif diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index b25bfee2..a567a531 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -119,8 +119,8 @@ namespace ui { CellRendererText::CellRendererText() : CellRendererText(GTK_CELL_RENDERER_TEXT(gtk_cell_renderer_text_new())) { } - ComboBox ComboBoxText() - { return ComboBox(GTK_COMBO_BOX(gtk_combo_box_new_text())); } + ComboBoxText::ComboBoxText() : ComboBoxText(GTK_COMBO_BOX_TEXT(gtk_combo_box_text_new())) + { } CheckButton::CheckButton(const char *label) : CheckButton(GTK_CHECK_BUTTON(gtk_check_button_new_with_label(label))) { } @@ -128,8 +128,10 @@ namespace ui { Entry::Entry() : Entry(GTK_ENTRY(gtk_entry_new())) { } - Entry::Entry(std::size_t max_length) : Entry(GTK_ENTRY(gtk_entry_new_with_max_length(max_length))) - { } + Entry::Entry(std::size_t max_length) : Entry() + { + gtk_entry_set_max_length(*this, static_cast(max_length)); + } Frame::Frame(const char *label) : Frame(GTK_FRAME(gtk_frame_new(label))) { } diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index a5164b02..96a6ddce 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -10,6 +10,7 @@ using ui_box = struct _GtkBox; using ui_button = struct _GtkButton; using ui_checkbutton = struct _GtkCheckButton; using ui_combobox = struct _GtkComboBox; +using ui_comboboxtext = struct _GtkComboBoxText; using ui_cellrenderer = struct _GtkCellRenderer; using ui_cellrenderertext = struct _GtkCellRendererText; using ui_entry = struct _GtkEntry; @@ -169,7 +170,9 @@ namespace ui { WRAP(ComboBox, Widget, ui_combobox,); - ComboBox ComboBoxText(); + WRAP(ComboBoxText, ComboBox, ui_comboboxtext, + ComboBoxText(); + ); WRAP(Entry, Widget, ui_entry, Entry(); diff --git a/plugins/textool/2DView.cpp b/plugins/textool/2DView.cpp index 4ad21fe9..a01172a1 100644 --- a/plugins/textool/2DView.cpp +++ b/plugins/textool/2DView.cpp @@ -117,22 +117,22 @@ bool C2DView::OnRButtonUp( int x, int y ){ menu = ui::Menu(); item = ui::MenuItem( "Validate (RETURN)" ); - gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( Textool_Validate ), NULL ); + g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( Textool_Validate ), NULL ); gtk_widget_show( item ); gtk_menu_append( GTK_MENU( menu ), item ); item = ui::MenuItem( "Zoom in (INSERT)" ); - gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( view_ZoomIn ), this ); + g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( view_ZoomIn ), this ); gtk_widget_show( item ); gtk_menu_append( GTK_MENU( menu ), item ); item = ui::MenuItem( "Zoom out (DELETE)" ); - gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( view_ZoomOut ), this ); + g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( view_ZoomOut ), this ); gtk_widget_show( item ); gtk_menu_append( GTK_MENU( menu ), item ); item = ui::MenuItem( "Cancel (ESC)" ); - gtk_signal_connect( GTK_OBJECT( item ), "activate", GTK_SIGNAL_FUNC( Textool_Cancel ), NULL ); + g_signal_connect( GTK_OBJECT( item ), "activate", G_CALLBACK( Textool_Cancel ), NULL ); gtk_widget_show( item ); gtk_menu_append( GTK_MENU( menu ), item ); diff --git a/plugins/textool/TexTool.cpp b/plugins/textool/TexTool.cpp index 162eb8a8..a4c1815f 100644 --- a/plugins/textool/TexTool.cpp +++ b/plugins/textool/TexTool.cpp @@ -55,10 +55,10 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ int mode = ( uType & MB_TYPEMASK ), ret, loop = 1; window = ui::Window( ui::window_type::TOP ); - gtk_signal_connect( GTK_OBJECT( window ), "delete_event", - GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL ); - gtk_signal_connect( GTK_OBJECT( window ), "destroy", - GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "delete_event", + G_CALLBACK( dialog_delete_callback ), NULL ); + g_signal_connect( GTK_OBJECT( window ), "destroy", + G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( GTK_WINDOW( window ), lpCaption ); gtk_container_border_width( GTK_CONTAINER( window ), 10 ); g_object_set_data( G_OBJECT( window ), "loop", &loop ); @@ -85,8 +85,8 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ if ( mode == MB_OK ) { 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( IDOK ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); @@ -95,38 +95,38 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ else if ( mode == MB_OKCANCEL ) { 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( IDOK ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDOK ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( IDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); ret = IDCANCEL; } else if ( mode == MB_YESNOCANCEL ) { w = ui::Button( "Yes" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "No" ); 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( IDNO ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); w = ui::Button( "Cancel" ); 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( IDCANCEL ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDCANCEL ) ); gtk_widget_show( w ); ret = IDCANCEL; } @@ -134,16 +134,16 @@ int DoMessageBox( const char* lpText, const char* lpCaption, guint32 uType ){ { w = ui::Button( "Yes" ); 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 ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDYES ) ); gtk_widget_set_can_default( w, true ); gtk_widget_grab_default( w ); gtk_widget_show( w ); w = ui::Button( "No" ); 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( IDNO ) ); + g_signal_connect( GTK_OBJECT( w ), "clicked", + G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( IDNO ) ); gtk_widget_show( w ); ret = IDNO; } @@ -643,17 +643,17 @@ static GtkWidget* CreateOpenGLWidget(){ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK ); // Connect signal handlers - gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "expose_event", GTK_SIGNAL_FUNC( expose ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "motion_notify_event", - GTK_SIGNAL_FUNC( motion ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "button_press_event", - GTK_SIGNAL_FUNC( button_press ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pToolWidget ), "button_release_event", - GTK_SIGNAL_FUNC( button_release ), NULL ); - - gtk_signal_connect( GTK_OBJECT( g_pToolWnd ), "delete_event", GTK_SIGNAL_FUNC( close ), NULL ); - gtk_signal_connect( GTK_OBJECT( g_pToolWnd ), "key_press_event", - GTK_SIGNAL_FUNC( keypress ), NULL ); + g_signal_connect( GTK_OBJECT( g_pToolWidget ), "expose_event", G_CALLBACK( expose ), NULL ); + g_signal_connect( GTK_OBJECT( g_pToolWidget ), "motion_notify_event", + G_CALLBACK( motion ), NULL ); + g_signal_connect( GTK_OBJECT( g_pToolWidget ), "button_press_event", + G_CALLBACK( button_press ), NULL ); + g_signal_connect( GTK_OBJECT( g_pToolWidget ), "button_release_event", + G_CALLBACK( button_release ), NULL ); + + g_signal_connect( GTK_OBJECT( g_pToolWnd ), "delete_event", G_CALLBACK( close ), NULL ); + g_signal_connect( GTK_OBJECT( g_pToolWnd ), "key_press_event", + G_CALLBACK( keypress ), NULL ); return g_pToolWidget; } diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index a04f1ecf..243404f3 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -1161,7 +1161,7 @@ CamWnd::CamWnd() : m_window_observer->setRectangleDrawCallback( ReferenceCaller1( *this ) ); m_window_observer->setView( m_view ); - gtk_widget_ref( m_gl_widget ); + g_object_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_can_focus( m_gl_widget, true ); @@ -1192,7 +1192,7 @@ CamWnd::~CamWnd(){ g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_sizeHandler ); g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_exposeHandler ); - gtk_widget_unref( m_gl_widget ); + g_object_unref( m_gl_widget ); m_window_observer->release(); } diff --git a/radiant/dialog.cpp b/radiant/dialog.cpp index 727ac358..13786e36 100644 --- a/radiant/dialog.cpp +++ b/radiant/dialog.cpp @@ -193,7 +193,7 @@ void FloatSpinnerImport( GtkSpinButton& widget, float value ){ gtk_spin_button_set_value( &widget, value ); } void FloatSpinnerExport( GtkSpinButton& widget, const FloatImportCallback& importCallback ){ - importCallback( float(gtk_spin_button_get_value_as_float( &widget ) ) ); + importCallback( float(gtk_spin_button_get_value( &widget ) ) ); } typedef ImportExport FloatSpinnerImportExport; @@ -474,7 +474,7 @@ void Dialog::addCombo( ui::Widget vbox, const char* name, StringArrayRange value for ( StringArrayRange::Iterator i = values.first; i != values.last; ++i ) { - gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), *i ); + gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT( combo ), *i ); } AddIntComboData( *GTK_COMBO_BOX( combo ), importViewer, exportViewer ); diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index f1860238..d7436263 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -668,7 +668,7 @@ ListAttribute( const char* key, const ListAttributeType& type ) : for ( ListAttributeType::const_iterator i = type.begin(); i != type.end(); ++i ) { - gtk_combo_box_append_text( GTK_COMBO_BOX( combo ), ( *i ).first.c_str() ); + gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT( combo ), ( *i ).first.c_str() ); } gtk_widget_show( GTK_WIDGET( combo ) ); @@ -865,7 +865,7 @@ void SurfaceFlags_setEntityClass( EntityClass* eclass ){ ui::Widget widget = ui::Widget(GTK_WIDGET( g_entitySpawnflagsCheck[i] )); gtk_label_set_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN(widget)) ), " " ); gtk_widget_hide( widget ); - gtk_widget_ref( widget ); + g_object_ref( widget ); gtk_container_remove( GTK_CONTAINER( g_spawnflagsTable ), widget ); } } @@ -884,7 +884,7 @@ void SurfaceFlags_setEntityClass( EntityClass* eclass ){ gtk_table_attach( g_spawnflagsTable, widget, i % 4, i % 4 + 1, i / 4, i / 4 + 1, (GtkAttachOptions)( GTK_FILL ), (GtkAttachOptions)( GTK_FILL ), 0, 0 ); - gtk_widget_unref( widget ); + g_object_unref( widget ); gtk_label_set_text( GTK_LABEL( gtk_bin_get_child(GTK_BIN(widget)) ), str.c_str() ); } @@ -1389,7 +1389,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){ for ( int i = 0; i < MAX_FLAGS; i++ ) { GtkCheckButton* check = ui::CheckButton( "" ); - gtk_widget_ref( GTK_WIDGET( check ) ); + g_object_ref( GTK_WIDGET( check ) ); g_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( SpawnflagCheck_toggled ), 0 ) ) ); g_entitySpawnflagsCheck[i] = check; } diff --git a/radiant/findtexturedialog.cpp b/radiant/findtexturedialog.cpp index abd0fb84..58c4665c 100644 --- a/radiant/findtexturedialog.cpp +++ b/radiant/findtexturedialog.cpp @@ -196,14 +196,14 @@ ui::Window FindTextureDialog::BuildDialog(){ gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnApply ), 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); button = ui::Button( "Close" ); gtk_widget_show( button ); gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnClose ), 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); return dlg; } diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index 6c95a5f5..f6e1d28b 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -80,7 +80,7 @@ void GroupDialog_updatePageTitle( ui::Window window, std::size_t pageIndex ){ } } -static gboolean switch_page( GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer data ){ +static gboolean switch_page( GtkNotebook *notebook, gpointer page, guint page_num, gpointer data ){ GroupDialog_updatePageTitle( ui::Window(GTK_WINDOW( data )), page_num ); g_current_page = page_num; diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index a481ee11..3bb123f4 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -153,7 +153,7 @@ inline void path_copy_clean( char* destination, const char* source ){ struct GameCombo { - GtkComboBox* game_select; + ui::ComboBoxText game_select; GtkEntry* fsgame_entry; }; @@ -240,11 +240,11 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal { dialog.game_combo.game_select = ui::ComboBoxText(); - gtk_combo_box_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().basegame ); + gtk_combo_box_text_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().basegame ); if ( globalGameComboConfiguration().known[0] != '\0' ) { - gtk_combo_box_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().known ); + gtk_combo_box_text_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().known ); } - gtk_combo_box_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().custom ); + gtk_combo_box_text_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().custom ); gtk_widget_show( GTK_WIDGET( dialog.game_combo.game_select ) ); gtk_table_attach( table2, GTK_WIDGET( dialog.game_combo.game_select ), 1, 2, 0, 1, @@ -280,9 +280,9 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal (GtkAttachOptions) ( 0 ), 0, 0 ); gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 ); - GtkComboBox* combo = ui::ComboBoxText(); - gtk_combo_box_append_text( combo, globalMappingMode().sp_mapping_mode ); - gtk_combo_box_append_text( combo, globalMappingMode().mp_mapping_mode ); + auto combo = ui::ComboBoxText(); + gtk_combo_box_text_append_text( combo, globalMappingMode().sp_mapping_mode ); + gtk_combo_box_text_append_text( combo, globalMappingMode().mp_mapping_mode ); gtk_widget_show( GTK_WIDGET( combo ) ); gtk_table_attach( table2, GTK_WIDGET( combo ), 1, 2, 3, 4, @@ -766,14 +766,14 @@ static void CreateGtkTextEditor(){ gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( editor_close ), dlg ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); button = ui::Button( "Save" ); gtk_widget_show( button ); gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( editor_save ), dlg ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); text_editor = dlg; text_widget = text; diff --git a/radiant/gtkmisc.cpp b/radiant/gtkmisc.cpp index d9cd7ed0..a2e6e5c7 100644 --- a/radiant/gtkmisc.cpp +++ b/radiant/gtkmisc.cpp @@ -86,11 +86,11 @@ GtkMenuItem* create_menu_item_with_mnemonic( GtkMenu* menu, const char *mnemonic return create_menu_item_with_mnemonic( menu, mnemonic, command ); } -GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ){ +GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ){ return toolbar_append_button( toolbar, description, icon, GlobalCommands_find( commandName ) ); } -GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ){ +GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ){ return toolbar_append_toggle_button( toolbar, description, icon, GlobalToggles_find( commandName ) ); } @@ -99,15 +99,11 @@ GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* bool color_dialog( ui::Widget parent, Vector3& color, const char* title ){ ui::Widget dlg; - double clr[3]; + GdkColor clr = { 0, guint16(color[0] * 65535), guint16(color[1] * 65535), guint16(color[2] * 65535) }; ModalDialog dialog; - clr[0] = color[0]; - clr[1] = color[1]; - 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_get_color_selection(GTK_COLOR_SELECTION_DIALOG( dlg )) ), clr ); + gtk_color_selection_set_current_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 ); GtkWidget *ok_button, *cancel_button; g_object_get(dlg, "ok-button", &ok_button, "cancel-button", &cancel_button, nullptr); @@ -120,15 +116,10 @@ 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_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; - - color[0] = (float)clr[0]; - color[1] = (float)clr[1]; - color[2] = (float)clr[2]; + gtk_color_selection_get_current_color( GTK_COLOR_SELECTION( gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG( dlg )) ), &clr ); + color[0] = clr.red / 65535.0f; + color[1] = clr.green / 65535.0f; + color[2] = clr.blue / 65535.0f; } gtk_widget_destroy( dlg ); diff --git a/radiant/gtkmisc.h b/radiant/gtkmisc.h index 755c7330..867aaccb 100644 --- a/radiant/gtkmisc.h +++ b/radiant/gtkmisc.h @@ -60,9 +60,9 @@ typedef struct _GtkToggleButton GtkToggleButton; typedef struct _GtkToolbar GtkToolbar; // this DOES NOT set up the shortcut using command_connect_accelerator -GtkButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ); +GtkToolButton* toolbar_append_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ); // this DOES NOT set up the shortcut using command_connect_accelerator -GtkToggleButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ); +GtkToggleToolButton* toolbar_append_toggle_button( GtkToolbar* toolbar, const char* description, const char* icon, const char* commandName ); template class BasicVector3; diff --git a/radiant/main.cpp b/radiant/main.cpp index 1167cc76..4fe858bc 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -585,7 +585,7 @@ int main( int argc, char* argv[] ){ G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION ), error_redirect, 0 ); g_log_set_handler( "GLib", (GLogLevelFlags)( G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION ), error_redirect, 0 ); - g_log_set_handler( 0, (GLogLevelFlags)( G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING | + g_log_set_handler( nullptr, (GLogLevelFlags)( G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION ), error_redirect, 0 ); GlobalDebugMessageHandler::instance().setHandler( GlobalPopupDebugMessageHandler::instance() ); diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 90facfde..953cf7cb 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -1588,13 +1588,13 @@ guint s_qe_every_second_id = 0; void EverySecondTimer_enable(){ if ( s_qe_every_second_id == 0 ) { - s_qe_every_second_id = gtk_timeout_add( 1000, qe_every_second, 0 ); + s_qe_every_second_id = g_timeout_add( 1000, qe_every_second, 0 ); } } void EverySecondTimer_disable(){ if ( s_qe_every_second_id != 0 ) { - gtk_timeout_remove( s_qe_every_second_id ); + g_source_remove( s_qe_every_second_id ); s_qe_every_second_id = 0; } } @@ -2311,66 +2311,72 @@ void Manipulators_constructToolbar( GtkToolbar* toolbar ){ GtkToolbar* create_main_toolbar( MainFrame::EViewStyle style ){ GtkToolbar* toolbar = GTK_TOOLBAR( gtk_toolbar_new() ); - gtk_toolbar_set_orientation( toolbar, GTK_ORIENTATION_HORIZONTAL ); + gtk_orientable_set_orientation( GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL ); gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS ); gtk_widget_show( GTK_WIDGET( toolbar ) ); + auto space = [&]() { + auto btn = gtk_separator_tool_item_new(); + gtk_widget_show(GTK_WIDGET(btn)); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(btn)); + }; + File_constructToolbar( toolbar ); - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); UndoRedo_constructToolbar( toolbar ); - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); RotateFlip_constructToolbar( toolbar ); - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); Select_constructToolbar( toolbar ); - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); CSG_constructToolbar( toolbar ); - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); ComponentModes_constructToolbar( toolbar ); if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft || style == MainFrame::eFloating ) { - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); XYWnd_constructToolbar( toolbar ); } - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); CamWnd_constructToolbar( toolbar ); - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); Manipulators_constructToolbar( toolbar ); if ( g_Layout_enablePatchToolbar.m_value ) { - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); Patch_constructToolbar( toolbar ); } - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); toolbar_append_toggle_button( toolbar, "Texture Lock (SHIFT +T)", "texture_lock.png", "TogTexLock" ); - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); /*GtkButton* g_view_entities_button =*/ toolbar_append_button( toolbar, "Entities (N)", "entities.png", "ToggleEntityInspector" ); - GtkButton* g_view_console_button = toolbar_append_button( toolbar, "Console (O)", "console.png", "ToggleConsole" ); - GtkButton* g_view_textures_button = toolbar_append_button( toolbar, "Texture Browser (T)", "texture_browser.png", "ToggleTextures" ); + auto g_view_console_button = toolbar_append_button( toolbar, "Console (O)", "console.png", "ToggleConsole" ); + auto g_view_textures_button = toolbar_append_button( toolbar, "Texture Browser (T)", "texture_browser.png", "ToggleTextures" ); // TODO: call light inspector //GtkButton* g_view_lightinspector_button = toolbar_append_button(toolbar, "Light Inspector", "lightinspector.png", "ToggleLightInspector"); - gtk_toolbar_append_space( GTK_TOOLBAR( toolbar ) ); + space(); /*GtkButton* g_refresh_models_button =*/ toolbar_append_button( toolbar, "Refresh Models", "refresh_models.png", "RefreshReferences" ); diff --git a/radiant/map.cpp b/radiant/map.cpp index 1c228181..1c21fce2 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -785,7 +785,7 @@ void DoMapInfo(){ gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_entry_set_editable( entry, FALSE ); + gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE ); brushes_entry = entry; } @@ -795,7 +795,7 @@ void DoMapInfo(){ gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_entry_set_editable( entry, FALSE ); + gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE ); entities_entry = entry; } diff --git a/radiant/patchdialog.cpp b/radiant/patchdialog.cpp index 9e7dd8b3..660face4 100644 --- a/radiant/patchdialog.cpp +++ b/radiant/patchdialog.cpp @@ -227,8 +227,8 @@ float m_fZ; float m_fVShift; */ int m_nCol; int m_nRow; -GtkComboBox *m_pRowCombo; -GtkComboBox *m_pColCombo; +ui::ComboBoxText m_pRowCombo{nullptr}; +ui::ComboBoxText m_pColCombo{nullptr}; std::size_t m_countRows; std::size_t m_countCols; @@ -608,28 +608,28 @@ ui::Window PatchInspector::BuildDialog(){ (GtkAttachOptions)( 0 ), 0, 0 ); } { - GtkComboBox* combo = ui::ComboBoxText(); + auto combo = ui::ComboBoxText(); g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this ); - AddDialogData( *combo, m_nRow ); + AddDialogData( *GTK_COMBO_BOX(combo), m_nRow ); gtk_widget_show( GTK_WIDGET( combo ) ); gtk_table_attach( table, GTK_WIDGET( combo ), 0, 1, 1, 2, (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( combo ), 60, -1 ); + gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 ); m_pRowCombo = combo; } { - GtkComboBox* combo = ui::ComboBoxText(); + auto combo = ui::ComboBoxText(); g_signal_connect( G_OBJECT( combo ), "changed", G_CALLBACK( OnSelchangeComboColRow ), this ); - AddDialogData( *combo, m_nCol ); + AddDialogData( *GTK_COMBO_BOX(combo), m_nCol ); gtk_widget_show( GTK_WIDGET( combo ) ); gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 1, 2, (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( combo ), 60, -1 ); + gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 ); m_pColCombo = combo; } } @@ -811,7 +811,7 @@ ui::Window PatchInspector::BuildDialog(){ } { GtkEntry* entry = ui::Entry(); - // gtk_entry_set_editable (GTK_ENTRY (entry), false); + // gtk_editable_set_editable (GTK_ENTRY (entry), false); gtk_widget_show( GTK_WIDGET( entry ) ); gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 ); AddDialogData( *entry, m_strName ); @@ -855,7 +855,7 @@ ui::Window PatchInspector::BuildDialog(){ (GtkAttachOptions)( GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } { GtkLabel* label = GTK_LABEL( ui::Label( "Vertical Stretch Step" ) ); @@ -872,7 +872,7 @@ ui::Window PatchInspector::BuildDialog(){ (GtkAttachOptions)( GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } { GtkLabel* label = GTK_LABEL( ui::Label( "Rotate Step" ) ); @@ -888,7 +888,7 @@ ui::Window PatchInspector::BuildDialog(){ gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 0, 1, (GtkAttachOptions)( GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 ); g_object_set_data( G_OBJECT( window ), "hshift_entry", entry ); // we fill in this data, if no patch is selected the widgets are unmodified when the inspector is raised // so we need to have at least one initialisation somewhere @@ -903,7 +903,7 @@ ui::Window PatchInspector::BuildDialog(){ 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_set_size_request( GTK_WIDGET( spin ), 10, -1 ); gtk_widget_set_can_focus( spin, false ); } { @@ -912,7 +912,7 @@ ui::Window PatchInspector::BuildDialog(){ gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 1, 2, (GtkAttachOptions)( GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 ); entry_set_float( entry, g_pi_globals.shift[1] ); auto adj = ui::Adjustment( 0, -8192, 8192, 1, 1, 0 ); @@ -924,7 +924,7 @@ ui::Window PatchInspector::BuildDialog(){ 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_set_size_request( GTK_WIDGET( spin ), 10, -1 ); gtk_widget_set_can_focus( spin, false ); } { @@ -933,7 +933,7 @@ ui::Window PatchInspector::BuildDialog(){ gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 2, 3, (GtkAttachOptions)( GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 ); entry_set_float( entry, g_pi_globals.scale[0] ); auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); @@ -945,7 +945,7 @@ ui::Window PatchInspector::BuildDialog(){ 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_set_size_request( GTK_WIDGET( spin ), 10, -1 ); gtk_widget_set_can_focus( spin, false ); } { @@ -954,7 +954,7 @@ ui::Window PatchInspector::BuildDialog(){ gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 3, 4, (GtkAttachOptions)( GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 ); entry_set_float( entry, g_pi_globals.scale[1] ); auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); @@ -966,7 +966,7 @@ ui::Window PatchInspector::BuildDialog(){ 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_set_size_request( GTK_WIDGET( spin ), 10, -1 ); gtk_widget_set_can_focus( spin, false ); } { @@ -975,7 +975,7 @@ ui::Window PatchInspector::BuildDialog(){ gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 4, 5, (GtkAttachOptions)( GTK_FILL ), (GtkAttachOptions)( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 ); entry_set_float( entry, g_pi_globals.rotate ); auto adj = ui::Adjustment( 0, -1000, 1000, 1, 1, 0 ); // NOTE: Arnout - this really should be 360 but can't change it anymore as it could break existing maps @@ -987,7 +987,7 @@ ui::Window PatchInspector::BuildDialog(){ 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_set_size_request( GTK_WIDGET( spin ), 10, -1 ); gtk_widget_set_can_focus( spin, false ); } } @@ -999,35 +999,35 @@ ui::Window PatchInspector::BuildDialog(){ gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchAutoCap ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } { GtkButton* button = ui::Button( "CAP" ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } { GtkButton* button = ui::Button( "Set..." ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchreset ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } { GtkButton* button = ui::Button( "Natural" ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } { GtkButton* button = ui::Button( "Fit" ); gtk_widget_show( GTK_WIDGET( button ) ); gtk_box_pack_end( GTK_BOX( hbox2 ), GTK_WIDGET( button ), TRUE, FALSE, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchfit ), 0 ); - gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 ); + gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 ); } } } @@ -1074,7 +1074,7 @@ void PatchInspector::GetPatchInfo(){ for ( std::size_t i = 0; i < m_countRows; ++i ) { - gtk_combo_box_remove_text( m_pRowCombo, gint( m_countRows - i - 1 ) ); + gtk_combo_box_text_remove( m_pRowCombo, gint( m_countRows - i - 1 ) ); } m_countRows = m_Patch->getHeight(); @@ -1082,7 +1082,7 @@ void PatchInspector::GetPatchInfo(){ { char buffer[16]; sprintf( buffer, "%u", Unsigned( i ) ); - gtk_combo_box_append_text( m_pRowCombo, buffer ); + gtk_combo_box_text_append_text( m_pRowCombo, buffer ); } gtk_combo_box_set_active( m_pRowCombo, 0 ); @@ -1093,7 +1093,7 @@ void PatchInspector::GetPatchInfo(){ for ( std::size_t i = 0; i < m_countCols; ++i ) { - gtk_combo_box_remove_text( m_pColCombo, gint( m_countCols - i - 1 ) ); + gtk_combo_box_text_remove( m_pColCombo, gint( m_countCols - i - 1 ) ); } m_countCols = m_Patch->getWidth(); @@ -1101,7 +1101,7 @@ void PatchInspector::GetPatchInfo(){ { char buffer[16]; sprintf( buffer, "%u", Unsigned( i ) ); - gtk_combo_box_append_text( m_pColCombo, buffer ); + gtk_combo_box_text_append_text( m_pColCombo, buffer ); } gtk_combo_box_set_active( m_pColCombo, 0 ); diff --git a/radiant/patchmanip.cpp b/radiant/patchmanip.cpp index 897cbd6d..2f22d49f 100644 --- a/radiant/patchmanip.cpp +++ b/radiant/patchmanip.cpp @@ -876,8 +876,8 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows, } { - GtkComboBox* combo = ui::ComboBoxText(); -#define D_ITEM( x ) if ( x >= mincols && ( !maxcols || x <= maxcols ) ) gtk_combo_box_append_text( combo, # x ) + auto combo = ui::ComboBoxText(); +#define D_ITEM( x ) if ( x >= mincols && ( !maxcols || x <= maxcols ) ) gtk_combo_box_text_append_text( combo, # x ) D_ITEM( 3 ); D_ITEM( 5 ); D_ITEM( 7 ); @@ -902,8 +902,8 @@ void DoNewPatchDlg( EPatchPrefab prefab, int minrows, int mincols, int defrows, width = combo; } { - GtkComboBox* combo = ui::ComboBoxText(); -#define D_ITEM( x ) if ( x >= minrows && ( !maxrows || x <= maxrows ) ) gtk_combo_box_append_text( combo, # x ) + auto combo = ui::ComboBoxText(); +#define D_ITEM( x ) if ( x >= minrows && ( !maxrows || x <= maxrows ) ) gtk_combo_box_text_append_text( combo, # x ) D_ITEM( 3 ); D_ITEM( 5 ); D_ITEM( 7 ); @@ -1038,7 +1038,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){ gtk_table_attach( table, button, 1, 2, 0, 1, (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ), (GtkAttachOptions) ( 0 ), 0, 0 ); - group = gtk_radio_button_group( GTK_RADIO_BUTTON( button ) ); + group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) ); bevel = button; } @@ -1048,7 +1048,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){ gtk_table_attach( table, button, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ), (GtkAttachOptions) ( 0 ), 0, 0 ); - group = gtk_radio_button_group( GTK_RADIO_BUTTON( button ) ); + group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) ); endcap = button; } @@ -1058,7 +1058,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){ gtk_table_attach( table, button, 1, 2, 2, 3, (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ), (GtkAttachOptions) ( 0 ), 0, 0 ); - group = gtk_radio_button_group( GTK_RADIO_BUTTON( button ) ); + group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) ); ibevel = button; } @@ -1068,7 +1068,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){ gtk_table_attach( table, button, 1, 2, 3, 4, (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ), (GtkAttachOptions) ( 0 ), 0, 0 ); - group = gtk_radio_button_group( GTK_RADIO_BUTTON( button ) ); + group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) ); iendcap = button; } @@ -1078,7 +1078,7 @@ EMessageBoxReturn DoCapDlg( ECapDialog* type ){ gtk_table_attach( table, button, 1, 2, 4, 5, (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ), (GtkAttachOptions) ( 0 ), 0, 0 ); - group = gtk_radio_button_group( GTK_RADIO_BUTTON( button ) ); + group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( button ) ); cylinder = button; } diff --git a/radiant/pluginmenu.cpp b/radiant/pluginmenu.cpp index b79e81ca..fb97825a 100644 --- a/radiant/pluginmenu.cpp +++ b/radiant/pluginmenu.cpp @@ -146,11 +146,11 @@ public: void PluginsMenu_clear(){ m_nNextPlugInID = 0; - GList* lst = g_list_find( gtk_container_children( GTK_CONTAINER( g_plugins_menu ) ), GTK_WIDGET( g_plugins_menu_separator ) ); + GList* lst = g_list_find( gtk_container_get_children( GTK_CONTAINER( g_plugins_menu ) ), GTK_WIDGET( g_plugins_menu_separator ) ); while ( lst->next ) { gtk_container_remove( GTK_CONTAINER( g_plugins_menu ), GTK_WIDGET( lst->next->data ) ); - lst = g_list_find( gtk_container_children( GTK_CONTAINER( g_plugins_menu ) ), GTK_WIDGET( g_plugins_menu_separator ) ); + lst = g_list_find( gtk_container_get_children( GTK_CONTAINER( g_plugins_menu ) ), GTK_WIDGET( g_plugins_menu_separator ) ); } } diff --git a/radiant/plugintoolbar.cpp b/radiant/plugintoolbar.cpp index 17dd4ce7..b105c49f 100644 --- a/radiant/plugintoolbar.cpp +++ b/radiant/plugintoolbar.cpp @@ -38,59 +38,61 @@ GtkImage* new_plugin_image( const char* filename ){ { StringOutputStream fullpath( 256 ); fullpath << GameToolsPath_get() << g_pluginsDir << "bitmaps/" << filename; - GtkImage* image = image_new_from_file_with_mask( fullpath.c_str() ); - if ( image != 0 ) { - return image; - } + char *s = fullpath.c_str(); + if ( auto image = image_new_from_file_with_mask(s) ) return image; } { StringOutputStream fullpath( 256 ); fullpath << AppPath_get() << g_pluginsDir << "bitmaps/" << filename; - GtkImage* image = image_new_from_file_with_mask( fullpath.c_str() ); - if ( image != 0 ) { - return image; - } + char *s = fullpath.c_str(); + if ( auto image = image_new_from_file_with_mask(s) ) return image; } { StringOutputStream fullpath( 256 ); fullpath << AppPath_get() << g_modulesDir << "bitmaps/" << filename; - GtkImage* image = image_new_from_file_with_mask( fullpath.c_str() ); - if ( image != 0 ) { - return image; - } + char *s = fullpath.c_str(); + if ( auto image = image_new_from_file_with_mask(s) ) return image; } return image_new_missing(); } -inline GtkToolbarChildType gtktoolbarchildtype_for_toolbarbuttontype( IToolbarButton::EType type ){ - switch ( type ) - { - case IToolbarButton::eSpace: - return GTK_TOOLBAR_CHILD_SPACE; - case IToolbarButton::eButton: - return GTK_TOOLBAR_CHILD_BUTTON; - case IToolbarButton::eToggleButton: - return GTK_TOOLBAR_CHILD_TOGGLEBUTTON; - case IToolbarButton::eRadioButton: - return GTK_TOOLBAR_CHILD_RADIOBUTTON; +void toolbar_insert( GtkToolbar *toolbar, const char* icon, const char* text, const char* tooltip, IToolbarButton::EType type, GCallback handler, gpointer data ){ + if (type == IToolbarButton::eSpace) { + auto it = gtk_separator_tool_item_new(); + gtk_widget_show(GTK_WIDGET(it)); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(it)); + return; + } + if (type == IToolbarButton::eButton) { + auto button = gtk_tool_button_new(GTK_WIDGET(new_plugin_image(icon)), text); + gtk_widget_set_tooltip_text(GTK_WIDGET(button), tooltip); + gtk_widget_show_all(GTK_WIDGET(button)); + g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(handler), data); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button)); + return; + } + if (type == IToolbarButton::eToggleButton) { + auto button = gtk_toggle_tool_button_new(); + gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(button), GTK_WIDGET(new_plugin_image(icon))); + gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), text); + gtk_widget_set_tooltip_text(GTK_WIDGET(button), tooltip); + gtk_widget_show_all(GTK_WIDGET(button)); + g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(handler), data); + gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(button)); + return; } ERROR_MESSAGE( "invalid toolbar button type" ); - return (GtkToolbarChildType)0; -} - -void toolbar_insert( GtkToolbar *toolbar, const char* icon, const char* text, const char* tooltip, IToolbarButton::EType type, GtkSignalFunc handler, gpointer data ){ - gtk_toolbar_append_element( toolbar, gtktoolbarchildtype_for_toolbarbuttontype( type ), 0, text, tooltip, "", GTK_WIDGET( new_plugin_image( icon ) ), handler, data ); } -void ActivateToolbarButton( ui::Widget widget, gpointer data ){ - const_cast( reinterpret_cast( data ) )->activate(); +void ActivateToolbarButton( GtkToolButton *widget, gpointer data ){ + (const_cast( reinterpret_cast( data )))->activate(); } void PlugInToolbar_AddButton( GtkToolbar* toolbar, const IToolbarButton* button ){ - toolbar_insert( toolbar, button->getImage(), button->getText(), button->getTooltip(), button->getType(), GTK_SIGNAL_FUNC( ActivateToolbarButton ), reinterpret_cast( const_cast( button ) ) ); + toolbar_insert( toolbar, button->getImage(), button->getText(), button->getTooltip(), button->getType(), G_CALLBACK( ActivateToolbarButton ), reinterpret_cast( const_cast( button ) ) ); } GtkToolbar* g_plugin_toolbar = 0; @@ -124,7 +126,7 @@ GtkToolbar* create_plugin_toolbar(){ GtkToolbar *toolbar; toolbar = GTK_TOOLBAR( gtk_toolbar_new() ); - gtk_toolbar_set_orientation( toolbar, GTK_ORIENTATION_HORIZONTAL ); + gtk_orientable_set_orientation( GTK_ORIENTABLE(toolbar), GTK_ORIENTATION_HORIZONTAL ); gtk_toolbar_set_style( toolbar, GTK_TOOLBAR_ICONS ); gtk_widget_show( GTK_WIDGET( toolbar ) ); diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 326702fb..50eefa61 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -827,7 +827,7 @@ ui::Window PrefsDlg::BuildDialog(){ } } - gtk_notebook_set_page( GTK_NOTEBOOK( m_notebook ), 0 ); + gtk_notebook_set_current_page( GTK_NOTEBOOK( m_notebook ), 0 ); return dialog; } diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index a6ee307e..7bc7df49 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -395,8 +395,8 @@ void SurfaceInspector_GridChange(){ // increment * scale = gridsize static void OnBtnMatchGrid( ui::Widget widget, gpointer data ){ float hscale, vscale; - hscale = static_cast( gtk_spin_button_get_value_as_float( getSurfaceInspector().m_hscaleIncrement.m_spin ) ); - vscale = static_cast( gtk_spin_button_get_value_as_float( getSurfaceInspector().m_vscaleIncrement.m_spin ) ); + hscale = static_cast( gtk_spin_button_get_value( getSurfaceInspector().m_hscaleIncrement.m_spin ) ); + vscale = static_cast( gtk_spin_button_get_value( getSurfaceInspector().m_vscaleIncrement.m_spin ) ); if ( hscale == 0.0f || vscale == 0.0f ) { globalOutputStream() << "ERROR: unexpected scale == 0.0f\n"; @@ -640,7 +640,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( spin ), 60, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 ); } { ui::Widget label = ui::Label( "Step" ); @@ -656,7 +656,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 0, 1, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 ); m_hshiftIncrement.m_entry = entry; m_hshiftEntry.connect( entry ); } @@ -676,7 +676,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 1, 2, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( spin ), 60, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 ); } { ui::Widget label = ui::Label( "Step" ); @@ -692,7 +692,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 1, 2, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 ); m_vshiftIncrement.m_entry = entry; m_vshiftEntry.connect( entry ); } @@ -712,7 +712,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 2, 3, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( spin ), 60, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 ); } { ui::Widget label = ui::Label( "Step" ); @@ -728,7 +728,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 2, 3, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 2, 3 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 ); m_hscaleIncrement.m_entry = entry; m_hscaleEntry.connect( entry ); } @@ -748,7 +748,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 3, 4, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( spin ), 60, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 ); } { ui::Widget label = ui::Label( "Step" ); @@ -764,7 +764,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 3, 4, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 ); m_vscaleIncrement.m_entry = entry; m_vscaleEntry.connect( entry ); } @@ -784,7 +784,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 4, 5, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( spin ), 60, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( spin ), 60, -1 ); gtk_spin_button_set_wrap( spin, TRUE ); } { @@ -801,7 +801,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 4, 5, (GtkAttachOptions) ( GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( GTK_WIDGET( entry ), 50, -2 ); + gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 ); m_rotateIncrement.m_entry = entry; m_rotateEntry.connect( entry ); } @@ -863,7 +863,7 @@ ui::Window SurfaceInspector::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnAxial ), 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); } { ui::Widget button = ui::Button( "Fit" ); @@ -873,7 +873,7 @@ ui::Window SurfaceInspector::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnFaceFit ), 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); } { ui::Widget button = ui::Button( "CAP" ); @@ -883,7 +883,7 @@ ui::Window SurfaceInspector::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); } { ui::Widget button = ui::Button( "Set..." ); @@ -893,7 +893,7 @@ ui::Window SurfaceInspector::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchreset ), 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); } { ui::Widget button = ui::Button( "Natural" ); @@ -903,7 +903,7 @@ ui::Window SurfaceInspector::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); } { ui::Widget button = ui::Button( "Fit" ); @@ -913,7 +913,7 @@ ui::Window SurfaceInspector::BuildDialog(){ (GtkAttachOptions) ( 0 ), 0, 0 ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFit ), 0 ); - gtk_widget_set_usize( button, 60, -2 ); + gtk_widget_set_size_request( button, 60, -1 ); } { ui::Widget spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ); @@ -921,7 +921,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 2, 3, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( spin, 60, -2 ); + gtk_widget_set_size_request( spin, 60, -1 ); AddDialogData( *GTK_SPIN_BUTTON( spin ), m_fitHorizontal ); } { @@ -930,7 +930,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), spin, 3, 4, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - gtk_widget_set_usize( spin, 60, -2 ); + gtk_widget_set_size_request( spin, 60, -1 ); AddDialogData( *GTK_SPIN_BUTTON( spin ), m_fitVertical ); } } @@ -1041,12 +1041,12 @@ ui::Window SurfaceInspector::BuildDialog(){ //Prolly should make this a member or global var, so the SI can draw on it... TexTool::g_textoolWin = glwidget_new( FALSE ); // --> Dunno, but this stuff may be necessary... (Looks like it!) - gtk_widget_ref( TexTool::g_textoolWin ); + g_object_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_can_focus( TexTool::g_textoolWin, true ); // <-- end stuff... gtk_widget_show( TexTool::g_textoolWin ); - gtk_widget_set_usize( TexTool::g_textoolWin, -1, 240 ); //Yeah! + gtk_widget_set_size_request( TexTool::g_textoolWin, -1, 240 ); //Yeah! gtk_container_add( GTK_CONTAINER( frame ), TexTool::g_textoolWin ); g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "size_allocate", G_CALLBACK( TexTool::size_allocate ), NULL ); @@ -1207,11 +1207,11 @@ void SurfaceInspector::ApplyShader(){ void SurfaceInspector::ApplyTexdef(){ texdef_t shiftScaleRotate; - shiftScaleRotate.shift[0] = static_cast( gtk_spin_button_get_value_as_float( m_hshiftIncrement.m_spin ) ); - shiftScaleRotate.shift[1] = static_cast( gtk_spin_button_get_value_as_float( m_vshiftIncrement.m_spin ) ); - shiftScaleRotate.scale[0] = static_cast( gtk_spin_button_get_value_as_float( m_hscaleIncrement.m_spin ) ); - shiftScaleRotate.scale[1] = static_cast( gtk_spin_button_get_value_as_float( m_vscaleIncrement.m_spin ) ); - shiftScaleRotate.rotate = static_cast( gtk_spin_button_get_value_as_float( m_rotateIncrement.m_spin ) ); + shiftScaleRotate.shift[0] = static_cast( gtk_spin_button_get_value( m_hshiftIncrement.m_spin ) ); + shiftScaleRotate.shift[1] = static_cast( gtk_spin_button_get_value( m_vshiftIncrement.m_spin ) ); + shiftScaleRotate.scale[0] = static_cast( gtk_spin_button_get_value( m_hscaleIncrement.m_spin ) ); + shiftScaleRotate.scale[1] = static_cast( gtk_spin_button_get_value( m_vscaleIncrement.m_spin ) ); + shiftScaleRotate.rotate = static_cast( gtk_spin_button_get_value( m_rotateIncrement.m_spin ) ); TextureProjection projection; //Shamus: This is the other place that screws up, it seems, since it doesn't seem to do the diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index ab558113..686de494 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -1854,7 +1854,7 @@ void TextureBrowser_toggleSearchButton(){ gtk_widget_show_all( g_TextureBrowser.m_search_button ); } else { - gtk_widget_hide_all( g_TextureBrowser.m_search_button ); + gtk_widget_hide( g_TextureBrowser.m_search_button ); } } @@ -1872,12 +1872,10 @@ void TextureBrowser_constructTagNotebook(){ } void TextureBrowser_constructSearchButton(){ - GtkTooltips* tooltips = gtk_tooltips_new(); - ui::Widget image = ui::Widget(gtk_image_new_from_stock( GTK_STOCK_FIND, GTK_ICON_SIZE_SMALL_TOOLBAR )); g_TextureBrowser.m_search_button = ui::Button(); g_signal_connect( G_OBJECT( g_TextureBrowser.m_search_button ), "clicked", G_CALLBACK( TextureBrowser_searchTags ), NULL ); - gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ), g_TextureBrowser.m_search_button, "Search with selected tags", "Search with selected tags" ); + gtk_widget_set_tooltip_text(g_TextureBrowser.m_search_button, "Search with selected tags"); gtk_container_add( GTK_CONTAINER( g_TextureBrowser.m_search_button ), image ); } @@ -1955,12 +1953,12 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){ ui::Widget menu_view = ui::Menu(); auto view_item = TextureBrowser_constructViewMenu( GTK_MENU( menu_view ) ); gtk_menu_item_set_submenu( GTK_MENU_ITEM( view_item ), menu_view ); - gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), view_item ); + gtk_menu_shell_append( GTK_MENU_SHELL( menu_bar ), view_item ); ui::Widget menu_tools = ui::Menu(); auto tools_item = TextureBrowser_constructToolsMenu( GTK_MENU( menu_tools ) ); gtk_menu_item_set_submenu( GTK_MENU_ITEM( tools_item ), menu_tools ); - gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), tools_item ); + gtk_menu_shell_append( GTK_MENU_SHELL( menu_bar ), tools_item ); gtk_table_attach( GTK_TABLE( table ), menu_bar, 0, 3, 0, 1, GTK_FILL, GTK_SHRINK, 0, 0 ); gtk_widget_show( menu_bar ); @@ -1992,7 +1990,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){ } { // gl_widget g_TextureBrowser.m_gl_widget = ui::Widget(glwidget_new( FALSE )); - gtk_widget_ref( g_TextureBrowser.m_gl_widget ); + g_object_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_can_focus( g_TextureBrowser.m_gl_widget, true ); @@ -2023,7 +2021,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){ ui::Widget menu_tags = ui::Menu(); auto tags_item = TextureBrowser_constructTagsMenu( GTK_MENU( menu_tags ) ); gtk_menu_item_set_submenu( GTK_MENU_ITEM( tags_item ), menu_tags ); - gtk_menu_bar_append( GTK_MENU_BAR( menu_bar ), tags_item ); + gtk_menu_shell_append( GTK_MENU_SHELL( menu_bar ), tags_item ); } { // Tag TreeView g_TextureBrowser.m_scr_win_tags = ui::ScrolledWindow(); @@ -2168,7 +2166,7 @@ void TextureBrowser_destroyWindow(){ g_signal_handler_disconnect( G_OBJECT( g_TextureBrowser.m_gl_widget ), g_TextureBrowser.m_sizeHandler ); g_signal_handler_disconnect( G_OBJECT( g_TextureBrowser.m_gl_widget ), g_TextureBrowser.m_exposeHandler ); - gtk_widget_unref( g_TextureBrowser.m_gl_widget ); + g_object_unref( g_TextureBrowser.m_gl_widget ); } const Vector3& TextureBrowser_getBackgroundColour( TextureBrowser& textureBrowser ){ diff --git a/radiant/watchbsp.cpp b/radiant/watchbsp.cpp index bd7e11ca..f48274a5 100644 --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@ -493,7 +493,7 @@ void CWatchBSP::Reset(){ } m_eState = EIdle; if ( s_routine_id ) { - gtk_timeout_remove( s_routine_id ); + g_source_remove( s_routine_id ); s_routine_id = 0; } } @@ -546,7 +546,7 @@ void CWatchBSP::DoEBeginStep(){ } } m_eState = EBeginStep; - s_routine_id = gtk_timeout_add( 25, watchbsp_routine, this ); + s_routine_id = g_timeout_add( 25, watchbsp_routine, this ); } diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index a20214da..abebef5d 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -828,7 +828,7 @@ XYWnd::XYWnd() : m_window_observer->setRectangleDrawCallback( ReferenceCaller1( *this ) ); m_window_observer->setView( m_view ); - gtk_widget_ref( m_gl_widget ); + g_object_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_can_focus( m_gl_widget, true ); @@ -867,7 +867,7 @@ XYWnd::~XYWnd(){ g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_sizeHandler ); g_signal_handler_disconnect( G_OBJECT( m_gl_widget ), m_exposeHandler ); - gtk_widget_unref( m_gl_widget ); + g_object_unref( m_gl_widget ); m_window_observer->release(); }