]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/build.cpp
Purge gtk_widget_show from radiant/*
[xonotic/netradiant.git] / radiant / build.cpp
index 1a4149882e12b739e44e89804dab4518cffb1f38..8fd89912447091d46b4ebc7b94b3bb5defeea85a 100644 (file)
@@ -633,18 +633,17 @@ void build_commands_write( const char* filename ){
 
 
 #include <gdk/gdkkeysyms.h>
-#include <gtk/gtk.h>
 
 #include "gtkutil/dialog.h"
 #include "gtkutil/closure.h"
 #include "gtkutil/window.h"
 #include "gtkdlgs.h"
 
-void Build_refreshMenu( GtkMenu* menu );
+void Build_refreshMenu( ui::Menu menu );
 
 
-void BSPCommandList_Construct( GtkListStore* store, Project& project ){
-       gtk_list_store_clear( store );
+void BSPCommandList_Construct( ui::ListStore store, Project& project ){
+       store.clear();
 
        for ( Project::iterator i = project.begin(); i != project.end(); ++i )
        {
@@ -663,7 +662,7 @@ class ProjectList
 {
 public:
 Project& m_project;
-GtkListStore* m_store;
+ui::ListStore m_store{nullptr};
 bool m_changed;
 ProjectList( Project& project ) : m_project( project ), m_changed( false ){
 }
@@ -735,7 +734,7 @@ gboolean project_key_press( ui::Widget widget, GdkEventKey* event, ProjectList*
 
 Build* g_current_build = 0;
 
-gboolean project_selection_changed( GtkTreeSelection* selection, GtkListStore* store ){
+gboolean project_selection_changed( GtkTreeSelection* selection, ui::ListStore store ){
        Project& project = g_build_project;
 
        gtk_list_store_clear( store );
@@ -773,7 +772,7 @@ gboolean project_selection_changed( GtkTreeSelection* selection, GtkListStore* s
        return FALSE;
 }
 
-gboolean commands_cell_edited( GtkCellRendererText* cell, gchar* path_string, gchar* new_text, GtkListStore* store ){
+gboolean commands_cell_edited( GtkCellRendererText* cell, gchar* path_string, gchar* new_text, ui::ListStore store ){
        if ( g_current_build == 0 ) {
                return FALSE;
        }
@@ -810,7 +809,7 @@ gboolean commands_cell_edited( GtkCellRendererText* cell, gchar* path_string, gc
        return FALSE;
 }
 
-gboolean commands_key_press( ui::Widget widget, GdkEventKey* event, GtkListStore* store ){
+gboolean commands_key_press( ui::Widget widget, GdkEventKey* event, ui::ListStore store ){
        if ( g_current_build == 0 ) {
                return FALSE;
        }
@@ -869,7 +868,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( scr ) );
 
                                {
-                                       GtkListStore* store = gtk_list_store_new( 1, G_TYPE_STRING );
+                                       auto store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
 
                                        ui::Widget view = ui::TreeView( ui::TreeModel(GTK_TREE_MODEL( store ) ));
                                        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
@@ -884,7 +883,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                        GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
                                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
 
-                                       gtk_widget_show( view );
+                                       view.show();
 
                                        buildView = view;
                                        projectList.m_store = store;
@@ -906,7 +905,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( scr ) );
 
                                {
-                                       GtkListStore* store = gtk_list_store_new( 1, G_TYPE_STRING );
+                                       ui::ListStore store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
 
                                        ui::Widget view = ui::TreeView(ui::TreeModel( GTK_TREE_MODEL( store ) ));
                                        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
@@ -921,7 +920,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                        GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
                                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
 
-                                       gtk_widget_show( view );
+                                       view.show();
 
                                        gtk_container_add( GTK_CONTAINER( scr ), view );
 
@@ -994,9 +993,9 @@ typedef std::list<BuildMenuItem> BuildMenuItems;
 BuildMenuItems g_BuildMenuItems;
 
 
-GtkMenu* g_bsp_menu;
+ui::Menu g_bsp_menu{nullptr};
 
-void Build_constructMenu( GtkMenu* menu ){
+void Build_constructMenu( ui::Menu menu ){
        for ( Project::iterator i = g_build_project.begin(); i != g_build_project.end(); ++i )
        {
                g_BuildMenuItems.push_back( BuildMenuItem( ( *i ).first.c_str(), 0 ) );
@@ -1011,10 +1010,10 @@ void Build_constructMenu( GtkMenu* menu ){
 }
 
 
-void Build_refreshMenu( GtkMenu* menu ){
+void Build_refreshMenu( ui::Menu menu ){
        for ( BuildMenuItems::iterator i = g_BuildMenuItems.begin(); i != g_BuildMenuItems.end(); ++i )
        {
-               gtk_container_remove( GTK_CONTAINER( menu ), GTK_WIDGET( ( *i ).m_item ) );
+               gtk_container_remove( menu, GTK_WIDGET( ( *i ).m_item ) );
        }
 
        g_BuildMenuItems.clear();