]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Wrap GtkCellRendererText
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 04:13:53 +0000 (15:13 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 17 Feb 2016 04:13:53 +0000 (15:13 +1100)
contrib/brushexport/interface.cpp
libs/uilib/uilib.cpp
libs/uilib/uilib.h
radiant/build.cpp
radiant/commands.cpp
radiant/entityinspector.cpp
radiant/entitylist.cpp
radiant/feedback.cpp
radiant/map.cpp
radiant/preferences.cpp
radiant/texwindow.cpp

index d2c0410015ed522fa7f738304d6d56616e0fa1f2..5d1f99829287ff9d0d9e175e30683fcae5c0a309 100644 (file)
@@ -214,7 +214,7 @@ void CreateWindow( void ){
        GtkTreeViewColumn* col = gtk_tree_view_column_new();
        gtk_tree_view_column_set_title( col, "materials" );
        gtk_tree_view_append_column( GTK_TREE_VIEW( lookup_widget( wnd, "t_materialist" ) ), col );
-       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+       GtkCellRenderer* renderer = ui::CellRendererText();
        gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( lookup_widget( wnd, "t_materialist" ) ), -1, "", renderer, "text", 0, NULL );
 
        // list store
index eb15398244ab6f2871c412d5be5c03146b2f8594..0e735c6db5a2894698b08a6c97e14ffd5ac998b9 100644 (file)
@@ -94,6 +94,9 @@ namespace ui {
     Button::Button(const char *label) : Button(GTK_BUTTON(gtk_button_new_with_label(label)))
     { }
 
+    CellRendererText::CellRendererText() : CellRendererText(GTK_CELL_RENDERER_TEXT(gtk_cell_renderer_text_new()))
+    { }
+
     CheckButton::CheckButton(const char *label) : CheckButton(GTK_CHECK_BUTTON(gtk_check_button_new_with_label(label)))
     { }
 
index 19ce370a88262bbd7ac7f85ff39d5272483e52e4..07c143bb23bf7c6124b7175317cfc728fec66722 100644 (file)
@@ -7,6 +7,8 @@ using ui_alignment = struct _GtkAlignment;
 using ui_box = struct _GtkBox;
 using ui_button = struct _GtkButton;
 using ui_checkbutton = struct _GtkCheckButton;
+using ui_cellrenderer = struct _GtkCellRenderer;
+using ui_cellrenderertext = struct _GtkCellRendererText;
 using ui_entry = struct _GtkEntry;
 using ui_evkey = struct _GdkEventKey;
 using ui_hbox = struct _GtkHBox;
@@ -119,6 +121,12 @@ namespace ui {
          Button(const char *label);
     );
 
+    WRAP(CellRenderer, Widget, ui_cellrenderer,);
+
+    WRAP(CellRendererText, CellRenderer, ui_cellrenderertext,
+         CellRendererText();
+    );
+
     WRAP(CheckButton, Widget, ui_checkbutton,
          CheckButton(const char *label);
     );
index 7294df5ca28c3669d570a5ff80c56d9bd3fa58a8..a81ad53fae98c041dc2e3dc3e07ee391362c5489 100644 (file)
@@ -882,7 +882,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                        ui::Widget view = ui::TreeView( ui::TreeModel(GTK_TREE_MODEL( store ) ));
                                        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
 
-                                       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                                       GtkCellRenderer* renderer = ui::CellRendererText();
                                        object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
                                        g_signal_connect( renderer, "edited", G_CALLBACK( project_cell_edited ), &projectList );
 
@@ -919,7 +919,7 @@ ui::Window BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
                                        ui::Widget view = ui::TreeView(ui::TreeModel( GTK_TREE_MODEL( store ) ));
                                        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
 
-                                       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                                       GtkCellRenderer* renderer = ui::CellRendererText();
                                        object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
                                        g_signal_connect( renderer, "edited", G_CALLBACK( commands_cell_edited ), store );
 
index eb3afaa4d53ef116b0e75252f577b21676a94c03..eaf4a15f9ec4de95516ce03b414e3478d4ee922f 100644 (file)
@@ -412,13 +412,13 @@ void DoCommandListDlg(){
                        gtk_tree_view_set_enable_search( GTK_TREE_VIEW( view ), false ); // annoying
 
                        {
-                               GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                               GtkCellRenderer* renderer = ui::CellRendererText();
                                GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "Command", renderer, "text", 0, "weight-set", 2, "weight", 3, NULL );
                                gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
                        }
 
                        {
-                               GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                               GtkCellRenderer* renderer = ui::CellRendererText();
                                GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "Key", renderer, "text", 1, "weight-set", 2, "weight", 3, NULL );
                                gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
                        }
index b509432bf7b972d8a5e444e9d01d57e8ad3ca9ac..d31b86c38310946b905467fbd4263490f008e3ca 100644 (file)
@@ -1344,7 +1344,7 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                        g_signal_connect( G_OBJECT( view ), "key_press_event", G_CALLBACK( EntityClassList_keypress ), 0 );
 
                                        {
-                                               GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                                               GtkCellRenderer* renderer = ui::CellRendererText();
                                                GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "Key", renderer, "text", 0, 0 );
                                                gtk_tree_view_append_column( view, column );
                                        }
@@ -1426,13 +1426,13 @@ ui::Widget EntityInspector_constructWindow( ui::Window toplevel ){
                                                gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
 
                                                {
-                                                       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                                                       GtkCellRenderer* renderer = ui::CellRendererText();
                                                        GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, 0 );
                                                        gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
                                                }
 
                                                {
-                                                       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                                                       GtkCellRenderer* renderer = ui::CellRendererText();
                                                        GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 1, 0 );
                                                        gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
                                                }
index 7aa5a80fa1ba9448a0a86c087fb69c8af08e198b..96de418cd57e00d2a2204eb0294fb4e16fcd87aa 100644 (file)
@@ -303,7 +303,7 @@ void EntityList_constructWindow( ui::Window main_window ){
                        ui::Widget view = ui::Widget(gtk_tree_view_new());
                        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
 
-                       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                       GtkCellRenderer* renderer = ui::CellRendererText();
                        GtkTreeViewColumn* column = gtk_tree_view_column_new();
                        gtk_tree_view_column_pack_start( column, renderer, TRUE );
                        gtk_tree_view_column_set_cell_data_func( column, renderer, entitylist_treeviewcolumn_celldatafunc, 0, 0 );
index a6e6cd658675d0a48745718706a97a7bd04a21f3..45bcf9c64d0ea243797c61da04854c24d79eb714 100644 (file)
@@ -311,7 +311,7 @@ ui::Window CDbgDlg::BuildDialog(){
                gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
 
                {
-                       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                       GtkCellRenderer* renderer = ui::CellRendererText();
                        GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, NULL );
                        gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
                }
index 07c1f654c9de4c70cde28f8e2d418cc29bc1575e..a035726b48b1664a999a6d9ed3a932c4ee34be41 100644 (file)
@@ -850,14 +850,14 @@ void DoMapInfo(){
                                gtk_tree_view_set_headers_clickable( GTK_TREE_VIEW( view ), TRUE );
 
                                {
-                                       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                                       GtkCellRenderer* renderer = ui::CellRendererText();
                                        GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "Entity", renderer, "text", 0, 0 );
                                        gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
                                        gtk_tree_view_column_set_sort_column_id( column, 0 );
                                }
 
                                {
-                                       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                                       GtkCellRenderer* renderer = ui::CellRendererText();
                                        GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "Count", renderer, "text", 1, 0 );
                                        gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
                                        gtk_tree_view_column_set_sort_column_id( column, 1 );
index f6e1704dfd20b973e6e543d6c13d6c701a3a4543..a194fb821a629e7cff93bdc4db73f8560eb04a98 100644 (file)
@@ -755,7 +755,7 @@ ui::Window PrefsDlg::BuildDialog(){
                                        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
 
                                        {
-                                               GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                                               GtkCellRenderer* renderer = ui::CellRendererText();
                                                GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "Preferences", renderer, "text", 0, NULL );
                                                gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
                                        }
index 95fdbd0fad1e9839de83120c338eb8b6437956e5..a86d65e4a798555138b7bf6e2d57159f2f80697f 100644 (file)
@@ -1536,7 +1536,7 @@ void TextureBrowser_createTreeViewTree(){
        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), FALSE );
        g_signal_connect( g_TextureBrowser.m_treeViewTree, "row-activated", (GCallback) TreeView_onRowActivated, NULL );
 
-       renderer = gtk_cell_renderer_text_new();
+       renderer = ui::CellRendererText();
        gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTree ), -1, "", renderer, "text", 0, NULL );
 
        TextureBrowser_constructTreeStore();
@@ -1594,7 +1594,7 @@ void TextureBrowser_createTreeViewTags(){
 
        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), FALSE );
 
-       renderer = gtk_cell_renderer_text_new();
+       renderer = ui::CellRendererText();
        gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( g_TextureBrowser.m_treeViewTags ), -1, "", renderer, "text", 0, NULL );
 
        TextureBrowser_constructTreeStoreTags();
@@ -2078,7 +2078,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                        GtkTreeSortable* sortable = GTK_TREE_SORTABLE( g_TextureBrowser.m_assigned_store );
                        gtk_tree_sortable_set_sort_column_id( sortable, TAG_COLUMN, GTK_SORT_ASCENDING );
 
-                       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                       GtkCellRenderer* renderer = ui::CellRendererText();
 
                        g_TextureBrowser.m_assigned_tree = ui::TreeView(ui::TreeModel( GTK_TREE_MODEL( g_TextureBrowser.m_assigned_store ) ));
                        g_object_unref( G_OBJECT( g_TextureBrowser.m_assigned_store ) );
@@ -2106,7 +2106,7 @@ ui::Widget TextureBrowser_constructWindow( ui::Window toplevel ){
                        GtkTreeSortable* sortable = GTK_TREE_SORTABLE( g_TextureBrowser.m_available_store );
                        gtk_tree_sortable_set_sort_column_id( sortable, TAG_COLUMN, GTK_SORT_ASCENDING );
 
-                       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+                       GtkCellRenderer* renderer = ui::CellRendererText();
 
                        g_TextureBrowser.m_available_tree = ui::TreeView(ui::TreeModel( GTK_TREE_MODEL( g_TextureBrowser.m_available_store ) ));
                        g_object_unref( G_OBJECT( g_TextureBrowser.m_available_store ) );