FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

sixeltek: pseudo-mouse support · gnuplot/gnuplot@2dff3b5 · GitHub

Repository navigation

Commit 2dff3b5

Browse files
Ethan A Merritt
committed
sixeltek: pseudo-mouse support
Also new terminal options {animate|scroll}
1 parent e5e44ca commit 2dff3b5

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

‎term/tek.trm‎

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ static int SIXEL_ncol = 16; /* actual number of colors to be used */
516516
static int SIXEL_lt;
517517
static int SIXEL_fp = 0; /* start of gnuplot palette colors */
518518
static int SIXEL_np = 0; /* size of gnuplot palette */
519+
static int SIXEL_anchor = 0; /* Anchor plot at top left */
519520

520521
struct SIXEL_colorspec {
521522
int state; /* see definitions above */
@@ -579,7 +580,7 @@ SIXEL_findslot(int rgbval)
579580
enum SIXEL_id {
580581
SIXEL_SMALL, SIXEL_MEDIUM, SIXEL_LARGE,
581582
SIXEL_MONOCHROME, SIXEL_COLOR, SIXEL_COLORS,
582-
SIXEL_SIZE,
583+
SIXEL_SIZE, SIXEL_ANIMATE, SIXEL_SCROLL,
583584
SIXEL_OTHER
584585
};
585586

@@ -593,6 +594,8 @@ static struct gen_table SIXEL_opts[] =
593594
{ "c$olour", SIXEL_COLOR },
594595
{ "colors", SIXEL_COLORS },
595596
{ "size", SIXEL_SIZE },
597+
{ "animate", SIXEL_ANIMATE },
598+
{ "scroll", SIXEL_SCROLL },
596599
{ NULL, SIXEL_OTHER }
597600
};
598601

@@ -643,9 +646,17 @@ SIXEL_options()
643646
}
644647
break;
645648
}
649+
case SIXEL_ANIMATE:
650+
SIXEL_anchor = 1;
651+
c_token++;
652+
break;
653+
case SIXEL_SCROLL:
654+
SIXEL_anchor = 0;
655+
c_token++;
656+
break;
646657
case SIXEL_OTHER:
647658
default:
648-
int_error(c_token, "unknown option; expecting: {small, medium, large}, {monochrome, color}, or {size x,y}");
659+
int_warn(c_token, "unknown terminal option");
649660
break;
650661
}
651662
}
@@ -671,6 +682,8 @@ SIXEL_options()
671682
strcat(term_options, " monochrome");
672683
else
673684
sprintf(term_options + strlen(term_options), " colors %d", SIXEL_ncol);
685+
if (SIXEL_anchor != 0)
686+
strcat(term_options, " animate");
674687
sprintf(term_options + strlen(term_options), " size %d,%d",
675688
term->xmax + 1, term->ymax + 1);
676689
}
@@ -713,10 +726,9 @@ SIXEL_text()
713726
unsigned * map;
714727
int *m;
715728

716-
#if (0)
717729
/* place each new plot at upper left of terminal window */
730+
if (SIXEL_anchor)
718731
fprintf(gpoutfile,"\033[H");
719-
#endif
720732

721733
/* initialization to Sixel mode and pixel aspect ratio,
722734
but do not change the background */
@@ -1384,7 +1396,7 @@ TERM_TABLE_START(sixel_driver)
13841396
b_justify_text, line_and_point, do_arrow, set_font_null,
13851397
0, 0, 0, 0, SIXEL_fillbox, b_linewidth,
13861398
#ifdef USE_MOUSE
1387-
NULL, NULL, NULL, NULL, NULL,
1399+
term_waitforinput, NULL, NULL, NULL, NULL,
13881400
#endif
13891401
SIXEL_make_palette, NULL, SIXEL_set_color,
13901402
SIXEL_filled_polygon,
@@ -1474,17 +1486,20 @@ START_HELP(tek40)
14741486
"?term sixeltek",
14751487
"?sixeltek",
14761488
" Syntax:",
1477-
" set terminal sixeltek {<fontsize>} {color|colors <n>|mono} {size <x>,<y>}",
1489+
" set terminal sixeltek {<fontsize>} {mono|color|colors <n>} {size <x>,<y>}",
1490+
" {animate}",
14781491
"",
14791492
" The `sixel` output format was originally used by DEC terminals and printers.",
14801493
" This driver supports palette images with a maximum of 256 colors. The default",
14811494
" is 16 which can be changed using the `colors` option.",
14821495
"",
14831496
" The font size can be specified as `small`, `medium` or `large`.",
14841497
"",
1485-
" For use with xterm emulation, xterm must be compiled/configured with",
1498+
" `animate` causes each new plot to be anchored at the top left of the window",
1499+
" rather than scrolling from the current cursor position.",
1500+
"",
1501+
" For use with xterm, xterm must be compiled/configured with",
14861502
" \"--enable-sixel-graphics\" and started with \"-ti 340\" on the command line.",
1487-
" The menu option \"sixelScrolling\" should be selected.",
14881503
"",
14891504
" Note that gnuplot also supports another sixel output terminal, `sixelgd`,",
14901505
" that offers more options and features."

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL