ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/scrollbar.h
(Generate patch)

Comparing rxvt-unicode/src/scrollbar.h (file contents):
Revision 1.15 by ayin, Sun Feb 17 11:37:21 2008 UTC vs.
Revision 1.17 by ayin, Sun Feb 17 12:11:56 2008 UTC

7 7
8#define R_SB_NEXT 1 8#define R_SB_NEXT 1
9#define R_SB_XTERM 2 9#define R_SB_XTERM 2
10#define R_SB_PLAIN 4 10#define R_SB_PLAIN 4
11#define R_SB_RXVT 8 11#define R_SB_RXVT 8
12
13#define R_SB_ALIGN_CENTRE 0
14#define R_SB_ALIGN_TOP 1
15#define R_SB_ALIGN_BOTTOM 2
16
17#define SB_WIDTH_NEXT 19
18#define SB_WIDTH_XTERM 15
19#define SB_WIDTH_PLAIN 7
20#ifndef SB_WIDTH_RXVT
21# define SB_WIDTH_RXVT 10
22#endif
23
24/*
25 * NeXT scrollbar defines
26 */
27#define SB_PADDING 1
28#define SB_BORDER_WIDTH 1
29#define SB_BEVEL_WIDTH_UPPER_LEFT 1
30#define SB_BEVEL_WIDTH_LOWER_RIGHT 2
31#define SB_LEFT_PADDING (SB_PADDING + SB_BORDER_WIDTH)
32#define SB_MARGIN_SPACE (SB_PADDING * 2)
33#define SB_BUTTON_WIDTH (SB_WIDTH_NEXT - SB_MARGIN_SPACE - SB_BORDER_WIDTH)
34#define SB_BUTTON_HEIGHT (SB_BUTTON_WIDTH)
35#define SB_BUTTON_SINGLE_HEIGHT (SB_BUTTON_HEIGHT + SB_PADDING)
36#define SB_BUTTON_BOTH_HEIGHT (SB_BUTTON_SINGLE_HEIGHT * 2)
37#define SB_BUTTON_TOTAL_HEIGHT (SB_BUTTON_BOTH_HEIGHT + SB_PADDING)
38#define SB_BUTTON_BEVEL_X (SB_LEFT_PADDING)
39#define SB_BUTTON_FACE_X (SB_BUTTON_BEVEL_X + SB_BEVEL_WIDTH_UPPER_LEFT)
40#define SB_THUMB_MIN_HEIGHT (SB_BUTTON_WIDTH - (SB_PADDING * 2))
12 41
13enum sb_state { 42enum sb_state {
14 STATE_IDLE = 1, 43 STATE_IDLE = 1,
15 STATE_MOTION, 44 STATE_MOTION,
16 STATE_UP, 45 STATE_UP,
52 return y > end + width + 1; 81 return y > end + width + 1;
53 if (style == R_SB_RXVT) 82 if (style == R_SB_RXVT)
54 return y > end; 83 return y > end;
55 return false; 84 return false;
56 } 85 }
86 unsigned min_height ()
87 {
88 return style == R_SB_NEXT ? SB_THUMB_MIN_HEIGHT : 10;
89 }
90 unsigned size ()
91 {
92 return end - beg - min_height ();
93 }
57 unsigned total_width () 94 unsigned total_width ()
58 { 95 {
59 return width + shadow * 2; 96 return width + shadow * 2;
60 } 97 }
61}; 98};
62 99
63#define SCROLLNEXT_MINHEIGHT SB_THUMB_MIN_HEIGHT
64#define SCROLLRXVT_MINHEIGHT 10
65
66#define scrollbar_minheight() (scrollBar.style == R_SB_NEXT \
67 ? SCROLLNEXT_MINHEIGHT \
68 : SCROLLRXVT_MINHEIGHT)
69#define scrollbar_above_slider(y) ((y) < scrollBar.top) 100#define scrollbar_above_slider(y) ((y) < scrollBar.top)
70#define scrollbar_below_slider(y) ((y) > scrollBar.bot) 101#define scrollbar_below_slider(y) ((y) > scrollBar.bot)
71#define scrollbar_position(y) ((y) - scrollBar.beg) 102#define scrollbar_position(y) ((y) - scrollBar.beg)
72#define scrollbar_size() (scrollBar.end - scrollBar.beg \
73 - scrollbar_minheight ())
74 103
75#define R_SB_ALIGN_CENTRE 0
76#define R_SB_ALIGN_TOP 1
77#define R_SB_ALIGN_BOTTOM 2
78
79#define SB_WIDTH_NEXT 19
80#define SB_WIDTH_XTERM 15
81#define SB_WIDTH_PLAIN 7
82#ifndef SB_WIDTH_RXVT
83# define SB_WIDTH_RXVT 10
84#endif
85
86/*
87 * NeXT scrollbar defines
88 */
89#define SB_PADDING 1
90#define SB_BORDER_WIDTH 1
91#define SB_BEVEL_WIDTH_UPPER_LEFT 1
92#define SB_BEVEL_WIDTH_LOWER_RIGHT 2
93#define SB_LEFT_PADDING (SB_PADDING + SB_BORDER_WIDTH)
94#define SB_MARGIN_SPACE (SB_PADDING * 2)
95#define SB_BUTTON_WIDTH (SB_WIDTH_NEXT - SB_MARGIN_SPACE - SB_BORDER_WIDTH)
96#define SB_BUTTON_HEIGHT (SB_BUTTON_WIDTH)
97#define SB_BUTTON_SINGLE_HEIGHT (SB_BUTTON_HEIGHT + SB_PADDING)
98#define SB_BUTTON_BOTH_HEIGHT (SB_BUTTON_SINGLE_HEIGHT * 2)
99#define SB_BUTTON_TOTAL_HEIGHT (SB_BUTTON_BOTH_HEIGHT + SB_PADDING)
100#define SB_BUTTON_BEVEL_X (SB_LEFT_PADDING)
101#define SB_BUTTON_FACE_X (SB_BUTTON_BEVEL_X + SB_BEVEL_WIDTH_UPPER_LEFT)
102#define SB_THUMB_MIN_HEIGHT (SB_BUTTON_WIDTH - (SB_PADDING * 2))
103 /* 104 /*
104 * +-------------+ 105 * +-------------+
105 * | | <---< SB_PADDING 106 * | | <---< SB_PADDING
106 * | ::::::::::: | 107 * | ::::::::::: |
107 * | ::::::::::: | 108 * | ::::::::::: |

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines