GTK: wrap GTK_WIDGET
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 29 Dec 2017 11:39:44 +0000 (22:39 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 29 Dec 2017 11:39:44 +0000 (22:39 +1100)
35 files changed:
contrib/brushexport/callbacks.cpp
contrib/brushexport/callbacks.h
contrib/camera/dialogs.cpp
contrib/gtkgensurf/bitmap.cpp
contrib/gtkgensurf/gendlgs.cpp
contrib/prtview/ConfigDialog.cpp
libs/gtkutil/accelerator.cpp
libs/gtkutil/cursor.cpp
libs/gtkutil/dialog.cpp
libs/gtkutil/menu.cpp
libs/gtkutil/messagebox.cpp
libs/gtkutil/nonmodal.cpp
libs/gtkutil/paned.cpp
libs/gtkutil/toolbar.cpp
libs/gtkutil/window.cpp
libs/uilib/uilib.h
radiant/build.cpp
radiant/commands.cpp
radiant/dialog.cpp
radiant/entity.cpp
radiant/entityinspector.cpp
radiant/entitylist.cpp
radiant/gtkdlgs.cpp
radiant/mainframe.cpp
radiant/map.cpp
radiant/mru.cpp
radiant/patchdialog.cpp
radiant/patchmanip.cpp
radiant/pluginmenu.cpp
radiant/plugintoolbar.cpp
radiant/preferences.cpp
radiant/select.cpp
radiant/surfacedialog.cpp
radiant/texwindow.cpp
radiant/xywindow.cpp

index fd6a600..c09ae13 100644 (file)
@@ -13,12 +13,12 @@ void DestroyWindow();
 
 namespace callbacks {
 
 
 namespace callbacks {
 
-void OnDestroy( GtkWidget* w, gpointer data ){
+void OnDestroy( ui::Widget w, gpointer data ){
        DestroyWindow();
 }
 
        DestroyWindow();
 }
 
-void OnExportClicked( GtkButton* button, gpointer user_data ){
-       ui::Widget window = lookup_widget( GTK_WIDGET( button ), "w_plugplug2" );
+void OnExportClicked( ui::Button button, gpointer user_data ){
+       ui::Widget window = lookup_widget( button , "w_plugplug2" );
        ASSERT_TRUE( window );
        const char* cpath = GlobalRadiant().m_pfnFileDialog( window, false, "Save as Obj", 0, 0, false, false, true );
        if ( !cpath ) {
        ASSERT_TRUE( window );
        const char* cpath = GlobalRadiant().m_pfnFileDialog( window, false, "Save as Obj", 0, 0, false, false, true );
        if ( !cpath ) {
@@ -30,7 +30,7 @@ void OnExportClicked( GtkButton* button, gpointer user_data ){
        // get ignore list from ui
        std::set<std::string> ignore;
 
        // get ignore list from ui
        std::set<std::string> ignore;
 
-       GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) );
+       GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( button , "t_materialist" ) );
        ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( view ) ));
 
        GtkTreeIter iter;
        ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( view ) ));
 
        GtkTreeIter iter;
@@ -51,7 +51,7 @@ void OnExportClicked( GtkButton* button, gpointer user_data ){
        // collapse mode
        collapsemode mode = COLLAPSE_NONE;
 
        // collapse mode
        collapsemode mode = COLLAPSE_NONE;
 
-       GtkWidget* radio = lookup_widget( GTK_WIDGET( button ), "r_collapse" );
+       GtkWidget* radio = lookup_widget( button , "r_collapse" );
        ASSERT_NOTNULL( radio );
 
        if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) ) {
        ASSERT_NOTNULL( radio );
 
        if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) ) {
@@ -59,14 +59,14 @@ void OnExportClicked( GtkButton* button, gpointer user_data ){
        }
        else
        {
        }
        else
        {
-               radio = lookup_widget( GTK_WIDGET( button ), "r_collapsebymaterial" );
+               radio = lookup_widget( button , "r_collapsebymaterial" );
                ASSERT_NOTNULL( radio );
                if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) ) {
                        mode = COLLAPSE_BY_MATERIAL;
                }
                else
                {
                ASSERT_NOTNULL( radio );
                if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) ) {
                        mode = COLLAPSE_BY_MATERIAL;
                }
                else
                {
-                       radio = lookup_widget( GTK_WIDGET( button ), "r_nocollapse" );
+                       radio = lookup_widget( button , "r_nocollapse" );
                        ASSERT_NOTNULL( radio );
                        ASSERT_TRUE( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) );
                        mode = COLLAPSE_NONE;
                        ASSERT_NOTNULL( radio );
                        ASSERT_TRUE( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) );
                        mode = COLLAPSE_NONE;
@@ -74,7 +74,7 @@ void OnExportClicked( GtkButton* button, gpointer user_data ){
        }
 
        // export materials?
        }
 
        // export materials?
-       GtkWidget* toggle = lookup_widget( GTK_WIDGET( button ), "t_exportmaterials" );
+       GtkWidget* toggle = lookup_widget( button , "t_exportmaterials" );
        ASSERT_NOTNULL( toggle );
 
        bool exportmat = FALSE;
        ASSERT_NOTNULL( toggle );
 
        bool exportmat = FALSE;
@@ -84,7 +84,7 @@ void OnExportClicked( GtkButton* button, gpointer user_data ){
        }
 
        // limit material names?
        }
 
        // limit material names?
-       toggle = lookup_widget( GTK_WIDGET( button ), "t_limitmatnames" );
+       toggle = lookup_widget( button , "t_limitmatnames" );
        ASSERT_NOTNULL( toggle );
 
        bool limitMatNames = FALSE;
        ASSERT_NOTNULL( toggle );
 
        bool limitMatNames = FALSE;
@@ -94,7 +94,7 @@ void OnExportClicked( GtkButton* button, gpointer user_data ){
        }
 
        // create objects instead of groups?
        }
 
        // create objects instead of groups?
-       toggle = lookup_widget( GTK_WIDGET( button ), "t_objects" );
+       toggle = lookup_widget( button , "t_objects" );
        ASSERT_NOTNULL( toggle );
 
        bool objects = FALSE;
        ASSERT_NOTNULL( toggle );
 
        bool objects = FALSE;
@@ -107,20 +107,20 @@ void OnExportClicked( GtkButton* button, gpointer user_data ){
        ExportSelection( ignore, mode, exportmat, path, limitMatNames, objects );
 }
 
        ExportSelection( ignore, mode, exportmat, path, limitMatNames, objects );
 }
 
-void OnAddMaterial( GtkButton* button, gpointer user_data ){
-       GtkEntry* edit = GTK_ENTRY( lookup_widget( GTK_WIDGET( button ), "ed_materialname" ) );
+void OnAddMaterial( ui::Button button, gpointer user_data ){
+       GtkEntry* edit = GTK_ENTRY( lookup_widget( button , "ed_materialname" ) );
        ASSERT_NOTNULL( edit );
 
        const gchar* name = gtk_entry_get_text( edit );
        if ( g_utf8_strlen( name, -1 ) > 0 ) {
        ASSERT_NOTNULL( edit );
 
        const gchar* name = gtk_entry_get_text( edit );
        if ( g_utf8_strlen( name, -1 ) > 0 ) {
-               ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) ) ) ));
+               ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( GTK_TREE_VIEW( lookup_widget( button , "t_materialist" ) ) ) ));
                list.append(0, name);
                gtk_entry_set_text( edit, "" );
        }
 }
 
                list.append(0, name);
                gtk_entry_set_text( edit, "" );
        }
 }
 
-void OnRemoveMaterial( GtkButton* button, gpointer user_data ){
-       GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) );
+void OnRemoveMaterial( ui::Button button, gpointer user_data ){
+       GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( button , "t_materialist" ) );
        ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( view ) ));
        GtkTreeSelection* sel = gtk_tree_view_get_selection( view );
 
        ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( view ) ));
        GtkTreeSelection* sel = gtk_tree_view_get_selection( view );
 
@@ -130,17 +130,17 @@ void OnRemoveMaterial( GtkButton* button, gpointer user_data ){
        }
 }
 
        }
 }
 
-void OnExportMatClicked( GtkButton* button, gpointer user_data ){
-       GtkWidget* toggleLimit = lookup_widget( GTK_WIDGET( button ), "t_limitmatnames" );
-       GtkWidget* toggleObject = lookup_widget( GTK_WIDGET( button ), "t_objects" );
+void OnExportMatClicked( ui::Button button, gpointer user_data ){
+       GtkWidget* toggleLimit = lookup_widget( button , "t_limitmatnames" );
+       GtkWidget* toggleObject = lookup_widget( button , "t_objects" );
 
        if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ) ) ) {
 
        if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( button ) ) ) {
-               gtk_widget_set_sensitive( GTK_WIDGET( toggleLimit ), TRUE );
-               gtk_widget_set_sensitive( GTK_WIDGET( toggleObject ), TRUE );
+               gtk_widget_set_sensitive( toggleLimit , TRUE );
+               gtk_widget_set_sensitive( toggleObject , TRUE );
        }
        else {
        }
        else {
-               gtk_widget_set_sensitive( GTK_WIDGET( toggleLimit ), FALSE );
-               gtk_widget_set_sensitive( GTK_WIDGET( toggleObject ), FALSE );
+               gtk_widget_set_sensitive( toggleLimit , FALSE );
+               gtk_widget_set_sensitive( toggleObject , FALSE );
        }
 }
 
        }
 }
 
index eece65a..ca4b9a1 100644 (file)
@@ -1,10 +1,12 @@
 
 
+#include <uilib/uilib.h>
+
 namespace callbacks {
 
 namespace callbacks {
 
-void OnDestroy( GtkWidget *, gpointer );
-void OnExportClicked( GtkButton *, gpointer );
-void OnAddMaterial( GtkButton *, gpointer );
-void OnRemoveMaterial( GtkButton *, gpointer );
-void OnExportMatClicked( GtkButton * button, gpointer );
+void OnDestroy( ui::Widget, gpointer );
+void OnExportClicked( ui::Button, gpointer );
+void OnAddMaterial( ui::Button, gpointer );
+void OnRemoveMaterial( ui::Button, gpointer );
+void OnExportMatClicked( ui::Button button, gpointer );
 
 } // callbacks
 
 } // callbacks
index b8f6568..e236623 100644 (file)
@@ -611,7 +611,7 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){
 
                                // Select the last item in the listbox
                                li = g_list_last( GTK_LIST( GTK_COMBO( g_pPathListCombo )->list )->children );
 
                                // Select the last item in the listbox
                                li = g_list_last( GTK_LIST( GTK_COMBO( g_pPathListCombo )->list )->children );
-                               gtk_list_select_child( GTK_LIST( GTK_COMBO( g_pPathListCombo )->list ), GTK_WIDGET( li->data ) );
+                               gtk_list_select_child( GTK_LIST( GTK_COMBO( g_pPathListCombo )->list ), li->data  );
 
                                // If this was the first one, refresh the event list
                                if ( GetCurrentCam()->GetCam()->numTargets() == 1 ) {
 
                                // If this was the first one, refresh the event list
                                if ( GetCurrentCam()->GetCam()->numTargets() == 1 ) {
@@ -675,7 +675,7 @@ void RefreshCamListCombo( void ){
                combo_cam = firstCam;
                while ( li && combo_cam ) {
                        if ( combo_cam == GetCurrentCam() ) {
                combo_cam = firstCam;
                while ( li && combo_cam ) {
                        if ( combo_cam == GetCurrentCam() ) {
-                               gtk_list_select_child( GTK_LIST( GTK_COMBO( g_pCamListCombo )->list ), GTK_WIDGET( li->data ) );
+                               gtk_list_select_child( GTK_LIST( GTK_COMBO( g_pCamListCombo )->list ), li->data  );
                                break;
                        }
                        li = li->next;
                                break;
                        }
                        li = li->next;
index 2ca7e6b..68eea5c 100644 (file)
@@ -438,7 +438,7 @@ bool OpenBitmap(){
 
        if ( g_pWnd ) {
                gtk_entry_set_text( GTK_ENTRY( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_file" ) ), gbmp.name );
 
        if ( g_pWnd ) {
                gtk_entry_set_text( GTK_ENTRY( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_file" ) ), gbmp.name );
-               gtk_widget_set_sensitive( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_reload" ) ),
+               gtk_widget_set_sensitive( g_object_get_data( G_OBJECT( g_pWnd , "bmp_reload" ) ),
                                                                  strlen( gbmp.name ) ? TRUE : FALSE );
 
                UpdatePreview( true );
                                                                  strlen( gbmp.name ) ? TRUE : FALSE );
 
                UpdatePreview( true );
index 0097893..a6545f3 100644 (file)
@@ -32,7 +32,7 @@
 //#define BUFF_SIZE    32768
 
 #define ENABLE_WIDGET( name,enable ) \
 //#define BUFF_SIZE    32768
 
 #define ENABLE_WIDGET( name,enable ) \
-       gtk_widget_set_sensitive( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), ( name ) ) ), ( enable ) )
+       gtk_widget_set_sensitive( g_object_get_data( G_OBJECT( g_pWnd , ( name ) ) ), ( enable ) )
 #define CHECK_WIDGET( name,check ) \
        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( g_object_get_data( G_OBJECT( g_pWnd ), name ) ), check )
 
 #define CHECK_WIDGET( name,check ) \
        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( g_object_get_data( G_OBJECT( g_pWnd ), name ) ), check )
 
@@ -111,12 +111,12 @@ static void SetupControls(){
 
        case EXTENTS_TAB:
                if ( Game != QUAKE3 ) {
 
        case EXTENTS_TAB:
                if ( Game != QUAKE3 ) {
-                       gtk_widget_hide( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "use_patches" ) ) );
+                       gtk_widget_hide( g_object_get_data( G_OBJECT( g_pWnd , "use_patches" ) ) );
                        ENABLE_WIDGET( "use_patches", FALSE );
                }
                else
                {
                        ENABLE_WIDGET( "use_patches", FALSE );
                }
                else
                {
-                       gtk_widget_show( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "use_patches" ) ) );
+                       gtk_widget_show( g_object_get_data( G_OBJECT( g_pWnd , "use_patches" ) ) );
                        ENABLE_WIDGET( "use_patches", TRUE );
                }
 
                        ENABLE_WIDGET( "use_patches", TRUE );
                }
 
@@ -316,7 +316,7 @@ static void SetDlgValues( int tab ){
                                                                  Decimate );
 
                if ( Game == QUAKE3 && UsePatches ) {
                                                                  Decimate );
 
                if ( Game == QUAKE3 && UsePatches ) {
-                       gtk_widget_set_sensitive( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "decimate" ) ), FALSE );
+                       gtk_widget_set_sensitive( g_object_get_data( G_OBJECT( g_pWnd , "decimate" ) ), FALSE );
 
                        if ( NH % 2 ) {
                                NH++;
 
                        if ( NH % 2 ) {
                                NH++;
@@ -363,7 +363,7 @@ static void SetDlgValues( int tab ){
                }
                else
                {
                }
                else
                {
-                       gtk_widget_set_sensitive( GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "decimate" ) ), TRUE );
+                       gtk_widget_set_sensitive( g_object_get_data( G_OBJECT( g_pWnd , "decimate" ) ), TRUE );
 
                        gpointer spin = g_object_get_data( G_OBJECT( g_pWnd ), "nh" );
                        GtkAdjustment *adj = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
 
                        gpointer spin = g_object_get_data( G_OBJECT( g_pWnd ), "nh" );
                        GtkAdjustment *adj = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) );
@@ -718,7 +718,7 @@ static void main_about( GtkWidget *widget, gpointer data ){
 }
 
 static void main_go( GtkWidget *widget, gpointer data ){
 }
 
 static void main_go( GtkWidget *widget, gpointer data ){
-       GtkWidget *notebook = GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "notebook" ) );
+       GtkWidget *notebook = g_object_get_data( G_OBJECT( g_pWnd , "notebook" ) );
        char Text[256];
 
        ReadDlgValues( current_tab );
        char Text[256];
 
        ReadDlgValues( current_tab );
@@ -1100,19 +1100,19 @@ void create_tooltips(){
 
        // Main
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
 
        // Main
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "go" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "go" ) ),
                                                  "Accept all input and generate a surface in Q3Radiant",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Accept all input and generate a surface in Q3Radiant",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "open" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "open" ) ),
                                                  "Open a previously saved GenSurf settings file.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Open a previously saved GenSurf settings file.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "save" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "save" ) ),
                                                  "Save all settings to a file.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Save all settings to a file.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "defaults" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "defaults" ) ),
                                                  "Restore default values from DEFAULTS.SRF. If this file does not exist, GenSurf "
                                                  "initializes all input parameters to reasonable values. You can create your own "
                                                  "default surface by setting all parameters to your liking, then saving a settings "
                                                  "Restore default values from DEFAULTS.SRF. If this file does not exist, GenSurf "
                                                  "initializes all input parameters to reasonable values. You can create your own "
                                                  "default surface by setting all parameters to your liking, then saving a settings "
@@ -1120,105 +1120,105 @@ void create_tooltips(){
                                                  "" );
 
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "" );
 
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "main_preview" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "main_preview" ) ),
                                                  "View a wire-frame representation of the surface",
                                                  "" );
 
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "View a wire-frame representation of the surface",
                                                  "" );
 
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "main_antialiasing" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "main_antialiasing" ) ),
                                                  "The lines in the preview window are antialiased for better quality",
                                                  "" );
 
        // General tab
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "The lines in the preview window are antialiased for better quality",
                                                  "" );
 
        // General tab
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( wave_radios[0] ),
+                                                 wave_radios[0] ,
                                                  "Builds a surface with alternating hills and valleys. Uses the general form Z=cos(X) "
                                                  "x sin(Y)",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Builds a surface with alternating hills and valleys. Uses the general form Z=cos(X) "
                                                  "x sin(Y)",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( wave_radios[1] ),
+                                                 wave_radios[1] ,
                                                  "Builds a surface with ridges parallel to the vertical axis.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Builds a surface with ridges parallel to the vertical axis.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( wave_radios[2] ),
+                                                 wave_radios[2] ,
                                                  "Builds a surface with ridges parallel to the horizontal axis.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Builds a surface with ridges parallel to the horizontal axis.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( wave_radios[3] ),
+                                                 wave_radios[3] ,
                                                  "Builds a map from a bitmap image representing a contour plot. Click the \"Bitmap\" "
                                                  "tab to select the image. GenSurf only supports 256-color (8 bit) "
                                                  "bitmaps. GenSurf will work with any 256-color bitmap, but gray scale bitmaps are a bit "
                                                  "more intuitive.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Builds a map from a bitmap image representing a contour plot. Click the \"Bitmap\" "
                                                  "tab to select the image. GenSurf only supports 256-color (8 bit) "
                                                  "bitmaps. GenSurf will work with any 256-color bitmap, but gray scale bitmaps are a bit "
                                                  "more intuitive.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( wave_radios[4] ),
+                                                 wave_radios[4] ,
                                                  "Builds a random surface using the Plasma Cloud technique. Variance is controlled "
                                                  "by the Roughness input. To build a surface with completely random values not "
                                                  "dependent on neighboring vertices, use one of the other waveforms with 0 amplitude.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Builds a random surface using the Plasma Cloud technique. Variance is controlled "
                                                  "by the Roughness input. To build a surface with completely random values not "
                                                  "dependent on neighboring vertices, use one of the other waveforms with 0 amplitude.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "wavelength" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "wavelength" ) ),
                                                  "Enter the wavelength (distance between crests). NOTE: Wavelengths equal to the grid "
                                                  "size or 2 times the grid size will result in 0 amplitudes. For best results, the "
                                                  "wavelength value should be at least 4 times the grid size (extents divided by the "
                                                  "number of divisions",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the wavelength (distance between crests). NOTE: Wavelengths equal to the grid "
                                                  "size or 2 times the grid size will result in 0 amplitudes. For best results, the "
                                                  "wavelength value should be at least 4 times the grid size (extents divided by the "
                                                  "number of divisions",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "amplitude" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "amplitude" ) ),
                                                  "Enter the height of hills/ridges.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the height of hills/ridges.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "roughness" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "roughness" ) ),
                                                  "Enter the roughness value (noise) for the surface. For fractal surfaces, this value "
                                                  "is used as a variance in the fractal calculations.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the roughness value (noise) for the surface. For fractal surfaces, this value "
                                                  "is used as a variance in the fractal calculations.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "random" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "random" ) ),
                                                  "Seed value for the pseudo-random number generator.",
                                                  "" );
        // Extents tab
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Seed value for the pseudo-random number generator.",
                                                  "" );
        // Extents tab
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "hmin" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "hmin" ) ),
                                                  "Minimum horizontal coordinate of the surface, i.e. X for a surface parallel to "
                                                  "the XY or XZ planes, Y for a surface parallel to the YZ plane. For best results, "
                                                  "the extents (maximum-minimum values) in a given direction should be evenly "
                                                  "divisible by the number of divisions in that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Minimum horizontal coordinate of the surface, i.e. X for a surface parallel to "
                                                  "the XY or XZ planes, Y for a surface parallel to the YZ plane. For best results, "
                                                  "the extents (maximum-minimum values) in a given direction should be evenly "
                                                  "divisible by the number of divisions in that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "hmax" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "hmax" ) ),
                                                  "Maximum horizontal coordinate of the surface, i.e. X for a surface parallel to "
                                                  "the XY or XZ planes, Y for a surface parallel to the YZ plane. For best results, "
                                                  "the extents (maximum-minimum values) in a given direction should be evenly "
                                                  "divisible by the number of divisions in that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Maximum horizontal coordinate of the surface, i.e. X for a surface parallel to "
                                                  "the XY or XZ planes, Y for a surface parallel to the YZ plane. For best results, "
                                                  "the extents (maximum-minimum values) in a given direction should be evenly "
                                                  "divisible by the number of divisions in that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "vmin" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "vmin" ) ),
                                                  "Minimum vertical coordinate of the surface, i.e. Y for a surface parallel to "
                                                  "the XY plane, Z for a surface parallel to the XZ or YZ planes. For best results, "
                                                  "the extents (maximum-minimum values) in a given direction should be evenly "
                                                  "divisible by the number of divisions in that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Minimum vertical coordinate of the surface, i.e. Y for a surface parallel to "
                                                  "the XY plane, Z for a surface parallel to the XZ or YZ planes. For best results, "
                                                  "the extents (maximum-minimum values) in a given direction should be evenly "
                                                  "divisible by the number of divisions in that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "vmax" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "vmax" ) ),
                                                  "Maximum vertical coordinate of the surface, i.e. Y for a surface parallel to "
                                                  "the XY plane, Z for a surface parallel to the XZ or YZ planes. For best results, "
                                                  "the extents (maximum-minimum values) in a given direction should be evenly "
                                                  "divisible by the number of divisions in that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Maximum vertical coordinate of the surface, i.e. Y for a surface parallel to "
                                                  "the XY plane, Z for a surface parallel to the XZ or YZ planes. For best results, "
                                                  "the extents (maximum-minimum values) in a given direction should be evenly "
                                                  "divisible by the number of divisions in that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "nh" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "nh" ) ),
                                                  "Number of divisions in the horizontal direction. For best results, the extents "
                                                  "in a given direction should be evenly divisible by the number of divisions in "
                                                  "that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Number of divisions in the horizontal direction. For best results, the extents "
                                                  "in a given direction should be evenly divisible by the number of divisions in "
                                                  "that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "nv" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "nv" ) ),
                                                  "Number of divisions in the vertical direction. For best results, the extents "
                                                  "in a given direction should be evenly divisible by the number of divisions in "
                                                  "that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Number of divisions in the vertical direction. For best results, the extents "
                                                  "in a given direction should be evenly divisible by the number of divisions in "
                                                  "that direction.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "use_patches" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "use_patches" ) ),
                                                  "Produce one or more curved patches in the shape of your selected surface rather "
                                                  "than producing solid brushes. Depending on the size of your surface (and the "
                                                  "user's graphic detail settings, which you cannot control), curved surfaces will "
                                                  "Produce one or more curved patches in the shape of your selected surface rather "
                                                  "than producing solid brushes. Depending on the size of your surface (and the "
                                                  "user's graphic detail settings, which you cannot control), curved surfaces will "
@@ -1226,7 +1226,7 @@ void create_tooltips(){
                                                  "concerning curved surfaces on the GenSurf web page before using this feature.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "concerning curved surfaces on the GenSurf web page before using this feature.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "decimate" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "decimate" ) ),
                                                  "Use the slider to control the number of vertices discarded by GenSurf. For many "
                                                  "surfaces, you can produce roughly the same shape surface with a high decimation "
                                                  "value. This will generally result in a map with lower polygon counts (and better "
                                                  "Use the slider to control the number of vertices discarded by GenSurf. For many "
                                                  "surfaces, you can produce roughly the same shape surface with a high decimation "
                                                  "value. This will generally result in a map with lower polygon counts (and better "
@@ -1234,71 +1234,71 @@ void create_tooltips(){
                                                  "surfaces in Q3",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "surfaces in Q3",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "z00" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "z00" ) ),
                                                  "Enter the height of the surface at the lower left corner. This value will likely "
                                                  "be modified unless \"Linear Borders\" is checked.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the height of the surface at the lower left corner. This value will likely "
                                                  "be modified unless \"Linear Borders\" is checked.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "z01" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "z01" ) ),
                                                  "Enter the height of the surface at the upper left corner. This value will likely "
                                                  "be modified unless \"Linear Borders\" is checked.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the height of the surface at the upper left corner. This value will likely "
                                                  "be modified unless \"Linear Borders\" is checked.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "z10" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "z10" ) ),
                                                  "Enter the height of the surface at the lower right corner. This value will likely "
                                                  "be modified unless \"Linear Borders\" is checked.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the height of the surface at the lower right corner. This value will likely "
                                                  "be modified unless \"Linear Borders\" is checked.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "z11" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "z11" ) ),
                                                  "Enter the height of the surface at the upper right corner. This value will likely "
                                                  "be modified unless \"Linear Borders\" is checked.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the height of the surface at the upper right corner. This value will likely "
                                                  "be modified unless \"Linear Borders\" is checked.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "linearborder" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "linearborder" ) ),
                                                  "Restrict the edges of the surface to a straight line. This will help match up "
                                                  "brush edges if you drop this surface into another map.",
                                                  "" );
        // Bitmap tab
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Restrict the edges of the surface to a straight line. This will help match up "
                                                  "brush edges if you drop this surface into another map.",
                                                  "" );
        // Bitmap tab
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_file" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "bmp_file" ) ),
                                                  "Type the name of an 8-bit bitmap image file, or click Browse to select an image "
                                                  "from a list of those available on your system.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Type the name of an 8-bit bitmap image file, or click Browse to select an image "
                                                  "from a list of those available on your system.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_file_browse" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "bmp_file_browse" ) ),
                                                  "Select a bitmap image file from a list of those available on your system.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Select a bitmap image file from a list of those available on your system.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_reload" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "bmp_reload" ) ),
                                                  "Reload the selected bitmap file after making changes in an external image editor.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Reload the selected bitmap file after making changes in an external image editor.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_black" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "bmp_black" ) ),
                                                  "Enter the value corresponding to color index 0 in the bitmap file. For gray scale "
                                                  "images, color 0 is normally black.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the value corresponding to color index 0 in the bitmap file. For gray scale "
                                                  "images, color 0 is normally black.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "bmp_white" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "bmp_white" ) ),
                                                  "Enter the value corresponding to color index 255 in the bitmap file. For gray scale "
                                                  "images, color 255 is normally white.",
                                                  "" );
        // Fixpoints tab
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the value corresponding to color index 255 in the bitmap file. For gray scale "
                                                  "images, color 255 is normally white.",
                                                  "" );
        // Fixpoints tab
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "fix_value" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "fix_value" ) ),
                                                  "Enter a value for the selected vertex. This value will not be adjusted when applying "
                                                  "a waveform or roughness to the surface. Unlock this vertex (so that it will be "
                                                  "adjusted normally) by clicking \"Free\". This vertex will influence vertices within "
                                                  "the \"Range affected\" of this vertex.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter a value for the selected vertex. This value will not be adjusted when applying "
                                                  "a waveform or roughness to the surface. Unlock this vertex (so that it will be "
                                                  "adjusted normally) by clicking \"Free\". This vertex will influence vertices within "
                                                  "the \"Range affected\" of this vertex.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "fix_range" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "fix_range" ) ),
                                                  "Enter the range away from the selected vertex that other vertices will be affected. "
                                                  "Use 0 if you don't want other vertices to be influenced by the currently selected "
                                                  "one. Note: this box is disabled if you've chosen the fractal generator, as it uses "
                                                  "a completely different method for determining values.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the range away from the selected vertex that other vertices will be affected. "
                                                  "Use 0 if you don't want other vertices to be influenced by the currently selected "
                                                  "one. Note: this box is disabled if you've chosen the fractal generator, as it uses "
                                                  "a completely different method for determining values.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "fix_rate" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "fix_rate" ) ),
                                                  "Enter a rate of change for the surface affected by the fixed value. 0 gives a smooth "
                                                  "sinusoidal curve, values less than 0 give progressively sharper spikes, and values "
                                                  "greater than 0 take on a square shape. Values less than -30 or greater than 30 are "
                                                  "Enter a rate of change for the surface affected by the fixed value. 0 gives a smooth "
                                                  "sinusoidal curve, values less than 0 give progressively sharper spikes, and values "
                                                  "greater than 0 take on a square shape. Values less than -30 or greater than 30 are "
@@ -1306,32 +1306,32 @@ void create_tooltips(){
                                                  "you also specify a \"range affected\".",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "you also specify a \"range affected\".",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "fix_free" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "fix_free" ) ),
                                                  "Click this to free (unlock the value of) the currently selected vertex.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Click this to free (unlock the value of) the currently selected vertex.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "fix_freeall" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "fix_freeall" ) ),
                                                  "Click this to free (unlock the values of) all vertices.",
                                                  "" );
        // Texture tab
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Click this to free (unlock the values of) all vertices.",
                                                  "" );
        // Texture tab
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "texture1" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "texture1" ) ),
                                                  "Enter the name of the texture or shader used for the surface faces.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the name of the texture or shader used for the surface faces.",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "texture2" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "texture2" ) ),
                                                  "Enter the name of the texture or shader used for faces other than the surface. Under "
                                                  "normal circumstances this should be \"common/caulk\"",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the name of the texture or shader used for faces other than the surface. Under "
                                                  "normal circumstances this should be \"common/caulk\"",
                                                  "" );
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "texture3" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "texture3" ) ),
                                                  "Enter the name of the texture or shader used for \"steep\" surface faces, where \"steep\" "
                                                  "is the angle specified below. If this entry is left blank or if the \"steep\" angle is 0, "
                                                  "all surface faces will use the texture specified by \"Surface\".",
                                                  "" );
 
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
                                                  "Enter the name of the texture or shader used for \"steep\" surface faces, where \"steep\" "
                                                  "is the angle specified below. If this entry is left blank or if the \"steep\" angle is 0, "
                                                  "all surface faces will use the texture specified by \"Surface\".",
                                                  "" );
 
        gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ),
-                                                 GTK_WIDGET( g_object_get_data( G_OBJECT( g_pWnd ), "detail" ) ),
+                                                 g_object_get_data( G_OBJECT( g_pWnd , "detail" ) ),
                                                  "Check this box to use the detail content property on the generated brushes. Compile "
                                                  "times will be considerably shorter if the detail property is used, though the surface "
                                                  "will not block visibility at all. If you use the detail property, you should make sure "
                                                  "Check this box to use the detail content property on the generated brushes. Compile "
                                                  "times will be considerably shorter if the detail property is used, though the surface "
                                                  "will not block visibility at all. If you use the detail property, you should make sure "
index c809005..6e24897 100644 (file)
@@ -123,7 +123,7 @@ static void SetClipText( GtkWidget* label ){
 
 static void OnScroll2d( GtkAdjustment *adj, gpointer data ){
        portals.width_2d = static_cast<float>( gtk_adjustment_get_value(adj) );
 
 static void OnScroll2d( GtkAdjustment *adj, gpointer data ){
        portals.width_2d = static_cast<float>( gtk_adjustment_get_value(adj) );
-       Set2DText( GTK_WIDGET( data ) );
+       Set2DText( ui::Widget::from(data) );
 
        Portals_shadersChanged();
        SceneChangeNotify();
 
        Portals_shadersChanged();
        SceneChangeNotify();
@@ -131,21 +131,21 @@ static void OnScroll2d( GtkAdjustment *adj, gpointer data ){
 
 static void OnScroll3d( GtkAdjustment *adj, gpointer data ){
        portals.width_3d = static_cast<float>( gtk_adjustment_get_value(adj) );
 
 static void OnScroll3d( GtkAdjustment *adj, gpointer data ){
        portals.width_3d = static_cast<float>( gtk_adjustment_get_value(adj) );
-       Set3DText( GTK_WIDGET( data ) );
+       Set3DText( ui::Widget::from( data ) );
 
        SceneChangeNotify();
 }
 
 static void OnScrollTrans( GtkAdjustment *adj, gpointer data ){
        portals.trans_3d = static_cast<float>( gtk_adjustment_get_value(adj) );
 
        SceneChangeNotify();
 }
 
 static void OnScrollTrans( GtkAdjustment *adj, gpointer data ){
        portals.trans_3d = static_cast<float>( gtk_adjustment_get_value(adj) );
-       Set3DTransText( GTK_WIDGET( data ) );
+       Set3DTransText( ui::Widget::from( data ) );
 
        SceneChangeNotify();
 }
 
 static void OnScrollClip( GtkAdjustment *adj, gpointer data ){
        portals.clip_range = static_cast<float>( gtk_adjustment_get_value(adj) );
 
        SceneChangeNotify();
 }
 
 static void OnScrollClip( GtkAdjustment *adj, gpointer data ){
        portals.clip_range = static_cast<float>( gtk_adjustment_get_value(adj) );
-       SetClipText( GTK_WIDGET( data ) );
+       SetClipText( ui::Widget::from( data ) );
 
        SceneChangeNotify();
 }
 
        SceneChangeNotify();
 }
@@ -331,8 +331,8 @@ void DoConfigDialog(){
        gtk_combo_box_text_append_text(zlist, "Z-Buffer Test Only (recommended for transparent polygons)");
        gtk_combo_box_text_append_text(zlist, "Z-Buffer Off");
 
        gtk_combo_box_text_append_text(zlist, "Z-Buffer Test Only (recommended for transparent polygons)");
        gtk_combo_box_text_append_text(zlist, "Z-Buffer Off");
 
-       zlist.connect("changed", G_CALLBACK(+[](GtkComboBox *self, void *) {
-               OnSelchangeZbuffer(GTK_WIDGET(self), GINT_TO_POINTER(gtk_combo_box_get_active(self)));
+       zlist.connect("changed", G_CALLBACK(+[](ui::ComboBox self, void *) {
+               OnSelchangeZbuffer(self, GINT_TO_POINTER(gtk_combo_box_get_active(self)));
        }), nullptr);
 
        table = ui::Table( 2, 2, FALSE );
        }), nullptr);
 
        table = ui::Table( 2, 2, FALSE );
index fcac228..67d917b 100644 (file)
@@ -232,7 +232,7 @@ bool Buttons_press( ButtonMask& buttons, guint button, guint state ){
                {
                        ui::Window toplevel = *i;
                        ASSERT_MESSAGE( window_has_accel( toplevel ), "ERROR" );
                {
                        ui::Window toplevel = *i;
                        ASSERT_MESSAGE( window_has_accel( toplevel ), "ERROR" );
-                       ASSERT_MESSAGE( gtk_widget_is_toplevel( GTK_WIDGET(toplevel) ), "disabling accel for non-toplevel window" );
+                       ASSERT_MESSAGE( gtk_widget_is_toplevel( toplevel ), "disabling accel for non-toplevel window" );
                        gtk_window_remove_accel_group( toplevel,  global_accel );
 #if 0
                        globalOutputStream() << reinterpret_cast<unsigned int>( toplevel ) << ": disabled global accelerators\n";
                        gtk_window_remove_accel_group( toplevel,  global_accel );
 #if 0
                        globalOutputStream() << reinterpret_cast<unsigned int>( toplevel ) << ": disabled global accelerators\n";
@@ -255,7 +255,7 @@ bool Buttons_release( ButtonMask& buttons, guint button, guint state ){
                {
                        ui::Window toplevel = *i;
                        ASSERT_MESSAGE( !window_has_accel( toplevel ), "ERROR" );
                {
                        ui::Window toplevel = *i;
                        ASSERT_MESSAGE( !window_has_accel( toplevel ), "ERROR" );
-                       ASSERT_MESSAGE( gtk_widget_is_toplevel( GTK_WIDGET(toplevel) ), "enabling accel for non-toplevel window" );
+                       ASSERT_MESSAGE( gtk_widget_is_toplevel( toplevel ), "enabling accel for non-toplevel window" );
                        toplevel.add_accel_group( global_accel );
 #if 0
                        globalOutputStream() << reinterpret_cast<unsigned int>( toplevel ) << ": enabled global accelerators\n";
                        toplevel.add_accel_group( global_accel );
 #if 0
                        globalOutputStream() << reinterpret_cast<unsigned int>( toplevel ) << ": enabled global accelerators\n";
index 69e95e8..bb56fe6 100644 (file)
@@ -97,7 +97,7 @@ void FreezePointer::freeze_pointer(ui::Window window, FreezePointer::MotionDelta
 
        GdkCursor* cursor = create_blank_cursor();
        //GdkGrabStatus status =
 
        GdkCursor* cursor = create_blank_cursor();
        //GdkGrabStatus status =
-       gdk_pointer_grab( gtk_widget_get_window(GTK_WIDGET(window)), TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
+       gdk_pointer_grab( gtk_widget_get_window(window), TRUE, mask, 0, cursor, GDK_CURRENT_TIME );
        gdk_cursor_unref( cursor );
 
        Sys_GetCursorPos( window, &recorded_x, &recorded_y );
        gdk_cursor_unref( cursor );
 
        Sys_GetCursorPos( window, &recorded_x, &recorded_y );
index 8fa34e6..c826731 100644 (file)
@@ -58,7 +58,7 @@ ui::Table create_dialog_table( unsigned int rows, unsigned int columns, unsigned
 
 ui::Button create_dialog_button( const char* label, GCallback func, gpointer data ){
        auto button = ui::Button( label );
 
 ui::Button create_dialog_button( const char* label, GCallback func, gpointer data ){
        auto button = ui::Button( label );
-       gtk_widget_set_size_request( GTK_WIDGET( button ), 64, -1 );
+       gtk_widget_set_size_request( button , 64, -1 );
        button.show();
        button.connect( "clicked", func, data );
        return button;
        button.show();
        button.connect( "clicked", func, data );
        return button;
@@ -86,7 +86,7 @@ gboolean modal_dialog_delete( ui::Widget widget, GdkEvent* event, ModalDialog* d
 }
 
 EMessageBoxReturn modal_dialog_show( ui::Window window, ModalDialog& dialog ){
 }
 
 EMessageBoxReturn modal_dialog_show( ui::Window window, ModalDialog& dialog ){
-       gtk_grab_add( GTK_WIDGET( window ) );
+       gtk_grab_add( window  );
        window.show();
 
        dialog.loop = true;
        window.show();
 
        dialog.loop = true;
@@ -96,7 +96,7 @@ EMessageBoxReturn modal_dialog_show( ui::Window window, ModalDialog& dialog ){
        }
 
        window.hide();
        }
 
        window.hide();
-       gtk_grab_remove( GTK_WIDGET( window ) );
+       gtk_grab_remove( window  );
 
        return dialog.ret;
 }
 
        return dialog.ret;
 }
@@ -118,11 +118,11 @@ ui::Window create_fixedsize_modal_dialog_window( ui::Window parent, const char*
 
        window_remove_minmax( window );
 
 
        window_remove_minmax( window );
 
-       //gtk_widget_set_size_request(GTK_WIDGET(window), width, height);
+       //gtk_widget_set_size_request(window, width, height);
        //gtk_window_set_default_size(window, width, height);
        //gtk_window_resize(window, width, height);
        //GdkGeometry geometry = { width, height, -1, -1, width, height, -1, -1, -1, -1, GDK_GRAVITY_STATIC, };
        //gtk_window_set_default_size(window, width, height);
        //gtk_window_resize(window, width, height);
        //GdkGeometry geometry = { width, height, -1, -1, width, height, -1, -1, -1, -1, GDK_GRAVITY_STATIC, };
-       //gtk_window_set_geometry_hints(window, GTK_WIDGET(window), &geometry, (GdkWindowHints)(GDK_HINT_POS|GDK_HINT_MIN_SIZE|GDK_HINT_BASE_SIZE));
+       //gtk_window_set_geometry_hints(window, window, &geometry, (GdkWindowHints)(GDK_HINT_POS|GDK_HINT_MIN_SIZE|GDK_HINT_BASE_SIZE));
 
        return window;
 }
 
        return window;
 }
@@ -251,7 +251,7 @@ ui::Table DialogRow_new( const char* name, ui::Widget widget ){
        gtk_table_set_col_spacings( table, 4 );
        gtk_table_set_row_spacings( table, 0 );
 
        gtk_table_set_col_spacings( table, 4 );
        gtk_table_set_row_spacings( table, 0 );
 
-       gtk_table_attach( table, GTK_WIDGET( DialogLabel_new( name ) ), 0, 1, 0, 1,
+       gtk_table_attach( table, DialogLabel_new( name  ), 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
index 6d71b23..93638e3 100644 (file)
@@ -40,7 +40,7 @@ void menu_add_item( ui::Menu menu, ui::MenuItem item ){
 ui::MenuItem menu_separator( ui::Menu menu ){
        auto menu_item = ui::MenuItem(GTK_MENU_ITEM( gtk_menu_item_new() ));
        menu.add(menu_item);
 ui::MenuItem menu_separator( ui::Menu menu ){
        auto menu_item = ui::MenuItem(GTK_MENU_ITEM( gtk_menu_item_new() ));
        menu.add(menu_item);
-       gtk_widget_set_sensitive( GTK_WIDGET( menu_item ), FALSE );
+       gtk_widget_set_sensitive( menu_item , FALSE );
        menu_item.show();
        return menu_item;
 }
        menu_item.show();
        return menu_item;
 }
@@ -48,7 +48,7 @@ ui::MenuItem menu_separator( ui::Menu menu ){
 ui::TearoffMenuItem menu_tearoff( ui::Menu menu ){
        auto menu_item = ui::TearoffMenuItem(GTK_TEAROFF_MENU_ITEM( gtk_tearoff_menu_item_new() ));
        menu.add(menu_item);
 ui::TearoffMenuItem menu_tearoff( ui::Menu menu ){
        auto menu_item = ui::TearoffMenuItem(GTK_TEAROFF_MENU_ITEM( gtk_tearoff_menu_item_new() ));
        menu.add(menu_item);
-// gtk_widget_set_sensitive(GTK_WIDGET(menu_item), FALSE); -- controls whether menu is detachable
+// gtk_widget_set_sensitive(menu_item, FALSE); -- controls whether menu is detachable
        menu_item.show();
        return menu_item;
 }
        menu_item.show();
        return menu_item;
 }
index 334c4e7..28e29a1 100644 (file)
@@ -110,8 +110,8 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha
        if ( type == eMB_OK ) {
                auto button = create_modal_dialog_button( "OK", ok_button );
                hbox.pack_start( button, TRUE, FALSE, 0 );
        if ( type == eMB_OK ) {
                auto button = create_modal_dialog_button( "OK", ok_button );
                hbox.pack_start( button, TRUE, FALSE, 0 );
-               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
-               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+               gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+               gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
                widget_make_default( button );
                button.show();
 
                widget_make_default( button );
                button.show();
 
@@ -121,7 +121,7 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha
                {
                        auto button = create_modal_dialog_button( "OK", ok_button );
                        hbox.pack_start( button, TRUE, FALSE, 0 );
                {
                        auto button = create_modal_dialog_button( "OK", ok_button );
                        hbox.pack_start( button, TRUE, FALSE, 0 );
-                       gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+                       gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
                        widget_make_default( button );
                        button.show();
                }
                        widget_make_default( button );
                        button.show();
                }
@@ -129,7 +129,7 @@ EMessageBoxReturn gtk_MessageBox( ui::Widget parent, const char* text, const cha
                {
                        auto button = create_modal_dialog_button( "OK", cancel_button );
                        hbox.pack_start( button, TRUE, FALSE, 0 );
                {
                        auto button = create_modal_dialog_button( "OK", cancel_button );
                        hbox.pack_start( button, TRUE, FALSE, 0 );
-                       gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+                       gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
                        button.show();
                }
 
                        button.show();
                }
 
index 97c4bce..f150ec2 100644 (file)
@@ -6,7 +6,7 @@
 gboolean escape_clear_focus_widget(ui::Widget widget, GdkEventKey *event, gpointer data)
 {
     if (event->keyval == GDK_KEY_Escape) {
 gboolean escape_clear_focus_widget(ui::Widget widget, GdkEventKey *event, gpointer data)
 {
     if (event->keyval == GDK_KEY_Escape) {
-        gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(widget))), NULL);
+        gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(widget)), NULL);
         return TRUE;
     }
     return FALSE;
         return TRUE;
     }
     return FALSE;
@@ -25,7 +25,7 @@ gboolean NonModalEntry::focus_in(ui::Entry entry, GdkEventFocus *event, NonModal
 
 gboolean NonModalEntry::focus_out(ui::Entry entry, GdkEventFocus *event, NonModalEntry *self)
 {
 
 gboolean NonModalEntry::focus_out(ui::Entry entry, GdkEventFocus *event, NonModalEntry *self)
 {
-    if (self->m_editing && gtk_widget_get_visible(GTK_WIDGET(entry))) {
+    if (self->m_editing && gtk_widget_get_visible(entry)) {
         self->m_apply();
     }
     self->m_editing = false;
         self->m_apply();
     }
     self->m_editing = false;
@@ -43,7 +43,7 @@ gboolean NonModalEntry::enter(ui::Entry entry, GdkEventKey *event, NonModalEntry
     if (event->keyval == GDK_KEY_Return) {
         self->m_apply();
         self->m_editing = false;
     if (event->keyval == GDK_KEY_Return) {
         self->m_apply();
         self->m_editing = false;
-        gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(entry))), NULL);
+        gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(entry)), NULL);
         return TRUE;
     }
     return FALSE;
         return TRUE;
     }
     return FALSE;
@@ -54,7 +54,7 @@ gboolean NonModalEntry::escape(ui::Entry entry, GdkEventKey *event, NonModalEntr
     if (event->keyval == GDK_KEY_Escape) {
         self->m_cancel();
         self->m_editing = false;
     if (event->keyval == GDK_KEY_Escape) {
         self->m_cancel();
         self->m_editing = false;
-        gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(entry))), NULL);
+        gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(entry)), NULL);
         return TRUE;
     }
     return FALSE;
         return TRUE;
     }
     return FALSE;
@@ -78,7 +78,7 @@ gboolean NonModalSpinner::changed(ui::SpinButton spin, NonModalSpinner *self)
 gboolean NonModalSpinner::enter(ui::SpinButton spin, GdkEventKey *event, NonModalSpinner *self)
 {
     if (event->keyval == GDK_KEY_Return) {
 gboolean NonModalSpinner::enter(ui::SpinButton spin, GdkEventKey *event, NonModalSpinner *self)
 {
     if (event->keyval == GDK_KEY_Return) {
-        gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(spin))), NULL);
+        gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(spin)), NULL);
         return TRUE;
     }
     return FALSE;
         return TRUE;
     }
     return FALSE;
@@ -88,7 +88,7 @@ gboolean NonModalSpinner::escape(ui::SpinButton spin, GdkEventKey *event, NonMod
 {
     if (event->keyval == GDK_KEY_Escape) {
         self->m_cancel();
 {
     if (event->keyval == GDK_KEY_Escape) {
         self->m_cancel();
-        gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(spin))), NULL);
+        gtk_window_set_focus(GTK_WINDOW(gtk_widget_get_toplevel(spin)), NULL);
         return TRUE;
     }
     return FALSE;
         return TRUE;
     }
     return FALSE;
index 4149f8b..1aeec45 100644 (file)
@@ -70,25 +70,25 @@ ui::HPaned create_split_views( ui::Widget topleft, ui::Widget topright, ui::Widg
 
        {
                auto vsplit = ui::VPaned(ui::New);
 
        {
                auto vsplit = ui::VPaned(ui::New);
-               gtk_paned_add1( GTK_PANED( hsplit ), GTK_WIDGET( vsplit ) );
+               gtk_paned_add1( GTK_PANED( hsplit ), vsplit  );
                vsplit.show();
 
                vsplit.connect( "size_allocate", G_CALLBACK( vpaned_allocate ), &g_vpaned1 );
                vsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_vpaned1 );
 
                vsplit.show();
 
                vsplit.connect( "size_allocate", G_CALLBACK( vpaned_allocate ), &g_vpaned1 );
                vsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_vpaned1 );
 
-               gtk_paned_add1( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( topleft ) ) );
-               gtk_paned_add2( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( topright ) ) );
+               gtk_paned_add1( GTK_PANED( vsplit ), create_framed_widget( topleft  ) );
+               gtk_paned_add2( GTK_PANED( vsplit ), create_framed_widget( topright  ) );
        }
        {
                auto vsplit = ui::VPaned(ui::New);
        }
        {
                auto vsplit = ui::VPaned(ui::New);
-               gtk_paned_add2( GTK_PANED( hsplit ), GTK_WIDGET( vsplit ) );
+               gtk_paned_add2( GTK_PANED( hsplit ), vsplit  );
                vsplit.show();
 
                vsplit.connect( "size_allocate", G_CALLBACK( vpaned_allocate ), &g_vpaned2 );
                vsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_vpaned2 );
 
                vsplit.show();
 
                vsplit.connect( "size_allocate", G_CALLBACK( vpaned_allocate ), &g_vpaned2 );
                vsplit.connect( "notify::position", G_CALLBACK( paned_position ), &g_vpaned2 );
 
-               gtk_paned_add1( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( botleft ) ) );
-               gtk_paned_add2( GTK_PANED( vsplit ), GTK_WIDGET( create_framed_widget( botright ) ) );
+               gtk_paned_add1( GTK_PANED( vsplit ), create_framed_widget( botleft  ) );
+               gtk_paned_add2( GTK_PANED( vsplit ), create_framed_widget( botright  ) );
        }
        return hsplit;
 }
        }
        return hsplit;
 }
index 0486360..d2ab45a 100644 (file)
 
 
 void toolbar_append( ui::Toolbar toolbar, ui::ToolItem button, const char* description ){
 
 
 void toolbar_append( ui::Toolbar toolbar, ui::ToolItem button, const char* description ){
-       gtk_widget_show_all(GTK_WIDGET(button));
-       gtk_widget_set_tooltip_text(GTK_WIDGET(button), description);
+       gtk_widget_show_all(button);
+       gtk_widget_set_tooltip_text(button, description);
        toolbar.add(button);
 }
 
 ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback ){
        toolbar.add(button);
 }
 
 ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback ){
-       auto button = ui::ToolButton(GTK_TOOL_BUTTON(gtk_tool_button_new(GTK_WIDGET(new_local_image(icon)), nullptr)));
+       auto button = ui::ToolButton(GTK_TOOL_BUTTON(gtk_tool_button_new(new_local_image(icon), nullptr)));
        button_connect_callback(button, callback);
        toolbar_append(toolbar, button, description);
        return button;
        button_connect_callback(button, callback);
        toolbar_append(toolbar, button, description);
        return button;
@@ -47,7 +47,7 @@ ui::ToolButton toolbar_append_button( ui::Toolbar toolbar, const char* descripti
 ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback ){
        auto button = ui::ToggleToolButton(GTK_TOGGLE_TOOL_BUTTON(gtk_toggle_tool_button_new()));
        toggle_button_connect_callback(button, callback);
 ui::ToggleToolButton toolbar_append_toggle_button( ui::Toolbar toolbar, const char* description, const char* icon, const Callback& callback ){
        auto button = ui::ToggleToolButton(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_icon_widget(GTK_TOOL_BUTTON(button), new_local_image(icon));
        gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), description);
        toolbar_append(toolbar, button, description);
        return button;
        gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), description);
        toolbar_append(toolbar, button, description);
        return button;
index 3da0b3b..411e2b5 100644 (file)
@@ -40,11 +40,11 @@ inline void CHECK_MINIMIZE( ui::Widget w ){
 static gboolean main_window_iconified( ui::Widget widget, GdkEventWindowState* event, gpointer data ){
        if ( ( event->changed_mask & ( GDK_WINDOW_STATE_ICONIFIED | GDK_WINDOW_STATE_WITHDRAWN ) ) != 0 ) {
                if ( ( event->new_window_state & ( GDK_WINDOW_STATE_ICONIFIED | GDK_WINDOW_STATE_WITHDRAWN ) ) != 0 ) {
 static gboolean main_window_iconified( ui::Widget widget, GdkEventWindowState* event, gpointer data ){
        if ( ( event->changed_mask & ( GDK_WINDOW_STATE_ICONIFIED | GDK_WINDOW_STATE_WITHDRAWN ) ) != 0 ) {
                if ( ( event->new_window_state & ( GDK_WINDOW_STATE_ICONIFIED | GDK_WINDOW_STATE_WITHDRAWN ) ) != 0 ) {
-                       CHECK_MINIMIZE( ui::Widget(GTK_WIDGET( data )) );
+                       CHECK_MINIMIZE( ui::Widget::from( data ) );
                }
                else
                {
                }
                else
                {
-                       CHECK_RESTORE( ui::Widget(GTK_WIDGET( data )) );
+                       CHECK_RESTORE( ui::Widget::from( data ) );
                }
        }
        return FALSE;
                }
        }
        return FALSE;
@@ -112,7 +112,7 @@ gboolean persistent_floating_window_delete( ui::Window floating, GdkEvent *event
 ui::Window create_persistent_floating_window( const char* title, ui::Window main_window ){
        ui::Window window = ui::Window(GTK_WINDOW( create_floating_window( title, main_window ) ));
 
 ui::Window create_persistent_floating_window( const char* title, ui::Window main_window ){
        ui::Window window = ui::Window(GTK_WINDOW( create_floating_window( title, main_window ) ));
 
-       gtk_widget_set_events( GTK_WIDGET( window ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK );
+       gtk_widget_set_events( window , GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK );
 
        connect_floating_window_delete_present( window, main_window );
        window.connect( "delete_event", G_CALLBACK( persistent_floating_window_delete ), 0 );
 
        connect_floating_window_delete_present( window, main_window );
        window.connect( "delete_event", G_CALLBACK( persistent_floating_window_delete ), 0 );
index 4a6eff4..e15bdbe 100644 (file)
@@ -189,6 +189,9 @@ namespace ui {
         void unref()
         { g_object_unref(_handle); }
 
         void unref()
         { g_object_unref(_handle); }
 
+        void ref()
+        { g_object_ref(_handle); }
+
         template<class Lambda>
         gulong connect(char const *detailed_signal, Lambda &&c_handler, void *data);
 
         template<class Lambda>
         gulong connect(char const *detailed_signal, Lambda &&c_handler, void *data);
 
index b76b5ec..d4285bf 100644 (file)
@@ -839,7 +839,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                window.add(table1);
                {
                        auto vbox = create_dialog_vbox( 4 );
                window.add(table1);
                {
                        auto vbox = create_dialog_vbox( 4 );
-                       gtk_table_attach( table1, GTK_WIDGET( vbox ), 1, 2, 0, 1,
+                       gtk_table_attach( table1, vbox , 1, 2, 0, 1,
                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
                        {
                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
                        {
@@ -853,7 +853,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                }
                {
                        auto frame = create_dialog_frame( "Build menu" );
                }
                {
                        auto frame = create_dialog_frame( "Build menu" );
-                       gtk_table_attach( table1, GTK_WIDGET( frame ), 0, 1, 0, 1,
+                       gtk_table_attach( table1, frame , 0, 1, 0, 1,
                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
                        {
                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
                        {
@@ -890,7 +890,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                }
                {
                        auto frame = create_dialog_frame( "Commandline" );
                }
                {
                        auto frame = create_dialog_frame( "Commandline" );
-                       gtk_table_attach( table1, GTK_WIDGET( frame ), 0, 1, 1, 2,
+                       gtk_table_attach( table1, frame , 0, 1, 1, 2,
                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
                        {
                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
                        {
@@ -1003,9 +1003,9 @@ void Build_constructMenu( ui::Menu menu ){
 
 
 void Build_refreshMenu( ui::Menu menu ){
 
 
 void Build_refreshMenu( ui::Menu menu ){
-       for ( BuildMenuItems::iterator i = g_BuildMenuItems.begin(); i != g_BuildMenuItems.end(); ++i )
+       for (auto i = g_BuildMenuItems.begin(); i != g_BuildMenuItems.end(); ++i )
        {
        {
-               menu.remove(ui::Widget(GTK_WIDGET((*i).m_item)));
+               menu.remove(ui::MenuItem(i->m_item));
        }
 
        g_BuildMenuItems.clear();
        }
 
        g_BuildMenuItems.clear();
index b8a67dd..02ad444 100644 (file)
@@ -165,7 +165,7 @@ struct command_list_dialog_t : public ModalDialog
        }
        ModalDialogButton m_close_button;
 
        }
        ModalDialogButton m_close_button;
 
-       GtkTreeView *m_list;
+       ui::TreeView m_list;
        GtkTreeIter m_command_iter;
        GtkTreeModel *m_model;
        bool m_waiting_for_key;
        GtkTreeIter m_command_iter;
        GtkTreeModel *m_model;
        bool m_waiting_for_key;
@@ -178,7 +178,7 @@ void accelerator_clear_button_clicked( GtkButton *btn, gpointer dialogptr ){
                // just unhighlight, user wanted to cancel
                dialog.m_waiting_for_key = false;
                gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
                // just unhighlight, user wanted to cancel
                dialog.m_waiting_for_key = false;
                gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
-               gtk_widget_set_sensitive( GTK_WIDGET( dialog.m_list ), true );
+               gtk_widget_set_sensitive( dialog.m_list , true );
                dialog.m_model = NULL;
                return;
        }
                dialog.m_model = NULL;
                return;
        }
@@ -223,7 +223,7 @@ void accelerator_edit_button_clicked( GtkButton *btn, gpointer dialogptr ){
        dialog.m_model = model;
 
        // 2. disallow changing the row
        dialog.m_model = model;
 
        // 2. disallow changing the row
-       //gtk_widget_set_sensitive(GTK_WIDGET(dialog.m_list), false);
+       //gtk_widget_set_sensitive(dialog.m_list, false);
 
        // 3. highlight the row
        gtk_list_store_set( GTK_LIST_STORE( model ), &iter, 2, true, -1 );
 
        // 3. highlight the row
        gtk_list_store_set( GTK_LIST_STORE( model ), &iter, 2, true, -1 );
@@ -274,7 +274,7 @@ bool accelerator_window_key_press( ui::Widget widget, GdkEventKey *event, gpoint
        Shortcuts::iterator thisShortcutIterator = g_shortcuts.find( commandName );
        if ( thisShortcutIterator == g_shortcuts.end() ) {
                gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
        Shortcuts::iterator thisShortcutIterator = g_shortcuts.find( commandName );
        if ( thisShortcutIterator == g_shortcuts.end() ) {
                gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
-               gtk_widget_set_sensitive( GTK_WIDGET( dialog.m_list ), true );
+               gtk_widget_set_sensitive( dialog.m_list , true );
                return true;
        }
 
                return true;
        }
 
@@ -341,7 +341,7 @@ public:
        GlobalShortcuts_foreach( verify_visitor );
 
        gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
        GlobalShortcuts_foreach( verify_visitor );
 
        gtk_list_store_set( GTK_LIST_STORE( dialog.m_model ), &dialog.m_command_iter, 2, false, -1 );
-       gtk_widget_set_sensitive( GTK_WIDGET( dialog.m_list ), true );
+       gtk_widget_set_sensitive( dialog.m_list , true );
 
        if ( verify_visitor.allow ) {
                // clear the ACTUAL accelerator first
 
        if ( verify_visitor.allow ) {
                // clear the ACTUAL accelerator first
@@ -405,8 +405,8 @@ void DoCommandListDlg(){
                {
                        ui::ListStore store = ui::ListStore(gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT ));
 
                {
                        ui::ListStore store = ui::ListStore(gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_INT ));
 
-                       ui::Widget view = ui::TreeView(ui::TreeModel(GTK_TREE_MODEL(store)));
-                       dialog.m_list = GTK_TREE_VIEW( view );
+                       auto view = ui::TreeView(ui::TreeModel(GTK_TREE_MODEL(store)));
+                       dialog.m_list = view;
 
                        gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), false ); // annoying
 
 
                        gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), false ); // annoying
 
@@ -476,9 +476,9 @@ public:
                auto button = create_modal_dialog_button( "Close", dialog.m_close_button );
                vbox.pack_start( button, FALSE, FALSE, 0 );
                widget_make_default( button );
                auto button = create_modal_dialog_button( "Close", dialog.m_close_button );
                vbox.pack_start( button, FALSE, FALSE, 0 );
                widget_make_default( button );
-               gtk_widget_grab_default( GTK_WIDGET( button ) );
-               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
-               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+               gtk_widget_grab_default( button  );
+               gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+               gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
        }
 
        modal_dialog_show( window, dialog );
        }
 
        modal_dialog_show( window, dialog );
index a5a39ec..e588f93 100644 (file)
@@ -50,7 +50,7 @@
 ui::Entry DialogEntry_new(){
        auto entry = ui::Entry(ui::New);
        entry.show();
 ui::Entry DialogEntry_new(){
        auto entry = ui::Entry(ui::New);
        entry.show();
-       gtk_widget_set_size_request( GTK_WIDGET( entry ), 64, -1 );
+       gtk_widget_set_size_request( entry , 64, -1 );
        return entry;
 }
 
        return entry;
 }
 
@@ -70,7 +70,7 @@ DialogEntryRow DialogEntryRow_new( const char* name ){
        auto entry = DialogEntry_new();
        alignment.add(entry);
 
        auto entry = DialogEntry_new();
        alignment.add(entry);
 
-       return DialogEntryRow( ui::Widget(GTK_WIDGET( DialogRow_new( name, alignment ) )), entry );
+       return DialogEntryRow( ui::Widget(DialogRow_new( name, alignment  )), entry );
 }
 
 
 }
 
 
@@ -83,7 +83,7 @@ ui::SpinButton DialogSpinner_new( double value, double lower, double upper, int
        }
        auto spin = ui::SpinButton( ui::Adjustment( value, lower, upper, step, 10, 0 ), step, digits );
        spin.show();
        }
        auto spin = ui::SpinButton( ui::Adjustment( value, lower, upper, step, 10, 0 ), step, digits );
        spin.show();
-       gtk_widget_set_size_request( GTK_WIDGET( spin ), 64, -1 );
+       gtk_widget_set_size_request( spin , 64, -1 );
        return spin;
 }
 
        return spin;
 }
 
@@ -103,7 +103,7 @@ DialogSpinnerRow DialogSpinnerRow_new( const char* name, double value, double lo
        auto spin = DialogSpinner_new( value, lower, upper, fraction );
        alignment.add(spin);
 
        auto spin = DialogSpinner_new( value, lower, upper, fraction );
        alignment.add(spin);
 
-       return DialogSpinnerRow( ui::Widget(GTK_WIDGET( DialogRow_new( name, alignment ) )), spin );
+       return DialogSpinnerRow( ui::Widget(DialogRow_new( name, alignment  )), spin );
 }
 
 
 }
 
 
@@ -458,7 +458,7 @@ ui::CheckButton Dialog::addCheckBox( ui::Widget vbox, const char* name, const ch
        check.show();
        AddBoolToggleData( *GTK_TOGGLE_BUTTON( check ), importViewer, exportViewer );
 
        check.show();
        AddBoolToggleData( *GTK_TOGGLE_BUTTON( check ), importViewer, exportViewer );
 
-       DialogVBox_packRow( ui::VBox(GTK_VBOX( vbox )), ui::Widget(GTK_WIDGET( DialogRow_new( name, check ) ) ));
+       DialogVBox_packRow( ui::VBox(GTK_VBOX( vbox )), ui::Widget(DialogRow_new( name, check  ) ));
        return check;
 }
 
        return check;
 }
 
@@ -496,7 +496,7 @@ void Dialog::addSlider( ui::Widget vbox, const char* name, int& data, gboolean d
        if ( draw_value == FALSE ) {
                auto hbox2 = ui::HBox( FALSE, 0 );
                hbox2.show();
        if ( draw_value == FALSE ) {
                auto hbox2 = ui::HBox( FALSE, 0 );
                hbox2.show();
-               vbox.pack_start( GTK_WIDGET( hbox2 ), FALSE, FALSE, 0 );
+               vbox.pack_start( hbox2 , FALSE, FALSE, 0 );
                {
                        ui::Widget label = ui::Label( low );
                        label.show();
                {
                        ui::Widget label = ui::Label( low );
                        label.show();
@@ -561,7 +561,7 @@ void Dialog::addRadioIcons( ui::Widget vbox, const char* name, StringArrayRange
                guint pos = static_cast<guint>( icon - icons.first );
                auto image = new_local_image( *icon );
                image.show();
                guint pos = static_cast<guint>( icon - icons.first );
                auto image = new_local_image( *icon );
                image.show();
-               gtk_table_attach( GTK_TABLE( table ), GTK_WIDGET( image ), pos, pos + 1, 0, 1,
+               gtk_table_attach( GTK_TABLE( table ), image , pos, pos + 1, 0, 1,
                                                  (GtkAttachOptions) ( 0 ),
                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
 
                                                  (GtkAttachOptions) ( 0 ),
                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
 
@@ -610,10 +610,10 @@ ui::Widget Dialog::addPathEntry( ui::Widget vbox, const char* name, bool browse_
 
        AddTextEntryData( *GTK_ENTRY(pathEntry.m_entry), importViewer, exportViewer );
 
 
        AddTextEntryData( *GTK_ENTRY(pathEntry.m_entry), importViewer, exportViewer );
 
-       auto row = DialogRow_new( name, ui::Widget(GTK_WIDGET( pathEntry.m_frame )) );
+       auto row = DialogRow_new( name, ui::Widget(pathEntry.m_frame ) );
        DialogVBox_packRow( ui::VBox(GTK_VBOX( vbox )), row );
 
        DialogVBox_packRow( ui::VBox(GTK_VBOX( vbox )), row );
 
-       return ui::Widget(GTK_WIDGET( row ));
+       return ui::Widget(row );
 }
 
 ui::Widget Dialog::addPathEntry( ui::Widget vbox, const char* name, CopiedString& data, bool browse_directory ){
 }
 
 ui::Widget Dialog::addPathEntry( ui::Widget vbox, const char* name, CopiedString& data, bool browse_directory ){
index cf726ac..fbb268f 100644 (file)
@@ -289,7 +289,7 @@ int g_iLastLightIntensity;
 void Entity_createFromSelection( const char* name, const Vector3& origin ){
 #if 0
        if ( string_equal_nocase( name, "worldspawn" ) ) {
 void Entity_createFromSelection( const char* name, const Vector3& origin ){
 #if 0
        if ( string_equal_nocase( name, "worldspawn" ) ) {
-               ui::alert( GTK_WIDGET( MainFrame_getWindow() ), "Can't create an entity with worldspawn.", "info" );
+               ui::alert( MainFrame_getWindow( ), "Can't create an entity with worldspawn.", "info" );
                return;
        }
 #endif
                return;
        }
 #endif
@@ -392,7 +392,7 @@ void Entity_createFromSelection( const char* name, const Vector3& origin ){
 
 #if 0
 bool DoNormalisedColor( Vector3& color ){
 
 #if 0
 bool DoNormalisedColor( Vector3& color ){
-       if ( !color_dialog( GTK_WIDGET( MainFrame_getWindow() ), color ) ) {
+       if ( !color_dialog( MainFrame_getWindow( ), color ) ) {
                return false;
        }
        /*
                return false;
        }
        /*
index 23dd957..a82d779 100644 (file)
@@ -240,7 +240,7 @@ void update(){
 }
 typedef MemberCaller<ModelAttribute, &ModelAttribute::update> UpdateCaller;
 void browse( const BrowsedPathEntry::SetPathCallback& setPath ){
 }
 typedef MemberCaller<ModelAttribute, &ModelAttribute::update> UpdateCaller;
 void browse( const BrowsedPathEntry::SetPathCallback& setPath ){
-       const char *filename = misc_model_dialog( ui::Widget(gtk_widget_get_toplevel( GTK_WIDGET( m_entry.m_entry.m_frame ) ) ));
+       const char *filename = misc_model_dialog( ui::Widget(gtk_widget_get_toplevel( m_entry.m_entry.m_frame  ) ));
 
        if ( filename != 0 ) {
                setPath( filename );
 
        if ( filename != 0 ) {
                setPath( filename );
@@ -288,7 +288,7 @@ void release(){
        delete this;
 }
 ui::Widget getWidget() const {
        delete this;
 }
 ui::Widget getWidget() const {
-       return ui::Widget(GTK_WIDGET( m_entry.m_entry.m_frame ));
+       return ui::Widget(m_entry.m_entry.m_frame );
 }
 void apply(){
        StringOutputStream value( 64 );
 }
 void apply(){
        StringOutputStream value( 64 );
@@ -303,7 +303,7 @@ void update(){
 }
 typedef MemberCaller<SoundAttribute, &SoundAttribute::update> UpdateCaller;
 void browse( const BrowsedPathEntry::SetPathCallback& setPath ){
 }
 typedef MemberCaller<SoundAttribute, &SoundAttribute::update> UpdateCaller;
 void browse( const BrowsedPathEntry::SetPathCallback& setPath ){
-       const char *filename = browse_sound( ui::Widget(gtk_widget_get_toplevel( GTK_WIDGET( m_entry.m_entry.m_frame ) )) );
+       const char *filename = browse_sound( ui::Widget(gtk_widget_get_toplevel( m_entry.m_entry.m_frame  )) );
 
        if ( filename != 0 ) {
                setPath( filename );
 
        if ( filename != 0 ) {
                setPath( filename );
@@ -335,7 +335,7 @@ void release(){
        delete this;
 }
 ui::Widget getWidget() const {
        delete this;
 }
 ui::Widget getWidget() const {
-       return ui::Widget(GTK_WIDGET( m_entry ));
+       return ui::Widget(m_entry );
 }
 void apply(){
        StringOutputStream angle( 32 );
 }
 void apply(){
        StringOutputStream angle( 32 );
@@ -396,7 +396,7 @@ void release(){
        delete this;
 }
 ui::Widget getWidget() const {
        delete this;
 }
 ui::Widget getWidget() const {
-       return ui::Widget(GTK_WIDGET( m_hbox ));
+       return ui::Widget(m_hbox );
 }
 void apply(){
        StringOutputStream angle( 32 );
 }
 void apply(){
        StringOutputStream angle( 32 );
@@ -410,18 +410,18 @@ void update(){
        if ( !string_empty( value ) ) {
                float f = float(atof( value ) );
                if ( f == -1 ) {
        if ( !string_empty( value ) ) {
                float f = float(atof( value ) );
                if ( f == -1 ) {
-                       gtk_widget_set_sensitive( GTK_WIDGET( m_entry ), FALSE );
+                       gtk_widget_set_sensitive( m_entry , FALSE );
                        radio_button_set_active_no_signal( m_radio.m_radio, 0 );
                        m_entry.text("");
                }
                else if ( f == -2 ) {
                        radio_button_set_active_no_signal( m_radio.m_radio, 0 );
                        m_entry.text("");
                }
                else if ( f == -2 ) {
-                       gtk_widget_set_sensitive( GTK_WIDGET( m_entry ), FALSE );
+                       gtk_widget_set_sensitive( m_entry , FALSE );
                        radio_button_set_active_no_signal( m_radio.m_radio, 1 );
                        m_entry.text("");
                }
                else
                {
                        radio_button_set_active_no_signal( m_radio.m_radio, 1 );
                        m_entry.text("");
                }
                else
                {
-                       gtk_widget_set_sensitive( GTK_WIDGET( m_entry ), TRUE );
+                       gtk_widget_set_sensitive( m_entry , TRUE );
                        radio_button_set_active_no_signal( m_radio.m_radio, 2 );
                        StringOutputStream angle( 32 );
                        angle << angle_normalised( f );
                        radio_button_set_active_no_signal( m_radio.m_radio, 2 );
                        StringOutputStream angle( 32 );
                        angle << angle_normalised( f );
@@ -499,7 +499,7 @@ void release(){
        delete this;
 }
 ui::Widget getWidget() const {
        delete this;
 }
 ui::Widget getWidget() const {
-       return ui::Widget(GTK_WIDGET( m_hbox ));
+       return ui::Widget(m_hbox );
 }
 void apply(){
        StringOutputStream angles( 64 );
 }
 void apply(){
        StringOutputStream angles( 64 );
@@ -586,7 +586,7 @@ void release(){
        delete this;
 }
 ui::Widget getWidget() const {
        delete this;
 }
 ui::Widget getWidget() const {
-       return ui::Widget(GTK_WIDGET( m_hbox ));
+       return ui::Widget(m_hbox );
 }
 void apply(){
        StringOutputStream vector3( 64 );
 }
 void apply(){
        StringOutputStream vector3( 64 );
@@ -679,7 +679,7 @@ void release(){
        delete this;
 }
 ui::Widget getWidget() const {
        delete this;
 }
 ui::Widget getWidget() const {
-       return ui::Widget(GTK_WIDGET( m_combo ));
+       return ui::Widget(m_combo );
 }
 void apply(){
        Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), m_type[gtk_combo_box_get_active( m_combo )].second.c_str() );
 }
 void apply(){
        Scene_EntitySetKeyValue_Selected_Undoable( m_key.c_str(), m_type[gtk_combo_box_get_active( m_combo )].second.c_str() );
@@ -858,11 +858,11 @@ void SurfaceFlags_setEntityClass( EntityClass* eclass ){
        {
                for ( int i = 0; i < g_spawnflag_count; ++i )
                {
        {
                for ( int i = 0; i < g_spawnflag_count; ++i )
                {
-                       auto widget = ui::Widget(GTK_WIDGET(g_entitySpawnflagsCheck[i]));
+                       auto widget = ui::CheckButton(g_entitySpawnflagsCheck[i]);
                        auto label = ui::Label(GTK_LABEL(gtk_bin_get_child(GTK_BIN(widget))));
                        label.text(" ");
                        widget.hide();
                        auto label = ui::Label(GTK_LABEL(gtk_bin_get_child(GTK_BIN(widget))));
                        label.text(" ");
                        widget.hide();
-                       g_object_ref( widget );
+                       widget.ref();
                        ui::Container(GTK_CONTAINER(g_spawnflagsTable)).remove(widget);
                }
        }
                        ui::Container(GTK_CONTAINER(g_spawnflagsTable)).remove(widget);
                }
        }
@@ -872,7 +872,7 @@ void SurfaceFlags_setEntityClass( EntityClass* eclass ){
        {
                for ( int i = 0; i < g_spawnflag_count; ++i )
                {
        {
                for ( int i = 0; i < g_spawnflag_count; ++i )
                {
-                       ui::Widget widget = ui::Widget(GTK_WIDGET( g_entitySpawnflagsCheck[i] ));
+                       auto widget = ui::CheckButton(g_entitySpawnflagsCheck[i] );
                        widget.show();
 
                        StringOutputStream str( 16 );
                        widget.show();
 
                        StringOutputStream str( 16 );
@@ -897,10 +897,10 @@ void EntityClassList_selectEntityClass( EntityClass* eclass ){
                char* text;
                gtk_tree_model_get( model, &iter, 0, &text, -1 );
                if ( strcmp( text, eclass->name() ) == 0 ) {
                char* text;
                gtk_tree_model_get( model, &iter, 0, &text, -1 );
                if ( strcmp( text, eclass->name() ) == 0 ) {
-                       GtkTreeView* view = g_entityClassList;
+                       auto view = ui::TreeView(g_entityClassList);
                        GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
                        gtk_tree_selection_select_path( gtk_tree_view_get_selection( view ), path );
                        GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
                        gtk_tree_selection_select_path( gtk_tree_view_get_selection( view ), path );
-                       if ( gtk_widget_get_realized( GTK_WIDGET(view) ) ) {
+                       if ( gtk_widget_get_realized( view ) ) {
                                gtk_tree_view_scroll_to_cell( view, path, 0, FALSE, 0, 0 );
                        }
                        gtk_tree_path_free( path );
                                gtk_tree_view_scroll_to_cell( view, path, 0, FALSE, 0, 0 );
                        }
                        gtk_tree_path_free( path );
@@ -1091,7 +1091,7 @@ void EntityClassList_createEntity(){
        GtkTreeModel* model;
        GtkTreeIter iter;
        if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( view ), &model, &iter ) == FALSE ) {
        GtkTreeModel* model;
        GtkTreeIter iter;
        if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( view ), &model, &iter ) == FALSE ) {
-               ui::Widget(gtk_widget_get_toplevel( GTK_WIDGET( g_entityClassList ) )).alert( "You must have a selected class to create an entity", "info" );
+               ui::Widget(gtk_widget_get_toplevel( ui::TreeView(g_entityClassList)  )).alert( "You must have a selected class to create an entity", "info" );
                return;
        }
 
                return;
        }
 
@@ -1119,14 +1119,14 @@ void EntityInspector_applyKeyValue(){
 
        // TTimo: if you change the classname to worldspawn you won't merge back in the structural brushes but create a parasite entity
        if ( !strcmp( key.c_str(), "classname" ) && !strcmp( value.c_str(), "worldspawn" ) ) {
 
        // TTimo: if you change the classname to worldspawn you won't merge back in the structural brushes but create a parasite entity
        if ( !strcmp( key.c_str(), "classname" ) && !strcmp( value.c_str(), "worldspawn" ) ) {
-               ui::Widget(gtk_widget_get_toplevel( GTK_WIDGET( g_entityKeyEntry )) ).alert( "Cannot change \"classname\" key back to worldspawn.", 0, ui::alert_type::OK );
+               ui::Widget(gtk_widget_get_toplevel( g_entityKeyEntry ) ).alert( "Cannot change \"classname\" key back to worldspawn.", 0, ui::alert_type::OK );
                return;
        }
 
 
        // RR2DO2: we don't want spaces in entity keys
        if ( strstr( key.c_str(), " " ) ) {
                return;
        }
 
 
        // RR2DO2: we don't want spaces in entity keys
        if ( strstr( key.c_str(), " " ) ) {
-               ui::Widget(gtk_widget_get_toplevel( GTK_WIDGET( g_entityKeyEntry )) ).alert( "No spaces are allowed in entity keys.", 0, ui::alert_type::OK );
+               ui::Widget(gtk_widget_get_toplevel( g_entityKeyEntry ) ).alert( "No spaces are allowed in entity keys.", 0, ui::alert_type::OK );
                return;
        }
 
                return;
        }
 
@@ -1200,7 +1200,7 @@ static gint EntityClassList_keypress( ui::Widget widget, GdkEventKey* event, gpo
 
        // select the entity that starts with the key pressed
        if ( code <= 'Z' && code >= 'A' ) {
 
        // select the entity that starts with the key pressed
        if ( code <= 'Z' && code >= 'A' ) {
-               GtkTreeView* view = g_entityClassList;
+               auto view = ui::TreeView(g_entityClassList);
                GtkTreeModel* model;
                GtkTreeIter iter;
                if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( view ), &model, &iter ) == FALSE
                GtkTreeModel* model;
                GtkTreeIter iter;
                if ( gtk_tree_selection_get_selected( gtk_tree_view_get_selection( view ), &model, &iter ) == FALSE
@@ -1216,7 +1216,7 @@ static gint EntityClassList_keypress( ui::Widget widget, GdkEventKey* event, gpo
                        if ( toupper( text[0] ) == (int)code ) {
                                GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
                                gtk_tree_selection_select_path( gtk_tree_view_get_selection( view ), path );
                        if ( toupper( text[0] ) == (int)code ) {
                                GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
                                gtk_tree_selection_select_path( gtk_tree_view_get_selection( view ), path );
-                               if ( gtk_widget_get_realized( GTK_WIDGET(view) ) ) {
+                               if ( gtk_widget_get_realized( view ) ) {
                                        gtk_tree_view_scroll_to_cell( view, path, 0, FALSE, 0, 0 );
                                }
                                gtk_tree_path_free( path );
                                        gtk_tree_view_scroll_to_cell( view, path, 0, FALSE, 0, 0 );
                                }
                                gtk_tree_path_free( path );
@@ -1258,11 +1258,11 @@ static void SpawnflagCheck_toggled( ui::Widget widget, gpointer data ){
        EntityInspector_applySpawnflags();
 }
 
        EntityInspector_applySpawnflags();
 }
 
-static gint EntityEntry_keypress( GtkEntry* widget, GdkEventKey* event, gpointer data ){
+static gint EntityEntry_keypress( ui::Entry widget, GdkEventKey* event, gpointer data ){
        if ( event->keyval == GDK_KEY_Return ) {
        if ( event->keyval == GDK_KEY_Return ) {
-               if ( widget == g_entityKeyEntry ) {
+               if ( widget._handle == g_entityKeyEntry._handle ) {
                        g_entityValueEntry.text( "" );
                        g_entityValueEntry.text( "" );
-                       gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( widget ) ) ), GTK_WIDGET( g_entityValueEntry ) );
+                       gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( widget ) ), g_entityValueEntry  );
                }
                else
                {
                }
                else
                {
@@ -1271,7 +1271,7 @@ static gint EntityEntry_keypress( GtkEntry* widget, GdkEventKey* event, gpointer
                return TRUE;
        }
        if ( event->keyval == GDK_KEY_Escape ) {
                return TRUE;
        }
        if ( event->keyval == GDK_KEY_Escape ) {
-               gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( GTK_WIDGET( widget ) ) ), NULL );
+               gtk_window_set_focus( GTK_WINDOW( gtk_widget_get_toplevel( widget ) ), NULL );
                return TRUE;
        }
 
                return TRUE;
        }
 
@@ -1354,7 +1354,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
 
                                {
                                        auto text = ui::TextView(ui::New);
 
                                {
                                        auto text = ui::TextView(ui::New);
-                                       gtk_widget_set_size_request( GTK_WIDGET( text ), 0, -1 ); // allow shrinking
+                                       gtk_widget_set_size_request( text , 0, -1 ); // allow shrinking
                                        gtk_text_view_set_wrap_mode( text, GTK_WRAP_WORD );
                                        gtk_text_view_set_editable( text, FALSE );
                                        text.show();
                                        gtk_text_view_set_wrap_mode( text, GTK_WRAP_WORD );
                                        gtk_text_view_set_editable( text, FALSE );
                                        text.show();
@@ -1385,7 +1385,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                        for ( int i = 0; i < MAX_FLAGS; i++ )
                                        {
                                                auto check = ui::CheckButton( "" );
                                        for ( int i = 0; i < MAX_FLAGS; i++ )
                                        {
                                                auto check = ui::CheckButton( "" );
-                                               g_object_ref( GTK_WIDGET( check ) );
+                                               check.ref();
                                                g_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( check.connect( "toggled", G_CALLBACK( SpawnflagCheck_toggled ), 0 ) ) );
                                                g_entitySpawnflagsCheck[i] = check;
                                        }
                                                g_object_set_data( G_OBJECT( check ), "handler", gint_to_pointer( check.connect( "toggled", G_CALLBACK( SpawnflagCheck_toggled ), 0 ) ) );
                                                g_entitySpawnflagsCheck[i] = check;
                                        }
@@ -1444,10 +1444,10 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                        {
                                                auto entry = ui::Entry(ui::New);
                                                entry.show();
                                        {
                                                auto entry = ui::Entry(ui::New);
                                                entry.show();
-                                               gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
+                                               gtk_table_attach( table, entry , 1, 2, 0, 1,
                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
-                                               gtk_widget_set_events( GTK_WIDGET( entry ), GDK_KEY_PRESS_MASK );
+                                               gtk_widget_set_events( entry , GDK_KEY_PRESS_MASK );
                                                entry.connect( "key_press_event", G_CALLBACK( EntityEntry_keypress ), 0 );
                                                g_entityKeyEntry = entry;
                                        }
                                                entry.connect( "key_press_event", G_CALLBACK( EntityEntry_keypress ), 0 );
                                                g_entityKeyEntry = entry;
                                        }
@@ -1455,10 +1455,10 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                        {
                                                auto entry = ui::Entry(ui::New);
                                                entry.show();
                                        {
                                                auto entry = ui::Entry(ui::New);
                                                entry.show();
-                                               gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+                                               gtk_table_attach( table, entry , 1, 2, 1, 2,
                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
-                                               gtk_widget_set_events( GTK_WIDGET( entry ), GDK_KEY_PRESS_MASK );
+                                               gtk_widget_set_events( entry , GDK_KEY_PRESS_MASK );
                                                entry.connect( "key_press_event", G_CALLBACK( EntityEntry_keypress ), 0 );
                                                g_entityValueEntry = entry;
                                        }
                                                entry.connect( "key_press_event", G_CALLBACK( EntityEntry_keypress ), 0 );
                                                g_entityValueEntry = entry;
                                        }
@@ -1466,7 +1466,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                        {
                                                auto label = ui::Label( "Value" );
                                                label.show();
                                        {
                                                auto label = ui::Label( "Value" );
                                                label.show();
-                                               gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+                                               gtk_table_attach( table, label , 0, 1, 1, 2,
                                                                                  (GtkAttachOptions)( GTK_FILL ),
                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                                  (GtkAttachOptions)( GTK_FILL ),
                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -1475,7 +1475,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                        {
                                                auto label = ui::Label( "Key" );
                                                label.show();
                                        {
                                                auto label = ui::Label( "Key" );
                                                label.show();
-                                               gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+                                               gtk_table_attach( table, label , 0, 1, 0, 1,
                                                                                  (GtkAttachOptions)( GTK_FILL ),
                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                                  (GtkAttachOptions)( GTK_FILL ),
                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
index 8f677c2..602ea1e 100644 (file)
@@ -118,7 +118,7 @@ void entitylist_treeviewcolumn_celldatafunc( GtkTreeViewColumn* column, GtkCellR
                g_object_set( G_OBJECT( renderer ), "text", name, "visible", TRUE, NULL );
 
                //globalOutputStream() << "rendering cell " << makeQuoted(name) << "\n";
                g_object_set( G_OBJECT( renderer ), "text", name, "visible", TRUE, NULL );
 
                //globalOutputStream() << "rendering cell " << makeQuoted(name) << "\n";
-               GtkStyle* style = gtk_widget_get_style( GTK_WIDGET( getEntityList().m_tree_view ) );
+               GtkStyle* style = gtk_widget_get_style( ui::TreeView( getEntityList().m_tree_view ) );
                if ( instance->childSelected() ) {
                        g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_ACTIVE], NULL );
                }
                if ( instance->childSelected() ) {
                        g_object_set( G_OBJECT( renderer ), "cell-background-gdk", &style->base[GTK_STATE_ACTIVE], NULL );
                }
index 32c025f..e35159f 100644 (file)
@@ -170,7 +170,7 @@ gboolean OnSelchangeComboWhatgame( ui::Widget widget, GameCombo* combo ){
        gamecombo_t gamecombo = gamecombo_for_gamename( gamename );
 
        combo->fsgame_entry.text( gamecombo.fs_game );
        gamecombo_t gamecombo = gamecombo_for_gamename( gamename );
 
        combo->fsgame_entry.text( gamecombo.fs_game );
-       gtk_widget_set_sensitive( GTK_WIDGET( combo->fsgame_entry ), gamecombo.sensitive );
+       gtk_widget_set_sensitive( combo->fsgame_entry , gamecombo.sensitive );
 
        return FALSE;
 }
 
        return FALSE;
 }
@@ -210,7 +210,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                window.add(table1);
                {
             auto vbox = create_dialog_vbox( 4 );
                window.add(table1);
                {
             auto vbox = create_dialog_vbox( 4 );
-                       gtk_table_attach( table1, GTK_WIDGET( vbox ), 1, 2, 0, 1,
+                       gtk_table_attach( table1, vbox , 1, 2, 0, 1,
                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
                        {
                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
                        {
@@ -224,7 +224,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                }
                {
                        auto frame = create_dialog_frame( "Project settings" );
                }
                {
                        auto frame = create_dialog_frame( "Project settings" );
-                       gtk_table_attach( table1, GTK_WIDGET( frame ), 0, 1, 0, 1,
+                       gtk_table_attach( table1, frame , 0, 1, 0, 1,
                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
                        {
                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
                        {
@@ -234,7 +234,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                {
                                        auto label = ui::Label( "Select mod" );
                                        label.show();
                                {
                                        auto label = ui::Label( "Select mod" );
                                        label.show();
-                                       gtk_table_attach( table2, GTK_WIDGET( label ), 0, 1, 0, 1,
+                                       gtk_table_attach( table2, label , 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
@@ -249,7 +249,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                        gtk_combo_box_text_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().custom );
 
                                        dialog.game_combo.game_select.show();
                                        gtk_combo_box_text_append_text( dialog.game_combo.game_select, globalGameComboConfiguration().custom );
 
                                        dialog.game_combo.game_select.show();
-                                       gtk_table_attach( table2, GTK_WIDGET( dialog.game_combo.game_select ), 1, 2, 0, 1,
+                                       gtk_table_attach( table2, dialog.game_combo.game_select , 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
@@ -259,7 +259,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                {
                                        auto label = ui::Label( "fs_game" );
                                        label.show();
                                {
                                        auto label = ui::Label( "fs_game" );
                                        label.show();
-                                       gtk_table_attach( table2, GTK_WIDGET( label ), 0, 1, 1, 2,
+                                       gtk_table_attach( table2, label , 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
@@ -267,7 +267,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                {
                                        auto entry = ui::Entry(ui::New);
                                        entry.show();
                                {
                                        auto entry = ui::Entry(ui::New);
                                        entry.show();
-                                       gtk_table_attach( table2, GTK_WIDGET( entry ), 1, 2, 1, 2,
+                                       gtk_table_attach( table2, entry , 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
@@ -277,7 +277,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                if ( globalMappingMode().do_mapping_mode ) {
                                        auto label = ui::Label( "Mapping mode" );
                                        label.show();
                                if ( globalMappingMode().do_mapping_mode ) {
                                        auto label = ui::Label( "Mapping mode" );
                                        label.show();
-                                       gtk_table_attach( table2, GTK_WIDGET( label ), 0, 1, 3, 4,
+                                       gtk_table_attach( table2, label , 0, 1, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
@@ -287,7 +287,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
                                        gtk_combo_box_text_append_text( combo, globalMappingMode().mp_mapping_mode );
 
                                        combo.show();
                                        gtk_combo_box_text_append_text( combo, globalMappingMode().mp_mapping_mode );
 
                                        combo.show();
-                                       gtk_table_attach( table2, GTK_WIDGET( combo ), 1, 2, 3, 4,
+                                       gtk_table_attach( table2, combo , 1, 2, 3, 4,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
@@ -303,7 +303,7 @@ ui::Window ProjectSettingsDialog_construct( ProjectSettingsDialog& dialog, Modal
 
        gtk_combo_box_set_active( dialog.game_combo.game_select, gamecombo.game );
        dialog.game_combo.fsgame_entry.text( gamecombo.fs_game );
 
        gtk_combo_box_set_active( dialog.game_combo.game_select, gamecombo.game );
        dialog.game_combo.fsgame_entry.text( gamecombo.fs_game );
-       gtk_widget_set_sensitive( GTK_WIDGET( dialog.game_combo.fsgame_entry ), gamecombo.sensitive );
+       gtk_widget_set_sensitive( dialog.game_combo.fsgame_entry , gamecombo.sensitive );
 
        if ( globalMappingMode().do_mapping_mode ) {
                const char *gamemode = gamemode_get();
 
        if ( globalMappingMode().do_mapping_mode ) {
                const char *gamemode = gamemode_get();
@@ -389,7 +389,7 @@ void DoSides( int type, int axis ){
                        entry.show();
                        hbox.pack_start( entry, FALSE, FALSE, 0 );
                        sides_entry = entry;
                        entry.show();
                        hbox.pack_start( entry, FALSE, FALSE, 0 );
                        sides_entry = entry;
-                       gtk_widget_grab_focus( GTK_WIDGET( entry ) );
+                       gtk_widget_grab_focus( entry  );
                }
                {
             auto vbox = create_dialog_vbox( 4 );
                }
                {
             auto vbox = create_dialog_vbox( 4 );
@@ -398,12 +398,12 @@ void DoSides( int type, int axis ){
                                auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &dialog );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
                                auto button = create_dialog_button( "OK", G_CALLBACK( dialog_button_ok ), &dialog );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+                               gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
                        }
                        {
                 auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                        }
                        {
                 auto button = create_dialog_button( "Cancel", G_CALLBACK( dialog_button_cancel ), &dialog );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+                               gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
                        }
                }
        }
                        }
                }
        }
@@ -514,7 +514,7 @@ void DoAbout(){
                                {
                                        auto label = ui::Label( "Vendor:" );
                                        label.show();
                                {
                                        auto label = ui::Label( "Vendor:" );
                                        label.show();
-                                       gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+                                       gtk_table_attach( table, label , 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -522,7 +522,7 @@ void DoAbout(){
                                {
                                        auto label = ui::Label( "Version:" );
                                        label.show();
                                {
                                        auto label = ui::Label( "Version:" );
                                        label.show();
-                                       gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+                                       gtk_table_attach( table, label , 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -530,7 +530,7 @@ void DoAbout(){
                                {
                                        auto label = ui::Label( "Renderer:" );
                                        label.show();
                                {
                                        auto label = ui::Label( "Renderer:" );
                                        label.show();
-                                       gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
+                                       gtk_table_attach( table, label , 0, 1, 2, 3,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -538,7 +538,7 @@ void DoAbout(){
                                {
                                        auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_VENDOR ) ) );
                                        label.show();
                                {
                                        auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_VENDOR ) ) );
                                        label.show();
-                                       gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 0, 1,
+                                       gtk_table_attach( table, label , 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -546,7 +546,7 @@ void DoAbout(){
                                {
                                        auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_VERSION ) ) );
                                        label.show();
                                {
                                        auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_VERSION ) ) );
                                        label.show();
-                                       gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 1, 2,
+                                       gtk_table_attach( table, label , 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -554,7 +554,7 @@ void DoAbout(){
                                {
                                        auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_RENDERER ) ) );
                                        label.show();
                                {
                                        auto label = ui::Label( reinterpret_cast<const char*>( glGetString( GL_RENDERER ) ) );
                                        label.show();
-                                       gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 2, 3,
+                                       gtk_table_attach( table, label , 1, 2, 2, 3,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -625,7 +625,7 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
                                {
                                        auto label = ui::Label( "Texture x:" );
                                        label.show();
                                {
                                        auto label = ui::Label( "Texture x:" );
                                        label.show();
-                                       gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+                                       gtk_table_attach( table, label , 0, 1, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -633,7 +633,7 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
                                {
                                        auto label = ui::Label( "Texture y:" );
                                        label.show();
                                {
                                        auto label = ui::Label( "Texture y:" );
                                        label.show();
-                                       gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+                                       gtk_table_attach( table, label , 0, 1, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                          (GtkAttachOptions) ( GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -641,7 +641,7 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
                                {
                                        auto entry = ui::Entry(ui::New);
                                        entry.show();
                                {
                                        auto entry = ui::Entry(ui::New);
                                        entry.show();
-                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
+                                       gtk_table_attach( table, entry , 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
@@ -650,7 +650,7 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
                                {
                                        auto entry = ui::Entry(ui::New);
                                        entry.show();
                                {
                                        auto entry = ui::Entry(ui::New);
                                        entry.show();
-                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+                                       gtk_table_attach( table, entry , 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
@@ -665,12 +665,12 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
                                auto button = create_modal_dialog_button( "OK", ok_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
                                auto button = create_modal_dialog_button( "OK", ok_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+                               gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
                        }
                        {
                 auto button = create_modal_dialog_button( "Cancel", cancel_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                        }
                        {
                 auto button = create_modal_dialog_button( "Cancel", cancel_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+                               gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
                        }
                }
        }
                        }
                }
        }
@@ -685,7 +685,7 @@ EMessageBoxReturn DoTextureLayout( float *fx, float *fy ){
        y.text( buf );
 
        // Set focus after intializing the values
        y.text( buf );
 
        // Set focus after intializing the values
-       gtk_widget_grab_focus( GTK_WIDGET( x ) );
+       gtk_widget_grab_focus(  );
 
        EMessageBoxReturn ret = modal_dialog_show( window, dialog );
        if ( ret == eIDOK ) {
 
        EMessageBoxReturn ret = modal_dialog_show( window, dialog );
        if ( ret == eIDOK ) {
@@ -724,7 +724,7 @@ static void editor_save( ui::Widget widget, gpointer data ){
        gpointer text = g_object_get_data( G_OBJECT( data ), "text" );
 
        if ( f == 0 ) {
        gpointer text = g_object_get_data( G_OBJECT( data ), "text" );
 
        if ( f == 0 ) {
-               ui::Widget(GTK_WIDGET( data )).alert( "Error saving file !" );
+               ui::Widget::from(data).alert( "Error saving file !" );
                return;
        }
 
                return;
        }
 
@@ -877,7 +877,7 @@ EMessageBoxReturn DoLightIntensityDlg( int *intensity ){
                                entry.show();
                                vbox.pack_start( entry, TRUE, TRUE, 0 );
 
                                entry.show();
                                vbox.pack_start( entry, TRUE, TRUE, 0 );
 
-                               gtk_widget_grab_focus( GTK_WIDGET( entry ) );
+                               gtk_widget_grab_focus( entry  );
 
                                intensity_entry = entry;
                        }
 
                                intensity_entry = entry;
                        }
@@ -890,12 +890,12 @@ EMessageBoxReturn DoLightIntensityDlg( int *intensity ){
                                auto button = create_modal_dialog_button( "OK", ok_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
                                auto button = create_modal_dialog_button( "OK", ok_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+                               gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
                        }
                        {
                 auto button = create_modal_dialog_button( "Cancel", cancel_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                        }
                        {
                 auto button = create_modal_dialog_button( "Cancel", cancel_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+                               gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
                        }
                }
        }
                        }
                }
        }
@@ -945,7 +945,7 @@ EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, const char* title ){
                                entry.show();
                                vbox.pack_start( entry, TRUE, TRUE, 0 );
 
                                entry.show();
                                vbox.pack_start( entry, TRUE, TRUE, 0 );
 
-                               gtk_widget_grab_focus( GTK_WIDGET( entry ) );
+                               gtk_widget_grab_focus( entry  );
 
                                textentry = entry;
                        }
 
                                textentry = entry;
                        }
@@ -958,12 +958,12 @@ EMessageBoxReturn DoShaderTagDlg( CopiedString* tag, const char* title ){
                                auto button = create_modal_dialog_button( "OK", ok_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
                                auto button = create_modal_dialog_button( "OK", ok_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+                               gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
                        }
                        {
                 auto button = create_modal_dialog_button( "Cancel", cancel_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                        }
                        {
                 auto button = create_modal_dialog_button( "Cancel", cancel_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+                               gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Escape, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
                        }
                }
        }
                        }
                }
        }
@@ -1017,7 +1017,7 @@ EMessageBoxReturn DoShaderInfoDlg( const char* name, const char* filename, const
                                auto button = create_modal_dialog_button( "OK", ok_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
                                auto button = create_modal_dialog_button( "OK", ok_button );
                                vbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
+                               gtk_widget_add_accelerator( button , "clicked", accel_group, GDK_KEY_Return, (GdkModifierType)0, GTK_ACCEL_VISIBLE );
                        }
                }
        }
                        }
                }
        }
index ecafc38..c06c290 100644 (file)
@@ -1631,7 +1631,7 @@ WaitDialog create_wait_dialog( const char* title, const char* text ){
                gtk_misc_set_alignment( GTK_MISC( dialog.m_label ), 0.0, 0.5 );
                gtk_label_set_justify( dialog.m_label, GTK_JUSTIFY_LEFT );
                dialog.m_label.show();
                gtk_misc_set_alignment( GTK_MISC( dialog.m_label ), 0.0, 0.5 );
                gtk_label_set_justify( dialog.m_label, GTK_JUSTIFY_LEFT );
                dialog.m_label.show();
-               gtk_widget_set_size_request( GTK_WIDGET( dialog.m_label ), 200, -1 );
+               gtk_widget_set_size_request( dialog.m_label , 200, -1 );
 
                dialog.m_window.add(dialog.m_label);
        }
 
                dialog.m_window.add(dialog.m_label);
        }
@@ -1692,7 +1692,7 @@ void ScreenUpdates_Disable( const char* message, const char* title ){
                bool isActiveApp = MainFrame_isActiveApp();
 
                g_wait = create_wait_dialog( title, message );
                bool isActiveApp = MainFrame_isActiveApp();
 
                g_wait = create_wait_dialog( title, message );
-               gtk_grab_add( GTK_WIDGET( g_wait.m_window ) );
+               gtk_grab_add( g_wait.m_window  );
 
                if ( isActiveApp ) {
                        g_wait.m_window.show();
 
                if ( isActiveApp ) {
                        g_wait.m_window.show();
@@ -1711,9 +1711,9 @@ void ScreenUpdates_Enable(){
        g_wait_stack.pop_back();
        if ( g_wait_stack.empty() ) {
                EverySecondTimer_enable();
        g_wait_stack.pop_back();
        if ( g_wait_stack.empty() ) {
                EverySecondTimer_enable();
-               //gtk_widget_set_sensitive(GTK_WIDGET(MainFrame_getWindow()), TRUE);
+               //gtk_widget_set_sensitive(MainFrame_getWindow(), TRUE);
 
 
-               gtk_grab_remove( GTK_WIDGET( g_wait.m_window ) );
+               gtk_grab_remove( g_wait.m_window  );
                destroy_floating_window( g_wait.m_window );
                g_wait.m_window = ui::Window{ui::null};
 
                destroy_floating_window( g_wait.m_window );
                g_wait.m_window = ui::Window{ui::null};
 
@@ -2321,7 +2321,7 @@ ui::Toolbar create_main_toolbar( MainFrame::EViewStyle style ){
        toolbar.show();
 
        auto space = [&]() {
        toolbar.show();
 
        auto space = [&]() {
-               auto btn = ui::Widget(GTK_WIDGET(gtk_separator_tool_item_new()));
+               auto btn = ui::ToolItem(gtk_separator_tool_item_new());
                btn.show();
                toolbar.add(btn);
        };
                btn.show();
                toolbar.add(btn);
        };
@@ -2386,8 +2386,8 @@ ui::Toolbar create_main_toolbar( MainFrame::EViewStyle style ){
 
        // disable the console and texture button in the regular layouts
        if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft ) {
 
        // disable the console and texture button in the regular layouts
        if ( style == MainFrame::eRegular || style == MainFrame::eRegularLeft ) {
-               gtk_widget_set_sensitive( GTK_WIDGET( g_view_console_button ), FALSE );
-               gtk_widget_set_sensitive( GTK_WIDGET( g_view_textures_button ), FALSE );
+               gtk_widget_set_sensitive( g_view_console_button , FALSE );
+               gtk_widget_set_sensitive( g_view_textures_button , FALSE );
        }
 
        return toolbar;
        }
 
        return toolbar;
@@ -2402,15 +2402,15 @@ ui::Widget create_main_statusbar( ui::Widget pStatusLabel[c_count_status] ){
                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                gtk_misc_set_padding( GTK_MISC( label ), 4, 2 );
                label.show();
                gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                gtk_misc_set_padding( GTK_MISC( label ), 4, 2 );
                label.show();
-               gtk_table_attach_defaults( table, GTK_WIDGET( label ), 0, 1, 0, 1 );
-               pStatusLabel[c_command_status] = ui::Widget(GTK_WIDGET( label ));
+               gtk_table_attach_defaults( table, label , 0, 1, 0, 1 );
+               pStatusLabel[c_command_status] = ui::Widget(label );
        }
 
        for ( int i = 1; i < c_count_status; ++i )
        {
                auto frame = ui::Frame();
                frame.show();
        }
 
        for ( int i = 1; i < c_count_status; ++i )
        {
                auto frame = ui::Frame();
                frame.show();
-               gtk_table_attach_defaults( table, GTK_WIDGET( frame ), i, i + 1, 0, 1 );
+               gtk_table_attach_defaults( table, frame , i, i + 1, 0, 1 );
                gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
 
                auto label = ui::Label( "Label" );
                gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
 
                auto label = ui::Label( "Label" );
@@ -2419,10 +2419,10 @@ ui::Widget create_main_statusbar( ui::Widget pStatusLabel[c_count_status] ){
                gtk_misc_set_padding( GTK_MISC( label ), 4, 2 );
                label.show();
                frame.add(label);
                gtk_misc_set_padding( GTK_MISC( label ), 4, 2 );
                label.show();
                frame.add(label);
-               pStatusLabel[i] = ui::Widget(GTK_WIDGET( label ));
+               pStatusLabel[i] = ui::Widget(label );
        }
 
        }
 
-       return ui::Widget(GTK_WIDGET( table ));
+       return ui::Widget(table );
 }
 
 #if 0
 }
 
 #if 0
@@ -2674,7 +2674,7 @@ ui::Window create_splash(){
        image.show();
        window.add(image);
 
        image.show();
        window.add(image);
 
-       gtk_widget_set_size_request( GTK_WIDGET( window ), -1, -1 );
+       gtk_widget_set_size_request( window , -1, -1 );
        window.show();
 
        return window;
        window.show();
 
        return window;
@@ -2722,7 +2722,7 @@ void MainFrame::Create(){
        }
 #endif
 
        }
 #endif
 
-       gtk_widget_add_events( GTK_WIDGET( window ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK );
+       gtk_widget_add_events( window , GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK );
        window.connect( "delete_event", G_CALLBACK( mainframe_delete ), this );
 
        m_position_tracker.connect( window );
        window.connect( "delete_event", G_CALLBACK( mainframe_delete ), this );
 
        m_position_tracker.connect( window );
@@ -2809,7 +2809,7 @@ void MainFrame::Create(){
                                // xy
                                m_pXYWnd = new XYWnd();
                                m_pXYWnd->SetViewType( XY );
                                // xy
                                m_pXYWnd = new XYWnd();
                                m_pXYWnd->SetViewType( XY );
-                               ui::Widget xy_window = ui::Widget(GTK_WIDGET( create_framed_widget( m_pXYWnd->GetWidget() ) ));
+                               ui::Widget xy_window = ui::Widget(create_framed_widget( m_pXYWnd->GetWidget( ) ));
 
                                {
                                        ui::Widget vsplit2 = ui::VPaned(ui::New);
 
                                {
                                        ui::Widget vsplit2 = ui::VPaned(ui::New);
@@ -2831,14 +2831,14 @@ void MainFrame::Create(){
                                        m_pCamWnd = NewCamWnd();
                                        GlobalCamera_setCamWnd( *m_pCamWnd );
                                        CamWnd_setParent( *m_pCamWnd, window );
                                        m_pCamWnd = NewCamWnd();
                                        GlobalCamera_setCamWnd( *m_pCamWnd );
                                        CamWnd_setParent( *m_pCamWnd, window );
-                                       GtkFrame* camera_window = create_framed_widget( CamWnd_getWidget( *m_pCamWnd ) );
+                                       auto camera_window = create_framed_widget( CamWnd_getWidget( *m_pCamWnd ) );
 
 
-                                       gtk_paned_add1( GTK_PANED( vsplit2 ), GTK_WIDGET( camera_window ) );
+                                       gtk_paned_add1( GTK_PANED( vsplit2 ), camera_window  );
 
                                        // textures
 
                                        // textures
-                                       GtkFrame* texture_window = create_framed_widget( TextureBrowser_constructWindow( window ) );
+                                       auto texture_window = create_framed_widget( TextureBrowser_constructWindow( window ) );
 
 
-                                       gtk_paned_add2( GTK_PANED( vsplit2 ), GTK_WIDGET( texture_window ) );
+                                       gtk_paned_add2( GTK_PANED( vsplit2 ), texture_window  );
                                }
                        }
                }
                                }
                        }
                }
@@ -2933,8 +2933,8 @@ void MainFrame::Create(){
                }
 
                {
                }
 
                {
-                       GtkFrame* frame = create_framed_widget( TextureBrowser_constructWindow( GroupDialog_getWindow() ) );
-                       g_page_textures = GroupDialog_addPage( "Textures", ui::Widget(GTK_WIDGET( frame )), TextureBrowserExportTitleCaller() );
+                       auto frame = create_framed_widget( TextureBrowser_constructWindow( GroupDialog_getWindow() ) );
+                       g_page_textures = GroupDialog_addPage( "Textures", frame, TextureBrowserExportTitleCaller() );
                }
 
                GroupDialog_show();
                }
 
                GroupDialog_show();
@@ -2966,8 +2966,8 @@ void MainFrame::Create(){
                vbox.pack_start( split, TRUE, TRUE, 0 );
 
                {
                vbox.pack_start( split, TRUE, TRUE, 0 );
 
                {
-                       GtkFrame* frame = create_framed_widget( TextureBrowser_constructWindow( window ) );
-                       g_page_textures = GroupDialog_addPage( "Textures", ui::Widget(GTK_WIDGET( frame )), TextureBrowserExportTitleCaller() );
+            auto frame = create_framed_widget( TextureBrowser_constructWindow( window ) );
+                       g_page_textures = GroupDialog_addPage( "Textures", frame, TextureBrowserExportTitleCaller() );
                }
        }
 
                }
        }
 
@@ -3008,7 +3008,7 @@ void MainFrame::SaveWindowInfo(){
 
        g_layout_globals.m_position = m_position_tracker.getPosition();
 
 
        g_layout_globals.m_position = m_position_tracker.getPosition();
 
-       g_layout_globals.nState = gdk_window_get_state( gtk_widget_get_window(GTK_WIDGET( m_window )) );
+       g_layout_globals.nState = gdk_window_get_state( gtk_widget_get_window(m_window ) );
 }
 
 void MainFrame::Shutdown(){
 }
 
 void MainFrame::Shutdown(){
index dbfb6c7..8da8654 100644 (file)
@@ -786,7 +786,7 @@ void DoMapInfo(){
                                {
                                        auto entry = ui::Entry(ui::New);
                                        entry.show();
                                {
                                        auto entry = ui::Entry(ui::New);
                                        entry.show();
-                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
+                                       gtk_table_attach( table, entry , 1, 2, 0, 1,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE );
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE );
@@ -796,7 +796,7 @@ void DoMapInfo(){
                                {
                                        auto entry = ui::Entry(ui::New);
                                        entry.show();
                                {
                                        auto entry = ui::Entry(ui::New);
                                        entry.show();
-                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+                                       gtk_table_attach( table, entry , 1, 2, 1, 2,
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE );
                                                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                          (GtkAttachOptions) ( 0 ), 0, 0 );
                                        gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE );
@@ -2065,16 +2065,16 @@ void DoFind(){
                        {
                                auto entry = ui::Entry(ui::New);
                                entry.show();
                        {
                                auto entry = ui::Entry(ui::New);
                                entry.show();
-                               gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
+                               gtk_table_attach( table, entry , 1, 2, 0, 1,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
-                               gtk_widget_grab_focus( GTK_WIDGET( entry ) );
+                               gtk_widget_grab_focus( entry  );
                                entity = entry;
                        }
                        {
                                auto entry = ui::Entry(ui::New);
                                entry.show();
                                entity = entry;
                        }
                        {
                                auto entry = ui::Entry(ui::New);
                                entry.show();
-                               gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+                               gtk_table_attach( table, entry , 1, 2, 1, 2,
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
 
                                                                  (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                                                  (GtkAttachOptions) ( 0 ), 0, 0 );
 
@@ -2088,12 +2088,12 @@ void DoFind(){
                                auto button = create_dialog_button( "Find", G_CALLBACK( dialog_button_ok ), &dialog );
                                hbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
                                auto button = create_dialog_button( "Find", G_CALLBACK( dialog_button_ok ), &dialog );
                                hbox.pack_start( button, FALSE, FALSE, 0 );
                                widget_make_default( button );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
+                               gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Return, (GdkModifierType)0, (GtkAccelFlags)0 );
                        }
                        {
                                auto button = create_dialog_button( "Close", G_CALLBACK( dialog_button_cancel ), &dialog );
                                hbox.pack_start( button, FALSE, FALSE, 0 );
                        }
                        {
                                auto button = create_dialog_button( "Close", G_CALLBACK( dialog_button_cancel ), &dialog );
                                hbox.pack_start( button, FALSE, FALSE, 0 );
-                               gtk_widget_add_accelerator( GTK_WIDGET( button ), "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
+                               gtk_widget_add_accelerator( button , "clicked", accel, GDK_KEY_Escape, (GdkModifierType)0, (GtkAccelFlags)0 );
                        }
                }
        }
                        }
                }
        }
index 71133c5..4f0df1a 100644 (file)
@@ -120,8 +120,8 @@ void MRU_AddFile( const char *str ){
                MRU_SetText( i, MRU_GetText( i - 1 ) );
 
        MRU_SetText( 0, str );
                MRU_SetText( i, MRU_GetText( i - 1 ) );
 
        MRU_SetText( 0, str );
-       gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), TRUE );
-       ui::Widget(GTK_WIDGET( MRU_items[MRU_used - 1] )).show();
+       gtk_widget_set_sensitive( ui::MenuItem(MRU_items[0]) , TRUE );
+       ui::MenuItem(MRU_items[MRU_used - 1] ).show();
 }
 
 void MRU_Init(){
 }
 
 void MRU_Init(){
@@ -135,8 +135,8 @@ void MRU_AddWidget( GtkMenuItem *widget, std::size_t pos ){
                MRU_items[pos] = widget;
                if ( pos < MRU_used ) {
                        MRU_updateWidget( pos, MRU_GetText( pos ) );
                MRU_items[pos] = widget;
                if ( pos < MRU_used ) {
                        MRU_updateWidget( pos, MRU_GetText( pos ) );
-                       gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), TRUE );
-                       ui::Widget(GTK_WIDGET( MRU_items[pos] )).show();
+                       gtk_widget_set_sensitive( ui::MenuItem(MRU_items[0]) , TRUE );
+                       ui::MenuItem(MRU_items[pos]).show();
                }
        }
 }
                }
        }
 }
@@ -161,7 +161,7 @@ void MRU_Activate( std::size_t index ){
                if ( MRU_used == 0 ) {
                        auto label = ui::Label(GTK_LABEL(gtk_bin_get_child(GTK_BIN(MRU_items[0] )) ));
                        label.text("Recent Files");
                if ( MRU_used == 0 ) {
                        auto label = ui::Label(GTK_LABEL(gtk_bin_get_child(GTK_BIN(MRU_items[0] )) ));
                        label.text("Recent Files");
-                       gtk_widget_set_sensitive( GTK_WIDGET( MRU_items[0] ), FALSE );
+                       gtk_widget_set_sensitive( ui::MenuItem(MRU_items[0]), FALSE );
                }
                else
                {
                }
                else
                {
@@ -195,7 +195,7 @@ LoadMRU g_load_mru4( 4 );
 void MRU_constructMenu( ui::Menu menu ){
        {
                auto item = create_menu_item_with_mnemonic( menu, "_1", LoadMRUCaller( g_load_mru1 ) );
 void MRU_constructMenu( ui::Menu menu ){
        {
                auto item = create_menu_item_with_mnemonic( menu, "_1", LoadMRUCaller( g_load_mru1 ) );
-               gtk_widget_set_sensitive( GTK_WIDGET( item ), FALSE );
+               gtk_widget_set_sensitive( item , FALSE );
                MRU_AddWidget( item, 0 );
        }
        {
                MRU_AddWidget( item, 0 );
        }
        {
index 464bc06..77ea3a6 100644 (file)
@@ -171,15 +171,15 @@ void update(){
        if ( subdivisions.m_enabled ) {
                entry_set_int( m_horizontal, static_cast<int>( subdivisions.m_x ) );
                entry_set_int( m_vertical, static_cast<int>( subdivisions.m_y ) );
        if ( subdivisions.m_enabled ) {
                entry_set_int( m_horizontal, static_cast<int>( subdivisions.m_x ) );
                entry_set_int( m_vertical, static_cast<int>( subdivisions.m_y ) );
-               gtk_widget_set_sensitive( GTK_WIDGET( m_horizontal ), TRUE );
-               gtk_widget_set_sensitive( GTK_WIDGET( m_vertical ), TRUE );
+               gtk_widget_set_sensitive( m_horizontal , TRUE );
+               gtk_widget_set_sensitive( m_vertical , TRUE );
        }
        else
        {
                m_horizontal.text("");
                m_vertical.text("");
        }
        else
        {
                m_horizontal.text("");
                m_vertical.text("");
-               gtk_widget_set_sensitive( GTK_WIDGET( m_horizontal ), FALSE );
-               gtk_widget_set_sensitive( GTK_WIDGET( m_vertical ), FALSE );
+               gtk_widget_set_sensitive( m_horizontal , FALSE );
+               gtk_widget_set_sensitive( m_vertical , FALSE );
        }
 }
 void cancel(){
        }
 }
 void cancel(){
@@ -595,14 +595,14 @@ ui::Window PatchInspector::BuildDialog(){
                                                        {
                                                                auto label = ui::Label( "Row:" );
                                                                label.show();
                                                        {
                                                                auto label = ui::Label( "Row:" );
                                                                label.show();
-                                                               gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+                                                               gtk_table_attach( table, label , 0, 1, 0, 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                        {
                                                                auto label = ui::Label( "Column:" );
                                                                label.show();
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                        {
                                                                auto label = ui::Label( "Column:" );
                                                                label.show();
-                                                               gtk_table_attach( table, GTK_WIDGET( label ), 1, 2, 0, 1,
+                                                               gtk_table_attach( table, label , 1, 2, 0, 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
@@ -612,10 +612,10 @@ ui::Window PatchInspector::BuildDialog(){
                                                                AddDialogData( *GTK_COMBO_BOX(combo), m_nRow );
 
                                                                combo.show();
                                                                AddDialogData( *GTK_COMBO_BOX(combo), m_nRow );
 
                                                                combo.show();
-                                                               gtk_table_attach( table, GTK_WIDGET( combo ), 0, 1, 1, 2,
+                                                               gtk_table_attach( table, combo , 0, 1, 1, 2,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
-                                                               gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 );
+                                                               gtk_widget_set_size_request( combo , 60, -1 );
                                                                m_pRowCombo = combo;
                                                        }
 
                                                                m_pRowCombo = combo;
                                                        }
 
@@ -625,10 +625,10 @@ ui::Window PatchInspector::BuildDialog(){
                                                                AddDialogData( *GTK_COMBO_BOX(combo), m_nCol );
 
                                                                combo.show();
                                                                AddDialogData( *GTK_COMBO_BOX(combo), m_nCol );
 
                                                                combo.show();
-                                                               gtk_table_attach( table, GTK_WIDGET( combo ), 1, 2, 1, 2,
+                                                               gtk_table_attach( table, combo , 1, 2, 1, 2,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
-                                                               gtk_widget_set_size_request( GTK_WIDGET( combo ), 60, -1 );
+                                                               gtk_widget_set_size_request( combo , 60, -1 );
                                                                m_pColCombo = combo;
                                                        }
                                                }
                                                                m_pColCombo = combo;
                                                        }
                                                }
@@ -640,42 +640,42 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto label = ui::Label( "X:" );
                                                        label.show();
                                                {
                                                        auto label = ui::Label( "X:" );
                                                        label.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+                                                       gtk_table_attach( table, label , 0, 1, 0, 1,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
                                                        auto label = ui::Label( "Y:" );
                                                        label.show();
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
                                                        auto label = ui::Label( "Y:" );
                                                        label.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+                                                       gtk_table_attach( table, label , 0, 1, 1, 2,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
                                                        auto label = ui::Label( "Z:" );
                                                        label.show();
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
                                                        auto label = ui::Label( "Z:" );
                                                        label.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
+                                                       gtk_table_attach( table, label , 0, 1, 2, 3,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
                                                        auto label = ui::Label( "S:" );
                                                        label.show();
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
                                                        auto label = ui::Label( "S:" );
                                                        label.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 3, 4,
+                                                       gtk_table_attach( table, label , 0, 1, 3, 4,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
                                                        auto label = ui::Label( "T:" );
                                                        label.show();
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
                                                        auto label = ui::Label( "T:" );
                                                        label.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 4, 5,
+                                                       gtk_table_attach( table, label , 0, 1, 4, 5,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                }
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
+                                                       gtk_table_attach( table, entry , 1, 2, 0, 1,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        AddDialogData( *GTK_ENTRY(entry), m_fX );
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        AddDialogData( *GTK_ENTRY(entry), m_fX );
@@ -685,7 +685,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+                                                       gtk_table_attach( table, entry , 1, 2, 1, 2,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        AddDialogData( *GTK_ENTRY(entry), m_fY );
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        AddDialogData( *GTK_ENTRY(entry), m_fY );
@@ -695,7 +695,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 2, 3,
+                                                       gtk_table_attach( table, entry , 1, 2, 2, 3,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        AddDialogData( *GTK_ENTRY(entry), m_fZ );
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        AddDialogData( *GTK_ENTRY(entry), m_fZ );
@@ -705,7 +705,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 3, 4,
+                                                       gtk_table_attach( table, entry , 1, 2, 3, 4,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        AddDialogData( *GTK_ENTRY(entry), m_fS );
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        AddDialogData( *GTK_ENTRY(entry), m_fS );
@@ -715,7 +715,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 4, 5,
+                                                       gtk_table_attach( table, entry , 1, 2, 4, 5,
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        AddDialogData( *GTK_ENTRY(entry), m_fT );
                                                                                          (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        AddDialogData( *GTK_ENTRY(entry), m_fT );
@@ -742,14 +742,14 @@ ui::Window PatchInspector::BuildDialog(){
                                                        {
                                                                auto label = ui::Label( "Fixed" );
                                                                label.show();
                                                        {
                                                                auto label = ui::Label( "Fixed" );
                                                                label.show();
-                                                               gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 0, 1,
+                                                               gtk_table_attach( table, label , 0, 1, 0, 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                        {
                                                                auto check = ui::CheckButton(GTK_CHECK_BUTTON( gtk_check_button_new() ));
                                                                check.show();
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                        {
                                                                auto check = ui::CheckButton(GTK_CHECK_BUTTON( gtk_check_button_new() ));
                                                                check.show();
-                                                               gtk_table_attach( table, GTK_WIDGET( check ), 1, 2, 0, 1,
+                                                               gtk_table_attach( table, check , 1, 2, 0, 1,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                                m_subdivisions.m_enabled = check;
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                                m_subdivisions.m_enabled = check;
@@ -759,14 +759,14 @@ ui::Window PatchInspector::BuildDialog(){
                                                        {
                                                                auto label = ui::Label( "Horizontal" );
                                                                label.show();
                                                        {
                                                                auto label = ui::Label( "Horizontal" );
                                                                label.show();
-                                                               gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 1, 2,
+                                                               gtk_table_attach( table, label , 0, 1, 1, 2,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                        {
                                                                auto entry = ui::Entry(ui::New);
                                                                entry.show();
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                        {
                                                                auto entry = ui::Entry(ui::New);
                                                                entry.show();
-                                                               gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
+                                                               gtk_table_attach( table, entry , 1, 2, 1, 2,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                                m_subdivisions.m_horizontal = entry;
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                                m_subdivisions.m_horizontal = entry;
@@ -775,14 +775,14 @@ ui::Window PatchInspector::BuildDialog(){
                                                        {
                                                                auto label = ui::Label( "Vertical" );
                                                                label.show();
                                                        {
                                                                auto label = ui::Label( "Vertical" );
                                                                label.show();
-                                                               gtk_table_attach( table, GTK_WIDGET( label ), 0, 1, 2, 3,
+                                                               gtk_table_attach( table, label , 0, 1, 2, 3,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                        {
                                                                auto entry = ui::Entry(ui::New);
                                                                entry.show();
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                        }
                                                        {
                                                                auto entry = ui::Entry(ui::New);
                                                                entry.show();
-                                                               gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 2, 3,
+                                                               gtk_table_attach( table, entry , 1, 2, 2, 3,
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                                m_subdivisions.m_vertical = entry;
                                                                                                  (GtkAttachOptions)( GTK_EXPAND | GTK_FILL ),
                                                                                                  (GtkAttachOptions)( 0 ), 0, 0 );
                                                                m_subdivisions.m_vertical = entry;
@@ -826,7 +826,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto label = ui::Label( "Horizontal Shift Step" );
                                                        label.show();
                                                {
                                                        auto label = ui::Label( "Horizontal Shift Step" );
                                                        label.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 0, 1,
+                                                       gtk_table_attach( table, label , 2, 4, 0, 1,
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -834,7 +834,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto label = ui::Label( "Vertical Shift Step" );
                                                        label.show();
                                                {
                                                        auto label = ui::Label( "Vertical Shift Step" );
                                                        label.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 1, 2,
+                                                       gtk_table_attach( table, label , 2, 4, 1, 2,
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -842,7 +842,7 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto label = ui::Label( "Horizontal Stretch Step" );
                                                        label.show();
                                                {
                                                        auto label = ui::Label( "Horizontal Stretch Step" );
                                                        label.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 2, 3,
+                                                       gtk_table_attach( table, label , 2, 3, 2, 3,
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -850,16 +850,16 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto button = ui::Button( "Flip" );
                                                        button.show();
                                                {
                                                        auto button = ui::Button( "Flip" );
                                                        button.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 2, 3,
+                                                       gtk_table_attach( table, button , 3, 4, 2, 3,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 );
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 );
-                                                       gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+                                                       gtk_widget_set_size_request( button , 60, -1 );
                                                }
                                                {
                                                        auto label = ui::Label( "Vertical Stretch Step" );
                                                        label.show();
                                                }
                                                {
                                                        auto label = ui::Label( "Vertical Stretch Step" );
                                                        label.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 3, 4,
+                                                       gtk_table_attach( table, label , 2, 3, 3, 4,
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -867,16 +867,16 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto button = ui::Button( "Flip" );
                                                        button.show();
                                                {
                                                        auto button = ui::Button( "Flip" );
                                                        button.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 3, 4,
+                                                       gtk_table_attach( table, button , 3, 4, 3, 4,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 );
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        button.connect( "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 );
-                                                       gtk_widget_set_size_request( GTK_WIDGET( button ), 60, -1 );
+                                                       gtk_widget_set_size_request( button , 60, -1 );
                                                }
                                                {
                                                        auto label = ui::Label( "Rotate Step" );
                                                        label.show();
                                                }
                                                {
                                                        auto label = ui::Label( "Rotate Step" );
                                                        label.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 4, 5,
+                                                       gtk_table_attach( table, label , 2, 4, 4, 5,
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                                                          (GtkAttachOptions)( GTK_FILL|GTK_EXPAND ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -884,10 +884,10 @@ ui::Window PatchInspector::BuildDialog(){
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 0, 1,
+                                                       gtk_table_attach( table, entry , 0, 1, 0, 1,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       gtk_widget_set_size_request( GTK_WIDGET( entry ), 50, -1 );
+                                                       gtk_widget_set_size_request( entry , 50, -1 );
                                                        g_object_set_data( G_OBJECT( window ), "hshift_entry", (void *) 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
                                                        g_object_set_data( G_OBJECT( window ), "hshift_entry", (void *) 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
@@ -899,19 +899,19 @@ ui::Window PatchInspector::BuildDialog(){
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
                                                        spin.show();
 
                                                        auto spin = ui::SpinButton( adj, 1, 0 );
                                                        spin.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( spin ), 1, 2, 0, 1,
+                                                       gtk_table_attach( table, spin , 1, 2, 0, 1,
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                                                          (GtkAttachOptions)( 0 ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-                                                       gtk_widget_set_size_request( GTK_WIDGET( spin ), 10, -1 );
+                                                       gtk_widget_set_size_request( spin , 10, -1 );
                                                        gtk_widget_set_can_focus( spin, false );
                                                }
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
                                                        gtk_widget_set_can_focus( spin, false );
                                                }
                                                {
                                                        auto entry = ui::Entry(ui::New);
                                                        entry.show();
-                                                       gtk_table_attach( table, GTK_WIDGET( entry ), 0, 1, 1, 2,
+                                                       gtk_table_attach( table, entry , 0, 1, 1, 2,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
-           &nb