Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:14:24

0001 /*
0002  *
0003 Copyright 1989, 1998 The Open Group
0004 
0005 Permission to use, copy, modify, distribute, and sell this software and its
0006 documentation for any purpose is hereby granted without fee, provided that
0007 the above copyright notice appear in all copies and that both that
0008 copyright notice and this permission notice appear in supporting
0009 documentation.
0010 
0011 The above copyright notice and this permission notice shall be included in
0012 all copies or substantial portions of the Software.
0013 
0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0017 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0020 
0021 Except as contained in this notice, the name of The Open Group shall not be
0022 used in advertising or otherwise to promote the sale, use or other dealings
0023 in this Software without prior written authorization from The Open Group.
0024  *
0025  * Author:  Jim Fulton, MIT X Consortium
0026  */
0027 
0028 #ifndef _XawPannerP_h
0029 #define _XawPannerP_h
0030 
0031 #include <X11/Xaw/Panner.h>
0032 #include <X11/Xaw/SimpleP.h>
0033 
0034 /* new fields in widget class */
0035 typedef struct {
0036     XtPointer extension;
0037 } PannerClassPart;
0038 
0039 /* Panner widget class */
0040 typedef struct _PannerClassRec {
0041     CoreClassPart core_class;
0042     SimpleClassPart simple_class;
0043     PannerClassPart panner_class;
0044 } PannerClassRec;
0045 
0046 /* new fields in widget */
0047 typedef struct {
0048     /* resources */
0049     XtCallbackList report_callbacks;    /* callback/Callback */
0050     Boolean allow_off;          /* allowOff/AllowOff */
0051     Boolean resize_to_pref;     /* resizeToPreferred/Boolean */
0052     Pixel foreground;           /* foreground/Foreground */
0053     Pixel shadow_color;         /* shadowColor/ShadowColor */
0054     Dimension shadow_thickness;     /* shadowThickness/ShadowThickness */
0055     Dimension default_scale;        /* defaultScale/DefaultScale */
0056     Dimension line_width;       /* lineWidth/LineWidth */
0057     Dimension canvas_width;     /* canvasWidth/CanvasWidth */
0058     Dimension canvas_height;        /* canvasHeight/CanvasHeight */
0059     Position slider_x;          /* sliderX/SliderX */
0060     Position slider_y;          /* sliderY/SliderY */
0061     Dimension slider_width;     /* sliderWidth/SliderWidth */
0062     Dimension slider_height;        /* sliderHeight/SliderHeight */
0063     Dimension internal_border;      /* internalBorderWidth/BorderWidth */
0064     String stipple_name;        /* backgroundStipple/BackgroundStipple
0065                      */
0066     /* private */
0067     GC slider_gc;           /* background of slider */
0068     GC shadow_gc;           /* edge of slider and shadow */
0069     GC xor_gc;              /* for doing XOR tmp graphics */
0070     double haspect, vaspect;        /* aspect ratio of core to canvas */
0071     Boolean rubber_band;        /* true = rubber band, false = move */
0072     struct {
0073     Boolean doing;          /* tmp graphics in progress */
0074     Boolean showing;        /* true if tmp graphics displayed */
0075     Position startx, starty;    /* initial position of slider */
0076     Position dx, dy;        /* offset loc for tmp graphics */
0077     Position x, y;          /* location for tmp graphics */
0078     } tmp;
0079     Position knob_x, knob_y;        /* real upper left of knob in canvas */
0080     Dimension knob_width, knob_height;  /* real size of knob in canvas */
0081     Boolean shadow_valid;       /* true if rects are valid */
0082     XRectangle shadow_rects[2];     /* location of shadows */
0083     Position last_x, last_y;        /* previous location of knob */
0084 #ifndef OLDXAW
0085     XtPointer pad[4];   /* for future use and keep binary compatibility */
0086 #endif
0087 } PannerPart;
0088 
0089 typedef struct _PannerRec {
0090     CorePart core;
0091     SimplePart simple;
0092     PannerPart panner;
0093 } PannerRec;
0094 
0095 #define PANNER_HSCALE(pw,val)   ((pw)->panner.haspect * ((double)(val)))
0096 #define PANNER_VSCALE(pw,val)   ((pw)->panner.vaspect * ((double)(val)))
0097 
0098 #define PANNER_DSCALE(pw,val) (Dimension)  \
0099 ((((unsigned long)(val)) * (unsigned long)pw->panner.default_scale) / 100L)
0100 
0101 #define PANNER_DEFAULT_SCALE    8       /* percent */
0102 #define PANNER_OUTOFRANGE -30000
0103 
0104 extern PannerClassRec pannerClassRec;
0105 
0106 #endif /* _XawPannerP_h */