/usr/include/InterViews/event.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 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 | /*
* Copyright (c) 1987, 1988, 1989, 1990, 1991 Stanford University
* Copyright (c) 1991 Silicon Graphics, Inc.
*
* 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 names of
* Stanford and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific, prior written
* permission of Stanford and Silicon Graphics.
*
* 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 STANFORD OR SILICON GRAPHICS 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.
*/
/*
* Input events.
*/
#ifndef iv_event_h
#define iv_event_h
#include <InterViews/coord.h>
#include <InterViews/_enter.h>
class Display;
class Event;
class EventRep;
class Interactor;
class Handler;
class Window;
class World;
typedef unsigned int EventType;
typedef unsigned int EventButton;
typedef void (*event_tracker_ptr)(Event&);
/* anachronism */
enum {
MotionEvent, /* mouse moved */
DownEvent, /* button pressed */
UpEvent, /* button released */
KeyEvent, /* key pressed, intepreted as ascii */
EnterEvent, /* mouse enters canvas */
LeaveEvent, /* mouse leaves canvas */
FocusInEvent, /* focus for keyboard events */
FocusOutEvent /* lose keyboard focus */
};
/* mouse button anachronisms */
static const int LEFTMOUSE = 0;
static const int MIDDLEMOUSE = 1;
static const int RIGHTMOUSE = 2;
//: user input events.
// <a href=../refman3.1/refman.html#PAGE23>in reference manual</a>.
class Event {
public:
enum { undefined, motion, down, up, key, selection_notify, other_event };
enum { none, any, left, middle, right, other_button };
Event();
Event(const Event&);
virtual ~Event();
virtual Event& operator =(const Event&);
virtual void display(Display*);
virtual Display* display() const;
virtual void window(Window*);
virtual Window* window() const;
virtual boolean pending() const;
virtual void read();
virtual boolean read(long sec, long usec);
virtual void unread();
virtual void poll();
virtual Handler* handler() const;
virtual void handle();
virtual void grab(Handler*) const;
virtual void ungrab(Handler*) const;
virtual Handler* grabber() const;
virtual boolean is_grabbing(Handler*) const;
virtual EventType type() const;
virtual unsigned long time() const;
virtual Coord pointer_x() const;
virtual Coord pointer_y() const;
virtual Coord pointer_root_x() const;
virtual Coord pointer_root_y() const;
virtual EventButton pointer_button() const;
virtual unsigned int keymask() const;
virtual boolean control_is_down() const;
virtual boolean meta_is_down() const;
virtual boolean shift_is_down() const;
virtual boolean capslock_is_down() const;
virtual boolean left_is_down() const;
virtual boolean middle_is_down() const;
virtual boolean right_is_down() const;
virtual unsigned char keycode() const;
virtual unsigned long keysym() const;
virtual unsigned int mapkey(char*, unsigned int len) const;
EventRep* rep() const;
static event_tracker_ptr event_tracker() { return _event_tracker; }
static void event_tracker(event_tracker_ptr ptr) { _event_tracker = ptr; }
protected:
static event_tracker_ptr _event_tracker;
private:
EventRep* rep_;
char free_store_[200];
void copy_rep(const Event&);
/*
* Old members for backward compatibility
*/
public:
Interactor* target;
unsigned long timestamp;
EventType eventType;
IntCoord x, y; /* mouse position relative to target */
boolean control : 1; /* true if down */
boolean meta : 1;
boolean shift : 1;
boolean shiftlock : 1;
boolean leftmouse : 1;
boolean middlemouse : 1;
boolean rightmouse : 1;
unsigned char button; /* button pressed or released, if any */
unsigned short len; /* length of ASCII string */
char* keystring; /* ASCII interpretation of event, if any */
void GetAbsolute(IntCoord&, IntCoord&);
void GetAbsolute(World*&, IntCoord&, IntCoord&);
EventRep* Rep() const;
private:
World* w;
_lib_iv2_6(Coord) wx, wy;
char keydata[sizeof(int)];
friend class Interactor;
void GetInfo();
void GetMotionInfo();
void GetButtonInfo(EventType);
void GetKeyInfo();
void GetKeyState(unsigned);
void GetCrossingInfo(EventType);
};
inline EventRep* Event::rep() const { return rep_; }
inline EventRep* Event::Rep() const { return rep(); }
#include <InterViews/_leave.h>
#endif
|