From: TimePath Date: Wed, 17 Feb 2016 04:13:53 +0000 (+1100) Subject: Wrap GtkCellRendererText X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=295c5731f9386a352862bc0bbec8b25ec3670824;p=xonotic%2Fnetradiant.git Wrap GtkCellRendererText --- diff --git a/contrib/brushexport/interface.cpp b/contrib/brushexport/interface.cpp index d2c04100..5d1f9982 100644 --- a/contrib/brushexport/interface.cpp +++ b/contrib/brushexport/interface.cpp @@ -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 diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index eb153982..0e735c6d 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -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))) { } diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index 19ce370a..07c143bb 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -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); ); diff --git a/radiant/build.cpp b/radiant/build.cpp index 7294df5c..a81ad53f 100644 --- a/radiant/build.cpp +++ b/radiant/build.cpp @@ -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 ); diff --git a/radiant/commands.cpp b/radiant/commands.cpp index eb3afaa4..eaf4a15f 100644 --- a/radiant/commands.cpp +++ b/radiant/commands.cpp @@ -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 ); } diff --git a/radiant/entityinspector.cpp b/radiant/entityinspector.cpp index b509432b..d31b86c3 100644 --- a/radiant/entityinspector.cpp +++ b/radiant/entityinspector.cpp @@ -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 ); } diff --git a/radiant/entitylist.cpp b/radiant/entitylist.cpp index 7aa5a80f..96de418c 100644 --- a/radiant/entitylist.cpp +++ b/radiant/entitylist.cpp @@ -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 ); diff --git a/radiant/feedback.cpp b/radiant/feedback.cpp index a6e6cd65..45bcf9c6 100644 --- a/radiant/feedback.cpp +++ b/radiant/feedback.cpp @@ -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 ); } diff --git a/radiant/map.cpp b/radiant/map.cpp index 07c1f654..a035726b 100644 --- a/radiant/map.cpp +++ b/radiant/map.cpp @@ -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 ); diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index f6e1704d..a194fb82 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -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 ); } diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 95fdbd0f..a86d65e4 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -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 ) );