1 /* 2 3 Copyright 1993, 1998 The Open Group 4 5 Permission to use, copy, modify, distribute, and sell this software and its 6 documentation for any purpose is hereby granted without fee, provided that 7 the above copyright notice appear in all copies and that both that 8 copyright notice and this permission notice appear in supporting 9 documentation. 10 11 The above copyright notice and this permission notice shall be included 12 in all copies or substantial portions of the Software. 13 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 OTHER DEALINGS IN THE SOFTWARE. 21 22 Except as contained in this notice, the name of The Open Group shall 23 not be used in advertising or otherwise to promote the sale, use or 24 other dealings in this Software without prior written authorization 25 from The Open Group. 26 27 */ 28 29 #ifndef _XawScale_h 30 #define _XawScale_h 31 32 /*********************************************************************** 33 * 34 * Scale Widget 35 * 36 ***********************************************************************/ 37 38 #include <X11/Xaw/Simple.h> 39 #include <X11/Xmu/Converters.h> 40 41 /* Resources: 42 43 All the SimpleWidget resources plus... 44 Name Class RepType Default Value 45 ---- ----- ------- ------------- 46 aspectRatio AspectRatio Float 1.0 47 autoscale Autoscale Boolean True 48 bufferSize BufferSize Cardinal 1024 49 foreground Foreground Pixel XtDefaultForeground 50 gravity Gravity XtGravity ForgetGravity 51 image Image XImage* NULL 52 internalHeight Height Dimension 2 53 internalWidth Width Dimension 2 54 pasteBuffer PasteBuffer Boolean False 55 precision Precision Float 0.001 56 proportional Proportional Boolean False 57 resize Resize Boolean True 58 scaleX ScaleValue Float 1.0 59 scaleY ScaleValue Float 1.0 60 userData UserData XtPointer NULL 61 visual Visual Visual* CopyFromParent 62 */ 63 64 #ifndef _XtStringDefs_h_ 65 #define XtNforeground "foreground" 66 #define XtNinternalWidth "internalWidth" 67 #define XtNinternalHeight "internalHeight" 68 #define XtNresize "resize" 69 #define XtCResize "Resize" 70 #endif 71 72 #define XtNaspectRatio "aspectRatio" 73 #define XtCAspectRatio "AspectRatio" 74 #define XtNbufferSize "bufferSize" 75 #define XtCBufferSize "BufferSize" 76 #define XtNscaleX "scaleX" 77 #define XtNscaleY "scaleY" 78 #define XtCScaleFactor "ScaleFactor" 79 #define XtNautoscale "autoscale" 80 #define XtCAutoscale "Autoscale" 81 #define XtNproportional "proportional" 82 #define XtCProportional "Proportional" 83 #define XtNprecision "precision" 84 #define XtCPrecision "Precision" 85 #define XtNgravity "gravity" 86 #define XtCGravity "Gravity" 87 #define XtNpasteBuffer "pasteBuffer" 88 #define XtCPasteBuffer "PasteBuffer" 89 #define XtNimage "image" 90 #define XtCImage "image" 91 #define XtNexponent "exponent" 92 #define XtCExponent "Exponent" 93 #define XtNuserData "userData" 94 #define XtCuserData "UserData" 95 #define XtRuserData "UserData" 96 #define XtRImage "Image" 97 #ifndef XtNvisual 98 #define XtNvisual "visual" 99 #endif 100 #define XtCvisual "Visual" 101 #define XtRvisual "Visual" 102 103 104 /* Class record constants */ 105 106 extern WidgetClass scaleWidgetClass; 107 108 typedef struct _ScaleClassRec *ScaleWidgetClass; 109 typedef struct _ScaleRec *ScaleWidget; 110 111 extern int SWGetImagePixel ( Widget w, Position x, Position y, 112 Position *img_x, Position *img_y, 113 Pixel *img_pixel ); 114 extern void SWUnscale ( Widget w, XEvent *event, String *params, 115 Cardinal *num_params ); 116 extern void SWAutoscale ( Widget w, XEvent *event, String *params, 117 Cardinal *num_params ); 118 extern void SWInitialSize ( Widget w, XEvent *event, String *params, 119 Cardinal *num_params ); 120 extern void SWSetImage ( Widget w, XImage *image ); 121 extern void RequestSelection ( Widget w, XEvent *event, String *params, 122 Cardinal *num_params ); 123 extern void GrabSelection ( Widget w, XEvent *event, String *params, 124 Cardinal *num_params ); 125 extern Pixmap SWGetPixmap ( Widget w ); 126 127 #endif /* _XawScale_h */ 128 129