1 /* MODIFIED ATHENA SCROLLBAR (USING ARROWHEADS AT ENDS OF TRAVEL) */ 2 /* Modifications Copyright 1992 by Mitch Trachtenberg */ 3 /* Rights, permissions, and disclaimer of warranty are as in the */ 4 /* DEC and MIT notice below. See usage warning in .c file. */ 5 6 /*********************************************************** 7 8 Copyright (c) 1987, 1988 X Consortium 9 10 Permission is hereby granted, free of charge, to any person obtaining a copy 11 of this software and associated documentation files (the "Software"), to deal 12 in the Software without restriction, including without limitation the rights 13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 copies of the Software, and to permit persons to whom the Software is 15 furnished to do so, subject to the following conditions: 16 17 The above copyright notice and this permission notice shall be included in 18 all copies or substantial portions of the Software. 19 20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 24 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 25 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 27 Except as contained in this notice, the name of the X Consortium shall not be 28 used in advertising or otherwise to promote the sale, use or other dealings 29 in this Software without prior written authorization from the X Consortium. 30 31 32 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. 33 34 All Rights Reserved 35 36 Permission to use, copy, modify, and distribute this software and its 37 documentation for any purpose and without fee is hereby granted, 38 provided that the above copyright notice appear in all copies and that 39 both that copyright notice and this permission notice appear in 40 supporting documentation, and that the name of Digital not be 41 used in advertising or publicity pertaining to distribution of the 42 software without specific, written prior permission. 43 44 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 45 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 46 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 47 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 48 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 49 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 50 SOFTWARE. 51 52 ******************************************************************/ 53 54 #ifndef _ScrollbarP_h 55 #define _ScrollbarP_h 56 57 #include "Xaw3dP.h" 58 #include <X11/Xaw3dxft/Scrollbar.h> 59 #include <X11/Xaw3dxft/ThreeDP.h> 60 61 typedef struct { 62 /* public */ 63 Pixel foreground; /* thumb foreground color */ 64 XtOrientation orientation; /* horizontal or vertical */ 65 XtCallbackList scrollProc; /* proportional scroll */ 66 XtCallbackList thumbProc; /* jump (to position) scroll */ 67 XtCallbackList jumpProc; /* same as thumbProc but pass data by ref */ 68 Pixmap thumb; /* thumb color */ 69 #ifndef XAW_ARROW_SCROLLBARS 70 Cursor upCursor; /* scroll up cursor */ 71 Cursor downCursor; /* scroll down cursor */ 72 Cursor leftCursor; /* scroll left cursor */ 73 Cursor rightCursor; /* scroll right cursor */ 74 Cursor verCursor; /* scroll vertical cursor */ 75 Cursor horCursor; /* scroll horizontal cursor */ 76 #endif 77 float top; /* What percent is above the win's top */ 78 float shown; /* What percent is shown in the win */ 79 Dimension length; /* either height or width */ 80 Dimension thickness; /* either width or height */ 81 Dimension min_thumb; /* minimum size for the thumb. */ 82 float picked; /* How much of the thumb is picked * 83 * when scrolling starts */ 84 85 /* private */ 86 #ifdef XAW_ARROW_SCROLLBARS 87 XtIntervalId timer_id; /* autorepeat timer; remove on destruction */ 88 char scroll_mode; /* 0:none 1:up/back 2:track 3:down/forward */ 89 Dimension scroll_steps; /* number of steps when using mouse wheel */ 90 #else 91 Cursor inactiveCursor; /* the normal cursor for scrollbar */ 92 char direction; /* a scroll has started; which direction */ 93 #endif 94 GC gc; /* a (shared) gc */ 95 Position topLoc; /* Pixel that corresponds to top */ 96 Dimension shownLength; /* Num pixels corresponding to shown */ 97 Boolean pick_top; /* pick thumb at top or anywhere*/ 98 99 } ScrollbarPart; 100 101 typedef struct _ScrollbarRec { 102 CorePart core; 103 SimplePart simple; 104 ThreeDPart threeD; 105 ScrollbarPart scrollbar; 106 } ScrollbarRec; 107 108 typedef struct {int empty;} ScrollbarClassPart; 109 110 typedef struct _ScrollbarClassRec { 111 CoreClassPart core_class; 112 SimpleClassPart simple_class; 113 ThreeDClassPart threeD_class; 114 ScrollbarClassPart scrollbar_class; 115 } ScrollbarClassRec; 116 117 extern ScrollbarClassRec scrollbarClassRec; 118 119 #endif /* _ScrollbarP_h */ 120