/*--------------------------------*-C-*---------------------------------*
 * File:	sbar.h
 *
 * ----------------------------------------------------------------------
 * Copyright 1995,1996
 * mj olesen <olesen@me.QueensU.CA> Queen's Univ at Kingston
 *
 * You can do what you like with this source code provided you don't make
 * money from it and you include an unaltered copy of this message
 * (including the copyright).  As usual, the author accepts no
 * responsibility for anything, nor does he guarantee anything whatsoever.
 *----------------------------------------------------------------------*/
#ifndef _SBAR_H
#define _SBAR_H
#include <ctype.h>

#ifndef NO_SCROLLBAR
typedef struct {
   int width;
   int beg, end;	/* beg/end of subwindow within parent window */
   int top, bot, len;	/* top/bot/len of slider */
   int motion;		/* last motion: Up, Down */
   Window parent, sb;
} sbar_t;
extern sbar_t	sbar;
#endif	/* NO_SCROLLBAR */

#define sbar_isMotion()	(sbar.motion == 'm')
#define sbar_isUp()	(sbar.motion == 'U')
#define sbar_isDn()	(sbar.motion == 'D')
#define sbar_isUpDn()	isupper (sbar.motion)

#define sbar_setNone()		do { sbar.motion = 0; } while (0)
#define sbar_setMotion()	do { sbar.motion = 'm'; } while (0)
#define sbar_setUp()		do { sbar.motion = 'U'; } while (0)
#define sbar_setDn()		do { sbar.motion = 'D'; } while (0)

#ifdef XTERM_SCROLLBAR
# define SB_BORDER	1
# define SB_SHADOW	0
# undef  SB_WIDTH
# define SB_WIDTH	12
#else
# define SB_BORDER	0
# define SB_SHADOW	2
# ifndef SB_WIDTH
#  define SB_WIDTH	14	/* width of scrollBar */
# endif
#endif	/* XTERM_SCROLLBAR */

#ifdef __cplusplus
extern "C" {
#endif
   extern void	sbar_init (Window win, XGCValues *gcv);
   extern int	sbar_show (int update);
#ifdef __cplusplus
}
#endif
#endif	/* whole file */
/*----------------------- end-of-file (C header) -----------------------*/
