]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/entitylist.cpp
Remove <gtk/gtk.h> from gtkutil/window.h
[xonotic/netradiant.git] / radiant / entitylist.cpp
index 6ec2f55d3b6155b46463ef1f983d4c3f36d4cdf3..e3d176a0597588c12cf5d41d9307bbf82ea7d907 100644 (file)
@@ -23,8 +23,8 @@
 
 #include "iselection.h"
 
-#include <gtk/gtk.h>
 #include <uilib/uilib.h>
+#include <gtk/gtk.h>
 
 #include "string/string.h"
 #include "scenelib.h"
@@ -43,7 +43,6 @@
 void RedrawEntityList();
 typedef FreeCaller<RedrawEntityList> RedrawEntityListCaller;
 
-typedef struct _GtkTreeView GtkTreeView;
 
 class EntityList
 {
@@ -245,7 +244,7 @@ void entitylist_treeview_row_expanded( GtkTreeView* view, GtkTreeIter* iter, Gtk
 
 
 void EntityList_SetShown( bool shown ){
-       widget_set_visible( GTK_WIDGET( getEntityList().m_window ), shown );
+       widget_set_visible( getEntityList().m_window, shown );
 }
 
 void EntityList_toggleShown(){
@@ -283,7 +282,7 @@ void DetachEntityTreeModel(){
 void EntityList_constructWindow( ui::Window main_window ){
        ASSERT_TRUE( !getEntityList().m_window );
 
-       ui::Window window = ui::Window(create_persistent_floating_window( "Entity List", main_window ));
+       auto window = ui::Window(create_persistent_floating_window( "Entity List", main_window ));
 
        window.add_accel_group(global_accel);
 
@@ -293,8 +292,8 @@ void EntityList_constructWindow( ui::Window main_window ){
        getEntityList().m_window = window;
 
        {
-               GtkScrolledWindow* scr = create_scrolled_window( GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
-               gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( scr ) );
+               auto scr = create_scrolled_window( ui::Policy::AUTOMATIC, ui::Policy::AUTOMATIC );
+               window.add(scr);
 
                {
                        ui::Widget view = ui::TreeView();
@@ -313,8 +312,8 @@ void EntityList_constructWindow( ui::Window main_window ){
 
                        gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
 
-                       gtk_widget_show( view );
-                       gtk_container_add( GTK_CONTAINER( scr ), view );
+                       view.show();
+                       scr.add(view);
                        getEntityList().m_tree_view = GTK_TREE_VIEW( view );
                }
        }