gdk4 3.5.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2012 Ruby-GNOME Project Team
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -24,675 +24,4 @@ class TestGdkEvent < Test::Unit::TestCase
24
24
  assert_true(Gdk::Event::STOP)
25
25
  end
26
26
  end
27
-
28
- module TestAnyMethods
29
- def test_window
30
- assert_nil(event.window)
31
- attributes = Gdk::WindowAttr.new(100, 100, :input_only, :temp)
32
- window = Gdk::Window.new(nil, attributes, 0)
33
- event.window = window
34
- assert_equal(window, event.window)
35
- end
36
-
37
- def test_send_event?
38
- assert_false(event.send_event?)
39
- end
40
- end
41
-
42
- class TestAny < self
43
- include TestAnyMethods
44
-
45
- def setup
46
- @event = Gdk::EventAny.new(:delete)
47
- end
48
-
49
- def event
50
- @event
51
- end
52
-
53
- def test_delete
54
- assert_equal("GDK_DELETE",
55
- Gdk::EventAny.new(:delete).type.name)
56
- end
57
-
58
- def test_destroy
59
- assert_equal("GDK_DESTROY",
60
- Gdk::EventAny.new(:destroy).type.name)
61
- end
62
- end
63
-
64
- class TestKey < self
65
- include TestAnyMethods
66
-
67
- def setup
68
- @key = Gdk::EventKey.new(:key_press)
69
- end
70
-
71
- def event
72
- @key
73
- end
74
-
75
- def test_key_press
76
- assert_equal("GDK_KEY_PRESS",
77
- Gdk::EventKey.new(:key_press).type.name)
78
- end
79
-
80
- def test_key_release
81
- assert_equal("GDK_KEY_RELEASE",
82
- Gdk::EventKey.new(:key_release).type.name)
83
- end
84
-
85
- def test_time
86
- assert_kind_of(Integer, @key.time)
87
- end
88
-
89
- def test_state
90
- assert_not_nil(@key.state)
91
- end
92
-
93
- def test_keyval
94
- assert_kind_of(Integer, @key.keyval)
95
- end
96
- end
97
-
98
- class TestButton < self
99
- include TestAnyMethods
100
-
101
- def setup
102
- @button = Gdk::EventButton.new(:button_press)
103
- end
104
-
105
- def event
106
- @button
107
- end
108
-
109
- def test_button_press
110
- assert_equal("GDK_BUTTON_PRESS",
111
- Gdk::EventButton.new(:button_press).type.name)
112
- end
113
-
114
- def test_button2_press
115
- assert_equal("GDK_2BUTTON_PRESS",
116
- Gdk::EventButton.new(:button2_press).type.name)
117
- end
118
-
119
- def test_button3_press
120
- assert_equal("GDK_3BUTTON_PRESS",
121
- Gdk::EventButton.new(:button3_press).type.name)
122
- end
123
-
124
- def test_button_release
125
- assert_equal("GDK_BUTTON_RELEASE",
126
- Gdk::EventButton.new(:button_release).type.name)
127
- end
128
-
129
- def test_time
130
- assert_kind_of(Integer, @button.time)
131
- end
132
-
133
- def test_x
134
- assert_kind_of(Float, @button.x)
135
- end
136
-
137
- def test_y
138
- assert_kind_of(Float, @button.y)
139
- end
140
-
141
- def test_state
142
- assert_not_nil(@button.state)
143
- end
144
-
145
- def test_button
146
- assert_kind_of(Integer, @button.button)
147
- end
148
-
149
- def test_x_root
150
- assert_kind_of(Float, @button.x_root)
151
- end
152
-
153
- def test_y_root
154
- assert_kind_of(Float, @button.y_root)
155
- end
156
- end
157
-
158
- class TestTouch < self
159
- include TestAnyMethods
160
-
161
- def setup
162
- @touch = Gdk::EventTouch.new(:touch_begin)
163
- end
164
-
165
- def event
166
- @touch
167
- end
168
-
169
- def test_time
170
- assert_kind_of(Integer, @touch.time)
171
- end
172
-
173
- def test_x
174
- assert_kind_of(Float, @touch.x)
175
- end
176
-
177
- def test_y
178
- assert_kind_of(Float, @touch.y)
179
- end
180
-
181
- def test_axis
182
- assert_kind_of(Numeric, @touch.get_axis(:x))
183
- end
184
-
185
- def test_state
186
- assert_not_nil(@touch.state)
187
- end
188
-
189
- def test_touch_begin
190
- assert_equal("GDK_TOUCH_BEGIN",
191
- Gdk::EventTouch.new(:touch_begin).type.name)
192
- end
193
-
194
- def test_touch_update
195
- assert_equal("GDK_TOUCH_UPDATE",
196
- Gdk::EventTouch.new(:touch_update).type.name)
197
- end
198
-
199
- def test_touch_cancel
200
- assert_equal("GDK_TOUCH_CANCEL",
201
- Gdk::EventTouch.new(:touch_cancel).type.name)
202
- end
203
-
204
- def test_touch_end
205
- assert_equal("GDK_TOUCH_END",
206
- Gdk::EventTouch.new(:touch_end).type.name)
207
- end
208
-
209
- def test_emulating_pointer
210
- assert_boolean(@touch.emulating_pointer?)
211
- end
212
-
213
- def test_device
214
- assert_nothing_raised do
215
- @touch.device
216
- end
217
- end
218
-
219
- def test_x_root
220
- assert_kind_of(Float, @touch.x_root)
221
- end
222
-
223
- def test_y_root
224
- assert_kind_of(Float, @touch.y_root)
225
- end
226
- end
227
-
228
- class TestScroll < self
229
- include TestAnyMethods
230
-
231
- def setup
232
- @scroll = Gdk::EventScroll.new(:scroll)
233
- end
234
-
235
- def event
236
- @scroll
237
- end
238
-
239
- def test_time
240
- assert_kind_of(Integer, @scroll.time)
241
- end
242
-
243
- def test_x
244
- assert_kind_of(Float, @scroll.x)
245
- end
246
-
247
- def test_y
248
- assert_kind_of(Float, @scroll.y)
249
- end
250
-
251
- def test_state
252
- assert_not_nil(@scroll.state)
253
- end
254
-
255
- def test_direction
256
- assert_kind_of(Gdk::ScrollDirection, @scroll.direction)
257
- end
258
-
259
- def test_x_root
260
- assert_kind_of(Float, @scroll.x_root)
261
- end
262
-
263
- def test_y_root
264
- assert_kind_of(Float, @scroll.y_root)
265
- end
266
- end
267
-
268
- class TestMotion < self
269
- include TestAnyMethods
270
-
271
- def setup
272
- @motion = Gdk::EventMotion.new(:motion_notify)
273
- end
274
-
275
- def event
276
- @motion
277
- end
278
-
279
- def test_time
280
- assert_kind_of(Integer, @motion.time)
281
- end
282
-
283
- def test_x
284
- assert_kind_of(Float, @motion.x)
285
- end
286
-
287
- def test_y
288
- assert_kind_of(Float, @motion.y)
289
- end
290
-
291
- def test_state
292
- assert_not_nil(@motion.state)
293
- end
294
-
295
- def test_x_root
296
- assert_kind_of(Float, @motion.x_root)
297
- end
298
-
299
- def test_y_root
300
- assert_kind_of(Float, @motion.y_root)
301
- end
302
-
303
- def test_request
304
- assert_nothing_raised do
305
- @motion.request
306
- end
307
- end
308
- end
309
-
310
- class TestVisibility < self
311
- include TestAnyMethods
312
-
313
- def setup
314
- @visibility = Gdk::EventVisibility.new(:visibility_notify)
315
- end
316
-
317
- def event
318
- @visibility
319
- end
320
-
321
- def test_state
322
- assert_kind_of(Gdk::VisibilityState, @visibility.state)
323
- end
324
- end
325
-
326
- class TestCrossing < self
327
- include TestAnyMethods
328
-
329
- def setup
330
- @crossing = Gdk::EventCrossing.new(:enter_notify)
331
- end
332
-
333
- def event
334
- @crossing
335
- end
336
-
337
- def test_enter_notify
338
- assert_equal("GDK_ENTER_NOTIFY",
339
- Gdk::EventCrossing.new(:enter_notify).type.name)
340
- end
341
-
342
- def test_leave_notify
343
- assert_equal("GDK_LEAVE_NOTIFY",
344
- Gdk::EventCrossing.new(:leave_notify).type.name)
345
- end
346
-
347
- def test_time
348
- assert_kind_of(Integer, @crossing.time)
349
- end
350
-
351
- def test_x
352
- assert_kind_of(Float, @crossing.x)
353
- end
354
-
355
- def test_y
356
- assert_kind_of(Float, @crossing.y)
357
- end
358
-
359
- def test_x_root
360
- assert_kind_of(Float, @crossing.x_root)
361
- end
362
-
363
- def test_y_root
364
- assert_kind_of(Float, @crossing.y_root)
365
- end
366
-
367
- def test_mode
368
- assert_kind_of(Gdk::CrossingMode, @crossing.mode)
369
- end
370
-
371
- def test_detail
372
- assert_not_nil(@crossing.detail)
373
- end
374
-
375
- def test_state
376
- assert_not_nil(@crossing.state)
377
- end
378
- end
379
-
380
- class TestFocus < self
381
- include TestAnyMethods
382
-
383
- def setup
384
- @focus = Gdk::EventFocus.new(:focus_change)
385
- end
386
-
387
- def event
388
- @focus
389
- end
390
-
391
- def test_in
392
- assert_false(@focus.in?)
393
- end
394
- end
395
-
396
- class TestConfigure < self
397
- include TestAnyMethods
398
-
399
- def setup
400
- @configure = Gdk::EventConfigure.new(:configure)
401
- end
402
-
403
- def event
404
- @configure
405
- end
406
-
407
- def test_x
408
- assert_kind_of(Numeric, @configure.x)
409
- end
410
-
411
- def test_y
412
- assert_kind_of(Numeric, @configure.y)
413
- end
414
-
415
- def test_width
416
- assert_kind_of(Integer, @configure.width)
417
- end
418
-
419
- def test_height
420
- assert_kind_of(Integer, @configure.height)
421
- end
422
- end
423
-
424
- class TestProperty < self
425
- include TestAnyMethods
426
-
427
- def setup
428
- @property = Gdk::EventProperty.new(:property_notify)
429
- end
430
-
431
- def event
432
- @property
433
- end
434
-
435
- def test_atom
436
- assert_nothing_raised do
437
- @property.atom
438
- end
439
- end
440
-
441
- def test_time
442
- assert_kind_of(Integer, @property.time)
443
- end
444
-
445
- def test_state
446
- assert_equal(Gdk::PropertyState::NEW_VALUE, @property.state)
447
- end
448
- end
449
-
450
- class TestSelection < self
451
- include TestAnyMethods
452
-
453
- def setup
454
- @selection = Gdk::EventSelection.new(:selection_clear)
455
- end
456
-
457
- def event
458
- @selection
459
- end
460
-
461
- def test_selection_clear
462
- assert_equal("GDK_SELECTION_CLEAR",
463
- Gdk::EventSelection.new(:selection_clear).type.name)
464
- end
465
-
466
- def test_selection_notify
467
- assert_equal("GDK_SELECTION_NOTIFY",
468
- Gdk::EventSelection.new(:selection_notify).type.name)
469
- end
470
-
471
- def test_selection_request
472
- assert_equal("GDK_SELECTION_REQUEST",
473
- Gdk::EventSelection.new(:selection_request).type.name)
474
- end
475
-
476
- def test_selection
477
- assert_nothing_raised do
478
- @selection.selection
479
- end
480
- end
481
-
482
- def test_target
483
- assert_nothing_raised do
484
- @selection.target
485
- end
486
- end
487
-
488
- def test_property
489
- assert_nothing_raised do
490
- @selection.property
491
- end
492
- end
493
-
494
- def test_time
495
- assert_kind_of(Integer, @selection.time)
496
- end
497
- end
498
-
499
- class TestDND < self
500
- include TestAnyMethods
501
-
502
- def setup
503
- @dnd = Gdk::EventDND.new(:drag_enter)
504
- end
505
-
506
- def event
507
- @dnd
508
- end
509
-
510
- def test_drag_enter
511
- assert_equal("GDK_DRAG_ENTER",
512
- Gdk::EventDND.new(:drag_enter).type.name)
513
- end
514
-
515
- def test_drag_leave
516
- assert_equal("GDK_DRAG_LEAVE",
517
- Gdk::EventDND.new(:drag_leave).type.name)
518
- end
519
-
520
- def test_drag_motion
521
- assert_equal("GDK_DRAG_MOTION",
522
- Gdk::EventDND.new(:drag_motion).type.name)
523
- end
524
-
525
- def test_drag_status
526
- assert_equal("GDK_DRAG_STATUS",
527
- Gdk::EventDND.new(:drag_status).type.name)
528
- end
529
-
530
- def test_drop_start
531
- assert_equal("GDK_DROP_START",
532
- Gdk::EventDND.new(:drop_start).type.name)
533
- end
534
-
535
- def test_drop_finished
536
- assert_equal("GDK_DROP_FINISHED",
537
- Gdk::EventDND.new(:drop_finished).type.name)
538
- end
539
-
540
- def test_context
541
- assert_nothing_raised do
542
- @dnd.context
543
- end
544
- end
545
-
546
- def test_time
547
- assert_kind_of(Integer, @dnd.time)
548
- end
549
-
550
- def test_x_root
551
- assert_kind_of(Numeric, @dnd.x_root)
552
- end
553
-
554
- def test_y_root
555
- assert_kind_of(Numeric, @dnd.y_root)
556
- end
557
- end
558
-
559
- class TestProximity < self
560
- include TestAnyMethods
561
-
562
- def setup
563
- @proximity = Gdk::EventProximity.new(:proximity_in)
564
- end
565
-
566
- def event
567
- @proximity
568
- end
569
-
570
- def test_proximity_in
571
- assert_equal("GDK_PROXIMITY_IN",
572
- Gdk::EventProximity.new(:proximity_in).type.name)
573
- end
574
-
575
- def test_proximity_out
576
- assert_equal("GDK_PROXIMITY_OUT",
577
- Gdk::EventProximity.new(:proximity_out).type.name)
578
- end
579
-
580
- def test_time
581
- assert_kind_of(Integer, @proximity.time)
582
- end
583
-
584
- def test_device
585
- assert_nothing_raised do
586
- @proximity.device
587
- end
588
- end
589
- end
590
-
591
- class TestWindowState < self
592
- include TestAnyMethods
593
-
594
- def setup
595
- @window_state = Gdk::EventWindowState.new(:window_state)
596
- end
597
-
598
- def event
599
- @window_state
600
- end
601
-
602
- def test_changed_mask
603
- assert_nothing_raised do
604
- @window_state.changed_mask
605
- end
606
- end
607
-
608
- def test_new_window_state
609
- assert_nothing_raised do
610
- @window_state.new_window_state
611
- end
612
- end
613
- end
614
-
615
- class TestSetting < self
616
- include TestAnyMethods
617
-
618
- def setup
619
- @setting = Gdk::EventSetting.new(:setting)
620
- end
621
-
622
- def event
623
- @setting
624
- end
625
-
626
- def test_action
627
- assert_nothing_raised do
628
- @setting.action
629
- end
630
- end
631
-
632
- def test_name
633
- assert_nothing_raised do
634
- @setting.name
635
- end
636
- end
637
- end
638
-
639
- class TestOwnerChange < self
640
- def setup
641
- @owner_change = Gdk::EventOwnerChange.new(:owner_change)
642
- end
643
-
644
- def event
645
- @owner_change
646
- end
647
-
648
- def test_owner
649
- assert_nothing_raised do
650
- @owner_change.owner
651
- end
652
- end
653
-
654
- def test_reason
655
- assert_nothing_raised do
656
- @owner_change.reason
657
- end
658
- end
659
-
660
- def test_selection
661
- assert_nothing_raised do
662
- @owner_change.selection
663
- end
664
- end
665
-
666
- def test_time
667
- assert_kind_of(Integer, @owner_change.time)
668
- end
669
-
670
- def test_selection_time
671
- assert_kind_of(Integer, @owner_change.selection_time)
672
- end
673
- end
674
-
675
- class TestGrabBroken < self
676
- include TestAnyMethods
677
-
678
- def setup
679
- @grab_broken = Gdk::EventGrabBroken.new(:grab_broken)
680
- end
681
-
682
- def event
683
- @grab_broken
684
- end
685
-
686
- def test_keyboard
687
- assert_boolean(@grab_broken.keyboard?)
688
- end
689
-
690
- def test_implicit
691
- assert_boolean(@grab_broken.implicit?)
692
- end
693
-
694
- def test_grab_window
695
- assert_nil(@grab_broken.grab_window)
696
- end
697
- end
698
27
  end
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2014 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2014-2022 Ruby-GNOME Project Team
4
2
  #
5
3
  # This library is free software; you can redistribute it and/or
6
4
  # modify it under the terms of the GNU Lesser General Public
@@ -17,21 +15,6 @@
17
15
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
16
 
19
17
  class TestGdkPixbuf < Test::Unit::TestCase
20
- def test_window
21
- gdk_window = Gdk.default_root_window
22
- src_x = 0
23
- src_y = 0
24
- width = 290
25
- height = 200
26
-
27
- pixbuf = gdk_window.to_pixbuf(src_x,
28
- src_y,
29
- width,
30
- height)
31
- assert_equal([width, height],
32
- [pixbuf.width, pixbuf.height])
33
- end
34
-
35
18
  def test_surface
36
19
  width = 290
37
20
  height = 200