Make a guess:

 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See thomas.h
 * for more details.
 */

/** \file scrollslider.h
 *  \brief Standard scrollbar for windows
 */

#ifndef _SFM_SCROLLSLIDER_H_
#define _SFM_SCROLLSLIDER_H_

#include <sys/time.h>

/** ScrollBar information */
typedef struct {
	unsigned int type;  /**< WINDOW_SB_XXX */
	int sliderMin;    /**< Minimal value */
	int sliderMax;    /**< Maximal value */
	int sliderStep;   /**< Step size */
	int sliderPage;   /**< Page size */
} ScrollBarInfo;

/** Directions of scroll bar relative to scrollbar position */
typedef enum {
	SD_Up,     /**< Upwards */
	SD_Down,    /**< Downwards */
	SD_None     /**< Both types */
} ScrollBarScrollDir;

/** Description of the scrollbars */
typedef struct {
	ScrollBarInfo sliders[2];     /**< scrollbars in row 0, row 1 */
	unsigned int n_sliders;        /**< number of elements in scrollbars array */
} ScrollBar;

/** Used to create a scrollbar */
typedef struct {
	int type;    /**< WINDOW_SB_XXX */
	int min;     /**< minimum value */
	int max;     /**< maximum value */
	int step;    /**< step size */
	int page;    /**< page size */
	int ticks;   /**< number of tickmarks in the scrollbar */
	int slid;    /**< scroll bar ID */
	char *text;   /**< text to display */
} ScrollBarThumb;

#define SCROLLBAR_INFO_DEFAULT_H    4
#define SCROLLBAR_INFO_DEFAULT_W    8
#define SCROLLBAR_INFO_DEFAULT_Y    3
#define SCROLLBAR_INFO_DEFAULT_X    0
#define SCROLLBAR_INFO_MAX_H_POS      1
#define SCROLLBAR_INFO_MAX_H_SIZE     12
#define SCROLLBAR_INFO_MAX_W_POS      2
#define SCROLLBAR_INFO_MAX_W_SIZE     16
#define SCROLLBAR_INFO_MAX_Y_POS      4
#define SCROLLBAR_INFO_MAX_Y_SIZE     32
#define SCROLLBAR_INFO_MAX_X_POS      8
#define SCROLLBAR_INFO_MAX_X_SIZE     48

/* scrollbar position values */
#define SCROLLBAR_POSITION_TOPLEFT     1
#define SCROLLBAR_POSITION_TOPRIGHT    2
#define SCROLLBAR_POSITION_BOTTOMLEFT   3
#define SCROLLBAR_POSITION_BOTTOMRIGHT  4

/** Describes a mouse position and the scrollbar state. */
typedef struct {
	int pos;         /**< position of the mouse */
	unsigned int state; /**< which states to receive */
} ScrPos;

#endif /* _SFM_SCROLLSLIDER_H_ */