/usr/include/InterViews/drag.h is in ivtools-dev 1.2.11a1-6.
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 | /*
* Copyright (c) 1992 Redwood Design Automation
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation, and (ii) the name of
* Redwood Design Automation may not be used in any advertising or publicity
* relating to the software without the specific, prior written permission of
* Redwood Design Automation.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL REDWOOD DESIGN AUTOMATION BE LIABLE FOR ANY SPECIAL,
* INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT
* ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#ifndef iv_drag_h
#define iv_drag_h
#include <InterViews/monoglyph.h>
#include <InterViews/_enter.h>
class Allocation;
class Canvas;
class Cursor;
class DragRep;
class DragZoneRep;
class DragZoneSinkHandler;
class Event;
class Hit;
/*
* To create a dragable glyph:
* 1) create a derived class of Drag
* 2) implement the member functions dragGlyph and/or dragCursor. dragGlyph
* should return a glyph that will be dragged across the screen in a window.
* dragCursor should return a cursor that will be dragged across the screen.
* 3) implement the member function dragData. dragData should produce a
* string to be sent to a drag zone
* 4) the dragType member function can be implemented to provide a string
* that is sent to a drag zone when the drag zone is entered
* 5) caught, commit, and abort can be implemented to change the default
* behavior. the default behavior is that a middle button press starts a
* drag, a chorded button press aborts, and a button release commits a drag.
* 6) dragOffset can be implemented to calculate a transformed offset from
* the left-top corner of the dragGlyph.
*/
class Drag : public MonoGlyph {
public:
Drag(Glyph* glyph);
virtual ~Drag();
virtual void dragable(boolean);
virtual boolean dragable() const;
virtual Glyph* dragGlyph() = 0;
virtual Cursor* dragCursor() = 0;
virtual void dragData(char*& value, int& length) = 0;
virtual void dragType(char*& value, int& length);
virtual void dragOffset(Event& event, int& dx, int& dy);
virtual boolean caught(const Event&) const;
virtual boolean commit(const Event&) const;
virtual boolean abort(const Event&) const;
virtual void allocate(Canvas*, const Allocation&, Extension&);
virtual void pick(Canvas*, const Allocation&, int depth, Hit&);
protected:
DragRep* rep() const;
private:
DragRep* rep_;
};
/*
* To create a drag zone glyph:
* 1) create a derived class of DragZone
* 2) implement the member function drop. drop will be called when a drag
* glyph is dropped in a DragZone glyph.
* 3) enter, motion, and leave can be implemented to indicate when a drop
* would be sent to a drag zone.
*/
class DragZone : public MonoGlyph {
public:
DragZone(Glyph*);
virtual ~DragZone();
virtual void sensitive(boolean);
virtual boolean sensitive() const;
virtual void enter(Event&, const char* type, int length);
virtual void motion(Event&);
virtual void leave(Event&);
virtual void drop(Event&, const char* data, int length) = 0;
virtual void allocate(Canvas*, const Allocation&, Extension&);
virtual void pick(Canvas*, const Allocation&, int depth, Hit&);
protected:
DragZoneRep* rep() const;
private:
DragZoneRep* rep_;
};
/*
* A drag zone sink publishes that a window can accept drag messages. It
* also consumes any drag messages that do not fall in a drag zone. This
* class could be eliminated and the code moved to xwindow.c.
*/
class DragZoneSink : public DragZone {
public:
DragZoneSink(Glyph*);
virtual ~DragZoneSink();
virtual void drop(Event&, const char* data, int length);
virtual void draw(Canvas*, const Allocation&) const;
virtual void pick(Canvas*, const Allocation&, int depth, Hit&);
virtual boolean event(Event& event);
private:
boolean dragPublished_;
DragZoneSinkHandler* target_;
};
#include <InterViews/_leave.h>
#endif
|