Fri Nov 19 18:43:58 PST 1999 Michael Jennings <mej@eterm.org>
Fixed some other stuff I found, and cleaned up the remaining occurances of calls to the old scrollbar_show() function. SVN revision: 1343
This commit is contained in:
parent
eec575c1e3
commit
eeab8b0a87
|
@ -2814,3 +2814,9 @@ Fri Nov 19 16:55:22 PST 1999 Michael Jennings <mej@eterm.org>
|
||||||
broke. :)
|
broke. :)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
Fri Nov 19 18:43:58 PST 1999 Michael Jennings <mej@eterm.org>
|
||||||
|
|
||||||
|
Fixed some other stuff I found, and cleaned up the remaining
|
||||||
|
occurances of calls to the old scrollbar_show() function.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
|
12
src/pixmap.c
12
src/pixmap.c
|
@ -458,20 +458,16 @@ redraw_image(unsigned char which) {
|
||||||
scr_touch();
|
scr_touch();
|
||||||
break;
|
break;
|
||||||
case image_up:
|
case image_up:
|
||||||
render_simage(images[image_up].current, scrollbar_get_uparrow_win(), scrollbar_arrow_width(), scrollbar_arrow_width(), image_up, 0);
|
scrollbar_draw_uparrow(IMAGE_STATE_CURRENT, MODE_MASK);
|
||||||
scrollbar_show(0);
|
|
||||||
break;
|
break;
|
||||||
case image_down:
|
case image_down:
|
||||||
render_simage(images[image_down].current, scrollbar_get_downarrow_win(), scrollbar_arrow_width(), scrollbar_arrow_width(), image_down, 0);
|
scrollbar_draw_downarrow(IMAGE_STATE_CURRENT, MODE_MASK);
|
||||||
scrollbar_show(0);
|
|
||||||
break;
|
break;
|
||||||
case image_sb:
|
case image_sb:
|
||||||
render_simage(images[image_sb].current, scrollbar_get_win(), scrollbar_trough_width(), scrollbar_trough_height(), image_sb, 0);
|
scrollbar_draw_trough(IMAGE_STATE_CURRENT, MODE_MASK);
|
||||||
scrollbar_show(0);
|
|
||||||
break;
|
break;
|
||||||
case image_sa:
|
case image_sa:
|
||||||
render_simage(images[image_sa].current, scrollbar_get_anchor_win(), scrollbar_anchor_width(), scrollbar_anchor_height(), image_sa, 0);
|
scrollbar_draw_anchor(IMAGE_STATE_CURRENT, MODE_MASK);
|
||||||
scrollbar_show(0);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
D_PIXMAP(("redraw_image(): Bad value %u\n", which));
|
D_PIXMAP(("redraw_image(): Bad value %u\n", which));
|
||||||
|
|
|
@ -102,7 +102,7 @@ enum {
|
||||||
#define image_mode_is(which, bit) (images[which].mode & (bit))
|
#define image_mode_is(which, bit) (images[which].mode & (bit))
|
||||||
#define image_mode_fallback(which) do {if (image_mode_is((which), ALLOW_IMAGE)) {image_set_mode((which), MODE_IMAGE);} else {image_set_mode((which), MODE_SOLID);}} while (0)
|
#define image_mode_fallback(which) do {if (image_mode_is((which), ALLOW_IMAGE)) {image_set_mode((which), MODE_IMAGE);} else {image_set_mode((which), MODE_SOLID);}} while (0)
|
||||||
#define redraw_all_images() do {render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 0); \
|
#define redraw_all_images() do {render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 0); \
|
||||||
scr_touch(); scrollbar_show(0); if (image_mode_any(MODE_AUTO)) enl_ipc_sync();} while (0)
|
scr_touch(); scrollbar_draw(MODE_MASK); if (image_mode_any(MODE_AUTO)) enl_ipc_sync();} while (0)
|
||||||
|
|
||||||
/* Elements of an simage to be reset */
|
/* Elements of an simage to be reset */
|
||||||
#define RESET_NONE (0UL)
|
#define RESET_NONE (0UL)
|
||||||
|
|
|
@ -379,7 +379,12 @@ scrollbar_draw_uparrow(unsigned char image_state, unsigned char force_modes) {
|
||||||
}
|
}
|
||||||
if (!image_mode_is(image_up, MODE_MASK)) {
|
if (!image_mode_is(image_up, MODE_MASK)) {
|
||||||
/* Solid mode. Redraw every time since it's cheap. */
|
/* Solid mode. Redraw every time since it's cheap. */
|
||||||
XFillRectangle(Xdisplay, scrollbar.up_win, gc_scrollbar, 0, 0, scrollbar_arrow_width(), scrollbar_arrow_height());
|
if (Options & Opt_scrollbar_floating) {
|
||||||
|
XSetWindowBackground(Xdisplay, scrollbar.up_win, PixColors[bgColor]);
|
||||||
|
XClearWindow(Xdisplay, scrollbar.up_win);
|
||||||
|
} else {
|
||||||
|
XFillRectangle(Xdisplay, scrollbar.up_win, gc_scrollbar, 0, 0, scrollbar_arrow_width(), scrollbar_arrow_height());
|
||||||
|
}
|
||||||
if (image_state == IMAGE_STATE_CLICKED) {
|
if (image_state == IMAGE_STATE_CLICKED) {
|
||||||
scrollbar_set_uparrow_pressed(1);
|
scrollbar_set_uparrow_pressed(1);
|
||||||
draw_uparrow_clicked(scrollbar.up_win, gc_top, gc_bottom, 0, 0, scrollbar_arrow_width() - 1, scrollbar_get_shadow());
|
draw_uparrow_clicked(scrollbar.up_win, gc_top, gc_bottom, 0, 0, scrollbar_arrow_width() - 1, scrollbar_get_shadow());
|
||||||
|
@ -436,7 +441,12 @@ scrollbar_draw_downarrow(unsigned char image_state, unsigned char force_modes) {
|
||||||
}
|
}
|
||||||
if (!image_mode_is(image_down, MODE_MASK)) {
|
if (!image_mode_is(image_down, MODE_MASK)) {
|
||||||
/* Solid mode. Redraw every time since it's cheap. */
|
/* Solid mode. Redraw every time since it's cheap. */
|
||||||
XFillRectangle(Xdisplay, scrollbar.dn_win, gc_scrollbar, 0, 0, scrollbar_arrow_width(), scrollbar_arrow_height());
|
if (Options & Opt_scrollbar_floating) {
|
||||||
|
XSetWindowBackground(Xdisplay, scrollbar.dn_win, PixColors[bgColor]);
|
||||||
|
XClearWindow(Xdisplay, scrollbar.dn_win);
|
||||||
|
} else {
|
||||||
|
XFillRectangle(Xdisplay, scrollbar.dn_win, gc_scrollbar, 0, 0, scrollbar_arrow_width(), scrollbar_arrow_height());
|
||||||
|
}
|
||||||
if (image_state == IMAGE_STATE_CLICKED) {
|
if (image_state == IMAGE_STATE_CLICKED) {
|
||||||
scrollbar_set_downarrow_pressed(1);
|
scrollbar_set_downarrow_pressed(1);
|
||||||
draw_downarrow_clicked(scrollbar.dn_win, gc_top, gc_bottom, 0, 0, scrollbar_arrow_width() - 1, scrollbar_get_shadow());
|
draw_downarrow_clicked(scrollbar.dn_win, gc_top, gc_bottom, 0, 0, scrollbar_arrow_width() - 1, scrollbar_get_shadow());
|
||||||
|
@ -503,7 +513,12 @@ scrollbar_draw_anchor(unsigned char image_state, unsigned char force_modes) {
|
||||||
#endif /* XTERM_SCROLLBAR */
|
#endif /* XTERM_SCROLLBAR */
|
||||||
#if defined(MOTIF_SCROLLBAR) || defined(NEXT_SCROLLBAR)
|
#if defined(MOTIF_SCROLLBAR) || defined(NEXT_SCROLLBAR)
|
||||||
if (scrollbar.type == SCROLLBAR_MOTIF || scrollbar.type == SCROLLBAR_NEXT) {
|
if (scrollbar.type == SCROLLBAR_MOTIF || scrollbar.type == SCROLLBAR_NEXT) {
|
||||||
XFillRectangle(Xdisplay, scrollbar.sa_win, gc_scrollbar, 0, 0, scrollbar_anchor_width(), scrollbar_anchor_height());
|
if (Options & Opt_scrollbar_floating) {
|
||||||
|
XSetWindowBackground(Xdisplay, scrollbar.sa_win, PixColors[bgColor]);
|
||||||
|
XClearWindow(Xdisplay, scrollbar.sa_win);
|
||||||
|
} else {
|
||||||
|
XFillRectangle(Xdisplay, scrollbar.sa_win, gc_scrollbar, 0, 0, scrollbar_anchor_width(), scrollbar_anchor_height());
|
||||||
|
}
|
||||||
if (scrollbar_anchor_is_pressed()) {
|
if (scrollbar_anchor_is_pressed()) {
|
||||||
draw_shadow(scrollbar.sa_win, gc_bottom, gc_top, 0, 0, scrollbar_anchor_width(), scrollbar_anchor_height(), scrollbar_get_shadow());
|
draw_shadow(scrollbar.sa_win, gc_bottom, gc_top, 0, 0, scrollbar_anchor_width(), scrollbar_anchor_height(), scrollbar_get_shadow());
|
||||||
} else {
|
} else {
|
||||||
|
@ -929,6 +944,20 @@ scrollbar_reposition_and_draw(unsigned char force_modes)
|
||||||
scrollbar.init = 1;
|
scrollbar.init = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
scrollbar_reposition_and_always_draw(void)
|
||||||
|
{
|
||||||
|
D_SCROLLBAR(("scrollbar_reposition_and_always_draw()\n"));
|
||||||
|
scrollbar_draw_trough(IMAGE_STATE_CURRENT, MODE_MASK);
|
||||||
|
scrollbar_move_uparrow();
|
||||||
|
scrollbar_draw_uparrow(IMAGE_STATE_CURRENT, MODE_MASK);
|
||||||
|
scrollbar_move_downarrow();
|
||||||
|
scrollbar_draw_downarrow(IMAGE_STATE_CURRENT, MODE_MASK);
|
||||||
|
scrollbar_anchor_update_position(1);
|
||||||
|
scrollbar_draw_anchor(IMAGE_STATE_CURRENT, MODE_MASK);
|
||||||
|
scrollbar.init = 1;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned char
|
unsigned char
|
||||||
scrollbar_show(short mouseoffset)
|
scrollbar_show(short mouseoffset)
|
||||||
{
|
{
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
#define map_scrollbar(show) do {PrivMode(show, PrivMode_scrollbar); if (scrollbar_mapping(show)) {scr_touch(); parent_resize();} } while (0)
|
#define map_scrollbar(show) do {PrivMode(show, PrivMode_scrollbar); if (scrollbar_mapping(show)) {scr_touch(); parent_resize();} } while (0)
|
||||||
#define scrollbar_map_arrows() do {XMapWindow(Xdisplay, scrollbar.up_win); XMapWindow(Xdisplay, scrollbar.dn_win);} while (0)
|
#define scrollbar_map_arrows() do {XMapWindow(Xdisplay, scrollbar.up_win); XMapWindow(Xdisplay, scrollbar.dn_win);} while (0)
|
||||||
#define scrollbar_unmap_arrows() do {XUnmapWindow(Xdisplay, scrollbar.up_win); XUnmapWindow(Xdisplay, scrollbar.dn_win);} while (0)
|
#define scrollbar_unmap_arrows() do {XUnmapWindow(Xdisplay, scrollbar.up_win); XUnmapWindow(Xdisplay, scrollbar.dn_win);} while (0)
|
||||||
#define scrollbar_get_shadow() (((scrollbar.type == SCROLLBAR_XTERM) || (Options & Opt_scrollbar_floating)) ? (0) : (scrollbar.shadow))
|
#define scrollbar_get_shadow() ((scrollbar.type == SCROLLBAR_XTERM) ? (0) : (scrollbar.shadow))
|
||||||
#define scrollbar_set_shadow(s) (scrollbar.shadow = (s))
|
#define scrollbar_set_shadow(s) (scrollbar.shadow = (s))
|
||||||
#define scrollbar_get_type() (scrollbar.type)
|
#define scrollbar_get_type() (scrollbar.type)
|
||||||
#define scrollbar_set_type(t) (scrollbar.type = (t))
|
#define scrollbar_set_type(t) (scrollbar.type = (t))
|
||||||
|
@ -150,6 +150,7 @@ extern unsigned char scrollbar_set_focus(short has_focus);
|
||||||
extern unsigned char scrollbar_anchor_update_position(short mouseoffset);
|
extern unsigned char scrollbar_anchor_update_position(short mouseoffset);
|
||||||
extern void scrollbar_draw(unsigned char force_modes);
|
extern void scrollbar_draw(unsigned char force_modes);
|
||||||
extern void scrollbar_reposition_and_draw(unsigned char force_modes);
|
extern void scrollbar_reposition_and_draw(unsigned char force_modes);
|
||||||
|
extern void scrollbar_reposition_and_always_draw(void);
|
||||||
extern unsigned char scrollbar_show(short);
|
extern unsigned char scrollbar_show(short);
|
||||||
|
|
||||||
_XFUNCPROTOEND
|
_XFUNCPROTOEND
|
||||||
|
|
11
src/term.c
11
src/term.c
|
@ -1881,18 +1881,13 @@ xterm_seq(int op, const char *str)
|
||||||
case 11:
|
case 11:
|
||||||
nstr = (char *) strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_right);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_right);
|
||||||
scrollbar_reset();
|
scr_touch();
|
||||||
map_scrollbar(0);
|
parent_resize();
|
||||||
map_scrollbar(1);
|
|
||||||
scrollbar_show(0);
|
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
nstr = (char *) strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_floating);
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_floating);
|
||||||
scrollbar_reset();
|
scrollbar_reposition_and_always_draw();
|
||||||
map_scrollbar(0);
|
|
||||||
map_scrollbar(1);
|
|
||||||
scrollbar_show(0);
|
|
||||||
break;
|
break;
|
||||||
case 13:
|
case 13:
|
||||||
nstr = (char *) strsep(&tnstr, ";");
|
nstr = (char *) strsep(&tnstr, ";");
|
||||||
|
|
Loading…
Reference in New Issue