mireru 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +11 -0
  3. data/NEWS.md +12 -0
  4. data/README.md +15 -2
  5. data/lib/mireru/version.rb +1 -1
  6. data/lib/mireru/widget.rb +31 -64
  7. data/lib/mireru/widget/binary.rb +32 -0
  8. data/lib/mireru/widget/image.rb +17 -0
  9. data/lib/mireru/widget/pdf.rb +39 -0
  10. data/lib/mireru/widget/text.rb +32 -0
  11. data/lib/mireru/widget/thumbnail.rb +46 -0
  12. data/lib/mireru/widget/video.rb +49 -0
  13. data/lib/mireru/window.rb +1 -1
  14. data/license/lgpl-2.1.txt +502 -0
  15. data/mireru.gemspec +2 -1
  16. data/test/clutter-test-utils.rb +26 -0
  17. data/test/fixtures/sample.pdf +0 -0
  18. data/test/run-test.rb +2 -0
  19. data/test/test-widget.rb +0 -21
  20. data/test/{test-binary.rb → widget/test-binary.rb} +3 -3
  21. data/test/widget/test-pdf.rb +11 -0
  22. data/test/widget/test-text.rb +19 -0
  23. data/test/{test-thumbnail.rb → widget/test-thumbnail.rb} +3 -3
  24. data/test/{test-video.rb → widget/test-video.rb} +6 -2
  25. data/travis-before-script.sh +32 -0
  26. data/{middleman → website}/.gitignore +0 -0
  27. data/{middleman → website}/Gemfile +0 -0
  28. data/{middleman → website}/config.rb +0 -0
  29. data/{middleman → website}/data/links.yml +0 -0
  30. data/{middleman → website}/locales/en.yml +0 -0
  31. data/{middleman → website}/locales/ja.yml +0 -0
  32. data/{middleman → website}/source/layouts/layout.haml +0 -0
  33. data/{middleman → website}/source/localizable/index.haml +0 -0
  34. data/{middleman → website}/source/localizable/usage.html.erb +0 -0
  35. data/{middleman → website}/source/stylesheets/_config.scss +0 -0
  36. data/{middleman → website}/source/stylesheets/index.scss +0 -0
  37. data/{middleman → website}/source/stylesheets/vendor/normalize.css +0 -0
  38. metadata +51 -26
  39. data/LICENSE.txt +0 -22
  40. data/images/sorry.png +0 -0
  41. data/lib/mireru/binary.rb +0 -30
  42. data/lib/mireru/thumbnail.rb +0 -44
  43. data/lib/mireru/video.rb +0 -47
@@ -1,47 +0,0 @@
1
- require "clutter-gtk"
2
- require "clutter-gst"
3
- require "mireru/widget"
4
-
5
- module Mireru
6
- class Video
7
- class << self
8
- def create(file)
9
- clutter = ClutterGtk::Embed.new
10
- stage = clutter.stage
11
- stage.background_color = Clutter::Color.new(:black)
12
- video_texture = ClutterGst::VideoTexture.new
13
- stage.add_child(video_texture)
14
- video_texture.signal_connect("eos") do |_video_texture|
15
- _video_texture.progress = 0.0
16
- _video_texture.playing = true
17
- end
18
- video_texture.filename = file
19
- video_texture.playing = true
20
- define_events(stage, video_texture)
21
- clutter.signal_connect("destroy") do
22
- video_texture.playing = false
23
- end
24
- clutter
25
- end
26
-
27
- def define_events(stage, video_texture)
28
- stage.signal_connect("event") do |_stage, event|
29
- handled = false
30
-
31
- case event.type
32
- when Clutter::EventType::KEY_PRESS
33
- animation = nil
34
- case event.key_symbol
35
- when Clutter::Keys::KEY_space
36
- state = video_texture.playing?
37
- video_texture.playing = state ? false : true
38
- end
39
- handled = true
40
- end
41
-
42
- handled
43
- end
44
- end
45
- end
46
- end
47
- end