]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
-DGTK_DISABLE_DEPRECATED
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 22:33:02 +0000 (09:33 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 18 Feb 2016 01:07:35 +0000 (12:07 +1100)
47 files changed:
CMakeLists.txt
contrib/bkgrnd2d/dialog.cpp
contrib/bobtoolz/dialogs/dialogs-gtk.cpp
contrib/bobtoolz/dialogs/dialogs-gtk.h
contrib/bobtoolz/lists.cpp
contrib/bobtoolz/lists.h
contrib/brushexport/interface.cpp
contrib/camera/dialogs.cpp
contrib/gtkgensurf/gendlgs.cpp
contrib/gtkgensurf/view.cpp
contrib/hydratoolz/plugin.cpp
contrib/prtview/AboutDialog.cpp
contrib/prtview/ConfigDialog.cpp
contrib/prtview/LoadPortalFileDialog.cpp
include/itoolbar.h
libs/gtkutil/button.cpp
libs/gtkutil/button.h
libs/gtkutil/glwidget.cpp
libs/gtkutil/image.cpp
libs/gtkutil/menu.cpp
libs/gtkutil/nonmodal.h
libs/gtkutil/toolbar.cpp
libs/gtkutil/toolbar.h
libs/uilib/uilib.cpp
libs/uilib/uilib.h
plugins/textool/2DView.cpp
plugins/textool/TexTool.cpp
radiant/camwindow.cpp
radiant/dialog.cpp
radiant/entityinspector.cpp
radiant/findtexturedialog.cpp
radiant/groupdialog.cpp
radiant/gtkdlgs.cpp
radiant/gtkmisc.cpp
radiant/gtkmisc.h
radiant/main.cpp
radiant/mainframe.cpp
radiant/map.cpp
radiant/patchdialog.cpp
radiant/patchmanip.cpp
radiant/pluginmenu.cpp
radiant/plugintoolbar.cpp
radiant/preferences.cpp
radiant/surfacedialog.cpp
radiant/texwindow.cpp
radiant/watchbsp.cpp
radiant/xywindow.cpp

index bcb4fbc576d7b8922ff66a39dcf8e70508da32a6..37ca39a6282c1760c2999551a07a601187699017 100644 (file)
@@ -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(
index 0764daca2453299b5b92ab65102eb6d0e81e9331..a787c8fa1e71955b9b1a37c93cd00a9760928155 100644 (file)
@@ -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();
 
index 08bac0970b9099b51009a10b1d240db6963f0f00..f4c28b979c80ca76e98b5b5cdae5a31154a86801 100644 (file)
@@ -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;
index ae35490431b48cfcd43779ecb82c292c77e21322..75db2d18697ff85a5672c38b8e1366c558f0bcdf 100644 (file)
@@ -20,6 +20,7 @@
 #if !defined( INCLUDED_DIALOGS_GTK_H )
 #define INCLUDED_DIALOGS_GTK_H
 
+#include <gtk/gtk.h>
 #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 );
index 810798397d6b7cfac63542f60d41c17a8fb612a3..c2b1ed9e30672e50ebacdc7aa02fd85ead8dcc85 100644 (file)
@@ -24,6 +24,7 @@
 #endif
 
 #include <glib.h>
+#include <gtk/gtk.h>
 
 #include "misc.h"
 
@@ -54,7 +55,7 @@ bool LoadExclusionList( char* filename, std::list<Str>* 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++;
index 827c9cbc1638b2a97221b7a8d5a181be4ea96717..00e50266f0d9e0db2b1c50756c0d0b420645ac68 100644 (file)
@@ -18,8 +18,9 @@
  */
 
 #include <list>
+#include <gtk/gtk.h>
 #include "str.h"
 typedef struct _GList GList;
 
 bool LoadExclusionList( char* filename, std::list<Str>* exclusionList );
-bool LoadGList( char* filename, GList** loadlist );
+bool LoadGList( char* filename, GtkListStore* loadlist );
index e9688ac2a17fcd211e398e7f9ea3a1146e056345..a2405aa5604567d5116a3124ecd69b3cc7068948 100644 (file)
@@ -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 )
index 43c2543bb6fd796a4b228fc82b4d17a5bf90de9a..460f8abfb91fa43383c07ef885e703bebef125c0 100644 (file)
@@ -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 );
index f817f925ce2c1fc13bea92a282845f78f77f23b8..2ff5c718100b0b799ab4a23e5c7b69805994b77b 100644 (file)
@@ -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 );
 
index 84912c3df8bad65c866f3eb995e91d6b68ec8ec2..7054d5d6aee61e4b93f1c8f27dbad5112d57a3be 100644 (file)
@@ -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 );
index a290649f2d21f3524f04316a20705352d074e290..934bd208ed104b281556c2a3dc7c598c01924fff 100644 (file)
@@ -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;
        }
index 198380427ed4c0c737d6711cff31626a902f81c0..ba70087162b84c4ceffbb046084be07882c64c55 100644 (file)
@@ -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 );
index 3a8245900da6c5c3a7f2069eae3bb5afeb210834..8a3e28a3729f1cad5e03d9d2b052f70bb5d19597 100644 (file)
@@ -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 );
index a2a9fbbf896404c581d495d82d9c8631800f4d1e..ff63a88568aed23785b7c3379c4eba26dbe6eb98 100644 (file)
@@ -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, '.' );
index 62d82b6ec889e83f5b1641bd92b821067525dc22..7e5daad302a0eae0761d0c51f13a7797bff35819 100644 (file)
@@ -33,7 +33,6 @@ enum EType
        eSpace,
        eButton,
        eToggleButton,
-       eRadioButton,
 };
 
 virtual const char* getImage() const = 0;
index d565c974c9c512d7183e798ebfac6169db65ea42..08744ff485a39fc8406aefc565c8af4dee3e6b55 100644 (file)
@@ -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 ) )
        {
index 15a9f2e8cd4513d10894710d12a92ccf6f8e5a9e..1ffb025cdd06528d5a4730544f2b62d8982b87fc 100644 (file)
@@ -22,6 +22,7 @@
 #if !defined( INCLUDED_GTKUTIL_BUTTON_H )
 #define INCLUDED_GTKUTIL_BUTTON_H
 
+#include <gtk/gtk.h>
 #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 );
index 1c9c275b24e592a3a3f6660f5457b0cf3b1f2804..3f9b9a00ac1dc9ab1c3387d251734fe0313c1e7a 100644 (file)
@@ -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;
index 4b91bd258a24798d2f99bec3875e00df3cb3fc7a..dd723bfe2fbfbfb00e0049114a45aace05078b8d 100644 (file)
@@ -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();
index 4f6eb3ae85da3da3194d62163ecccfa4c52d3134..7ef18911942a0aec9b3d6ec410d52fe69b9227d3 100644 (file)
@@ -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;
index 345eaac2ca42c515af47924d09a53651b6f22591..4baf54b54fb6b5e704d2bdf420141e325a61d4cf 100644 (file)
@@ -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 );
index 0c19b9ff73702adfd954a5e269eaed44e679c97b..c06594012b523a1900ca41a1893a869bc2401648 100644 (file)
 
 #include "toolbar.h"
 
-#include <gtk/gtk.h>
 #include <uilib/uilib.h>
 
 #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<GtkToggleButton, bool, toggle_button_set_active_callback> ToggleButtonSetActiveCaller;
+using ToggleButtonSetActiveCaller = ReferenceCaller1<GtkToggleToolButton, bool, toggle_button_set_active_callback>;
 
-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;
 }
index 6b9e32fb71f118c377bf5393a72e7db32646fcee..687fa0a3beb6f1179ef4e848409567bbc47e3379 100644 (file)
@@ -22,6 +22,7 @@
 #if !defined( INCLUDED_GTKUTIL_TOOLBAR_H )
 #define INCLUDED_GTKUTIL_TOOLBAR_H
 
+#include <gtk/gtk.h>
 #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
index b25bfee204cd71adb2d448bd2e80ba3b5df18de6..a567a531e58e53d8986d0b71c22d29510e2b9ae8 100644 (file)
@@ -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<gint>(max_length));
+    }
 
     Frame::Frame(const char *label) : Frame(GTK_FRAME(gtk_frame_new(label)))
     { }
index a5164b022b9451f88c3b88bbec75eb2f6a764774..96a6ddce257fedfa1d35841127965a9fa7d4237e 100644 (file)
@@ -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();
index 4ad21fe94e65405af60f983addec2d30a062fc51..a01172a1b397d5253b34a61f98aae76fefd114a5 100644 (file)
@@ -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 );
 
index 162eb8a8510142840405b3c64e8ce23efb4cc9eb..a4c1815f9f0c6b5e18a0f8a47395bbdb2437c0f9 100644 (file)
@@ -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;
 }
index a04f1ecf1e22ef7938d3fe0c6cadc7d906994a1c..243404f3d0b6f3594c2e7a3b40b7ac0494d29dfa 100644 (file)
@@ -1161,7 +1161,7 @@ CamWnd::CamWnd() :
        m_window_observer->setRectangleDrawCallback( ReferenceCaller1<CamWnd, rect_t, camwnd_update_xor_rectangle>( *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();
 }
index 727ac358aa3d106d6fe12e59751a6ea7a6f902d2..13786e36c6f5d3ca95a0fc64e3a36fc4efd8af2c 100644 (file)
@@ -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<GtkSpinButton, float, FloatSpinnerImport, FloatSpinnerExport> 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 );
index f1860238a6f75dea4a3392750359721aa969f61f..d7436263c866af2e0c7785215358c35b5146fc38 100644 (file)
@@ -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;
                                        }
index abd0fb840d8d9f3d65168b22799ddac3de6d9afa..58c4665c86ea497cab2c6dbfe6b6adb53da5c25f 100644 (file)
@@ -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;
 }
index 6c95a5f53165b6ca3f4c01ef5d51efdbdc3ae02e..f6e1d28b1c6e3e82ac3d87cc3058cb07ae56fd82 100644 (file)
@@ -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;
 
index a481ee11c32d5a3cabbd9fd25541fe8549dfd4b4..3bb123f4e3ec84cb7d6b7986ced273fb437cfd1a 100644 (file)
@@ -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;
index d9cd7ed008cfcfe0e7fdb551b8771fbb82eede39..a2e6e5c7908cf0784d0d310fa734095f8e1f136a 100644 (file)
@@ -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 );
index 755c7330f4182ddae5c49ebc68ea8f6be830d46e..867aaccb4f295d98a0eb5dbb0c4de0169736c752 100644 (file)
@@ -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<typename Element> class BasicVector3;
index 1167cc762a7aaeb838b8abf95ec97803eedc1626..4fe858bc5cf92481809ea4b9563c06871bfb3b8d 100644 (file)
@@ -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() );
index 90facfdef3cbe12839b6c407da810a96f396064e..953cf7cb3571e1cfcfbe56f4a59f2c589bfc578d 100644 (file)
@@ -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" );
 
 
index 1c228181a7b1b6e788fac6053f7b4bcf0666fc19..1c21fce22cd8691686fa2c25a7048f79bb7e697e 100644 (file)
@@ -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;
                                }
index 9e7dd8b310eef7055c7944b933a65c7ec44489a1..660face4b1f240269a548cea277e95686ee56c3f 100644 (file)
@@ -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 );
index 897cbd6dd217a3c5199805f1c61b63b3983f4c5c..2f22d49fdc31a0416e30523c70191659fa9d7fc4 100644 (file)
@@ -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;
                                }
index b79e81ca3b8b0608148d27c130ce7e5235857834..fb97825abbc39098d4fa31b7b3096f094c369e91 100644 (file)
@@ -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 ) );
        }
 }
 
index 17dd4ce7f4f68f370690fd575a4425a2bb9a11ea..b105c49f5c0cef67ab884aa63c5f39c399a980ad 100644 (file)
@@ -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<const IToolbarButton*>( reinterpret_cast<IToolbarButton*>( data ) )->activate();
+void ActivateToolbarButton( GtkToolButton *widget, gpointer data ){
+       (const_cast<const IToolbarButton *>( reinterpret_cast<IToolbarButton *>( 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<gpointer>( const_cast<IToolbarButton*>( button ) ) );
+       toolbar_insert( toolbar, button->getImage(), button->getText(), button->getTooltip(), button->getType(), G_CALLBACK( ActivateToolbarButton ), reinterpret_cast<gpointer>( const_cast<IToolbarButton*>( 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 ) );
 
index 326702fb3739e75d062ae171457c47de440da87e..50eefa61acef88ab45fba8a67b04ac49a5e24eec 100644 (file)
@@ -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;
 }
index a6ee307e14e6b59a998f2b72e99031eb1f83819c..7bc7df499077ce3d6a4bceaf2e4e7d618a653390 100644 (file)
@@ -395,8 +395,8 @@ void SurfaceInspector_GridChange(){
 // increment * scale = gridsize
 static void OnBtnMatchGrid( ui::Widget widget, gpointer data ){
        float hscale, vscale;
-       hscale = static_cast<float>( gtk_spin_button_get_value_as_float( getSurfaceInspector().m_hscaleIncrement.m_spin ) );
-       vscale = static_cast<float>( gtk_spin_button_get_value_as_float( getSurfaceInspector().m_vscaleIncrement.m_spin ) );
+       hscale = static_cast<float>( gtk_spin_button_get_value( getSurfaceInspector().m_hscaleIncrement.m_spin ) );
+       vscale = static_cast<float>( 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<float>( gtk_spin_button_get_value_as_float( m_hshiftIncrement.m_spin ) );
-       shiftScaleRotate.shift[1] = static_cast<float>( gtk_spin_button_get_value_as_float( m_vshiftIncrement.m_spin ) );
-       shiftScaleRotate.scale[0] = static_cast<float>( gtk_spin_button_get_value_as_float( m_hscaleIncrement.m_spin ) );
-       shiftScaleRotate.scale[1] = static_cast<float>( gtk_spin_button_get_value_as_float( m_vscaleIncrement.m_spin ) );
-       shiftScaleRotate.rotate = static_cast<float>( gtk_spin_button_get_value_as_float( m_rotateIncrement.m_spin ) );
+       shiftScaleRotate.shift[0] = static_cast<float>( gtk_spin_button_get_value( m_hshiftIncrement.m_spin ) );
+       shiftScaleRotate.shift[1] = static_cast<float>( gtk_spin_button_get_value( m_vshiftIncrement.m_spin ) );
+       shiftScaleRotate.scale[0] = static_cast<float>( gtk_spin_button_get_value( m_hscaleIncrement.m_spin ) );
+       shiftScaleRotate.scale[1] = static_cast<float>( gtk_spin_button_get_value( m_vscaleIncrement.m_spin ) );
+       shiftScaleRotate.rotate = static_cast<float>( 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
index ab5581136354b3249c1ab7449343475e555b6245..686de494eda9db4ce7b7210da10186bb7b7701fb 100644 (file)
@@ -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 ){
index bd7e11ca41f9807c09b997dc9325e590d165493b..f48274a57569da390a26d1451fc4a6810619d7ed 100644 (file)
@@ -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 );
 }
 
 
index a20214da55c26c96343f07e48fc7fd82cfc7f0ec..abebef5d7435f922ade76a838d09b87b171a2433 100644 (file)
@@ -828,7 +828,7 @@ XYWnd::XYWnd() :
        m_window_observer->setRectangleDrawCallback( ReferenceCaller1<XYWnd, rect_t, xy_update_xor_rectangle>( *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();
 }