/* EXTPROTO */ int rxvt_scrollbar_show (rxvt_t* r) { int changed = 0; assert (IS_WIN(r->scrollBar.win)); changed = !r->scrollBar.state; XMapWindow(r->Xdisplay, r->scrollBar.win); r->scrollBar.state = 1; return (changed); }
/* EXTPROTO */ int rxvt_scrollbar_hide (rxvt_t* r) { int changed = 0; assert (IS_WIN(r->scrollBar.win)); changed = r->scrollBar.state; XUnmapWindow(r->Xdisplay, r->scrollBar.win); r->scrollBar.state = 0; /* scrollbar_setIdle(); */ return (changed); }
/* EXTPROTO */ int rxvt_scrollbar_visible(rxvt_t *r) { return (IS_WIN(r->scrollBar.win) && r->scrollBar.state); }
/* EXTPROTO */ void rxvt_scrollbar_create (rxvt_t* r) { int sb_x, sb_y; unsigned int sb_w, sb_h; rxvt_dbgmsg ((DBG_VERBOSE, DBG_SCROLLBAR, "Create scrollbar\n")); assert (IS_WIN(r->TermWin.parent)); sb_x = ISSET_OPTION(r, Opt_scrollBar_right) ? VT_WIDTH(r) : 0; sb_y = r->h->window_vt_y; sb_w = rxvt_scrollbar_rwidth (r); /* real scrollbar width */ sb_h = VT_HEIGHT(r); /* same height as vt window */ /* set scrollbar parameters */ # ifdef PLAIN_SCROLLBAR if (r->scrollBar.style == R_SB_PLAIN) { r->scrollBar.beg = R_SCROLLBEG_PLAIN; r->scrollBar.end = R_SCROLLEND_PLAIN; } # endif # ifdef XTERM_SCROLLBAR if (r->scrollBar.style == R_SB_XTERM) { r->scrollBar.beg = R_SCROLLBEG_XTERM; r->scrollBar.end = R_SCROLLEND_XTERM; } # endif # ifdef NEXT_SCROLLBAR if (r->scrollBar.style == R_SB_NEXT) { r->scrollBar.beg = R_SCROLLBEG_NEXT; r->scrollBar.end = R_SCROLLEND_NEXT; } # endif # ifdef RXVT_SCROLLBAR if (r->scrollBar.style == R_SB_RXVT) { r->scrollBar.beg = R_SCROLLBEG_RXVT; r->scrollBar.end = R_SCROLLEND_RXVT; } # endif # ifdef SGI_SCROLLBAR if (r->scrollBar.style == R_SB_SGI) { r->scrollBar.beg = R_SCROLLBEG_SGI; r->scrollBar.end = R_SCROLLEND_SGI; } # endif r->scrollBar.win = XCreateSimpleWindow(r->Xdisplay, r->TermWin.parent, sb_x, sb_y, sb_w, sb_h, 0, r->pixColorsFocus[Color_fg], r->pixColorsFocus[Color_bg]); assert (IS_WIN(r->scrollBar.win)); # ifdef DEBUG rxvt_set_win_title (r, r->scrollBar.win, "scrollbar"); # endif XDefineCursor(r->Xdisplay, r->scrollBar.win, r->h->bar_pointer); XSelectInput(r->Xdisplay, r->scrollBar.win, (ExposureMask | ButtonPressMask | ButtonReleaseMask | Button1MotionMask | Button2MotionMask | Button3MotionMask)); # ifdef BACKGROUND_IMAGE UNSET_PIXMAP(r->scrollBar.pixmap); /* initialize it to None */ # ifdef TRANSPARENT if (!(ISSET_OPTION(r, Opt_transparent) && ISSET_OPTION(r, Opt_transparent_scrollbar) )) # endif if (r->h->rs[Rs_scrollbarPixmap]) { long w = 0, h = 0; r->scrollBar.pixmap = rxvt_load_pixmap (r, r->h->rs[Rs_scrollbarPixmap], &w, &h); if (IS_PIXMAP(r->scrollBar.pixmap)) XSetWindowBackgroundPixmap (r->Xdisplay, r->scrollBar.win, r->scrollBar.pixmap); } # endif # ifdef TRANSPARENT if (ISSET_OPTION(r, Opt_transparent) && ISSET_OPTION(r, Opt_transparent_scrollbar)) { XSetWindowBackgroundPixmap (r->Xdisplay, r->scrollBar.win, ParentRelative); } # endif r->scrollBar.state = 0; /* Final initialization of the scrollbars */ # ifdef PLAIN_SCROLLBAR if (r->scrollBar.style == R_SB_PLAIN) rxvt_scrollbar_init_plain (r); # endif # ifdef XTERM_SCROLLBAR if (r->scrollBar.style == R_SB_XTERM) rxvt_scrollbar_init_xterm (r); # endif # ifdef RXVT_SCROLLBAR if (r->scrollBar.style == R_SB_RXVT) rxvt_scrollbar_init_rxvt (r); # endif # ifdef NEXT_SCROLLBAR if (r->scrollBar.style == R_SB_NEXT) rxvt_scrollbar_init_next (r); # endif # ifdef SGI_SCROLLBAR if (r->scrollBar.style == R_SB_SGI) rxvt_scrollbar_init_sgi (r); # endif }
int IS_NONE () { if ( IS_WIN() || IS_LALT() ) return FALSE; else return TRUE; }