]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/surfacedialog.cpp
Wrap GtkAccelGroup
[xonotic/netradiant.git] / radiant / surfacedialog.cpp
index dbd076124ba6ba75de9fd186f69ea6ce94808176..f1597159bd779b686e500c849b5eb19e6d6aa281 100644 (file)
@@ -599,13 +599,13 @@ ui::Window SurfaceInspector::BuildDialog(){
 
        {
                // replaced by only the vbox:
-               ui::Widget vbox = ui::Widget(gtk_vbox_new( FALSE, 5 ));
+               ui::Widget vbox = ui::VBox( FALSE, 5 );
                gtk_widget_show( vbox );
                gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( vbox ) );
                gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
                {
-                       ui::Widget hbox2 = ui::Widget(gtk_hbox_new( FALSE, 5 ));
+                       ui::Widget hbox2 = ui::HBox( FALSE, 5 );
                        gtk_widget_show( hbox2 );
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox2 ), FALSE, FALSE, 0 );
 
@@ -615,7 +615,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
                        }
                        {
-                               GtkEntry* entry = GTK_ENTRY( gtk_entry_new() );
+                               GtkEntry* entry = ui::Entry();
                                gtk_widget_show( GTK_WIDGET( entry ) );
                                gtk_box_pack_start( GTK_BOX( hbox2 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
                                m_texture = entry;
@@ -626,7 +626,7 @@ ui::Window SurfaceInspector::BuildDialog(){
 
 
                {
-                       ui::Widget table = ui::Widget(gtk_table_new( 6, 4, FALSE ));
+                       ui::Widget table = ui::Table( 6, 4, FALSE );
                        gtk_widget_show( table );
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( table ), FALSE, FALSE, 0 );
                        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
@@ -640,7 +640,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 2 ) );
+                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
                                m_hshiftIncrement.m_spin = spin;
                                m_hshiftSpinner.connect( spin );
                                gtk_widget_show( GTK_WIDGET( spin ) );
@@ -658,7 +658,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkEntry* entry = GTK_ENTRY( gtk_entry_new() );
+                               GtkEntry* entry = ui::Entry();
                                gtk_widget_show( GTK_WIDGET( entry ) );
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 0, 1,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -676,7 +676,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 2 ) );
+                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
                                m_vshiftIncrement.m_spin = spin;
                                m_vshiftSpinner.connect( spin );
                                gtk_widget_show( GTK_WIDGET( spin ) );
@@ -694,7 +694,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkEntry* entry = GTK_ENTRY( gtk_entry_new() );
+                               GtkEntry* entry = ui::Entry();
                                gtk_widget_show( GTK_WIDGET( entry ) );
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 1, 2,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -712,7 +712,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 5 ) );
+                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 );
                                m_hscaleIncrement.m_spin = spin;
                                m_hscaleSpinner.connect( spin );
                                gtk_widget_show( GTK_WIDGET( spin ) );
@@ -730,7 +730,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 2, 3 );
                        }
                        {
-                               GtkEntry* entry = GTK_ENTRY( gtk_entry_new() );
+                               GtkEntry* entry = ui::Entry();
                                gtk_widget_show( GTK_WIDGET( entry ) );
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 2, 3,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -748,7 +748,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 5 ) );
+                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 );
                                m_vscaleIncrement.m_spin = spin;
                                m_vscaleSpinner.connect( spin );
                                gtk_widget_show( GTK_WIDGET( spin ) );
@@ -766,7 +766,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkEntry* entry = GTK_ENTRY( gtk_entry_new() );
+                               GtkEntry* entry = ui::Entry();
                                gtk_widget_show( GTK_WIDGET( entry ) );
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 3, 4,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -784,7 +784,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = GTK_SPIN_BUTTON( gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 2 ) );
+                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
                                m_rotateIncrement.m_spin = spin;
                                m_rotateSpinner.connect( spin );
                                gtk_widget_show( GTK_WIDGET( spin ) );
@@ -803,7 +803,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkEntry* entry = GTK_ENTRY( gtk_entry_new() );
+                               GtkEntry* entry = ui::Entry();
                                gtk_widget_show( GTK_WIDGET( entry ) );
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 4, 5,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
@@ -814,7 +814,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                // match grid button
-                               ui::Widget button = ui::Widget(gtk_button_new_with_label( "Match Grid" ));
+                               ui::Widget button = ui::Button( "Match Grid" );
                                gtk_widget_show( button );
                                gtk_table_attach( GTK_TABLE( table ), button, 2, 4, 5, 6,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -828,7 +828,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                        gtk_widget_show( frame );
                        gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), FALSE, FALSE, 0 );
                        {
-                               ui::Widget table = ui::Widget(gtk_table_new( 4, 4, FALSE ));
+                               ui::Widget table = ui::Table( 4, 4, FALSE );
                                gtk_widget_show( table );
                                gtk_container_add( GTK_CONTAINER( frame ), table );
                                gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
@@ -863,7 +863,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                }
                                {
-                                       ui::Widget button = ui::Widget(gtk_button_new_with_label( "Axial" ));
+                                       ui::Widget button = ui::Button( "Axial" );
                                        gtk_widget_show( button );
                                        gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -873,7 +873,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                        gtk_widget_set_usize( button, 60, -2 );
                                }
                                {
-                                       ui::Widget button = ui::Widget(gtk_button_new_with_label( "Fit" ));
+                                       ui::Widget button = ui::Button( "Fit" );
                                        gtk_widget_show( button );
                                        gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -883,7 +883,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                        gtk_widget_set_usize( button, 60, -2 );
                                }
                                {
-                                       ui::Widget button = ui::Widget(gtk_button_new_with_label( "CAP" ));
+                                       ui::Widget button = ui::Button( "CAP" );
                                        gtk_widget_show( button );
                                        gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -893,7 +893,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                        gtk_widget_set_usize( button, 60, -2 );
                                }
                                {
-                                       ui::Widget button = ui::Widget(gtk_button_new_with_label( "Set..." ));
+                                       ui::Widget button = ui::Button( "Set..." );
                                        gtk_widget_show( button );
                                        gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -903,7 +903,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                        gtk_widget_set_usize( button, 60, -2 );
                                }
                                {
-                                       ui::Widget button = ui::Widget(gtk_button_new_with_label( "Natural" ));
+                                       ui::Widget button = ui::Button( "Natural" );
                                        gtk_widget_show( button );
                                        gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -913,7 +913,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                        gtk_widget_set_usize( button, 60, -2 );
                                }
                                {
-                                       ui::Widget button = ui::Widget(gtk_button_new_with_label( "Fit" ));
+                                       ui::Widget button = ui::Button( "Fit" );
                                        gtk_widget_show( button );
                                        gtk_table_attach( GTK_TABLE( table ), button, 3, 4, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -923,7 +923,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                        gtk_widget_set_usize( button, 60, -2 );
                                }
                                {
-                                       ui::Widget spin = ui::Widget(gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 0, 1 << 16, 1, 10, 0 ) ), 0, 6 ));
+                                       ui::Widget spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 );
                                        gtk_widget_show( spin );
                                        gtk_table_attach( GTK_TABLE( table ), spin, 2, 3, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -932,7 +932,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                        AddDialogData( *GTK_SPIN_BUTTON( spin ), m_fitHorizontal );
                                }
                                {
-                                       ui::Widget spin = ui::Widget(gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 0, 1 << 16, 1, 10, 0 ) ), 0, 6 ));
+                                       ui::Widget spin = ui::SpinButton( ui::Adjustment( 1, 0, 1 << 16, 1, 10, 0 ), 0, 6 );
                                        gtk_widget_show( spin );
                                        gtk_table_attach( GTK_TABLE( table ), spin, 3, 4, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -948,12 +948,12 @@ ui::Window SurfaceInspector::BuildDialog(){
                                gtk_widget_show( GTK_WIDGET( frame ) );
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
                                {
-                                       GtkVBox* vbox3 = GTK_VBOX( gtk_vbox_new( FALSE, 4 ) );
+                                       GtkVBox* vbox3 = ui::VBox( FALSE, 4 );
                                        //gtk_container_set_border_width(GTK_CONTAINER(vbox3), 4);
                                        gtk_widget_show( GTK_WIDGET( vbox3 ) );
                                        gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
                                        {
-                                               GtkTable* table = GTK_TABLE( gtk_table_new( 8, 4, FALSE ) );
+                                               GtkTable* table = ui::Table( 8, 4, FALSE );
                                                gtk_widget_show( GTK_WIDGET( table ) );
                                                gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                                gtk_table_set_row_spacings( table, 0 );
@@ -965,7 +965,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                {
                                                        for ( int r = 0; r != 8; ++r )
                                                        {
-                                                               GtkCheckButton* check = GTK_CHECK_BUTTON( gtk_check_button_new_with_label( getSurfaceFlagName( c * 8 + r ) ) );
+                                                               GtkCheckButton* check = ui::CheckButton( getSurfaceFlagName( c * 8 + r ) );
                                                                gtk_widget_show( GTK_WIDGET( check ) );
                                                                gtk_table_attach( table, GTK_WIDGET( check ), c, c + 1, r, r + 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
@@ -983,13 +983,13 @@ ui::Window SurfaceInspector::BuildDialog(){
                                gtk_widget_show( GTK_WIDGET( frame ) );
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
                                {
-                                       GtkVBox* vbox3 = GTK_VBOX( gtk_vbox_new( FALSE, 4 ) );
+                                       GtkVBox* vbox3 = ui::VBox( FALSE, 4 );
                                        //gtk_container_set_border_width(GTK_CONTAINER(vbox3), 4);
                                        gtk_widget_show( GTK_WIDGET( vbox3 ) );
                                        gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
                                        {
 
-                                               GtkTable* table = GTK_TABLE( gtk_table_new( 8, 4, FALSE ) );
+                                               GtkTable* table = ui::Table( 8, 4, FALSE );
                                                gtk_widget_show( GTK_WIDGET( table ) );
                                                gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                                gtk_table_set_row_spacings( table, 0 );
@@ -1001,7 +1001,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                {
                                                        for ( int r = 0; r != 8; ++r )
                                                        {
-                                                               GtkCheckButton* check = GTK_CHECK_BUTTON( gtk_check_button_new_with_label( getContentFlagName( c * 8 + r ) ) );
+                                                               GtkCheckButton* check = ui::CheckButton( getContentFlagName( c * 8 + r ) );
                                                                gtk_widget_show( GTK_WIDGET( check ) );
                                                                gtk_table_attach( table, GTK_WIDGET( check ), c, c + 1, r, r + 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
@@ -1022,13 +1022,13 @@ ui::Window SurfaceInspector::BuildDialog(){
                                gtk_widget_show( GTK_WIDGET( frame ) );
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( frame ), TRUE, TRUE, 0 );
                                {
-                                       GtkVBox* vbox3 = GTK_VBOX( gtk_vbox_new( FALSE, 4 ) );
+                                       GtkVBox* vbox3 = ui::VBox( FALSE, 4 );
                                        gtk_container_set_border_width( GTK_CONTAINER( vbox3 ), 4 );
                                        gtk_widget_show( GTK_WIDGET( vbox3 ) );
                                        gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
 
                                        {
-                                               GtkEntry* entry = GTK_ENTRY( gtk_entry_new() );
+                                               GtkEntry* entry = ui::Entry();
                                                gtk_widget_show( GTK_WIDGET( entry ) );
                                                gtk_box_pack_start( GTK_BOX( vbox3 ), GTK_WIDGET( entry ), TRUE, TRUE, 0 );
                                                m_valueEntryWidget = entry;
@@ -1063,12 +1063,12 @@ ui::Window SurfaceInspector::BuildDialog(){
                                g_signal_connect( G_OBJECT( TexTool::g_textoolWin ), "motion_notify_event", G_CALLBACK( TexTool::motion ), NULL );
                        }
                        {
-                               ui::Widget hbox = gtk_hbox_new( FALSE, 5 );
+                               ui::Widget hbox = ui::HBox( FALSE, 5 );
                                gtk_widget_show( hbox );
                                gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, FALSE, 0 );
                                // Checkboxes go here... (Flip X/Y)
-                               ui::Widget flipX = gtk_check_button_new_with_label( "Flip X axis" );
-                               ui::Widget flipY = gtk_check_button_new_with_label( "Flip Y axis" );
+                               ui::Widget flipX = ui::CheckButton( "Flip X axis" );
+                               ui::Widget flipY = ui::CheckButton( "Flip Y axis" );
                                gtk_widget_show( flipX );
                                gtk_widget_show( flipY );
                                gtk_box_pack_start( GTK_BOX( hbox ), flipX, FALSE, FALSE, 0 );