Back to index

plt-scheme  4.2.1
xwscroll.h
Go to the documentation of this file.
00001 /*
00002  * File: <scroll.h>
00003  *
00004  *
00005  * Declarations and typedefs for the Free Widget Foundation
00006  * Scrolling Widget Interface Policy.
00007  */
00008 
00009 #ifndef _XFWF_SCROLL_H
00010 #define _XFWF_SCROLL_H 1
00011 
00012 /*
00013  * The XfwfSReason typedef defines all the possible types
00014  * of scroll messages.  XfwfSNotify indicates a _notify_
00015  * message, and all others indicate a _command_ message.
00016  */
00017 typedef enum _XfwfSReason
00018 {
00019     XfwfSNotify,        /* Widget has changed position or size */
00020 
00021     XfwfSMove,          /* Request to move widget */
00022     XfwfSDrag,          /* widget is being moved continuously */
00023 
00024     XfwfSZoom,              /* Request to Zoom (resize visible area) */
00025     XfwfSStretch,       /* widget is being zoomed continuously */
00026 
00027     XfwfSUp,            /* User request to ``move up one unit'' */
00028     XfwfSLeft,          /* User request to ``move left one unit'' */
00029     XfwfSDown, XfwfSRight,      /* similar */
00030 
00031     XfwfSPageUp,        /* User request to ``move up one page'' */
00032     XfwfSPageLeft, XfwfSPageDown, XfwfSPageRight,       /* similar */
00033 
00034     XfwfSZoomIn,        /* User invoked ``Zoom In'' */
00035     XfwfSZoomOut,       /* User invoked ``Zoom Out'' */
00036 
00037     XfwfSTop,        /* User invoked ``Scroll to top'' */
00038     XfwfSBottom, XfwfSLeftSide, XfwfSRightSide, /* similar */
00039 
00040     XfwfSZoomInFull, XfwfSZoomOutFull  /* similar, but wrt zoom state */
00041 
00042 } XfwfSReason;
00043 
00044 /* =
00045 
00046  * #define's for the 'flags' field:
00047  */
00048 typedef unsigned short XfwfSFlags;
00049 #define XFWF_VPOS       0x1     /* vpos set */
00050 #define XFWF_VSIZE      0x2     /* vsize set */
00051 #define XFWF_HPOS       0x4     /* hpos set */
00052 #define XFWF_HSIZE      0x8     /* hsize set */
00053 
00054 /*
00055  * The XfwfScrollInfo structure defines the scroll message passed
00056  * between scrolling widgets:
00057  */
00058 typedef struct _XfwfScrollInfo
00059 {
00060         XfwfSReason     reason;         /* see above */
00061         XfwfSFlags      flags;          /* defines which fields are relevant */
00062         float           vpos;           /* "top" position, [0..1] */
00063         float           vsize;          /* total visible vertical size [0..1] */
00064         float           hpos;           /* "left" position */
00065         float           hsize;          /* total visible horizontal size */
00066        Position      gx, gy;              /* position computed by ScrollWin::scroll_callback */
00067 } XfwfScrollInfo;
00068 
00069 
00070 /*
00071  * Application convenience functions:
00072  *
00073  * XfwfConnectScrollingWidgets(Widget, Widget) attaches two
00074  * widgets, which must have the scrollCallback and scrollResponse
00075  * resources.
00076  */
00077 
00078 extern void XfwfConnectScrollingWidgets( /* Widget w1, Widget w2 */);
00079 
00080 
00081 /*
00082  * Widget convenience functions:
00083  *
00084  * =
00085 
00086  * XcwfCvtStringToScrollReason(char *s) converts 's' to one
00087  * of the XfwfS* enumerated values.  The comparison is case-insensitive,
00088  * and the XfwfS prefix may be present but is not necessary.
00089  */
00090 
00091 extern XfwfSReason XfwfCvtStringToScrollReason(/* char * */);
00092 
00093 #endif /* _XFWF_SCROLL_H */