749N/A/*
749N/A * $XConsortium: PannerP.h,v 1.19 94/04/17 20:12:33 jim Exp $
749N/A *
749N/ACopyright (c) 1989 X Consortium
749N/A
749N/APermission is hereby granted, free of charge, to any person obtaining a copy
749N/Aof this software and associated documentation files (the "Software"), to deal
749N/Ain the Software without restriction, including without limitation the rights
749N/Ato use, copy, modify, merge, publish, distribute, sublicense, and/or sell
749N/Acopies of the Software, and to permit persons to whom the Software is
749N/Afurnished to do so, subject to the following conditions:
749N/A
749N/AThe above copyright notice and this permission notice shall be included in
749N/Aall copies or substantial portions of the Software.
749N/A
749N/ATHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
749N/AIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
749N/AFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
749N/AX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
749N/AAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
749N/ACONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
749N/A
749N/AExcept as contained in this notice, the name of the X Consortium shall not be
749N/Aused in advertising or otherwise to promote the sale, use or other dealings
749N/Ain this Software without prior written authorization from the X Consortium.
749N/A *
749N/A * Author: Jim Fulton, MIT X Consortium
749N/A */
749N/A
749N/A#ifndef _XawPannerP_h
749N/A#define _XawPannerP_h
749N/A
749N/A#include <X11/Xaw/Panner.h>
749N/A#include <X11/Xaw/SimpleP.h> /* parent */
749N/A
749N/Atypedef struct { /* new fields in widget class */
749N/A int dummy;
749N/A} PannerClassPart;
749N/A
749N/Atypedef struct _PannerClassRec { /* Panner widget class */
749N/A CoreClassPart core_class;
749N/A SimpleClassPart simple_class;
749N/A PannerClassPart panner_class;
749N/A} PannerClassRec;
749N/A
749N/Atypedef struct { /* new fields in widget */
749N/A /* resources... */
749N/A XtCallbackList report_callbacks; /* callback/Callback */
749N/A Boolean allow_off; /* allowOff/AllowOff */
749N/A Boolean resize_to_pref; /* resizeToPreferred/Boolean */
749N/A Pixel foreground; /* foreground/Foreground */
749N/A Pixel shadow_color; /* shadowColor/ShadowColor */
749N/A Dimension shadow_thickness; /* shadowThickness/ShadowThickness */
749N/A Dimension default_scale; /* defaultScale/DefaultScale */
749N/A Dimension line_width; /* lineWidth/LineWidth */
749N/A Dimension canvas_width; /* canvasWidth/CanvasWidth */
749N/A Dimension canvas_height; /* canvasHeight/CanvasHeight */
749N/A Position slider_x; /* sliderX/SliderX */
749N/A Position slider_y; /* sliderY/SliderY */
749N/A Dimension slider_width; /* sliderWidth/SliderWidth */
749N/A Dimension slider_height; /* sliderHeight/SliderHeight */
749N/A Dimension internal_border; /* internalBorderWidth/BorderWidth */
749N/A String stipple_name; /* backgroundStipple/BackgroundStipple */
749N/A /* private data... */
749N/A GC slider_gc; /* background of slider */
749N/A GC shadow_gc; /* edge of slider and shadow */
749N/A GC xor_gc; /* for doing XOR tmp graphics */
749N/A double haspect, vaspect; /* aspect ratio of core to canvas */
749N/A Boolean rubber_band; /* true = rubber band, false = move */
749N/A struct {
749N/A Boolean doing; /* tmp graphics in progress */
749N/A Boolean showing; /* true if tmp graphics displayed */
749N/A Position startx, starty; /* initial position of slider */
749N/A Position dx, dy; /* offset loc for tmp graphics */
749N/A Position x, y; /* location for tmp graphics */
749N/A } tmp;
749N/A Position knob_x, knob_y; /* real upper left of knob in canvas */
749N/A Dimension knob_width, knob_height; /* real size of knob in canvas */
749N/A Boolean shadow_valid; /* true if rects are valid */
749N/A XRectangle shadow_rects[2]; /* location of shadows */
749N/A Position last_x, last_y; /* previous location of knob */
749N/A} PannerPart;
749N/A
749N/Atypedef struct _PannerRec {
749N/A CorePart core;
749N/A SimplePart simple;
749N/A PannerPart panner;
749N/A} PannerRec;
749N/A
749N/A#define PANNER_HSCALE(pw,val) ((pw)->panner.haspect * ((double) (val)))
749N/A#define PANNER_VSCALE(pw,val) ((pw)->panner.vaspect * ((double) (val)))
749N/A
749N/A#define PANNER_DSCALE(pw,val) (Dimension) \
749N/A ((((unsigned long) (val)) * (unsigned long) pw->panner.default_scale) / 100L)
749N/A#define PANNER_DEFAULT_SCALE 8 /* percent */
749N/A
749N/A#define PANNER_OUTOFRANGE -30000
749N/A
749N/A/*
749N/A * external declarations
749N/A */
749N/Aextern PannerClassRec pannerClassRec;
749N/A
749N/A#endif /* _XawPannerP_h */