mireru 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +11 -0
- data/NEWS.md +12 -0
- data/README.md +15 -2
- data/lib/mireru/version.rb +1 -1
- data/lib/mireru/widget.rb +31 -64
- data/lib/mireru/widget/binary.rb +32 -0
- data/lib/mireru/widget/image.rb +17 -0
- data/lib/mireru/widget/pdf.rb +39 -0
- data/lib/mireru/widget/text.rb +32 -0
- data/lib/mireru/widget/thumbnail.rb +46 -0
- data/lib/mireru/widget/video.rb +49 -0
- data/lib/mireru/window.rb +1 -1
- data/license/lgpl-2.1.txt +502 -0
- data/mireru.gemspec +2 -1
- data/test/clutter-test-utils.rb +26 -0
- data/test/fixtures/sample.pdf +0 -0
- data/test/run-test.rb +2 -0
- data/test/test-widget.rb +0 -21
- data/test/{test-binary.rb → widget/test-binary.rb} +3 -3
- data/test/widget/test-pdf.rb +11 -0
- data/test/widget/test-text.rb +19 -0
- data/test/{test-thumbnail.rb → widget/test-thumbnail.rb} +3 -3
- data/test/{test-video.rb → widget/test-video.rb} +6 -2
- data/travis-before-script.sh +32 -0
- data/{middleman → website}/.gitignore +0 -0
- data/{middleman → website}/Gemfile +0 -0
- data/{middleman → website}/config.rb +0 -0
- data/{middleman → website}/data/links.yml +0 -0
- data/{middleman → website}/locales/en.yml +0 -0
- data/{middleman → website}/locales/ja.yml +0 -0
- data/{middleman → website}/source/layouts/layout.haml +0 -0
- data/{middleman → website}/source/localizable/index.haml +0 -0
- data/{middleman → website}/source/localizable/usage.html.erb +0 -0
- data/{middleman → website}/source/stylesheets/_config.scss +0 -0
- data/{middleman → website}/source/stylesheets/index.scss +0 -0
- data/{middleman → website}/source/stylesheets/vendor/normalize.css +0 -0
- metadata +51 -26
- data/LICENSE.txt +0 -22
- data/images/sorry.png +0 -0
- data/lib/mireru/binary.rb +0 -30
- data/lib/mireru/thumbnail.rb +0 -44
- data/lib/mireru/video.rb +0 -47
data/lib/mireru/video.rb
DELETED
@@ -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
|