/usr/include/OverlayUnidraw/ovviews.h is in ivtools-dev 1.2.11a1-11.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | /*
* Copyright (c) 2000 IET Inc.
* Copyright (c) 1994 Vectaport Inc., Cartoactive Systems
* Copyright (c) 1990, 1991 Stanford University
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the names of the copyright holders not be used in
* advertising or publicity pertaining to distribution of the software
* without specific, written prior permission. The copyright holders make
* no representations about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
* IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* OverlayView - view of an OverlayComp.
* OverlaysView - view of an OverlaysComp.
*/
#ifndef overlay_views_h
#define overlay_views_h
#include <Unidraw/Components/grview.h>
#include <Unidraw/Components/psview.h>
#include <InterViews/resource.h>
#include <IV-2_6/_enter.h>
#include <leakchecker.h>
class Canvas;
class OverlayComp;
class OverlaysComp;
class OverlayIdrawComp;
//: base class for graphic view of an OverlayComp.
class OverlayView : public GraphicView {
public:
OverlayComp* GetOverlayComp();
virtual void DrawHandles();
// draw tic mark handles and highlight some things with a new graphic state.
virtual void RedrawHandles();
// redraw tic mark handles and highlight some things with a new graphic state.
virtual void InitHandles();
// initialize tic mark handles and set up to highlight some things with a new
// graphic state.
virtual void EraseHandles();
// erase tic mark handles and unhighlight some things by replacing their
// old graphic state.
virtual boolean Highlightable();
// true if set up to be highlighted with a graphic state.
virtual boolean Highlighted();
// true if highlighted with a graphic state.
virtual void Highlight();
// cause highlighting by graphic state to happen.
virtual void Unhighlight();
// undo any highlighting by graphic state to happen.
virtual boolean Hidable();
// true for this class.
virtual boolean Hidden();
// true if hidden.
virtual void Hide();
// hide the graphic.
virtual void Show();
// unhide the graphic.
virtual boolean Desensitizable();
// true for this class.
virtual boolean Desensitized();
// true if desensitized.
virtual void Desensitize();
// desensitize the graphic (ignore mouse events)
virtual void Sensitize();
// resensitize the graphic (pay attention to mouse events)
virtual Graphic* HighlightGraphic();
// graphic used to highlight by changing graphic state.
// A nil returned from this method disables the mechanism.
virtual void HighlightGraphic(Graphic* hilite_gs);
// graphic used to highlight by changing graphic state.
// A nil returned from this method disables the mechanism.
virtual Selection* MakeSelection();
// factor method to construct an OverlaySelection.
virtual void AdjustForZoom(float factor, Coord cx, Coord cy);
// called once per OverlayView before each zoom, to let
// fixed size graphics adjust accordingly.
virtual void AdjustForPan(float dx, float dy);
// called once per OverlayView before each pan, to let
// fixed location graphics adjust accordingly.
virtual void Interpret(Command*);
// interpret hide-view, desensitize-view, (un)fix-size, and (un)fix-location
// commands.
virtual void Uninterpret(Command*);
// uninterpret hide-view, desensitize-view, (un)fix-size, and (un)fix-location
// commands.
virtual Manipulator* CreateManipulator(Viewer*,Event&,Transformer*,Tool*);
// create move tool manipulator.
virtual ClassId GetClassId();
virtual boolean IsA(ClassId);
void FixSize(float factor=1.0);
// fix size of graphic, with optional factor to reduce or increase effect.
void UnfixSize();
// disable fixing of graphic size.
boolean FixedSize();
// return flag to indicate if graphic is of fixed size.
void FixLocation();
// enable fixing of graphic location.
void UnfixLocation();
// disable fixing of graphic location.
boolean FixedLocation();
// return flag to indicate if graphic is of fixed location.
Manipulator* CreateStretchManip(Viewer*, Event&, Transformer*, Tool*);
// specialized method to construct OpaqueDragManip instead of DragManip.
virtual ComponentView* Duplicate() { return new OverlayView(); }
virtual ~OverlayView();
protected:
OverlayView(OverlayComp* = nil);
OverlayView* View(UList*);
OverlayView* GetOverlayView(Graphic*);
boolean _touched;
boolean _fixed_size;
float _fixed_size_factor;
boolean _fixed_location;
Graphic* _hilite_gs;
#ifdef LEAKCHECK
public:
static LeakChecker* _leakchecker;
#endif
};
//: OverlayView used as Resource
class OverlayViewRef : public OverlayView {
public:
OverlayViewRef(OverlayComp* = nil);
virtual ~OverlayViewRef();
virtual ClassId GetClassId();
virtual boolean IsA(ClassId);
};
//: graphical view of OverlaysComp.
class OverlaysView : public OverlayView {
public:
OverlaysView(OverlaysComp* = nil);
virtual ~OverlaysView();
virtual void Interpret(Command*);
// interpret align-to-grid command, pass rest to base class.
virtual void Update();
virtual Graphic* GetGraphic();
OverlaysComp* GetOverlaysComp();
// return pointer to associated graphic.
virtual void First(Iterator&);
// set iterator to first sub-view.
virtual void Last(Iterator&);
// set iterator to last sub-view.
virtual void Next(Iterator&);
// set iterator to next sub-view.
virtual void Prev(Iterator&);
// set iterator to previous sub-view.
virtual boolean Done(Iterator);
// return true if iterator off the end or beginning of list of sub-views.
int Index(Iterator);
// return index of where the iterator is pointing in the list of sub-views.
virtual GraphicView* GetView(Iterator);
// return sub-view pointed at by iterator.
virtual void SetView(GraphicView*, Iterator&);
// set sub-view pointed at by iterator.
virtual Selection* SelectAll();
// return selection with all sub-views.
virtual Selection* ViewContaining(Coord, Coord);
// return selection of foremost subview that contains a point.
virtual Selection* ViewsContaining(Coord, Coord);
// return selection of all subviews that contains a point.
virtual Selection* ViewIntersecting(Coord, Coord, Coord, Coord);
// return selection of foremost subview that intersect a rectangle.
virtual Selection* ViewsIntersecting(Coord, Coord, Coord, Coord);
// return selection of all subviews that intersect a rectangle.
virtual Selection* ViewsWithin(Coord, Coord, Coord, Coord);
// return selection of all subviews that fit within a rectangle.
virtual ClassId GetClassId();
virtual boolean IsA(ClassId);
virtual void AdjustForZoom(float factor, Coord cx, Coord cy);
// called once per OverlayView before each zoom, to let
// fixed size graphics adjust accordingly.
virtual void AdjustForPan(float dx, float dy);
// called once per OverlayView before each pan, to let
// fixed location graphics adjust accordingly.
virtual Manipulator* CreateManipulator(Viewer*,Event&,Transformer*,Tool*);
// create manipulator for laying down composite graphic
virtual Command* InterpretManipulator(Manipulator*);
// interpret manipulator by copying prototype
protected:
UList* Elem(Iterator);
virtual void Add(GraphicView*);
virtual void Append(GraphicView*);
virtual void InsertBefore(Iterator, GraphicView*);
virtual void Remove(Iterator&);
virtual void DeleteView(Iterator&);
protected:
UList* _views;
};
//: graphical view of OverlayIdrawComp.
class OverlayIdrawView : public OverlaysView {
public:
OverlayIdrawView(OverlayIdrawComp* = nil);
virtual ClassId GetClassId();
virtual boolean IsA(ClassId);
};
#include <IV-2_6/_leave.h>
#endif
|