~ubuntu-branches/ubuntu/quantal/texmacs/quantal

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
/******************************************************************************
* MODULE     : basic_event.hpp
* DESCRIPTION: The most common events
* COPYRIGHT  : (C) 1999  Joris van der Hoeven
*******************************************************************************
* This software falls under the GNU general public license version 3 or later.
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
******************************************************************************/

#ifndef BASIC_EVENT_H
#define BASIC_EVENT_H
#include "Widkit/event.hpp"
#include "Widkit/wk_widget.hpp"
#include "Widkit/Event/event_codes.hpp"

/******************************************************************************
* Attribute events
******************************************************************************/

struct get_size_event_rep: public event_rep {
  SI& w; SI& h; int mode;
  get_size_event_rep (SI& w, SI& h, int mode);
  operator tree ();
};
EVENT(get_size_event);

struct get_widget_event_rep: public event_rep {
  string which; wk_widget& w;
  get_widget_event_rep (string which, wk_widget& w);
  operator tree ();
};
EVENT(get_widget_event);

struct set_widget_event_rep: public event_rep {
  string which; wk_widget w;
  set_widget_event_rep (string which, wk_widget w);
  operator tree ();
};
EVENT(set_widget_event);

/******************************************************************************
* Structure events
******************************************************************************/

struct attach_window_event_rep: public event_rep {
  window win;
  attach_window_event_rep (window win);
  operator tree ();
};
EVENT(attach_window_event);

struct position_event_rep: public event_rep {
  bool flag; SI ox, oy, w, h; gravity grav;
  position_event_rep ();
  position_event_rep (SI ox, SI oy, SI w, SI h, gravity grav);
  operator tree ();
};
tree as_tree (gravity grav);
tm_ostream& operator << (tm_ostream& out, gravity grav);
EVENT(position_event);

struct move_event_rep: public event_rep {
  move_event_rep ();
  operator tree ();
};
EVENT(move_event);

struct resize_event_rep: public event_rep {
  resize_event_rep ();
  operator tree ();
};
EVENT(resize_event);

struct destroy_event_rep: public event_rep {
  destroy_event_rep ();
  operator tree ();
};
EVENT(destroy_event);

/******************************************************************************
* Input events
******************************************************************************/

struct keypress_event_rep: public event_rep {
  string key; time_t t;
  keypress_event_rep (string key, time_t t);
  operator tree ();
};
EVENT(keypress_event);

struct keyboard_focus_event_rep: public event_rep {
  bool flag; time_t t;
  keyboard_focus_event_rep (bool in_out_flag, time_t t);
  operator tree ();
};
EVENT(keyboard_focus_event);

struct mouse_event_rep: public event_rep {
  string type; SI x, y; int mods; time_t t;
  mouse_event_rep (string type, SI x, SI y, int mods, time_t t);
  bool pressed (string which);
  operator tree ();
};
EVENT(mouse_event);

struct alarm_event_rep: public event_rep {
  string message; time_t t;
  alarm_event_rep (string message, time_t t);
  operator tree ();
};
EVENT(alarm_event);

/******************************************************************************
* Output events
******************************************************************************/

struct clear_event_rep: public event_rep {
  SI x1, y1, x2, y2;
  clear_event_rep (SI x1, SI y1, SI x2, SI y2);
  operator tree ();
};
EVENT(clear_event);

struct repaint_event_rep: public event_rep {
  SI x1, y1, x2, y2; bool& stop;
  repaint_event_rep (SI x1, SI y1, SI x2, SI y2, bool& stop);
  operator tree ();
};
EVENT(repaint_event);

/******************************************************************************
* Request some action
******************************************************************************/

struct update_event_rep: public event_rep {
  update_event_rep ();
  operator tree ();
};
EVENT(update_event);

struct invalidate_event_rep: public event_rep {
  bool all_flag;
  SI x1, y1, x2, y2;
  invalidate_event_rep ();
  invalidate_event_rep (SI x1, SI y1, SI x2, SI y2);
  operator tree ();
};
EVENT(invalidate_event);

struct keyboard_grab_event_rep: public event_rep {
  bool flag; time_t t;
  keyboard_grab_event_rep (bool in_out_flag, time_t t);
  operator tree ();
};
EVENT(keyboard_grab_event);

struct mouse_grab_event_rep: public event_rep {
  bool flag; time_t t;
  mouse_grab_event_rep (bool in_out_flag, time_t t);
  operator tree ();
};
EVENT(mouse_grab_event);

struct request_alarm_event_rep: public event_rep {
  event ev; time_t delay;
  request_alarm_event_rep (event ev, time_t delay);
  operator tree ();
};
EVENT(request_alarm_event);

/******************************************************************************
* Miscellaneous events
******************************************************************************/

struct find_child_event_rep: public event_rep {
  SI x, y; int& which;
  find_child_event_rep (SI x, SI y, int& which);
  operator tree ();
};
EVENT(find_child_event);

/******************************************************************************
* Modification of events
******************************************************************************/

event emit_keypress (keypress_event ev, string key);
event emit_mouse (mouse_event ev, string type, SI x, SI y);

#endif // defined BASIC_EVENT_H