swi-prolog: update to 9.2.9
[oi-userland.git] / components / x11 / libXaw5 / src / X11 / PannerP.h
blobc77bb22a5bfd125a30593ce164e0f144e69a26c0
1 /*
2 * $XConsortium: PannerP.h,v 1.19 94/04/17 20:12:33 jim Exp $
4 Copyright (c) 1989 X Consortium
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 Except as contained in this notice, the name of the X Consortium shall not be
24 used in advertising or otherwise to promote the sale, use or other dealings
25 in this Software without prior written authorization from the X Consortium.
27 * Author: Jim Fulton, MIT X Consortium
30 #ifndef _XawPannerP_h
31 #define _XawPannerP_h
33 #include <X11/Xaw/Panner.h>
34 #include <X11/Xaw/SimpleP.h> /* parent */
36 typedef struct { /* new fields in widget class */
37 int dummy;
38 } PannerClassPart;
40 typedef struct _PannerClassRec { /* Panner widget class */
41 CoreClassPart core_class;
42 SimpleClassPart simple_class;
43 PannerClassPart panner_class;
44 } PannerClassRec;
46 typedef struct { /* new fields in widget */
47 /* resources... */
48 XtCallbackList report_callbacks; /* callback/Callback */
49 Boolean allow_off; /* allowOff/AllowOff */
50 Boolean resize_to_pref; /* resizeToPreferred/Boolean */
51 Pixel foreground; /* foreground/Foreground */
52 Pixel shadow_color; /* shadowColor/ShadowColor */
53 Dimension shadow_thickness; /* shadowThickness/ShadowThickness */
54 Dimension default_scale; /* defaultScale/DefaultScale */
55 Dimension line_width; /* lineWidth/LineWidth */
56 Dimension canvas_width; /* canvasWidth/CanvasWidth */
57 Dimension canvas_height; /* canvasHeight/CanvasHeight */
58 Position slider_x; /* sliderX/SliderX */
59 Position slider_y; /* sliderY/SliderY */
60 Dimension slider_width; /* sliderWidth/SliderWidth */
61 Dimension slider_height; /* sliderHeight/SliderHeight */
62 Dimension internal_border; /* internalBorderWidth/BorderWidth */
63 String stipple_name; /* backgroundStipple/BackgroundStipple */
64 /* private data... */
65 GC slider_gc; /* background of slider */
66 GC shadow_gc; /* edge of slider and shadow */
67 GC xor_gc; /* for doing XOR tmp graphics */
68 double haspect, vaspect; /* aspect ratio of core to canvas */
69 Boolean rubber_band; /* true = rubber band, false = move */
70 struct {
71 Boolean doing; /* tmp graphics in progress */
72 Boolean showing; /* true if tmp graphics displayed */
73 Position startx, starty; /* initial position of slider */
74 Position dx, dy; /* offset loc for tmp graphics */
75 Position x, y; /* location for tmp graphics */
76 } tmp;
77 Position knob_x, knob_y; /* real upper left of knob in canvas */
78 Dimension knob_width, knob_height; /* real size of knob in canvas */
79 Boolean shadow_valid; /* true if rects are valid */
80 XRectangle shadow_rects[2]; /* location of shadows */
81 Position last_x, last_y; /* previous location of knob */
82 } PannerPart;
84 typedef struct _PannerRec {
85 CorePart core;
86 SimplePart simple;
87 PannerPart panner;
88 } PannerRec;
90 #define PANNER_HSCALE(pw,val) ((pw)->panner.haspect * ((double) (val)))
91 #define PANNER_VSCALE(pw,val) ((pw)->panner.vaspect * ((double) (val)))
93 #define PANNER_DSCALE(pw,val) (Dimension) \
94 ((((unsigned long) (val)) * (unsigned long) pw->panner.default_scale) / 100L)
95 #define PANNER_DEFAULT_SCALE 8 /* percent */
97 #define PANNER_OUTOFRANGE -30000
100 * external declarations
102 extern PannerClassRec pannerClassRec;
104 #endif /* _XawPannerP_h */