PageRenderTime 53ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 1ms

/src/scrollbar-sgi.c

https://gitlab.com/Jehan_ZeMarmot/mrxvt
C | 575 lines | 433 code | 67 blank | 75 comment | 25 complexity | e5a6fd26bf1bb92dbce5a4a0a3d02e73 MD5 | raw file
  1. /*--------------------------------*-C-*---------------------------------*
  2. * File: scrollbar-sgi.c
  3. *----------------------------------------------------------------------*
  4. *
  5. * All portions of code are copyright by their respective author/s.
  6. * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org>
  7. * Copyright (c) 1998 Sasha Vasko
  8. * Copyright (c) 2000 Frank Everdij <frank@ff-net.demon.nl>
  9. * Copyright (c) 2004 Jingmin Zhou <jimmyzhou@users.sourceforge.net>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. *----------------------------------------------------------------------*/
  25. #include "../config.h"
  26. #include "rxvt.h"
  27. /*----------------------------------------------------------------------*/
  28. #ifdef HAVE_SCROLLBARS
  29. #ifdef SGI_SCROLLBAR
  30. #define CHOOSE_GC_FG(R, PIXCOL) \
  31. XSetForeground ((R)->Xdisplay, (R)->scrollBar.gc, (PIXCOL))
  32. static char *SCROLLER_DIMPLE[] = {
  33. " ",
  34. "############",
  35. ".==========%",
  36. ".==========%",
  37. " ",
  38. "############",
  39. ".==========%",
  40. ".==========%",
  41. " ",
  42. "############"
  43. };
  44. #define SCROLLER_DIMPLE_WIDTH 12
  45. #define SCROLLER_DIMPLE_HEIGHT 10
  46. static char *SCROLLER_ARROW_UP[] = {
  47. "============",
  48. "============",
  49. "=====*======",
  50. "=====**=====",
  51. "=====**=====",
  52. "====****====",
  53. "====****====",
  54. "===******===",
  55. "===******===",
  56. "==********==",
  57. "==********==",
  58. "============",
  59. "============",
  60. "============"
  61. };
  62. static char *SCROLLER_ARROW_DOWN[] = {
  63. "============",
  64. "============",
  65. "=*********==",
  66. "==********==",
  67. "==********==",
  68. "===******===",
  69. "===******===",
  70. "====****====",
  71. "====****====",
  72. "=====**=====",
  73. "=====**=====",
  74. "============",
  75. "============",
  76. "============"
  77. };
  78. static char *LO_SCROLLER_ARROW_UP[] = {
  79. "============",
  80. "============",
  81. "=====-======",
  82. "=====--=====",
  83. "=====--=====",
  84. "====----====",
  85. "====----====",
  86. "===------===",
  87. "===------===",
  88. "==--------==",
  89. "==--------==",
  90. "============",
  91. "============",
  92. "============"
  93. };
  94. static char *LO_SCROLLER_ARROW_DOWN[] = {
  95. "============",
  96. "============",
  97. "=---------==",
  98. "==--------==",
  99. "==--------==",
  100. "===------===",
  101. "===------===",
  102. "====----====",
  103. "====----====",
  104. "=====--=====",
  105. "=====--=====",
  106. "============",
  107. "============",
  108. "============"
  109. };
  110. static char *HI_SCROLLER_ARROW_UP[] = {
  111. " ",
  112. " ",
  113. " % ",
  114. " %% ",
  115. " %% ",
  116. " %%%% ",
  117. " %%%% ",
  118. " %%%%%% ",
  119. " %%%%%% ",
  120. " %%%%%%%% ",
  121. " %%%%%%%% ",
  122. " ",
  123. " ",
  124. " "
  125. };
  126. static char *HI_SCROLLER_ARROW_DOWN[] = {
  127. " ",
  128. " ",
  129. " %%%%%%%%% ",
  130. " %%%%%%%% ",
  131. " %%%%%%%% ",
  132. " %%%%%% ",
  133. " %%%%%% ",
  134. " %%%% ",
  135. " %%%% ",
  136. " %% ",
  137. " %% ",
  138. " ",
  139. " ",
  140. " "
  141. };
  142. #define ARROW_SOURCE_WIDTH 12
  143. #define ARROW_SOURCE_HEIGHT 14
  144. #ifndef SCROLL_SHADOW_HEIGHT
  145. # define SCROLL_SHADOW_HEIGHT 1
  146. #endif
  147. /* end unconfigurable stuff */
  148. #define stp_width 8
  149. #define stp_height 8
  150. static unsigned char stp_bits[] = {
  151. 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa};
  152. /* INTPROTO */
  153. static Pixmap
  154. create_icon (rxvt_t* r, char **data, int sx, int sy, unsigned int width, unsigned int height)
  155. {
  156. register int i, k;
  157. register int x, y;
  158. unsigned long pixel;
  159. Pixmap pixmap;
  160. pixmap = XCreatePixmap (r->Xdisplay, r->scrollBar.win,
  161. width, height, XDEPTH);
  162. if (NOT_PIXMAP(pixmap))
  163. return None;
  164. y = sy;
  165. for (i = 0; i < height ; y++, i++ ) {
  166. x = sx ;
  167. for (k = 0; k < width ; k++, x++ ) {
  168. switch (data[y][x]) {
  169. case ' ':
  170. case 'w':
  171. pixel = r->scrollBar.sgi_white; break;
  172. case '.':
  173. case 'l':
  174. pixel = r->scrollBar.sgi_fg; break;
  175. case '-':
  176. case 'g':
  177. pixel = r->scrollBar.sgi_lmedium; break;
  178. case '%':
  179. case 'd':
  180. pixel = r->scrollBar.sgi_dark; break;
  181. case '*':
  182. case 'v':
  183. pixel = r->scrollBar.sgi_vdark; break;
  184. case '#':
  185. case 'b':
  186. pixel = r->scrollBar.sgi_black; break;
  187. case '=':
  188. case 'm':
  189. default:
  190. pixel = r->scrollBar.sgi_bg;
  191. break;
  192. }
  193. CHOOSE_GC_FG(r, pixel);
  194. XDrawPoint (r->Xdisplay, pixmap, r->scrollBar.gc, k, i);
  195. }
  196. }
  197. return (pixmap);
  198. }
  199. /* Draw bevel & arrows */
  200. /* INTPROTO */
  201. static void
  202. sgi_draw_bevel (rxvt_t* r, Drawable d, int x, int y, int w, int h)
  203. {
  204. CHOOSE_GC_FG(r, r->scrollBar.sgi_fg);
  205. XDrawLine(r->Xdisplay, d, r->scrollBar.gc, x, y, x+w, y);
  206. XDrawLine(r->Xdisplay, d, r->scrollBar.gc, x, y, x, y+h);
  207. XDrawLine(r->Xdisplay, d, r->scrollBar.gc, x+1, y+1, x+w-1, y+1);
  208. XDrawLine(r->Xdisplay, d, r->scrollBar.gc, x+1, y+1, x+1, y+h-1);
  209. CHOOSE_GC_FG(r, r->scrollBar.sgi_dark);
  210. XDrawLine(r->Xdisplay, d, r->scrollBar.gc, x+w, y+1, x+w, y+h);
  211. XDrawLine(r->Xdisplay, d, r->scrollBar.gc, x+1, y+h, x+w, y+h);
  212. XDrawLine(r->Xdisplay, d, r->scrollBar.gc, x+w-1, y+2, x+w-1, y+h-1);
  213. XDrawLine(r->Xdisplay, d, r->scrollBar.gc, x+2, y+h-1, x+w-1, y+h-1);
  214. }
  215. /* INTPROTO */
  216. static void
  217. scrollbar_fill_back (rxvt_t* r, unsigned int height)
  218. {
  219. /* fill background */
  220. XClearArea (r->Xdisplay, r->scrollBar.win,
  221. 0, SGI_SB_BUTTON_HEIGHT,
  222. SB_WIDTH_SGI, height, False);
  223. /* fill top button space */
  224. CHOOSE_GC_FG(r, r->scrollBar.sgi_fg);
  225. XFillRectangle (r->Xdisplay, r->scrollBar.win, r->scrollBar.gc,
  226. 0, 0,
  227. SB_WIDTH_SGI, SGI_SB_BUTTON_HEIGHT);
  228. /* fill bottom button space */
  229. XFillRectangle (r->Xdisplay, r->scrollBar.win, r->scrollBar.gc,
  230. 0, height+SGI_SB_BUTTON_HEIGHT,
  231. SB_WIDTH_SGI, SGI_SB_BUTTON_HEIGHT);
  232. CHOOSE_GC_FG(r, r->scrollBar.sgi_dark);
  233. /* right vertical border line */
  234. XDrawLine (r->Xdisplay, r->scrollBar.win, r->scrollBar.gc,
  235. SB_WIDTH_SGI-1, 0,
  236. SB_WIDTH_SGI-1, height+SGI_SB_BUTTONS_HEIGHT);
  237. /* bottom horizontal line */
  238. XDrawLine (r->Xdisplay, r->scrollBar.win, r->scrollBar.gc,
  239. 2, height+SGI_SB_BUTTONS_HEIGHT-1,
  240. SB_WIDTH_SGI, height+SGI_SB_BUTTONS_HEIGHT-1);
  241. }
  242. /* EXTPROTO */
  243. void
  244. rxvt_scrollbar_init_sgi (rxvt_t* r)
  245. {
  246. XGCValues gcvalue;
  247. unsigned long gcmask;
  248. Pixmap stipple;
  249. XColor xcol;
  250. unsigned int x_offset, y_offset;
  251. /* Initialize colors */
  252. r->scrollBar.sgi_black =
  253. BlackPixelOfScreen(DefaultScreenOfDisplay(r->Xdisplay));
  254. r->scrollBar.sgi_white =
  255. WhitePixelOfScreen(DefaultScreenOfDisplay(r->Xdisplay));
  256. /* alloc light gray */
  257. xcol.red = 0xde00;
  258. xcol.green = 0xde00;
  259. xcol.blue = 0xde00;
  260. if (!rxvt_alloc_color (r, &xcol, "light gray")) {
  261. #ifndef NO_BRIGHTCOLOR
  262. r->scrollBar.sgi_fg = r->pixColorsFocus [Color_AntiqueWhite];
  263. #else
  264. r->scrollBar.sgi_fg = r->pixColorsFocus [Color_White];
  265. #endif
  266. }
  267. else
  268. r->scrollBar.sgi_fg = xcol.pixel;
  269. /* alloc light medium gray */
  270. xcol.red = 0xaa00;
  271. xcol.green = 0xaa00;
  272. xcol.blue = 0xaa00;
  273. if (!rxvt_alloc_color (r, &xcol, "light medium gray")) {
  274. #ifndef NO_BRIGHTCOLOR
  275. r->scrollBar.sgi_lmedium = r->pixColorsFocus [Color_AntiqueWhite];
  276. #else
  277. r->scrollBar.sgi_lmedium = r->pixColorsFocus [Color_White];
  278. #endif
  279. }
  280. else
  281. r->scrollBar.sgi_lmedium = xcol.pixel;
  282. /* alloc medium gray */
  283. xcol.red = 0xbd00;
  284. xcol.green = 0xbd00;
  285. xcol.blue = 0xbd00;
  286. if (!rxvt_alloc_color (r, &xcol, "medium gray")) {
  287. #ifndef NO_BRIGHTCOLOR
  288. r->scrollBar.sgi_bg = r->pixColorsFocus [Color_Black];
  289. #else
  290. r->scrollBar.sgi_bg = r->pixColorsFocus [Color_Grey50];
  291. #endif
  292. }
  293. else
  294. r->scrollBar.sgi_bg = xcol.pixel;
  295. /* alloc dark gray */
  296. xcol.red = 0x8e00;
  297. xcol.green = 0x8e00;
  298. xcol.blue = 0x8e00;
  299. if (!rxvt_alloc_color (r, &xcol, "dark gray")) {
  300. #ifndef NO_BRIGHTCOLOR
  301. r->scrollBar.sgi_dark = r->pixColorsFocus [Color_Grey25];
  302. #else
  303. r->scrollBar.sgi_dark = r->pixColorsFocus [Color_Black];
  304. #endif
  305. }
  306. r->scrollBar.sgi_dark = xcol.pixel;
  307. /* alloc very dark gray */
  308. xcol.red = 0x5e00;
  309. xcol.green = 0x5e00;
  310. xcol.blue = 0x5e00;
  311. if (!rxvt_alloc_color (r, &xcol, "very dark gray")) {
  312. #ifndef NO_BRIGHTCOLOR
  313. r->scrollBar.sgi_vdark = r->pixColorsFocus [Color_Grey25];
  314. #else
  315. r->scrollBar.sgi_vdark = r->pixColorsFocus [Color_Black];
  316. #endif
  317. }
  318. r->scrollBar.sgi_vdark = xcol.pixel;
  319. /* Create GCs */
  320. gcvalue.foreground = r->scrollBar.sgi_white;
  321. gcmask = GCForeground;
  322. r->scrollBar.gc = XCreateGC (r->Xdisplay, r->scrollBar.win,
  323. gcmask, &gcvalue);
  324. stipple = XCreateBitmapFromData(r->Xdisplay, r->scrollBar.win,
  325. (const char*) stp_bits, stp_width, stp_height);
  326. assert (IS_PIXMAP(stipple));
  327. gcvalue.foreground = r->scrollBar.sgi_dark;
  328. gcvalue.background = r->scrollBar.sgi_bg;
  329. gcvalue.fill_style = FillStippled;
  330. gcvalue.stipple = stipple;
  331. gcmask = GCForeground | GCBackground | GCStipple | GCFillStyle;
  332. r->scrollBar.sgi_stippleGC = XCreateGC(r->Xdisplay,
  333. r->scrollBar.win, gcmask, &gcvalue);
  334. assert (IS_GC(r->scrollBar.sgi_stippleGC));
  335. /* Create icons */
  336. r->scrollBar.sgi_dimple = create_icon (r, SCROLLER_DIMPLE,
  337. 0, 0,
  338. SCROLLER_DIMPLE_WIDTH, SCROLLER_DIMPLE_HEIGHT);
  339. assert (IS_PIXMAP(r->scrollBar.sgi_dimple));
  340. x_offset = y_offset = (ARROW_SOURCE_WIDTH-SGI_ARROW_WIDTH)>>1;
  341. r->scrollBar.sgi_upArrow = create_icon (r, SCROLLER_ARROW_UP,
  342. x_offset, y_offset,
  343. ARROW_SOURCE_WIDTH, ARROW_SOURCE_HEIGHT);
  344. r->scrollBar.sgi_upArrowHi = create_icon (r, HI_SCROLLER_ARROW_UP,
  345. x_offset, y_offset,
  346. ARROW_SOURCE_WIDTH, ARROW_SOURCE_HEIGHT);
  347. r->scrollBar.sgi_upArrowLow = create_icon (r, LO_SCROLLER_ARROW_UP,
  348. x_offset, y_offset,
  349. ARROW_SOURCE_WIDTH, ARROW_SOURCE_HEIGHT);
  350. r->scrollBar.sgi_downArrow = create_icon (r, SCROLLER_ARROW_DOWN,
  351. x_offset, y_offset,
  352. ARROW_SOURCE_WIDTH, ARROW_SOURCE_HEIGHT);
  353. r->scrollBar.sgi_downArrowHi = create_icon (r,
  354. HI_SCROLLER_ARROW_DOWN,
  355. x_offset, y_offset,
  356. ARROW_SOURCE_WIDTH, ARROW_SOURCE_HEIGHT);
  357. r->scrollBar.sgi_downArrowLow = create_icon (r,
  358. LO_SCROLLER_ARROW_DOWN,
  359. x_offset, y_offset,
  360. ARROW_SOURCE_WIDTH, ARROW_SOURCE_HEIGHT);
  361. #ifdef TRANSPARENT
  362. /* set background color when there's no transparent */
  363. if (!(ISSET_OPTION(r, Opt_transparent) &&
  364. ISSET_OPTION(r, Opt_transparent_scrollbar)
  365. ))
  366. #endif
  367. #ifdef BACKGROUND_IMAGE
  368. /* set background color when there's no bg image */
  369. if (NOT_PIXMAP(r->scrollBar.pixmap))
  370. #endif
  371. XSetWindowBackground (r->Xdisplay, r->scrollBar.win,
  372. r->scrollBar.sgi_bg);
  373. }
  374. /* EXTPROTO */
  375. void
  376. rxvt_scrollbar_exit_sgi (rxvt_t* r)
  377. {
  378. if (IS_GC(r->scrollBar.sgi_stippleGC)) {
  379. XFreeGC (r->Xdisplay, r->scrollBar.sgi_stippleGC);
  380. UNSET_GC(r->scrollBar.sgi_stippleGC);
  381. }
  382. if (IS_PIXMAP(r->scrollBar.sgi_dimple)) {
  383. XFreePixmap (r->Xdisplay, r->scrollBar.sgi_dimple);
  384. UNSET_PIXMAP(r->scrollBar.sgi_dimple);
  385. }
  386. if (IS_PIXMAP(r->scrollBar.sgi_upArrow)) {
  387. XFreePixmap (r->Xdisplay, r->scrollBar.sgi_upArrow);
  388. UNSET_PIXMAP(r->scrollBar.sgi_upArrow);
  389. }
  390. if (IS_PIXMAP(r->scrollBar.sgi_upArrowHi)) {
  391. XFreePixmap (r->Xdisplay, r->scrollBar.sgi_upArrowHi);
  392. UNSET_PIXMAP(r->scrollBar.sgi_upArrowHi);
  393. }
  394. if (IS_PIXMAP(r->scrollBar.sgi_upArrowLow)) {
  395. XFreePixmap (r->Xdisplay, r->scrollBar.sgi_upArrowLow);
  396. UNSET_PIXMAP(r->scrollBar.sgi_upArrowLow);
  397. }
  398. if (IS_PIXMAP(r->scrollBar.sgi_downArrow)) {
  399. XFreePixmap (r->Xdisplay, r->scrollBar.sgi_downArrow);
  400. UNSET_PIXMAP(r->scrollBar.sgi_downArrow);
  401. }
  402. if (IS_PIXMAP(r->scrollBar.sgi_downArrowHi)) {
  403. XFreePixmap (r->Xdisplay, r->scrollBar.sgi_downArrowHi);
  404. UNSET_PIXMAP(r->scrollBar.sgi_downArrowHi);
  405. }
  406. if (IS_PIXMAP(r->scrollBar.sgi_downArrowLow)) {
  407. XFreePixmap (r->Xdisplay, r->scrollBar.sgi_downArrowLow);
  408. UNSET_PIXMAP(r->scrollBar.sgi_downArrowLow);
  409. }
  410. }
  411. /* EXTPROTO */
  412. int
  413. rxvt_scrollbar_show_sgi (rxvt_t* r, int update, int last_top, int last_bot, int scroller_len)
  414. {
  415. register int new_height =
  416. r->scrollBar.end + SGI_SB_BUTTON_HEIGHT +
  417. ((r->sb_shadow) << 1);
  418. if (!update)
  419. scrollbar_fill_back (r, r->scrollBar.end);
  420. if (0 == AVTS(r)->nscrolled) {
  421. /* top button */
  422. XCopyArea (r->Xdisplay, r->scrollBar.sgi_upArrowLow,
  423. r->scrollBar.win, r->scrollBar.gc,
  424. /* src x, y, width, height */
  425. 0, 0, SGI_ARROW_WIDTH, SGI_ARROW_HEIGHT,
  426. /* dst x, y */
  427. ((SB_WIDTH_SGI)>>1)-(SGI_ARROW_WIDTH>>1)+1,
  428. SGI_BEVEL_SIZE);
  429. /* bottom button */
  430. XCopyArea (r->Xdisplay, r->scrollBar.sgi_downArrowLow,
  431. r->scrollBar.win, r->scrollBar.gc,
  432. /* src x, y, width, height */
  433. 0, 0, SGI_ARROW_WIDTH, SGI_ARROW_HEIGHT,
  434. /* dst x, y */
  435. ((SB_WIDTH_SGI)>>1)-(SGI_ARROW_WIDTH>>1)+1,
  436. new_height - SGI_ARROW_HEIGHT - SGI_BEVEL_SIZE);
  437. }
  438. else {
  439. /* (AVTS(r)->nscrolled > 0) */
  440. rxvt_dbgmsg ((DBG_DEBUG, DBG_SCROLLBAR, "top=%d, bot=%d, last_top=%d, last_bot=%d\n", r->scrollBar.top, r->scrollBar.bot, last_top, last_bot));
  441. if (last_top < r->scrollBar.top)
  442. XClearArea (r->Xdisplay, r->scrollBar.win,
  443. 0, last_top,
  444. SB_WIDTH_SGI-1, (last_top - r->scrollBar.top), False);
  445. if (r->scrollBar.bot < last_bot)
  446. XClearArea (r->Xdisplay, r->scrollBar.win,
  447. 0, r->scrollBar.bot,
  448. SB_WIDTH_SGI-1, (last_bot - r->scrollBar.bot + 1), False);
  449. XClearArea (r->Xdisplay, r->scrollBar.win,
  450. 0, r->scrollBar.top,
  451. SB_WIDTH_SGI-1, scroller_len, False);
  452. /* scroller frame */
  453. CHOOSE_GC_FG(r, r->scrollBar.sgi_vdark);
  454. XDrawRectangle (r->Xdisplay, r->scrollBar.win, r->scrollBar.gc,
  455. 0, r->scrollBar.top,
  456. SB_WIDTH_SGI-1, scroller_len);
  457. /* bevel of scroller, inside scroller frame */
  458. sgi_draw_bevel (r, r->scrollBar.win,
  459. 1, r->scrollBar.top+1,
  460. SB_WIDTH_SGI-3, scroller_len-2);
  461. /*
  462. sgi_draw_bevel (r, r->scrollBar.win,
  463. 0, 0,
  464. SB_WIDTH_SGI-1, SGI_SB_BUTTON_HEIGHT);
  465. sgi_draw_bevel (r, r->scrollBar.win,
  466. 0, new_height-SGI_SB_BUTTON_HEIGHT,
  467. SB_WIDTH_SGI-1, SGI_SB_BUTTON_HEIGHT);
  468. */
  469. /* dimple */
  470. XCopyArea (r->Xdisplay, r->scrollBar.sgi_dimple,
  471. r->scrollBar.win, r->scrollBar.gc,
  472. 0, 0,
  473. SCROLLER_DIMPLE_WIDTH, SCROLLER_DIMPLE_HEIGHT,
  474. ((SB_WIDTH_SGI)>>1)-(SCROLLER_DIMPLE_WIDTH>>1)+1,
  475. r->scrollBar.top + ((scroller_len-SCROLLER_DIMPLE_HEIGHT)>>1));
  476. /* top button */
  477. XCopyArea (r->Xdisplay, (scrollbar_isUp()) ?
  478. r->scrollBar.sgi_upArrowHi : r->scrollBar.sgi_upArrow,
  479. r->scrollBar.win, r->scrollBar.gc,
  480. /* src x, y, width, height */
  481. 0, 0, SGI_ARROW_WIDTH, SGI_ARROW_HEIGHT,
  482. /* dst x, y */
  483. ((SB_WIDTH_SGI)>>1)-(SGI_ARROW_WIDTH>>1)+1,
  484. SGI_BEVEL_SIZE);
  485. /* bottom button */
  486. XCopyArea (r->Xdisplay, (scrollbar_isDn()) ?
  487. r->scrollBar.sgi_downArrowHi : r->scrollBar.sgi_downArrow,
  488. r->scrollBar.win, r->scrollBar.gc,
  489. /* src x, y, width, height */
  490. 0, 0, SGI_ARROW_WIDTH, SGI_ARROW_HEIGHT,
  491. /* dst x, y */
  492. ((SB_WIDTH_SGI)>>1)-(SGI_ARROW_WIDTH>>1)+1,
  493. new_height - SGI_ARROW_HEIGHT - SGI_BEVEL_SIZE);
  494. }
  495. /* bottom line of top button */
  496. CHOOSE_GC_FG(r, r->scrollBar.sgi_fg);
  497. XDrawLine (r->Xdisplay, r->scrollBar.win, r->scrollBar.gc,
  498. 0, SGI_SB_BUTTON_HEIGHT-1,
  499. SB_WIDTH_SGI-1, SGI_SB_BUTTON_HEIGHT-1);
  500. /* top line of bottom button */
  501. XDrawLine (r->Xdisplay, r->scrollBar.win, r->scrollBar.gc,
  502. 0, new_height-SGI_SB_BUTTON_HEIGHT,
  503. SB_WIDTH_SGI-1, new_height-SGI_SB_BUTTON_HEIGHT);
  504. return 1;
  505. }
  506. #endif /* SGI_SCROLLBAR */
  507. #endif /* HAVE_SCROLLBARS */
  508. /*----------------------- end-of-file (C source) -----------------------*/