int ansieeol(void) { ttputc(ESC); ttputc('['); ttputc('K'); }
st520move(row, col) { ttputc(ESC); ttputc('Y'); ttputc(row+BIAS); ttputc(col+BIAS); }
int ansieeop(void) { ttputc(ESC); ttputc('['); ttputc('J'); }
void ansimove(row, col) { ttputc(ESC); ttputc('['); ansiparm(row + 1); ttputc(';'); ansiparm(col + 1); ttputc('H'); }
/* Set the current background color. * color: color to set. */ void ansibcol(int color) { if (color == cbcolor) return; ttputc(ESC); ttputc('['); ansiparm(color + 40); ttputc('m'); cbcolor = color; }
st520eeop() { #if COLOR st520fcol(gfcolor); st520bcol(gbcolor); #endif ttputc(ESC); ttputc('J'); }
PASCAL NEAR hp15move(row, col) { ttputc(ESC); ttputc('&'); ttputc('a'); hp15parm(col); ttputc('c'); hp15parm(row); ttputc('R'); }
int ansimove(int row, int col) { ttputc(ESC); ttputc('['); ansiparm(row+1); ttputc(';'); ansiparm(col+1); ttputc('H'); }
/* set the current output color */ void ansifcol(int color) { if (color == cfcolor) return; ttputc(ESC); ttputc('['); ansiparm(color + 30); ttputc('m'); cfcolor = color; }
void ansieeop(void) { #if COLOR ansifcol(gfcolor); ansibcol(gbcolor); #endif ttputc(ESC); ttputc('['); ttputc('J'); }
/* * tinfoinsert - insert a character at the current character position. * _insertchar takes precedence. */ static void tinfoinsert(UCS ch) { if(_insertchar != NULL){ putpad(_insertchar); ttputc(ch); } else{ putpad(_startinsert); ttputc(ch); putpad(_endinsert); } }
/* VOID */ ttmove(row, col) { if (ttrow!=row || ttcol!=col) { ttnflush(8); /* flush if buffer too full */ ttputc(CSI); asciiparm(row+1); ttputc(';'); asciiparm(col+1); ttputc('H'); ttrow = row; ttcol = col; } }
int ansirev(int state) /* change reverse video state */ { /* TRUE = reverse, FALSE = normal */ static int PrevState = 0; if(state != PrevState) { PrevState = state ; ttputc(ESC); ttputc('['); ttputc(state ? '7': '0'); ttputc('m'); } }
void ansiparm(int n) { int q, r; q = n / 10; if (q != 0) { r = q / 10; if (r != 0) { ttputc((r % 10) + '0'); } ttputc((q % 10) + '0'); } ttputc((n % 10) + '0'); }
int modify_logic(BW *bw,B *b) { if (last_time > b->check_time + CHECK_INTERVAL) { b->check_time = last_time; if (!nomodcheck && !b->gave_notice && check_mod(b)) { file_changed(bw,0,b,NULL); return 0; } } if (b != bw->b) { if (!b->didfirst) { /* This happens when we try to block move from a window which is not on the screen */ if (bw->o.mfirst) { msgnw(bw->parent,joe_gettext(_("Modify other window first for macro"))); return 0; } b->didfirst = 1; if (bw->o.mfirst) exmacro(bw->o.mfirst,1); } if (b->rdonly) { msgnw(bw->parent,joe_gettext(_("Other buffer is read only"))); if (joe_beep) ttputc(7); return 0; } else if (!b->changed && !b->locked) { if (!try_lock(bw,b)) return 0; } } else { if (!b->didfirst) { b->didfirst = 1; if (bw->o.mfirst) exmacro(bw->o.mfirst,1); } if (b->rdonly) { msgnw(bw->parent,joe_gettext(_("Read only"))); if (joe_beep) ttputc(7); return 0; } else if (!b->changed && !b->locked) { if (!try_lock(bw,b)) return 0; } } return 1; }
static void cdata(B *b, unsigned char *dat, int siz) { P *q = pdup(b->eof, USTR "cdata"); P *r = pdup(b->eof, USTR "cdata"); long byte = q->byte; unsigned char bf[1024]; int x, y; for (x = y = 0; x != siz; ++x) { if (dat[x] == 13 || dat[x] == 0) { ; } else if (dat[x] == 8 || dat[x] == 127) { if (y) { --y; } else { pset(q, r); prgetc(q); bdel(q, r); --byte; } } else if (dat[x] == 7) { ttputc(7); } else { bf[y++] = dat[x]; } } if (y) { binsm(r, bf, y); } prm(r); prm(q); cfollow(b,byte); undomark(); }
static int tinfoeeol(void) { int c, starting_col, starting_line; char *last_bg_color; /* * If the terminal doesn't have back color erase, then we have to * erase manually to preserve the background color. */ if(pico_usingcolor() && (!_bce || !_cleartoeoln)){ extern int ttcol, ttrow; starting_col = ttcol; starting_line = ttrow; last_bg_color = pico_get_last_bg_color(); pico_set_nbg_color(); for(c = ttcol; c < term.t_ncol; c++) ttputc(' '); tinfomove(starting_line, starting_col); if(last_bg_color){ pico_set_bg_color(last_bg_color); free(last_bg_color); } } else if(_cleartoeoln) putpad(_cleartoeoln); /* return ignored */ return(0); }
/* * Erase to end of line. */ tteeol() { if(CE) putpad(CE, 1); else { register int i=ncol-ttcol; while(i--) ttputc(' '); ttrow = ttcol = HUGE; } }
static int tinfobeep(void) { ttputc(BELL); /* return ignored */ return(0); }
int ansiparm(int n) { register int q; q = n/10; if (q != 0) ansiparm(q); ttputc((n%10) + '0'); }
static void tcapbeep(void) { #if OPT_FLASH if (global_g_val(GMDFLASH) && vb != NULL) { putpad(vb); } else #endif ttputc(BEL); }
static void cdata(B *b, unsigned char *dat, int siz) { if (b->vt) { /* ANSI terminal emulator */ MACRO *m; do { cready(b, b->vt->vtcur->byte); m = vt_data(b->vt, &dat, &siz); cfollow(b, b->vt, b->vt->vtcur->byte); undomark(); if (m) { /* only do this if cursor is on window */ if ((maint->curwin->watom->what & TYPETW) && ((BW *)maint->curwin->object)->b == b) { exmacro(m, 1); edupd(1); } rmmacro(m); } } while (m); } else { /* Dumb terminal */ P *q = pdup(b->eof, USTR "cdata"); P *r = pdup(b->eof, USTR "cdata"); off_t byte = q->byte; unsigned char bf[1024]; int x, y; cready(b, byte); for (x = y = 0; x != siz; ++x) { if (dat[x] == 13 || dat[x] == 0) { ; } else if (dat[x] == 8 || dat[x] == 127) { if (y) { --y; } else { pset(q, r); prgetc(q); bdel(q, r); --byte; } } else if (dat[x] == 7) { ttputc(7); } else { bf[y++] = dat[x]; } } if (y) { binsm(r, bf, y); } prm(r); prm(q); cfollow(b, NULL, b->eof->byte); undomark(); } }
/* Change reverse video state. * state: TRUE = reverse, FALSE = normal */ void ansirev(int state) { #if COLOR int ftmp, btmp; /* temporaries for colors */ #endif ttputc(ESC); ttputc('['); ttputc(state ? '7' : '0'); ttputc('m'); #if COLOR if (state == FALSE) { ftmp = cfcolor; btmp = cbcolor; cfcolor = -1; cbcolor = -1; ansifcol(ftmp); ansibcol(btmp); } #endif }
static int tag_cmplt(BW *bw) { if (!tag_word_list) tag_word_list = get_tag_list(); if (!tag_word_list) { ttputc(7); return 0; } return simple_cmplt(bw,tag_word_list); }
/* * Put character. Watch for control characters, and for the line getting * too long. */ static void eputc(char c) { if (ttcol + 2 < ncol) { if (ISCTRL(c)) { eputc('^'); c = CCHR(c); } ttputc(c); ++ttcol; } }
/* * Erase to end of line. */ tteeol() { #ifdef TCCONIO ttflush(); clreol(); #else if(CE) putpad(CE, 1); else { register int i=ncol-ttcol; while(i--) ttputc(' '); ttrow = ttcol = HUGE; } #endif }
/* * Erase to end of line. */ void tteeol(void) { int i; if (clr_eol) putpad(clr_eol, 1); else { i = ncol - ttcol; while (i--) ttputc(' '); ttrow = ttcol = HUGE; } }
static int keymap_cmplt(BW *bw) { /* Reload every time: we should really check date of tags file... if (tag_word_list) varm(tag_word_list); */ if (!keymap_list) keymap_list = get_keymap_list(); if (!keymap_list) { ttputc(7); return 0; } return simple_cmplt(bw,keymap_list); }
/* VOID */ tteeop() { ttnflush(12); /* flush (but only if not enough room for seq */ ttputc(CSI); asciiparm((tthue == CTEXT) ? text_rendition : mode_rendition); ttputc(';'); asciiparm(text_fg); ttputc(';'); asciiparm(text_bg); ttputc('m'); ttputc(CSI); /* clear to end of display */ ttputc('J'); }
static void iappend(BW *bw, struct isrch *isrch, char *s, ptrdiff_t len) { /* Append text and search */ /* Append char and search */ IREC *i = alirec(); SRCH *srch; i->what = len; i->disp = bw->cursor->byte; isrch->pattern = vsncpy(sv(isrch->pattern), s, len); if (!qempty(IREC, link, &isrch->irecs)) { pgoto(bw->cursor, isrch->irecs.link.prev->start); if (globalsrch) globalsrch->wrap_flag = isrch->irecs.link.prev->wrap_flag; } i->start = bw->cursor->byte; if (!globalsrch) srch = mksrch(NULL,NULL,opt_icase,isrch->dir,-1,0,0,0,0); else { srch = globalsrch; globalsrch = 0; } srch->addr = bw->cursor->byte; if (!srch->wrap_p || srch->wrap_p->b!=bw->b) { prm(srch->wrap_p); srch->wrap_p = pdup(bw->cursor, "iappend"); srch->wrap_p->owner = &srch->wrap_p; srch->wrap_flag = 0; } i->wrap_flag = srch->wrap_flag; setpat(srch, vsncpy(NULL, 0, isrch->pattern, sLen(isrch->pattern))); srch->backwards = isrch->dir; if (dopfnext(bw, srch, NULL)) { if(joe_beep) ttputc(7); } enqueb(IREC, link, &isrch->irecs, i); }