update flexipatch base
Update void-packages template / Update xbps-src template (push) Failing after 1m45s
Details
Update void-packages template / Update xbps-src template (push) Failing after 1m45s
Details
This commit is contained in:
parent
2c359d9156
commit
5d34e9e445
|
@ -71,7 +71,7 @@ treflow_moveimages(int oldy, int newy)
|
||||||
void
|
void
|
||||||
treflow(int col, int row)
|
treflow(int col, int row)
|
||||||
{
|
{
|
||||||
int i, j, x, x2;
|
int i, j;
|
||||||
int oce, nce, bot, scr;
|
int oce, nce, bot, scr;
|
||||||
int ox = 0, oy = -term.histf, nx = 0, ny = -1, len;
|
int ox = 0, oy = -term.histf, nx = 0, ny = -1, len;
|
||||||
int cy = -1; /* proxy for new y coordinate of cursor */
|
int cy = -1; /* proxy for new y coordinate of cursor */
|
||||||
|
@ -205,13 +205,12 @@ treflow(int col, int row)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* expand images into new text cells */
|
/* expand images into new text cells */
|
||||||
for (im = term.images; im; im = next) {
|
for (im = term.images; im; im = im->next) {
|
||||||
next = im->next;
|
j = MIN(im->x + im->cols, col);
|
||||||
if (im->x < col) {
|
line = TLINE(im->y);
|
||||||
line = TLINE(im->y);
|
for (i = im->x; i < j; i++) {
|
||||||
x2 = MIN(im->x + im->cols, col);
|
if (!(line[i].mode & ATTR_SET))
|
||||||
for (x = im->x; x < x2; x++)
|
line[i].mode |= ATTR_SIXEL;
|
||||||
line[x].mode |= ATTR_SIXEL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
54
st.c
54
st.c
|
@ -184,6 +184,7 @@ static void tsetattr(const int *, int);
|
||||||
static void tsetchar(Rune, const Glyph *, int, int);
|
static void tsetchar(Rune, const Glyph *, int, int);
|
||||||
static void tsetdirt(int, int);
|
static void tsetdirt(int, int);
|
||||||
static void tsetscroll(int, int);
|
static void tsetscroll(int, int);
|
||||||
|
static inline void tsetsixelattr(Line line, int x1, int x2);
|
||||||
static void tswapscreen(void);
|
static void tswapscreen(void);
|
||||||
static void tsetmode(int, int, const int *, int);
|
static void tsetmode(int, int, const int *, int);
|
||||||
static int twrite(const char *, int, int);
|
static int twrite(const char *, int, int);
|
||||||
|
@ -836,6 +837,13 @@ tsetdirtattr(int attr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
tsetsixelattr(Line line, int x1, int x2)
|
||||||
|
{
|
||||||
|
for (; x1 <= x2; x1++)
|
||||||
|
line[x1].mode |= ATTR_SIXEL;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
tfulldirt(void)
|
tfulldirt(void)
|
||||||
{
|
{
|
||||||
|
@ -1771,7 +1779,7 @@ strhandle(void)
|
||||||
{ defaultcs, "cursor" }
|
{ defaultcs, "cursor" }
|
||||||
};
|
};
|
||||||
ImageList *im, *newimages, *next, *tail;
|
ImageList *im, *newimages, *next, *tail;
|
||||||
int i, x, y, x1, y1, x2, y2, numimages;
|
int i, x1, y1, x2, y2, numimages;
|
||||||
int cx, cy;
|
int cx, cy;
|
||||||
Line line;
|
Line line;
|
||||||
int scr = IS_SET(MODE_ALTSCREEN) ? 0 : term.scr;
|
int scr = IS_SET(MODE_ALTSCREEN) ? 0 : term.scr;
|
||||||
|
@ -1897,34 +1905,38 @@ strhandle(void)
|
||||||
} else {
|
} else {
|
||||||
term.images = newimages;
|
term.images = newimages;
|
||||||
}
|
}
|
||||||
x2 = MIN(x2, term.col);
|
x2 = MIN(x2, term.col) - 1;
|
||||||
for (i = 0, im = newimages; im; im = next, i++) {
|
if (IS_SET(MODE_SIXEL_SDM)) {
|
||||||
next = im->next;
|
/* Sixel display mode: put the sixel in the upper left corner of
|
||||||
scr = IS_SET(MODE_ALTSCREEN) ? 0 : term.scr;
|
* the screen, disable scrolling (the sixel will be truncated if
|
||||||
if (IS_SET(MODE_SIXEL_SDM)) {
|
* it is too long) and do not change the cursor position. */
|
||||||
|
for (i = 0, im = newimages; im; im = next, i++) {
|
||||||
|
next = im->next;
|
||||||
if (i >= term.row) {
|
if (i >= term.row) {
|
||||||
delete_image(im);
|
delete_image(im);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
im->y = i + scr;
|
im->y = i + scr;
|
||||||
line = term.line[i];
|
tsetsixelattr(term.line[i], x1, x2);
|
||||||
} else {
|
term.dirty[MIN(im->y, term.row-1)] = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i = 0, im = newimages; im; im = next, i++) {
|
||||||
|
next = im->next;
|
||||||
|
scr = IS_SET(MODE_ALTSCREEN) ? 0 : term.scr;
|
||||||
im->y = term.c.y + scr;
|
im->y = term.c.y + scr;
|
||||||
line = term.line[term.c.y];
|
tsetsixelattr(term.line[term.c.y], x1, x2);
|
||||||
}
|
term.dirty[MIN(im->y, term.row-1)] = 1;
|
||||||
for (x = im->x; x < x2; x++) {
|
if (i < numimages-1) {
|
||||||
line[x].mode |= ATTR_SIXEL;
|
im->next = NULL;
|
||||||
}
|
tnewline(0);
|
||||||
term.dirty[MIN(im->y, term.row-1)] = 1;
|
im->next = next;
|
||||||
if (!IS_SET(MODE_SIXEL_SDM) && i < numimages-1) {
|
}
|
||||||
im->next = NULL;
|
|
||||||
tnewline(0);
|
|
||||||
im->next = next;
|
|
||||||
}
|
}
|
||||||
|
/* if mode 8452 is set, sixel scrolling leaves cursor to right of graphic */
|
||||||
|
if (IS_SET(MODE_SIXEL_CUR_RT))
|
||||||
|
term.c.x = MIN(term.c.x + newimages->cols, term.col-1);
|
||||||
}
|
}
|
||||||
/* if mode 8452 is set, sixel scrolling leaves cursor to right of graphic */
|
|
||||||
if (!IS_SET(MODE_SIXEL_SDM) && IS_SET(MODE_SIXEL_CUR_RT))
|
|
||||||
term.c.x = MIN(term.c.x + newimages->cols, term.col-1);
|
|
||||||
}
|
}
|
||||||
/* https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec */
|
/* https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec */
|
||||||
if (strstr(strescseq.buf, "=1s") == strescseq.buf)
|
if (strstr(strescseq.buf, "=1s") == strescseq.buf)
|
||||||
|
|
84
x.c
84
x.c
|
@ -254,20 +254,23 @@ zoom(const Arg *arg)
|
||||||
void
|
void
|
||||||
zoomabs(const Arg *arg)
|
zoomabs(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
ImageList *im;
|
ImageList *im;
|
||||||
|
|
||||||
xunloadfonts();
|
xunloadfonts();
|
||||||
xloadfonts(usedfont, arg->f);
|
xloadfonts(usedfont, arg->f);
|
||||||
xloadsparefonts();
|
xloadsparefonts();
|
||||||
|
|
||||||
/* deleting old pixmaps forces the new scaled pixmaps to be created */
|
/* delete old pixmaps so that xfinishdraw() can create new scaled ones */
|
||||||
for (im = term.images; im; im = im->next) {
|
for (im = term.images, i = 0; i < 2; i++, im = term.images_alt) {
|
||||||
if (im->pixmap)
|
for (; im; im = im->next) {
|
||||||
XFreePixmap(xw.dpy, (Drawable)im->pixmap);
|
if (im->pixmap)
|
||||||
if (im->clipmask)
|
XFreePixmap(xw.dpy, (Drawable)im->pixmap);
|
||||||
XFreePixmap(xw.dpy, (Drawable)im->clipmask);
|
if (im->clipmask)
|
||||||
im->pixmap = NULL;
|
XFreePixmap(xw.dpy, (Drawable)im->clipmask);
|
||||||
im->clipmask = NULL;
|
im->pixmap = NULL;
|
||||||
|
im->clipmask = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cresize(0, 0);
|
cresize(0, 0);
|
||||||
|
@ -2221,9 +2224,10 @@ xfinishdraw(void)
|
||||||
ImageList *im, *next;
|
ImageList *im, *next;
|
||||||
Imlib_Image origin, scaled;
|
Imlib_Image origin, scaled;
|
||||||
XGCValues gcvalues;
|
XGCValues gcvalues;
|
||||||
GC gc;
|
GC gc = NULL;
|
||||||
int width, height;
|
int width, height;
|
||||||
int x, x2, del, destx, desty;
|
int del, desty, mode, x1, x2, xend;
|
||||||
|
int bw = win.hborderpx, bh = win.vborderpx;
|
||||||
Line line;
|
Line line;
|
||||||
|
|
||||||
for (im = term.images; im; im = next) {
|
for (im = term.images; im; im = next) {
|
||||||
|
@ -2233,6 +2237,10 @@ xfinishdraw(void)
|
||||||
if (im->x >= term.col || im->y >= term.row || im->y < 0)
|
if (im->x >= term.col || im->y >= term.row || im->y < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* do not draw the image on the search bar */
|
||||||
|
if (im->y == term.row-1 && IS_SET(MODE_KBDSELECT) && kbds_issearchmode())
|
||||||
|
continue;
|
||||||
|
|
||||||
/* scale the image */
|
/* scale the image */
|
||||||
width = MAX(im->width * win.cw / im->cw, 1);
|
width = MAX(im->width * win.cw / im->cw, 1);
|
||||||
height = MAX(im->height * win.ch / im->ch, 1);
|
height = MAX(im->height * win.ch / im->ch, 1);
|
||||||
|
@ -2294,34 +2302,46 @@ xfinishdraw(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clip the image so it does not go over to borders */
|
/* create GC */
|
||||||
x2 = MIN(im->x + im->cols, term.col);
|
if (!gc) {
|
||||||
width = MIN(width, (x2 - im->x) * win.cw);
|
memset(&gcvalues, 0, sizeof(gcvalues));
|
||||||
|
gcvalues.graphics_exposures = False;
|
||||||
/* delete the image if the text cells behind it have been changed */
|
gc = XCreateGC(xw.dpy, xw.win, GCGraphicsExposures, &gcvalues);
|
||||||
line = TLINE(im->y);
|
|
||||||
for (del = 0, x = im->x; x < x2; x++) {
|
|
||||||
if ((del = !(line[x].mode & ATTR_SIXEL)))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (del) {
|
|
||||||
delete_image(im);
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* draw the image */
|
/* set the clip mask */
|
||||||
memset(&gcvalues, 0, sizeof(gcvalues));
|
desty = bh + im->y * win.ch;
|
||||||
gcvalues.graphics_exposures = False;
|
|
||||||
gc = XCreateGC(xw.dpy, xw.win, GCGraphicsExposures, &gcvalues);
|
|
||||||
destx = win.hborderpx + im->x * win.cw;
|
|
||||||
desty = win.vborderpx + im->y * win.ch;
|
|
||||||
if (im->clipmask) {
|
if (im->clipmask) {
|
||||||
XSetClipMask(xw.dpy, gc, (Drawable)im->clipmask);
|
XSetClipMask(xw.dpy, gc, (Drawable)im->clipmask);
|
||||||
XSetClipOrigin(xw.dpy, gc, destx, desty);
|
XSetClipOrigin(xw.dpy, gc, bw + im->x * win.cw, desty);
|
||||||
}
|
}
|
||||||
XCopyArea(xw.dpy, (Drawable)im->pixmap, xw.buf, gc, 0, 0, width, height, destx, desty);
|
|
||||||
XFreeGC(xw.dpy, gc);
|
/* draw only the parts of the image that are not erased */
|
||||||
|
line = TLINE(im->y) + im->x;
|
||||||
|
xend = MIN(im->x + im->cols, term.col);
|
||||||
|
for (del = 1, x1 = im->x; x1 < xend; x1 = x2) {
|
||||||
|
mode = line->mode & ATTR_SIXEL;
|
||||||
|
for (x2 = x1 + 1; x2 < xend; x2++) {
|
||||||
|
if (((++line)->mode & ATTR_SIXEL) != mode)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (mode) {
|
||||||
|
XCopyArea(xw.dpy, (Drawable)im->pixmap, xw.buf, gc,
|
||||||
|
(x1 - im->x) * win.cw, 0,
|
||||||
|
MIN((x2 - x1) * win.cw, width - (x1 - im->x) * win.cw), height,
|
||||||
|
bw + x1 * win.cw, desty);
|
||||||
|
del = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (im->clipmask)
|
||||||
|
XSetClipMask(xw.dpy, gc, None);
|
||||||
|
|
||||||
|
/* if all the parts are erased, we can delete the entire image */
|
||||||
|
if (del && im->x + im->cols <= term.col)
|
||||||
|
delete_image(im);
|
||||||
}
|
}
|
||||||
|
if (gc)
|
||||||
|
XFreeGC(xw.dpy, gc);
|
||||||
|
|
||||||
XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w, win.h, 0, 0);
|
XCopyArea(xw.dpy, xw.buf, xw.win, dc.gc, 0, 0, win.w, win.h, 0, 0);
|
||||||
XSetForeground(xw.dpy, dc.gc, dc.col[IS_SET(MODE_REVERSE) ? defaultfg : defaultbg].pixel);
|
XSetForeground(xw.dpy, dc.gc, dc.col[IS_SET(MODE_REVERSE) ? defaultfg : defaultbg].pixel);
|
||||||
|
|
Loading…
Reference in New Issue