Index: trunk/src/view.c =================================================================== --- trunk/src/view.c (revision 30856) +++ trunk/src/view.c (revision 30857) @@ -53,7 +53,12 @@ pcb_idpath_list_clear(&item->objs[0]); pcb_idpath_list_clear(&item->objs[1]); free(item->title); - free(item->description); + + if (item->long_desc.used == 0) + free(item->description); + else + gds_uninit(&item->long_desc); + free(item); } @@ -521,3 +526,14 @@ return dst; } + +void pcb_view_append_text(pcb_view_t *view, const char *txt) +{ + if (view->long_desc.used == 0) { + gds_append_str(&view->long_desc, view->description); + gds_append_str(&view->long_desc, " Details: "); + free(view->description); + } + gds_append_str(&view->long_desc, txt); + view->description = view->long_desc.array; +} Index: trunk/src/view.h =================================================================== --- trunk/src/view.h (revision 30856) +++ trunk/src/view.h (revision 30857) @@ -63,6 +63,8 @@ pcb_coord_t x, y; /* optional: a coord to mark on the preview */ pcb_idpath_list_t objs[2]; /* optional: two groups of objects to highlight on preview */ + gds_t long_desc; /* optional: if non-empty, description shall point to long_desc.array */ + pcb_view_type_t data_type; union { struct { @@ -143,4 +145,10 @@ /* call after the last item or to cancel the load */ void pcb_view_load_end(void *load_ctx); +/*** utility ***/ + +/* append txt to description */ +void pcb_drc_append_text(pcb_view_t *view, const char *txt); + + #endif