m_string = string;
}
void evaluate( StringBuffer& output ){
+ #if !(GDEF_OS_WINDOWS)
+ // strip .[ExecutableType] entirely (including preceding dot) on Mac and Linux
+ {
+ StringBuffer output;
+ StringBuffer variable;
+ bool found_dot = false;
+ bool in_variable = false;
+ for (const char *i = m_string.c_str(); *i != '\0'; ++i) {
+ if (!found_dot && !in_variable) {
+ switch (*i) {
+ case '.':
+ found_dot = true;
+ break;
+ default:
+ output.push_back(*i);
+ break;
+ }
+ } else if (found_dot && !in_variable) {
+ switch (*i) {
+ case '[':
+ in_variable = true;
+ break;
+ default:
+ found_dot = false;
+ output.push_back(*i);
+ break;
+ }
+ } else {
+ switch (*i) {
+ case ']':
+ found_dot = false;
+ in_variable = false;
+ if ( strncmp("ExecutableType", variable.c_str(), sizeof(variable.c_str())) == 0 ) {
+ output.push_string("");
+ variable.clear();
+ }
+ break;
+ default:
+ variable.push_back(*i);
+ break;
+ }
+ }
+ }
+ setString(output.c_str());
+ }
+ #endif // !(GDEF_OS_WINDOWS)
+
StringBuffer variable;
bool in_variable = false;
for ( const char* i = m_string.c_str(); *i != '\0'; ++i )
}
};
-gboolean project_cell_edited( GtkCellRendererText* cell, gchar* path_string, gchar* new_text, ProjectList* projectList ){
+gboolean project_cell_edited(ui::CellRendererText cell, gchar* path_string, gchar* new_text, ProjectList* projectList ){
Project& project = projectList->m_project;
auto path = ui::TreePath( path_string );
Project& project = projectList->m_project;
if ( event->keyval == GDK_KEY_Delete ) {
- auto selection = ui::TreeSelection(gtk_tree_view_get_selection(widget));
+ auto selection = ui::TreeSelection::from(gtk_tree_view_get_selection(widget));
GtkTreeIter iter;
GtkTreeModel* model;
if ( gtk_tree_selection_get_selected( selection, &model, &iter ) ) {
return FALSE;
}
-gboolean commands_cell_edited( GtkCellRendererText* cell, gchar* path_string, gchar* new_text, ui::ListStore store ){
+gboolean commands_cell_edited(ui::CellRendererText cell, gchar* path_string, gchar* new_text, ui::ListStore store ){
if ( g_current_build == 0 ) {
return FALSE;
}
vbox.pack_start( button, FALSE, FALSE, 0 );
}
}
- auto buildViewStore = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
- auto buildView = ui::TreeView( ui::TreeModel( buildViewStore ));
+ auto buildViewStore = ui::ListStore::from(gtk_list_store_new( 1, G_TYPE_STRING ));
+ auto buildView = ui::TreeView( ui::TreeModel::from( buildViewStore._handle ));
{
auto frame = create_dialog_frame( "Build menu" );
table1.attach(frame, {0, 1, 0, 1});
frame.add(scr);
{
- auto store = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
+ auto store = ui::ListStore::from(gtk_list_store_new( 1, G_TYPE_STRING ));
- auto view = ui::TreeView(ui::TreeModel( store ));
+ auto view = ui::TreeView(ui::TreeModel::from( store._handle ));
gtk_tree_view_set_headers_visible(view, FALSE );
auto renderer = ui::CellRendererText(ui::New);
view.connect( "key_press_event", G_CALLBACK( commands_key_press ), store );
- auto sel = ui::TreeSelection(gtk_tree_view_get_selection(buildView ));
+ auto sel = ui::TreeSelection::from(gtk_tree_view_get_selection(buildView ));
sel.connect( "changed", G_CALLBACK( project_selection_changed ), store );
}
}