static void _display(rect_t r, int options) { doc_ptr doc = doc_alloc(r.cx); _list_spells(doc, options); doc_sync_term(doc, doc_range_all(doc), doc_pos_create(r.x, r.y)); doc_free(doc); }
void msg_line_redraw(void) { doc_sync_term( _msg_line_doc, doc_range_all(_msg_line_doc), doc_pos_create(_msg_line_rect.x, _msg_line_rect.y) ); _msg_line_sync_pos = doc_cursor(_msg_line_doc); }
static void _display_spells_to_gain(object_type *o_ptr, rect_t r) { doc_ptr doc = doc_alloc(r.cx); int i; int realm = tval2realm(o_ptr->tval); int start_idx = o_ptr->sval * _SPELLS_PER_BOOK; doc_insert(doc, "<style:table>"); doc_printf(doc, "<color:G> %-20.20s Lvl SP Fail Desc</color>\n", "Name"); for (i = start_idx; i < start_idx + _SPELLS_PER_BOOK; i++) _list_spell(doc, realm, i, i - start_idx, _FROM_BOOK); doc_insert(doc, "</style>"); doc_sync_term(doc, doc_range_all(doc), doc_pos_create(r.x, r.y)); doc_free(doc); }
int doc_line_count(doc_ptr doc) { doc_region_t r = doc_range_all(doc); return doc_region_line_count(&r); }