Wed Nov 17 18:34:43 PST 1999 Michael Jennings <mej@eterm.org>
Some selection changes and escape sequence fixes. You can now specify multiple color modifier commands in a single escape sequence. You can also remove any existing color modifiers using "clear". SVN revision: 1324
This commit is contained in:
parent
b6305595a7
commit
5894debb3a
|
@ -2792,3 +2792,10 @@ Mon Nov 15 13:20:05 PST 1999 Michael Jennings <mej@eterm.org>
|
|||
raster has given me the cl00bat beating, so it's fixed now. :-]
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Wed Nov 17 18:34:43 PST 1999 Michael Jennings <mej@eterm.org>
|
||||
|
||||
Some selection changes and escape sequence fixes. You can now
|
||||
specify multiple color modifier commands in a single escape sequence.
|
||||
You can also remove any existing color modifiers using "clear".
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
|
42
src/screen.c
42
src/screen.c
|
@ -99,7 +99,9 @@ static short lost_multi = 0;
|
|||
* SCREEN `COMMON' ROUTINES *
|
||||
* ------------------------------------------------------------------------- */
|
||||
/* Fill part/all of a drawn line with blanks. */
|
||||
void
|
||||
inline void blank_line(text_t *, rend_t *, int, rend_t);
|
||||
|
||||
inline void
|
||||
blank_line(text_t * et, rend_t * er, int width, rend_t efs)
|
||||
{
|
||||
/* int i = width; */
|
||||
|
@ -631,13 +633,6 @@ scroll_text(int row1, int row2, int count, int spec)
|
|||
|
||||
if (count == 0 || (row1 > row2))
|
||||
return 0;
|
||||
|
||||
if (selection.op) { /* move selected region too */
|
||||
selection.beg.row -= count;
|
||||
selection.end.row -= count;
|
||||
selection.mark.row -= count;
|
||||
}
|
||||
CHECK_SELECTION;
|
||||
if ((count > 0) && (row1 == 0) && (current_screen == PRIMARY)) {
|
||||
TermWin.nscrolled += count;
|
||||
MIN_IT(TermWin.nscrolled, TermWin.saveLines);
|
||||
|
@ -645,6 +640,26 @@ scroll_text(int row1, int row2, int count, int spec)
|
|||
row1 += TermWin.saveLines;
|
||||
row2 += TermWin.saveLines;
|
||||
|
||||
if (selection.op && current_screen == selection.screen) {
|
||||
i = selection.beg.row + TermWin.saveLines;
|
||||
j = selection.end.row + TermWin.saveLines;
|
||||
if ((i < row1 && j > row1)
|
||||
|| (i < row2 && j > row2)
|
||||
|| (i - count < row1 && i >= row1)
|
||||
|| (i - count > row2 && i <= row2)
|
||||
|| (j - count < row1 && j >= row1)
|
||||
|| (j - count > row2 && j <= row2)) {
|
||||
CLEAR_ALL_SELECTION;
|
||||
selection.op = SELECTION_CLEAR;
|
||||
} else if (j >= row1 && j <= row2) {
|
||||
/* move selected region too */
|
||||
selection.beg.row -= count;
|
||||
selection.end.row -= count;
|
||||
selection.mark.row -= count;
|
||||
}
|
||||
}
|
||||
CHECK_SELECTION;
|
||||
|
||||
if (count > 0) {
|
||||
|
||||
/* A: scroll up */
|
||||
|
@ -729,6 +744,9 @@ scr_add_lines(const unsigned char *str, int nlines, int len)
|
|||
rend_t *srp;
|
||||
row_col_t beg, end;
|
||||
|
||||
if (len <= 0) /* sanity */
|
||||
return;
|
||||
|
||||
last_col = TermWin.ncol;
|
||||
|
||||
D_SCREEN(("scr_add_lines(*,%d,%d)\n", nlines, len));
|
||||
|
@ -755,9 +773,7 @@ scr_add_lines(const unsigned char *str, int nlines, int len)
|
|||
MIN_IT(screen.col, last_col - 1);
|
||||
MIN_IT(screen.row, TermWin.nrow - 1);
|
||||
/*MAX_IT(screen.row, 0); */
|
||||
MAX_IT(screen.row, -TermWin.saveLines);
|
||||
if (len <= 0) /* sanity */
|
||||
return;
|
||||
MAX_IT(screen.row, -TermWin.nscrolled);
|
||||
|
||||
row = screen.row + TermWin.saveLines;
|
||||
if (screen.text[row] == NULL) {
|
||||
|
@ -807,7 +823,7 @@ scr_add_lines(const unsigned char *str, int nlines, int len)
|
|||
if (screen.text[j] == NULL)
|
||||
make_screen_mem(screen.text, screen.rend, j);
|
||||
blank_line(screen.text[j], screen.rend[j],
|
||||
TermWin.ncol, DEFAULT_RSTYLE | (rstyle & RS_RVid ? RS_RVid : 0));
|
||||
TermWin.ncol, DEFAULT_RSTYLE | ((rstyle & RS_RVid) ? (RS_RVid) : (0)));
|
||||
screen.text[j][TermWin.ncol] = 0;
|
||||
} else if (screen.row < (TermWin.nrow - 1)) {
|
||||
screen.row++;
|
||||
|
@ -838,7 +854,7 @@ scr_add_lines(const unsigned char *str, int nlines, int len)
|
|||
blank_line(screen.text[j], screen.rend[j], TermWin.ncol,
|
||||
rstyle); Bug fix from John Ellison - need to reset rstyle */
|
||||
blank_line(screen.text[j], screen.rend[j], TermWin.ncol,
|
||||
DEFAULT_RSTYLE | (rstyle & RS_RVid ? RS_RVid : 0));
|
||||
DEFAULT_RSTYLE | ((rstyle & RS_RVid) ? (RS_RVid) : (0)));
|
||||
screen.text[j][TermWin.ncol] = 0;
|
||||
} else if (screen.row < (TermWin.nrow - 1)) {
|
||||
screen.row++;
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
#define CHECK_SELECTION do { \
|
||||
if (selection.op) selection_check(); \
|
||||
} while (0)
|
||||
#define CLEAR_SELECTION (selection.beg.row = selection.beg.col = selection.end.row = selection.end.col = 0)
|
||||
#define CLEAR_ALL_SELECTION (selection.beg.row = selection.beg.col = selection.mark.row = selection.mark.col = selection.end.row = selection.end.col = 0)
|
||||
|
||||
#define scr_touch() scr_expose(0, 0, TermWin.width, TermWin.height)
|
||||
|
||||
/*
|
||||
|
@ -218,7 +221,6 @@ extern unsigned int colorfgbg;
|
|||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern void blank_line(text_t *, rend_t *, int, rend_t);
|
||||
extern void blank_dline(text_t *, rend_t *, int, rend_t);
|
||||
extern void blank_sline(text_t *, rend_t *, int);
|
||||
extern void make_screen_mem(text_t **, rend_t **, int);
|
||||
|
|
22
src/term.c
22
src/term.c
|
@ -234,7 +234,6 @@ lookup_key(XEvent * ev)
|
|||
LK_RET();
|
||||
break;
|
||||
|
||||
/* Eterm extras */
|
||||
case XK_KP_Add: /* Shift+KP_Add = bigger font */
|
||||
change_font(0, FONT_UP);
|
||||
LK_RET();
|
||||
|
@ -1717,6 +1716,8 @@ xterm_seq(int op, const char *str)
|
|||
redraw_all_images();
|
||||
break;
|
||||
case 1:
|
||||
changed = 0;
|
||||
for (; 1;) {
|
||||
if ((color = (char *) strsep(&tnstr, ";")) == NULL) {
|
||||
break;
|
||||
}
|
||||
|
@ -1744,10 +1745,26 @@ xterm_seq(int op, const char *str)
|
|||
if ((mod = (char *) strsep(&tnstr, ";")) == NULL) {
|
||||
break;
|
||||
}
|
||||
if (!strcasecmp(mod, "clear")) {
|
||||
imlib_t *iml = images[which].current->iml;
|
||||
|
||||
if (!strcasecmp(color, "image")) {
|
||||
FREE(iml->mod);
|
||||
} else if (!strcasecmp(color, "red")) {
|
||||
FREE(iml->rmod);
|
||||
} else if (!strcasecmp(color, "green")) {
|
||||
FREE(iml->gmod);
|
||||
} else if (!strcasecmp(color, "blue")) {
|
||||
FREE(iml->bmod);
|
||||
}
|
||||
changed = 1;
|
||||
continue;
|
||||
}
|
||||
if ((valptr = (char *) strsep(&tnstr, ";")) == NULL) {
|
||||
break;
|
||||
}
|
||||
D_CMD(("Modifying the %s attribute of the %s color modifier of the %s image to be %s\n", mod, color, get_image_type(which), valptr));
|
||||
changed = 1;
|
||||
if (image_mode_is(which, MODE_TRANS) && (desktop_pixmap != None)) {
|
||||
free_desktop_pixmap();
|
||||
}
|
||||
|
@ -1815,7 +1832,10 @@ xterm_seq(int op, const char *str)
|
|||
iml->bmod->gamma = (int) strtol(valptr, (char **) NULL, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
redraw_all_images();
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
get_desktop_window();
|
||||
|
|
Loading…
Reference in New Issue