Back to index

plt-scheme  4.2.1
xwscroll.c
Go to the documentation of this file.
00001 /*
00002  */
00003 
00004 #include <X11/Intrinsic.h>
00005 #include <X11/StringDefs.h>
00006 #include <X11/Xmu/CharSet.h>
00007 #include <xwscroll.h>
00008 
00009 void XfwfConnectScrollingWidgets(w1, w2)
00010     Widget w1, w2;
00011 {
00012     XtCallbackProc response_cb_1 = NULL, response_cb_2 = NULL;
00013 
00014     /* Error checking omitted */
00015     XtVaGetValues(w1, "scrollResponse", &response_cb_1, NULL);
00016     XtVaGetValues(w2, "scrollResponse", &response_cb_2, NULL);
00017 
00018     XtAddCallback(w1, "scrollCallback", response_cb_2, (XtPointer)w2);
00019 
00020     XtAddCallback(w2, "scrollCallback", response_cb_1, (XtPointer)w1);
00021 }
00022 
00023 XfwfSReason XfwfCvtStringToScrollReason(s)
00024     String s;
00025 {
00026     if (XmuCompareISOLatin1(s, "Notify") == 0) return XfwfSNotify;
00027     if (XmuCompareISOLatin1(s, "Move") == 0) return XfwfSMove;
00028     if (XmuCompareISOLatin1(s, "Drag") == 0) return XfwfSDrag;
00029     if (XmuCompareISOLatin1(s, "Zoom") == 0) return XfwfSZoom;
00030     if (XmuCompareISOLatin1(s, "Stretch") == 0) return XfwfSStretch;
00031     if (XmuCompareISOLatin1(s, "Up") == 0) return XfwfSUp;
00032     if (XmuCompareISOLatin1(s, "Down") == 0) return XfwfSDown;
00033     if (XmuCompareISOLatin1(s, "Left") == 0) return XfwfSLeft;
00034     if (XmuCompareISOLatin1(s, "Right") == 0) return XfwfSRight;
00035     if (XmuCompareISOLatin1(s, "PageUp") == 0) return XfwfSPageUp;
00036     if (XmuCompareISOLatin1(s, "PageDown") == 0) return XfwfSPageDown;
00037     if (XmuCompareISOLatin1(s, "PageLeft") == 0) return XfwfSPageLeft;
00038     if (XmuCompareISOLatin1(s, "PageRight") == 0) return XfwfSPageRight;
00039     if (XmuCompareISOLatin1(s, "ZoomIn") == 0) return XfwfSZoomIn;
00040     if (XmuCompareISOLatin1(s, "ZoomOut") == 0) return XfwfSZoomOut;
00041     if (XmuCompareISOLatin1(s, "Top") == 0) return XfwfSTop;
00042     if (XmuCompareISOLatin1(s, "Bottom") == 0) return XfwfSBottom;
00043     if (XmuCompareISOLatin1(s, "LeftSide") == 0) return XfwfSLeftSide;
00044     if (XmuCompareISOLatin1(s, "RightSide") == 0) return XfwfSRightSide;
00045     if (XmuCompareISOLatin1(s, "ZoomInFull") == 0) return XfwfSZoomInFull;
00046     if (XmuCompareISOLatin1(s, "ZoomOutFull") == 0) return XfwfSZoomOutFull;
00047     return XfwfSNotify;                          /* Should be: error */
00048 }
00049