reflexion 0.3 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/src/pointer.cpp CHANGED
@@ -1,7 +1,6 @@
1
1
  #include "pointer.h"
2
2
 
3
3
 
4
- #include <limits.h>
5
4
  #include <xot/time.h>
6
5
  #include "reflex/exception.h"
7
6
 
@@ -48,9 +47,7 @@ namespace Reflex
48
47
 
49
48
  Point position, prev_position;
50
49
 
51
- uint modifiers, flags;
52
-
53
- ushort click_count, view_index;
50
+ uint modifiers, click_count, flags;
54
51
 
55
52
  double time;
56
53
 
@@ -58,16 +55,14 @@ namespace Reflex
58
55
 
59
56
  Data (
60
57
  ID id = -1, uint types = TYPE_NONE, Action action = ACTION_NONE,
61
- const Point& position = 0, uint modifiers = 0,
58
+ const Point& position = 0, uint modifiers = 0, uint click_count = 0,
62
59
  bool drag = false, bool enter = false, bool exit = false,
63
- uint click_count = 0, uint view_index = 0, double time = 0)
60
+ double time = 0)
64
61
  : id(id), types(types), action(action),
65
- position(position), modifiers(modifiers),
62
+ position(position), modifiers(modifiers), click_count(click_count),
66
63
  flags(make_flags(drag, enter, exit)),
67
- click_count(click_count), view_index(view_index), time(time)
64
+ time(time)
68
65
  {
69
- if (view_index >= USHRT_MAX)
70
- argument_error(__FILE__, __LINE__);
71
66
  }
72
67
 
73
68
  uint make_flags (bool drag, bool enter, bool exit)
@@ -101,15 +96,6 @@ namespace Reflex
101
96
  it->self->id = id;
102
97
  }
103
98
 
104
- void
105
- Pointer_set_view_index (Pointer* it, uint view_index)
106
- {
107
- if (view_index >= USHRT_MAX)
108
- argument_error(__FILE__, __LINE__);
109
-
110
- it->self->view_index = view_index;
111
- }
112
-
113
99
  void
114
100
  Pointer_add_flag (Pointer* it, uint flag)
115
101
  {
@@ -177,12 +163,12 @@ namespace Reflex
177
163
 
178
164
  Pointer::Pointer (
179
165
  ID id, uint types, Action action,
180
- const Point& position, uint modifiers, bool drag,
181
- uint click_count, uint view_index, double time)
166
+ const Point& position, uint modifiers, uint click_count, bool drag,
167
+ double time)
182
168
  : self(new Data(
183
169
  id, types, action,
184
- position, modifiers, drag, false, false,
185
- click_count, view_index, time))
170
+ position, modifiers, click_count, drag, false, false,
171
+ time))
186
172
  {
187
173
  }
188
174
 
@@ -232,22 +218,16 @@ namespace Reflex
232
218
  return self->modifiers;
233
219
  }
234
220
 
235
- bool
236
- Pointer::is_drag () const
237
- {
238
- return Xot::has_flag(self->flags, Data::DRAG);
239
- }
240
-
241
221
  uint
242
222
  Pointer::click_count () const
243
223
  {
244
224
  return self->click_count;
245
225
  }
246
226
 
247
- uint
248
- Pointer::view_index () const
227
+ bool
228
+ Pointer::is_drag () const
249
229
  {
250
- return self->view_index;
230
+ return Xot::has_flag(self->flags, Data::DRAG);
251
231
  }
252
232
 
253
233
  double
data/src/pointer.h CHANGED
@@ -16,8 +16,6 @@ namespace Reflex
16
16
 
17
17
  void Pointer_set_id (Pointer* it, Pointer::ID id);
18
18
 
19
- void Pointer_set_view_index (Pointer* it, uint view_index);
20
-
21
19
  void Pointer_add_flag (Pointer* it, uint flag);
22
20
 
23
21
  void Pointer_remove_flag (Pointer* it, uint flag);
data/src/selector.cpp CHANGED
@@ -76,7 +76,9 @@ namespace Reflex
76
76
  void
77
77
  Selector::add_tag (const char* tag)
78
78
  {
79
- if (!tag || *tag == '\0')
79
+ if (!tag)
80
+ argument_error(__FILE__, __LINE__);
81
+ if (*tag == '\0')
80
82
  argument_error(__FILE__, __LINE__);
81
83
 
82
84
  iterator it = self->tags.find(tag);
data/src/shape.cpp CHANGED
@@ -444,7 +444,9 @@ namespace Reflex
444
444
  void
445
445
  Shape_call_contact_event (Shape* shape, ContactEvent* event)
446
446
  {
447
- if (!shape || !event)
447
+ if (!shape)
448
+ argument_error(__FILE__, __LINE__);
449
+ if (!event)
448
450
  argument_error(__FILE__, __LINE__);
449
451
 
450
452
  shape->on_contact(event);
data/src/style.cpp CHANGED
@@ -202,7 +202,9 @@ namespace Reflex
202
202
  void
203
203
  StyleLength::reset (Type type, Value value)
204
204
  {
205
- if (type < NONE || TYPE_MAX <= type)
205
+ if (type < NONE)
206
+ argument_error(__FILE__, __LINE__);
207
+ if (type >= TYPE_MAX)
206
208
  argument_error(__FILE__, __LINE__);
207
209
 
208
210
  if (type == FIT && value != 1)
@@ -615,14 +617,18 @@ namespace Reflex
615
617
  void
616
618
  Style::set_flow (Flow main, Flow sub)
617
619
  {
618
- if (
619
- main < FLOW_NONE || FLOW_MAX <= main ||
620
- sub < FLOW_NONE || FLOW_MAX <= sub ||
621
- (main != FLOW_NONE && (get_flow_dir(main) == get_flow_dir(sub))) ||
622
- (main == FLOW_NONE && sub != FLOW_NONE))
623
- {
620
+ if (main < FLOW_NONE)
621
+ argument_error(__FILE__, __LINE__);
622
+ if (main >= FLOW_MAX)
623
+ argument_error(__FILE__, __LINE__);
624
+ if (sub < FLOW_NONE)
625
+ argument_error(__FILE__, __LINE__);
626
+ if (sub >= FLOW_MAX)
627
+ argument_error(__FILE__, __LINE__);
628
+ if (main != FLOW_NONE && (get_flow_dir(main) == get_flow_dir(sub)))
629
+ argument_error(__FILE__, __LINE__);
630
+ if (main == FLOW_NONE && sub != FLOW_NONE)
624
631
  argument_error(__FILE__, __LINE__);
625
- }
626
632
 
627
633
  self->set_flow(main, sub);
628
634
 
data/src/view.cpp CHANGED
@@ -289,15 +289,22 @@ namespace Reflex
289
289
 
290
290
  World* child_world (View* view, bool create = true)
291
291
  {
292
- if (!pchild_world && create)
293
- {
294
- pchild_world.reset(new World());
295
- create_walls(view);
296
- }
297
-
292
+ if (!pchild_world && create) create_world(view);
298
293
  return pchild_world.get();
299
294
  }
300
295
 
296
+ void create_world (View* view, float pixels_per_meter = 0)
297
+ {
298
+ if (pchild_world)
299
+ invalid_state_error(__FILE__, __LINE__);
300
+
301
+ if (pixels_per_meter == 0)
302
+ pixels_per_meter = World::DEFAULT_PIXELS_PER_METER;
303
+
304
+ pchild_world.reset(new World(pixels_per_meter));
305
+ create_walls(view);
306
+ }
307
+
301
308
  void create_walls (View* view)
302
309
  {
303
310
  clear_walls(view);
@@ -1327,7 +1334,9 @@ namespace Reflex
1327
1334
  void
1328
1335
  View_call_key_event (View* view, KeyEvent* event)
1329
1336
  {
1330
- if (!view || !event)
1337
+ if (!view)
1338
+ argument_error(__FILE__, __LINE__);
1339
+ if (!event)
1331
1340
  argument_error(__FILE__, __LINE__);
1332
1341
 
1333
1342
  if (view->hidden()) return;
@@ -1383,9 +1392,6 @@ namespace Reflex
1383
1392
  case Pointer::CANCEL: view->on_pointer_cancel(event); break;
1384
1393
  default: break;
1385
1394
  }
1386
-
1387
- if (!event->is_captured())
1388
- PointerEvent_increment_view_indices(event);
1389
1395
  }
1390
1396
 
1391
1397
  static void
@@ -1398,34 +1404,36 @@ namespace Reflex
1398
1404
  PointerEvent_each_pointer(&event, [&](const auto& pointer)
1399
1405
  {
1400
1406
  if (pointer.action() == Pointer::DOWN)
1401
- Window_register_capture(win, view, pointer.id(), pointer.view_index());
1407
+ Window_register_capture(win, view, pointer.id());
1402
1408
  });
1403
1409
  }
1404
1410
 
1405
1411
  static void
1406
- unregister_captures (View* view, const PointerEvent& event)
1412
+ unregister_captures (Window* window, View* view, const PointerEvent& event)
1407
1413
  {
1408
- Window* win = view->window();
1409
- if (!win)
1410
- invalid_state_error(__FILE__, __LINE__);
1411
-
1412
1414
  PointerEvent_each_pointer(&event, [&](const auto& pointer)
1413
1415
  {
1414
1416
  auto action = pointer.action();
1415
1417
  if (action == Pointer::UP || action == Pointer::CANCEL)
1416
- Window_unregister_capture(win, view, pointer.id());
1418
+ Window_unregister_capture(window, view, pointer.id());
1417
1419
  });
1418
1420
  }
1419
1421
 
1420
1422
  void
1421
1423
  View_call_pointer_event (View* view, PointerEvent* event)
1422
1424
  {
1423
- if (!view || !event)
1425
+ if (!view)
1426
+ argument_error(__FILE__, __LINE__);
1427
+ if (!event)
1424
1428
  argument_error(__FILE__, __LINE__);
1425
1429
 
1426
1430
  if (view->hidden() || event->empty())
1427
1431
  return;
1428
1432
 
1433
+ Window* win = view->window();
1434
+ if (!win)
1435
+ invalid_state_error(__FILE__, __LINE__);
1436
+
1429
1437
  PointerEvent e = event->dup();
1430
1438
 
1431
1439
  if (!e.is_captured())
@@ -1437,13 +1445,15 @@ namespace Reflex
1437
1445
  call_pointer_events(view, &e);
1438
1446
  }
1439
1447
 
1440
- unregister_captures(view, e);
1448
+ unregister_captures(win, view, e);
1441
1449
  }
1442
1450
 
1443
1451
  void
1444
1452
  View_call_wheel_event (View* view, WheelEvent* event)
1445
1453
  {
1446
- if (!view || !event)
1454
+ if (!view)
1455
+ argument_error(__FILE__, __LINE__);
1456
+ if (!event)
1447
1457
  argument_error(__FILE__, __LINE__);
1448
1458
 
1449
1459
  if (view->hidden()) return;
@@ -1469,7 +1479,9 @@ namespace Reflex
1469
1479
  void
1470
1480
  View_call_contact_event (View* view, ContactEvent* event)
1471
1481
  {
1472
- if (!view || !event)
1482
+ if (!view)
1483
+ argument_error(__FILE__, __LINE__);
1484
+ if (!event)
1473
1485
  argument_error(__FILE__, __LINE__);
1474
1486
 
1475
1487
  ContactEvent e = event->dup();
@@ -1738,7 +1750,9 @@ namespace Reflex
1738
1750
  void
1739
1751
  View::add_child (View* child)
1740
1752
  {
1741
- if (!child || child == this)
1753
+ if (!child)
1754
+ argument_error(__FILE__, __LINE__);
1755
+ if (child == this)
1742
1756
  argument_error(__FILE__, __LINE__);
1743
1757
 
1744
1758
  bool found = std::find(child_begin(), child_end(), child) != child_end();
@@ -1764,7 +1778,9 @@ namespace Reflex
1764
1778
  void
1765
1779
  View::remove_child (View* child)
1766
1780
  {
1767
- if (!child || child == this)
1781
+ if (!child)
1782
+ argument_error(__FILE__, __LINE__);
1783
+ if (child == this)
1768
1784
  argument_error(__FILE__, __LINE__);
1769
1785
 
1770
1786
  bool found = std::find(child_begin(), child_end(), child) != child_end();
@@ -2517,7 +2533,13 @@ namespace Reflex
2517
2533
  }
2518
2534
 
2519
2535
  void
2520
- View::update_physics (float duration)
2536
+ View::create_world (float pixels_per_meter)
2537
+ {
2538
+ self->create_world(this, pixels_per_meter);
2539
+ }
2540
+
2541
+ void
2542
+ View::update_world (float duration)
2521
2543
  {
2522
2544
  World* w = self->pchild_world.get();
2523
2545
  if (w) w->update(duration);
data/src/win32/event.cpp CHANGED
@@ -135,9 +135,8 @@ namespace Reflex
135
135
  get_mouse_action(msg),
136
136
  Point(GET_X_LPARAM(lp), GET_Y_LPARAM(lp)),
137
137
  get_modifiers(),
138
- is_mouse_dragging(msg, wp),
139
138
  get_mouse_click_count(msg),
140
- 0,
139
+ is_mouse_dragging(msg, wp),
141
140
  Xot::time()));
142
141
  }
143
142
 
@@ -197,9 +196,8 @@ namespace Reflex
197
196
  action,
198
197
  get_touch_position(hwnd, touch),
199
198
  get_modifiers(),
200
- action == Pointer::MOVE,
201
199
  action == Pointer::DOWN ? 1 : 0,
202
- 0,
200
+ action == Pointer::MOVE,
203
201
  get_touch_time(touch));
204
202
  Pointer_set_system_id(&pointer, touch.dwID);
205
203
 
data/src/window.cpp CHANGED
@@ -19,9 +19,7 @@ namespace Reflex
19
19
 
20
20
  using ExtractedPointerIDSet = std::set<Pointer::ID>;
21
21
 
22
- using PointerData = Window::Data::PointerData;
23
-
24
- using TargetPointerMap = Window::Data::TargetPointerMap;
22
+ using CaptureTargetIDList = Window::Data::CaptureTargetIDList;
25
23
 
26
24
 
27
25
  Window::Data::Data ()
@@ -35,16 +33,12 @@ namespace Reflex
35
33
  }
36
34
 
37
35
 
38
- Window::Data::PointerData::PointerData (uint view_index)
39
- : view_index(view_index)
40
- {
41
- }
42
-
43
-
44
36
  void
45
37
  Window_set_focus (Window* window, View* view)
46
38
  {
47
- if (!window || !view)
39
+ if (!window)
40
+ argument_error(__FILE__, __LINE__);
41
+ if (!view)
48
42
  argument_error(__FILE__, __LINE__);
49
43
 
50
44
  View* current = window->self->focus.get();
@@ -89,8 +83,7 @@ namespace Reflex
89
83
  }
90
84
 
91
85
  void
92
- Window_register_capture (
93
- Window* window, View* view, Pointer::ID target, uint view_index)
86
+ Window_register_capture (Window* window, View* view, Pointer::ID target)
94
87
  {
95
88
  if (!view)
96
89
  argument_error(__FILE__, __LINE__);
@@ -101,10 +94,12 @@ namespace Reflex
101
94
  if (target < 0) return;
102
95
 
103
96
  auto& targets = window->self->captures[view];
104
- if (targets.find(target) != targets.end())
97
+ if (std::find(targets.begin(), targets.end(), target) != targets.end())
105
98
  return;
106
99
 
107
- targets.insert(std::make_pair(target, PointerData(view_index)));
100
+ targets.insert(
101
+ target == CAPTURE_ALL ? targets.begin() : targets.end(),
102
+ target);
108
103
  }
109
104
 
110
105
  void
@@ -117,7 +112,7 @@ namespace Reflex
117
112
  if (captures_it == window->self->captures.end()) return;
118
113
 
119
114
  auto& targets = captures_it->second;
120
- auto targets_it = targets.find(target);
115
+ auto targets_it = std::find(targets.begin(), targets.end(), target);
121
116
  if (targets_it == targets.end()) return;
122
117
 
123
118
  targets.erase(targets_it);
@@ -157,7 +152,9 @@ namespace Reflex
157
152
  void
158
153
  Window_call_draw_event (Window* window, DrawEvent* event)
159
154
  {
160
- if (!window || !event)
155
+ if (!window)
156
+ argument_error(__FILE__, __LINE__);
157
+ if (!event)
161
158
  argument_error(__FILE__, __LINE__);
162
159
 
163
160
  Painter* painter = window->painter();
@@ -182,12 +179,12 @@ namespace Reflex
182
179
  }
183
180
 
184
181
  static bool
185
- is_capturing (
186
- const View* view, const TargetPointerMap& targets, View::Capture type)
182
+ is_capturing_all (
183
+ const View* view, const CaptureTargetIDList& targets, View::Capture type)
187
184
  {
188
185
  return
189
186
  !targets.empty() &&
190
- targets.find(CAPTURE_ALL) != targets.end() &&
187
+ targets[0] == CAPTURE_ALL &&
191
188
  (view->capture() & type) == type;
192
189
  }
193
190
 
@@ -210,8 +207,12 @@ namespace Reflex
210
207
 
211
208
  for (auto& [view, targets] : window->self->captures)
212
209
  {
213
- if (!view->window() || !is_capturing(view.get(), targets, View::CAPTURE_KEY))
210
+ if (
211
+ !view->window() ||
212
+ !is_capturing_all(view.get(), targets, View::CAPTURE_KEY))
213
+ {
214
214
  continue;
215
+ }
215
216
 
216
217
  KeyEvent e = event->dup();
217
218
  KeyEvent_set_captured(&e, true);
@@ -335,7 +336,7 @@ namespace Reflex
335
336
  result->clear();
336
337
  for (const auto& [view, targets] : window->self->captures)
337
338
  {
338
- if (is_capturing(view.get(), targets, View::CAPTURE_POINTER))
339
+ if (is_capturing_all(view.get(), targets, View::CAPTURE_POINTER))
339
340
  result->emplace_back(view);
340
341
  }
341
342
  }
@@ -361,28 +362,24 @@ namespace Reflex
361
362
  static void
362
363
  extract_pointer (
363
364
  PointerEvent* event, ExtractedPointerIDSet* extracteds,
364
- const Pointer& pointer, uint view_index = 0)
365
+ const Pointer& pointer)
365
366
  {
366
- PointerEvent_add_pointer(event, pointer, [&](auto* p)
367
- {
368
- Pointer_set_view_index(p, view_index);
369
- });
370
-
367
+ PointerEvent_add_pointer(event, pointer);
371
368
  extracteds->insert(pointer.id());
372
369
  }
373
370
 
374
371
  static void
375
372
  extract_targeted_pointers (
376
373
  PointerEvent* event, ExtractedPointerIDSet* extracteds,
377
- const TargetPointerMap& targets, const PointerMap& pointers)
374
+ const CaptureTargetIDList& targets, const PointerMap& pointers)
378
375
  {
379
376
  assert(event->empty());
380
377
 
381
- for (auto& [pointer_id, data] : targets)
378
+ for (auto pointer_id : targets)
382
379
  {
383
380
  auto it = pointers.find(pointer_id);
384
381
  if (it != pointers.end())
385
- extract_pointer(event, extracteds, it->second, data.view_index);
382
+ extract_pointer(event, extracteds, it->second);
386
383
  }
387
384
  }
388
385
 
data/src/window.h CHANGED
@@ -28,18 +28,9 @@ namespace Reflex
28
28
  struct Window::Data
29
29
  {
30
30
 
31
- struct PointerData
32
- {
33
-
34
- uint view_index;
35
-
36
- PointerData (uint view_index);
31
+ typedef std::vector<Pointer::ID> CaptureTargetIDList;
37
32
 
38
- };// PointerData
39
-
40
- typedef std::map<Pointer::ID, PointerData> TargetPointerMap;
41
-
42
- typedef std::map<View::Ref, TargetPointerMap> CaptureMap;
33
+ typedef std::map<View::Ref, CaptureTargetIDList> CaptureMap;
43
34
 
44
35
  int hide_count = 1;
45
36
 
@@ -112,7 +103,7 @@ namespace Reflex
112
103
  void Window_set_focus (Window* window, View* view);
113
104
 
114
105
  void Window_register_capture (
115
- Window* window, View* view, Pointer::ID target, uint view_index = 0);
106
+ Window* window, View* view, Pointer::ID target);
116
107
 
117
108
  void Window_unregister_capture (
118
109
  Window* window, View* view, Pointer::ID target);
data/test/test_pointer.rb CHANGED
@@ -23,11 +23,11 @@ class TestPointer < Test::Unit::TestCase
23
23
 
24
24
  def pointer(
25
25
  id: 0, types: TYPE_NONE, action: ACTION_NONE,
26
- position: 0, modifiers: 0, drag: false, click_count: 0, view_index: 0,
26
+ position: 0, modifiers: 0, click_count: 0, drag: false,
27
27
  time: 0)
28
28
 
29
29
  Reflex::Pointer.new(
30
- id, types, action, position, modifiers, drag, click_count, view_index, time)
30
+ id, types, action, position, modifiers, click_count, drag, time)
31
31
  end
32
32
 
33
33
  def test_initialize()
@@ -35,8 +35,8 @@ class TestPointer < Test::Unit::TestCase
35
35
 
36
36
  p = pointer(
37
37
  id: 1, types: TOUCH, action: UP,
38
- position: [2, 3], modifiers: 4, drag: true, click_count: 5, view_index: 6,
39
- time: 7)
38
+ position: [2, 3], modifiers: 4, click_count: 5, drag: true,
39
+ time: 6)
40
40
 
41
41
  assert_equal 1, p.id
42
42
  assert_equal [:touch], p.types
@@ -45,10 +45,9 @@ class TestPointer < Test::Unit::TestCase
45
45
  assert_equal 2, p.x
46
46
  assert_equal 3, p.y
47
47
  assert_equal 4, p.modifiers
48
- assert_equal true, p.drag?
49
48
  assert_equal 5, p.click_count
50
- assert_equal 6, p.view_index
51
- assert_equal 7, p.time
49
+ assert_equal true, p.drag?
50
+ assert_equal 6, p.time
52
51
  assert_nil p.prev
53
52
  assert_nil p.down
54
53
  end
@@ -147,10 +146,9 @@ class TestPointer < Test::Unit::TestCase
147
146
  assert_not_equal pointer, pointer(action: Reflex::Pointer::UP)
148
147
  assert_not_equal pointer, pointer(position: 2)
149
148
  assert_not_equal pointer, pointer(modifiers: 3)
150
- assert_not_equal pointer, pointer(drag: true)
151
149
  assert_not_equal pointer, pointer(click_count: 4)
152
- assert_not_equal pointer, pointer(view_index: 5)
153
- assert_not_equal pointer, pointer(time: 6)
150
+ assert_not_equal pointer, pointer(drag: true)
151
+ assert_not_equal pointer, pointer(time: 5)
154
152
  end
155
153
 
156
154
  end# TestPointer
@@ -17,11 +17,11 @@ class TestPointerEvent < Test::Unit::TestCase
17
17
 
18
18
  def pointer(
19
19
  id: 0, type: TYPE_NONE, action: ACTION_NONE,
20
- position: 0, modifiers: 0, drag: false, click_count: 0, view_index: 0,
20
+ position: 0, modifiers: 0, click_count: 0, drag: false,
21
21
  time: 0)
22
22
 
23
23
  Reflex::Pointer.new(
24
- id, type, action, position, modifiers, drag, click_count, view_index, time)
24
+ id, type, action, position, modifiers, click_count, drag, time)
25
25
  end
26
26
 
27
27
  def test_initialize()
@@ -31,12 +31,12 @@ class TestPointerEvent < Test::Unit::TestCase
31
31
 
32
32
  p1 = pointer(
33
33
  id: 1, type: TOUCH, action: DOWN,
34
- position: [2, 3], modifiers: 4, drag: true, click_count: 5, view_index: 6,
35
- time: 7)
34
+ position: [2, 3], modifiers: 4, drag: true, click_count: 5,
35
+ time: 6)
36
36
  p2 = pointer(
37
37
  id: 10, type: PEN, action: UP,
38
- position: [20, 30], modifiers: 40, drag: false, click_count: 50, view_index: 60,
39
- time: 70)
38
+ position: [20, 30], modifiers: 40, drag: false, click_count: 50,
39
+ time: 60)
40
40
  e = event p1, p2
41
41
 
42
42
  assert_equal [p1, p2], e.pointers.to_a
@@ -51,10 +51,9 @@ class TestPointerEvent < Test::Unit::TestCase
51
51
  assert_equal 2, e.x
52
52
  assert_equal 3, e.y
53
53
  assert_equal 4, e.modifiers
54
- assert_equal true, e.drag?
55
54
  assert_equal 5, e.click_count
56
- assert_equal 6, e.view_index
57
- assert_equal 7, e.time
55
+ assert_equal true, e.drag?
56
+ assert_equal 6, e.time
58
57
  end
59
58
 
60
59
  def test_dup()