gboolean project_cell_edited( GtkCellRendererText* cell, gchar* path_string, gchar* new_text, ProjectList* projectList ){
Project& project = projectList->m_project;
- GtkTreePath* path = ui::TreePath( path_string );
+ auto path = ui::TreePath( path_string );
ASSERT_MESSAGE( gtk_tree_path_get_depth( path ) == 1, "invalid path length" );
Project& project = projectList->m_project;
if ( event->keyval == GDK_KEY_Delete ) {
- GtkTreeSelection* selection = gtk_tree_view_get_selection(widget );
+ auto selection = ui::TreeSelection(gtk_tree_view_get_selection(widget));
GtkTreeIter iter;
GtkTreeModel* model;
if ( gtk_tree_selection_get_selected( selection, &model, &iter ) ) {
- GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
+ auto path = gtk_tree_model_get_path( model, &iter );
Project::iterator x = Project_find( project, gtk_tree_path_get_indices( path )[0] );
gtk_tree_path_free( path );
Build* g_current_build = 0;
-gboolean project_selection_changed( GtkTreeSelection* selection, ui::ListStore store ){
+gboolean project_selection_changed( ui::TreeSelection selection, ui::ListStore store ){
Project& project = g_build_project;
store.clear();
GtkTreeIter iter;
GtkTreeModel* model;
if ( gtk_tree_selection_get_selected( selection, &model, &iter ) ) {
- GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
+ auto path = gtk_tree_model_get_path( model, &iter );
Project::iterator x = Project_find( project, gtk_tree_path_get_indices( path )[0] );
gtk_tree_path_free( path );
}
Build& build = *g_current_build;
- GtkTreePath* path = ui::TreePath( path_string );
+ auto path = ui::TreePath( path_string );
ASSERT_MESSAGE( gtk_tree_path_get_depth( path ) == 1, "invalid path length" );
Build& build = *g_current_build;
if ( event->keyval == GDK_KEY_Delete ) {
- GtkTreeSelection* selection = gtk_tree_view_get_selection(widget );
+ auto selection = gtk_tree_view_get_selection(widget );
GtkTreeIter iter;
GtkTreeModel* model;
if ( gtk_tree_selection_get_selected( selection, &model, &iter ) ) {
- GtkTreePath* path = gtk_tree_model_get_path( model, &iter );
+ auto path = gtk_tree_model_get_path( model, &iter );
Build::iterator i = Build_find( build, gtk_tree_path_get_indices( path )[0] );
gtk_tree_path_free( path );
object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
renderer.connect("edited", G_CALLBACK( project_cell_edited ), &projectList );
- GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
+ auto column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
gtk_tree_view_append_column(view, column );
- GtkTreeSelection* selection = gtk_tree_view_get_selection(view );
+ auto selection = gtk_tree_view_get_selection(view );
gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
view.show();
object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
renderer.connect( "edited", G_CALLBACK( commands_cell_edited ), store );
- GtkTreeViewColumn* column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
+ auto column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
gtk_tree_view_append_column(view, column );
- GtkTreeSelection* selection = gtk_tree_view_get_selection(view );
+ auto selection = gtk_tree_view_get_selection(view );
gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
view.show();
{
const char* m_name;
public:
-GtkMenuItem* m_item;
-BuildMenuItem( const char* name, GtkMenuItem* item )
+ui::MenuItem m_item;
+BuildMenuItem( const char* name, ui::MenuItem item )
: m_name( name ), m_item( item ){
}
void run(){
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 ) );
+ g_BuildMenuItems.push_back( BuildMenuItem( ( *i ).first.c_str(), ui::MenuItem(ui::null) ) );
if ( is_separator( *i ) ) {
g_BuildMenuItems.back().m_item = menu_separator( menu );
}