452 {
454 return -1;
455 }
456 if(sectionidx < 0 || sectionidx >=
n->sectioncount){
457 logerror(
"unrolled invalid sectionidx %d", sectionidx);
458 return -1;
459 }
460 if(
n->sections[sectionidx].enabled_item_count <= 0){
461 return 0;
462 }
463 if(
n->sections[sectionidx].name ==
NULL){
464 return -1;
465 }
466 n->unrolledsection = sectionidx;
467 unsigned dimy, dimx;
469 const int height = section_height(
n, sectionidx);
470 const int width = section_width(
n, sectionidx);
471 int xpos =
n->sections[sectionidx].xoff < 0 ?
472 (int)dimx + (
n->sections[sectionidx].xoff - 2) :
n->sections[sectionidx].xoff;
473 if(xpos + width >= (int)dimx){
474 xpos = dimx - (width + 2);
475 }
476 int ypos =
n->bottom ? dimy - height - 1 : 1;
478 return -1;
479 }
480 if(ncplane_rounded_box_sized(
n->ncp, 0,
n->headerchannels, height, width, 0)){
481 return -1;
482 }
484 for(
unsigned i = 0 ; i < sec->
itemcount ; ++i){
485 ++ypos;
487
492 }
493 }else{
495 }
499 }
500 }
502 int cols = ncplane_putstr_yx(
n->ncp, ypos, xpos + 1, sec->
items[i].
desc);
503 if(cols < 0){
504 return -1;
505 }
506
507
508
509 int thiswidth = width;
512 }
513
514 for(int j = cols + 1 ; j < thiswidth - 1 ; ++j){
515 if(ncplane_putchar(
n->ncp,
' ') < 0){
516 return -1;
517 }
518 }
521 return -1;
522 }
523 }
527 return -1;
528 }
531 return -1;
532 }
534 }
535 }else{
536 n->ncp->channels =
n->headerchannels;
539 return -1;
540 }
541 for(int j = 1 ; j < width - 1 ; ++j){
542 if(ncplane_putegc(
n->ncp,
"─",
NULL) < 0){
543 return -1;
544 }
545 }
546 if(ncplane_putegc(
n->ncp,
"┤",
NULL) < 0){
547 return -1;
548 }
549 }
550 }
551 return 0;
552}
int ncplane_cursor_move_yx(ncplane *n, int y, int x)
void ncplane_set_channels(ncplane *n, uint64_t channels)
void ncplane_set_styles(ncplane *n, unsigned stylebits)
int ncplane_putegc_yx(ncplane *n, int y, int x, const char *gclust, size_t *sbytes)
int ncplane_at_yx_cell(ncplane *n, int y, int x, nccell *c)
uint64_t ncplane_channels(const ncplane *n)
int ncplane_putc_yx(ncplane *n, int y, int x, const nccell *c)
#define NCSTYLE_UNDERLINE