Back to index

tetex-bin  3.0
PannerP.h
Go to the documentation of this file.
00001 /*
00002  * $XConsortium: PannerP.h,v 1.19 94/04/17 20:12:33 jim Exp $
00003  *
00004 Copyright (c) 1989  X Consortium
00005 
00006 Permission is hereby granted, free of charge, to any person obtaining a copy
00007 of this software and associated documentation files (the "Software"), to deal
00008 in the Software without restriction, including without limitation the rights
00009 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00010 copies of the Software, and to permit persons to whom the Software is
00011 furnished to do so, subject to the following conditions:
00012 
00013 The above copyright notice and this permission notice shall be included in
00014 all copies or substantial portions of the Software.
00015 
00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00019 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00020 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00021 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00022 
00023 Except as contained in this notice, the name of the X Consortium shall not be
00024 used in advertising or otherwise to promote the sale, use or other dealings
00025 in this Software without prior written authorization from the X Consortium.
00026  *
00027  * Author:  Jim Fulton, MIT X Consortium
00028  */
00029 
00030 #ifndef _XawPannerP_h
00031 #define _XawPannerP_h
00032 
00033 #include "Panner.h"
00034 #include <X11/Xaw/SimpleP.h>              /* parent */
00035 
00036 typedef struct {                   /* new fields in widget class */
00037     int dummy;
00038 } PannerClassPart;
00039 
00040 typedef struct _PannerClassRec {   /* Panner widget class */
00041     CoreClassPart core_class;
00042     SimpleClassPart simple_class;
00043     PannerClassPart panner_class;
00044 } PannerClassRec;
00045 
00046 typedef struct {                   /* new fields in widget */
00047     /* resources... */
00048     XtCallbackList report_callbacks;      /* callback/Callback */
00049     Boolean allow_off;                    /* allowOff/AllowOff */
00050     Boolean resize_to_pref;        /* resizeToPreferred/Boolean */
00051     Pixel foreground;                     /* foreground/Foreground */
00052     Pixel shadow_color;                   /* shadowColor/ShadowColor */
00053     Dimension shadow_thickness;           /* shadowThickness/ShadowThickness */
00054     Dimension default_scale;              /* defaultScale/DefaultScale */
00055     Dimension line_width;          /* lineWidth/LineWidth */
00056     Dimension canvas_width;        /* canvasWidth/CanvasWidth */
00057     Dimension canvas_height;              /* canvasHeight/CanvasHeight */
00058     Position slider_x;                    /* sliderX/SliderX */
00059     Position slider_y;                    /* sliderY/SliderY */
00060     Dimension slider_width;        /* sliderWidth/SliderWidth */
00061     Dimension slider_height;              /* sliderHeight/SliderHeight */
00062     Dimension internal_border;            /* internalBorderWidth/BorderWidth */
00063     String stipple_name;           /* backgroundStipple/BackgroundStipple */
00064     /* private data... */
00065     GC slider_gc;                  /* background of slider */
00066     GC shadow_gc;                  /* edge of slider and shadow */
00067     GC xor_gc;                            /* for doing XOR tmp graphics */
00068     double haspect, vaspect;              /* aspect ratio of core to canvas */
00069     Boolean rubber_band;           /* true = rubber band, false = move */
00070     struct {
00071        Boolean doing;                     /* tmp graphics in progress */
00072        Boolean showing;            /* true if tmp graphics displayed */
00073        Position startx, starty;    /* initial position of slider */
00074        Position dx, dy;            /* offset loc for tmp graphics */
00075        Position x, y;                     /* location for tmp graphics */
00076     } tmp;
00077     Position knob_x, knob_y;              /* real upper left of knob in canvas */
00078     Dimension knob_width, knob_height;    /* real size of knob in canvas */
00079     Boolean shadow_valid;          /* true if rects are valid */
00080     XRectangle shadow_rects[2];           /* location of shadows */
00081     Position last_x, last_y;              /* previous location of knob */
00082 } PannerPart;
00083 
00084 typedef struct _PannerRec {
00085     CorePart core;
00086     SimplePart simple;
00087     PannerPart panner;
00088 } PannerRec;
00089 
00090 #define PANNER_HSCALE(pw,val) ((pw)->panner.haspect * ((double) (val)))
00091 #define PANNER_VSCALE(pw,val) ((pw)->panner.vaspect * ((double) (val)))
00092 
00093 #define PANNER_DSCALE(pw,val) (Dimension)  \
00094   ((((unsigned long) (val)) * (unsigned long) pw->panner.default_scale) / 100L)
00095 #define PANNER_DEFAULT_SCALE 8            /* percent */
00096 
00097 #define PANNER_OUTOFRANGE -30000
00098 
00099 /*
00100  * external declarations
00101  */
00102 extern PannerClassRec pannerClassRec;
00103 
00104 #endif /* _XawPannerP_h */