X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fsurfacedialog.cpp;h=f97745598e2c551174ca5ea4321368f6d9614056;hb=c001d05fb1dc902a725dbf50df82e88a1a526a21;hp=8209a16a944f62f152b8f31a728881fb5d42efa0;hpb=225950494a606af9aac2bc2f06ece70cb2146481;p=xonotic%2Fnetradiant.git diff --git a/radiant/surfacedialog.cpp b/radiant/surfacedialog.cpp index 8209a16a..f9774559 100644 --- a/radiant/surfacedialog.cpp +++ b/radiant/surfacedialog.cpp @@ -27,6 +27,8 @@ #include "surfacedialog.h" +#include + #include "debugging/debugging.h" #include "warnings.h" @@ -120,7 +122,7 @@ float& m_f; public: GtkSpinButton* m_spin; ui::Entry m_entry; -Increment( float& f ) : m_f( f ), m_spin( 0 ), m_entry( nullptr ){ +Increment( float& f ) : m_f( f ), m_spin( 0 ), m_entry( ui::null ){ } void cancel(){ entry_set_float( m_entry, m_f ); @@ -157,7 +159,7 @@ GtkCheckButton* m_surfaceFlags[32]; GtkCheckButton* m_contentFlags[32]; NonModalEntry m_valueEntry; -ui::Entry m_valueEntryWidget{nullptr}; +ui::Entry m_valueEntryWidget{ui::null}; public: WindowPositionTracker m_positionTracker; WindowPositionTrackerImportStringCaller m_importPosition; @@ -811,7 +813,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), button, 2, 4, 5, 6, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnMatchGrid ), 0 ); + button.connect( "clicked", G_CALLBACK( OnBtnMatchGrid ), 0 ); } } @@ -860,7 +862,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", + button.connect( "clicked", G_CALLBACK( OnBtnAxial ), 0 ); gtk_widget_set_size_request( button, 60, -1 ); } @@ -870,7 +872,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", + button.connect( "clicked", G_CALLBACK( OnBtnFaceFit ), 0 ); gtk_widget_set_size_request( button, 60, -1 ); } @@ -880,7 +882,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 3, 4, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", + button.connect( "clicked", G_CALLBACK( OnBtnPatchdetails ), 0 ); gtk_widget_set_size_request( button, 60, -1 ); } @@ -890,7 +892,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 3, 4, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", + button.connect( "clicked", G_CALLBACK( OnBtnPatchreset ), 0 ); gtk_widget_set_size_request( button, 60, -1 ); } @@ -900,7 +902,7 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 3, 4, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", + button.connect( "clicked", G_CALLBACK( OnBtnPatchnatural ), 0 ); gtk_widget_set_size_request( button, 60, -1 ); } @@ -910,12 +912,12 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_table_attach( GTK_TABLE( table ), button, 3, 4, 3, 4, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), (GtkAttachOptions) ( 0 ), 0, 0 ); - g_signal_connect( G_OBJECT( button ), "clicked", + button.connect( "clicked", G_CALLBACK( OnBtnPatchFit ), 0 ); gtk_widget_set_size_request( button, 60, -1 ); } { - ui::Widget spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ); + auto spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ); spin.show(); gtk_table_attach( GTK_TABLE( table ), spin, 2, 3, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), @@ -924,7 +926,7 @@ ui::Window SurfaceInspector::BuildDialog(){ AddDialogData( *GTK_SPIN_BUTTON( spin ), m_fitHorizontal ); } { - ui::Widget spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ); + auto spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 ); spin.show(); gtk_table_attach( GTK_TABLE( table ), spin, 3, 4, 1, 2, (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), @@ -1048,11 +1050,11 @@ ui::Window SurfaceInspector::BuildDialog(){ gtk_widget_set_size_request( TexTool::g_textoolWin, -1, 240 ); //Yeah! frame.add(TexTool::g_textoolWin); - g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "size_allocate", G_CALLBACK( TexTool::size_allocate ), NULL ); - g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "expose_event", G_CALLBACK( TexTool::expose ), NULL ); - g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "button_press_event", G_CALLBACK( TexTool::button_press ), NULL ); - g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "button_release_event", G_CALLBACK( TexTool::button_release ), NULL ); - g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "motion_notify_event", G_CALLBACK( TexTool::motion ), NULL ); + TexTool::g_textoolWin.connect( "size_allocate", G_CALLBACK( TexTool::size_allocate ), NULL ); + TexTool::g_textoolWin.connect( "expose_event", G_CALLBACK( TexTool::expose ), NULL ); + TexTool::g_textoolWin.connect( "button_press_event", G_CALLBACK( TexTool::button_press ), NULL ); + TexTool::g_textoolWin.connect( "button_release_event", G_CALLBACK( TexTool::button_release ), NULL ); + TexTool::g_textoolWin.connect( "motion_notify_event", G_CALLBACK( TexTool::motion ), NULL ); } { ui::Widget hbox = ui::HBox( FALSE, 5 ); @@ -1071,11 +1073,11 @@ ui::Window SurfaceInspector::BuildDialog(){ // frame.add(hbox); //Hmm. Do we really need g_object_set_data? Mebbe not... And we don't! :-) -// g_object_set_data(G_OBJECT(flipX), "handler", gint_to_pointer(g_signal_connect(G_OBJECT(flipX), "toggled", G_CALLBACK(TexTool::flipX), 0))); -// g_object_set_data(G_OBJECT(flipY), "handler", gint_to_pointer(g_signal_connect(G_OBJECT(flipY), "toggled", G_CALLBACK(TexTool::flipY), 0))); +// g_object_set_data(G_OBJECT(flipX), "handler", gint_to_pointer(flipX.connect("toggled", G_CALLBACK(TexTool::flipX), 0))); +// g_object_set_data(G_OBJECT(flipY), "handler", gint_to_pointer(flipY.connect("toggled", G_CALLBACK(TexTool::flipY), 0))); //Instead, just do: - g_signal_connect( G_OBJECT( flipX ), "toggled", G_CALLBACK( TexTool::flipX ), NULL ); - g_signal_connect( G_OBJECT( flipY ), "toggled", G_CALLBACK( TexTool::flipY ), NULL ); + flipX.connect( "toggled", G_CALLBACK( TexTool::flipX ), NULL ); + flipY.connect( "toggled", G_CALLBACK( TexTool::flipY ), NULL ); } } #endif