1/*
2
3Copyright 1993, 1998  The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included
12in all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20OTHER DEALINGS IN THE SOFTWARE.
21
22Except as contained in this notice, the name of The Open Group shall
23not be used in advertising or otherwise to promote the sale, use or
24other dealings in this Software without prior written authorization
25from 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
106extern WidgetClass scaleWidgetClass;
107
108typedef struct _ScaleClassRec *ScaleWidgetClass;
109typedef struct _ScaleRec      *ScaleWidget;
110
111extern int SWGetImagePixel ( Widget w, Position x, Position y,
112			     Position *img_x, Position *img_y,
113			     Pixel *img_pixel );
114extern void SWUnscale ( Widget w, XEvent *event, String *params,
115			Cardinal *num_params );
116extern void SWAutoscale ( Widget w, XEvent *event, String *params,
117			  Cardinal *num_params );
118extern void SWInitialSize ( Widget w, XEvent *event, String *params,
119			    Cardinal *num_params );
120extern void SWSetImage ( Widget w, XImage *image );
121extern void RequestSelection ( Widget w, XEvent *event, String *params,
122			       Cardinal *num_params );
123extern void GrabSelection ( Widget w, XEvent *event, String *params,
124			    Cardinal *num_params );
125extern Pixmap SWGetPixmap ( Widget w );
126
127#endif /* _XawScale_h */
128
129