1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
/*
* File: <Xfwf/scroll.h>
*
* Declarations and typedefs for the Free Widget Foundation
* Scrolling Widget Interface Policy.
* =
*/
#ifndef _XFWF_SCROLL_H
#define _XFWF_SCROLL_H 1
/*
* The XfwfSReason typedef defines all the possible types
* of scroll messages. XfwfSNotify indicates a _notify_
* message, and all others indicate a _command_ message.
*/
typedef enum _XfwfSReason
{
XfwfSNotify, /* Widget has changed position or size */
XfwfSMove, /* Request to move widget */
XfwfSDrag, /* widget is being moved continuously */
XfwfSZoom, /* Request to Zoom (resize visible area) */
XfwfSStretch, /* widget is being zoomed continuously */
XfwfSUp, /* User request to ``move up one unit'' */
XfwfSLeft, /* User request to ``move left one unit'' */
XfwfSDown, XfwfSRight, /* similar */
XfwfSPageUp, /* User request to ``move up one page'' */
XfwfSPageLeft, XfwfSPageDown, XfwfSPageRight, /* similar */
XfwfSZoomIn, /* User invoked ``Zoom In'' */
XfwfSZoomOut, /* User invoked ``Zoom Out'' */
XfwfSTop, /* User invoked ``Scroll to top'' */
XfwfSBottom, XfwfSLeftSide, XfwfSRightSide, /* similar */
XfwfSZoomInFull, XfwfSZoomOutFull /* similar, but wrt zoom state */
} XfwfSReason;
/* =
* #define's for the 'flags' field:
*/
typedef unsigned short XfwfSFlags;
#define XFWF_VPOS 0x1 /* vpos set */
#define XFWF_VSIZE 0x2 /* vsize set */
#define XFWF_HPOS 0x4 /* hpos set */
#define XFWF_HSIZE 0x8 /* hsize set */
/*
* The XfwfScrollInfo structure defines the scroll message passed
* between scrolling widgets:
*/
typedef struct _XfwfScrollInfo
{
XfwfSReason reason; /* see above */
XfwfSFlags flags; /* defines which fields are relev=
ant */
float vpos; /* "top" position, [0..1] */
float vsize; /* total visible vertical size [0=
=2E.1] */
float hpos; /* "left" position */
float hsize; /* total visible horizontal size =
*/
} XfwfScrollInfo;
/*
* Application convenience functions:
*
* XfwfConnectScrollingWidgets(Widget, Widget) attaches two
* widgets, which must have the scrollCallback and scrollResponse
* resources.
*/
extern void XfwfConnectScrollingWidgets( /* Widget w1, Widget w2 */);
/*
* Widget convenience functions:
*
* =
* XcwfCvtStringToScrollReason(char *s) converts 's' to one
* of the XfwfS* enumerated values. The comparison is case-insensitive,
* and the XfwfS prefix may be present but is not necessary.
*/
extern XfwfSReason XfwfCvtStringToScrollReason(/* char * */);
#endif /* _XFWF_SCROLL_H */
|