]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/surfacedialog.cpp
Remove <gtk/gtk.h> from most of radiant/*
[xonotic/netradiant.git] / radiant / surfacedialog.cpp
index 2a2d09821c13c478757ca24b038d985643d5b1d3..6b0961357cc0171727ba51d4464ebab2ec1a7950 100644 (file)
@@ -35,7 +35,6 @@
 #include "iundo.h"
 #include "iselection.h"
 
-#include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
 
 #include "signal/isignal.h"
@@ -120,8 +119,8 @@ class Increment
 float& m_f;
 public:
 GtkSpinButton* m_spin;
-GtkEntry* m_entry;
-Increment( float& f ) : m_f( f ), m_spin( 0 ), m_entry( 0 ){
+ui::Entry m_entry;
+Increment( float& f ) : m_f( f ), m_spin( 0 ), m_entry( nullptr ){
 }
 void cancel(){
        entry_set_float( m_entry, m_f );
@@ -158,7 +157,7 @@ GtkCheckButton* m_surfaceFlags[32];
 GtkCheckButton* m_contentFlags[32];
 
 NonModalEntry m_valueEntry;
-GtkEntry* m_valueEntryWidget;
+ui::Entry m_valueEntryWidget{nullptr};
 public:
 WindowPositionTracker m_positionTracker;
 WindowPositionTrackerImportStringCaller m_importPosition;
@@ -608,7 +607,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
                        }
                        {
-                               GtkEntry* entry = ui::Entry();
+                               auto 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,17 +625,17 @@ ui::Window SurfaceInspector::BuildDialog(){
                        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
                        {
                                ui::Widget label = ui::Label( "Horizontal shift" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
                                gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
+                               auto 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 ) );
+                               spin.show();
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( spin ), 1, 2, 0, 1,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -644,15 +643,15 @@ ui::Window SurfaceInspector::BuildDialog(){
                        }
                        {
                                ui::Widget label = ui::Label( "Step" );
-                               gtk_widget_show( label );
+                               label.show();
                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
                                gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 0, 1,
                                                                  (GtkAttachOptions) ( GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkEntry* entry = ui::Entry();
-                               gtk_widget_show( GTK_WIDGET( entry ) );
+                               auto entry = ui::Entry();
+                               entry.show();
                                gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( entry ), 3, 4, 0, 1,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
@@ -669,7 +668,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
+                               auto 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 ) );
@@ -687,7 +686,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkEntry* entry = ui::Entry();
+                               auto 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 ),
@@ -705,7 +704,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 );
+                               auto 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 ) );
@@ -723,7 +722,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 2, 3 );
                        }
                        {
-                               GtkEntry* entry = ui::Entry();
+                               auto 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 ),
@@ -741,7 +740,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 5 );
+                               auto 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 ) );
@@ -759,7 +758,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkEntry* entry = ui::Entry();
+                               auto 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 ),
@@ -777,7 +776,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkSpinButton* spin = ui::SpinButton( ui::Adjustment( 0, -8192, 8192, 2, 8, 0 ), 0, 2 );
+                               auto 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 ) );
@@ -796,7 +795,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                        }
                        {
-                               GtkEntry* entry = ui::Entry();
+                               auto 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 ),
@@ -1021,7 +1020,7 @@ ui::Window SurfaceInspector::BuildDialog(){
                                        gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( vbox3 ) );
 
                                        {
-                                               GtkEntry* entry = ui::Entry();
+                                               auto 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;