rabbit 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/NEWS.en +87 -1
- data/NEWS.ja +87 -1
- data/README.en +3 -1
- data/README.ja +5 -3
- data/bin/rabbit +18 -0
- data/lib/rabbit/canvas.rb +4 -1
- data/lib/rabbit/element/base.rb +1 -1
- data/lib/rabbit/element/image.rb +4 -0
- data/lib/rabbit/element/text-renderer.rb +27 -9
- data/lib/rabbit/frame.rb +18 -3
- data/lib/rabbit/html/generator.rb +7 -2
- data/lib/rabbit/parser/pdf.rb +1 -1
- data/lib/rabbit/rabbit.rb +1 -1
- data/lib/rabbit/renderer/display/drawing-area-base.rb +6 -2
- data/lib/rabbit/theme/applier.rb +12 -0
- data/lib/rabbit/theme/default-slide/default-slide.rb +10 -2
- data/lib/rabbit/theme/entry.rb +40 -7
- data/lib/rabbit/theme/per-slide-background-color/per-slide-background-color.rb +18 -0
- data/lib/rabbit/theme/per-slide-background-color/property.rb +16 -0
- data/lib/rabbit/theme/per-slide-background-image/per-slide-background-image.rb +39 -0
- data/lib/rabbit/theme/per-slide-background-image/property.rb +16 -0
- data/lib/rabbit/theme/searcher.rb +21 -7
- data/lib/rabbit/theme/title-shadow/title-shadow.rb +1 -27
- data/po/en/rabbit.po +238 -189
- data/po/fr/rabbit.po +239 -189
- data/po/ja/rabbit.po +240 -195
- metadata +27 -3
data/NEWS.en
CHANGED
@@ -2,7 +2,93 @@
|
|
2
2
|
|
3
3
|
= NEWS.en
|
4
4
|
|
5
|
-
$Id: NEWS.en
|
5
|
+
$Id: NEWS.en 1358 2010-01-29 14:01:18Z kou $
|
6
|
+
|
7
|
+
== Changes 0.6.4 from 0.6.3: 2009-12-16
|
8
|
+
|
9
|
+
Rabbit had been included in Debian official packages! [Youhei
|
10
|
+
SASAKI]
|
11
|
+
|
12
|
+
=== Improvements
|
13
|
+
|
14
|
+
* Added --keep-above option: Rabbit is always shown top of
|
15
|
+
windows.
|
16
|
+
* Added --source-filename option that adds source link to
|
17
|
+
output HTML.
|
18
|
+
* Added a directory in source file into theme load path.
|
19
|
+
* Supported a single theme file in the same directory of
|
20
|
+
source file. [zunda]
|
21
|
+
* Improved PDF file detection.
|
22
|
+
|
23
|
+
==== Theme
|
24
|
+
|
25
|
+
* Added:
|
26
|
+
* per-slide-background-image:
|
27
|
+
Uses background image per slide. A background
|
28
|
+
image is specified by slide property:
|
29
|
+
|
30
|
+
= target slide
|
31
|
+
|
32
|
+
...
|
33
|
+
|
34
|
+
== properties
|
35
|
+
|
36
|
+
: background-image
|
37
|
+
my-picture.png
|
38
|
+
: background-image-ralative-height
|
39
|
+
95
|
40
|
+
|
41
|
+
Supported options are same as image options in slide.
|
42
|
+
Options name should be started with "background-image-".
|
43
|
+
|
44
|
+
e.g.: "background-image-relative-height" for
|
45
|
+
"relative-height" option.
|
46
|
+
|
47
|
+
* per-slide-background-color:
|
48
|
+
Uses background color per slide. A background color is
|
49
|
+
specified by slide property:
|
50
|
+
|
51
|
+
= target slide
|
52
|
+
|
53
|
+
...
|
54
|
+
|
55
|
+
== properties
|
56
|
+
|
57
|
+
: background-color
|
58
|
+
black
|
59
|
+
|
60
|
+
Color can be specified as color name, "black", or RGB
|
61
|
+
values "#RRGGBBAA".
|
62
|
+
|
63
|
+
* Changed:
|
64
|
+
* default-slide:
|
65
|
+
Supports title foreground color and shadow color
|
66
|
+
change per slide. They are specified by slide
|
67
|
+
property:
|
68
|
+
|
69
|
+
= target slide
|
70
|
+
|
71
|
+
...
|
72
|
+
|
73
|
+
== properties
|
74
|
+
|
75
|
+
: headline-color
|
76
|
+
red
|
77
|
+
: headline-shadow-color
|
78
|
+
gray
|
79
|
+
|
80
|
+
=== Fixes
|
81
|
+
|
82
|
+
* Fixed a bug that empty title with
|
83
|
+
@lightning_talk_as_large_as_possible = true crashes.
|
84
|
+
[kdmsnr]
|
85
|
+
* Added workaround for Ruby 1.8.7 p249.
|
86
|
+
|
87
|
+
=== Thanks
|
88
|
+
|
89
|
+
* zunda
|
90
|
+
* kdmsnr
|
91
|
+
* Youhei SASAKI
|
6
92
|
|
7
93
|
== Changes 0.6.3 from 0.6.2: 2009-12-16
|
8
94
|
|
data/NEWS.ja
CHANGED
@@ -2,7 +2,93 @@
|
|
2
2
|
|
3
3
|
= NEWS.ja
|
4
4
|
|
5
|
-
$Id: NEWS.ja
|
5
|
+
$Id: NEWS.ja 1358 2010-01-29 14:01:18Z kou $
|
6
|
+
|
7
|
+
== 0.6.3から0.6.4の変更点: 2010-01-29
|
8
|
+
|
9
|
+
Debianオフィシャルパッケージになりました![佐々木さん]
|
10
|
+
|
11
|
+
=== 改良
|
12
|
+
|
13
|
+
* 常にウィンドウを最全面に表示する--keep-aboveオプションの追加。
|
14
|
+
* HTML出力時にソースへのリンクを追加する--source-filename
|
15
|
+
オプションの追加。
|
16
|
+
* ソースと同じディレクトリがテーマの検索パスに含まれるよう
|
17
|
+
になった。
|
18
|
+
* ソースと同じディレクトリにテーマを置けるようになった。
|
19
|
+
[zundaさん]
|
20
|
+
* PDFファイルの検出率向上。
|
21
|
+
|
22
|
+
==== テーマ
|
23
|
+
|
24
|
+
* 追加
|
25
|
+
* per-slide-background-image:
|
26
|
+
スライド毎に背景画像を指定できるようになります。画像は
|
27
|
+
スライドプロパティで指定します。
|
28
|
+
|
29
|
+
= 対象となるスライド
|
30
|
+
|
31
|
+
...
|
32
|
+
|
33
|
+
== プロパティ
|
34
|
+
|
35
|
+
: background-image
|
36
|
+
my-picture.png
|
37
|
+
: background-image-ralative-height
|
38
|
+
95
|
39
|
+
|
40
|
+
スライド内で画像を指定する時と同じオプションを指定でき
|
41
|
+
ます。オプションを指定する場合はプロパティ名を
|
42
|
+
「background-image-」からはじめてください。
|
43
|
+
|
44
|
+
例えば、「relative-height」オプションを指定する場合は
|
45
|
+
「background-image-relative-height」スライドオプション
|
46
|
+
になります。
|
47
|
+
|
48
|
+
* per-slide-background-color:
|
49
|
+
スライド毎に背景色を指定できるようになります。色は
|
50
|
+
スライドプロパティで指定します。
|
51
|
+
|
52
|
+
= 対象となるスライド
|
53
|
+
|
54
|
+
...
|
55
|
+
|
56
|
+
== プロパティ
|
57
|
+
|
58
|
+
: background-color
|
59
|
+
black
|
60
|
+
|
61
|
+
色はテーマ内での指定方法と同様に「black」など色の名前
|
62
|
+
でも「#RRGGBBAA」というようにRGB値でも指定できます。
|
63
|
+
|
64
|
+
* 変更
|
65
|
+
* default-slide:
|
66
|
+
スライドプロパティでスライド毎にタイトルの前景色と影の
|
67
|
+
色を変更できるようになりました。
|
68
|
+
|
69
|
+
= 対象となるスライド
|
70
|
+
|
71
|
+
...
|
72
|
+
|
73
|
+
== プロパティ
|
74
|
+
|
75
|
+
: headline-color
|
76
|
+
red
|
77
|
+
: headline-shadow-color
|
78
|
+
gray
|
79
|
+
|
80
|
+
=== 修正
|
81
|
+
|
82
|
+
* タイトルがないときに
|
83
|
+
@lightning_talk_as_large_as_possible = trueを指定すると
|
84
|
+
落ちる問題を修正。[kdmsnrさん]
|
85
|
+
* Ruby 1.8.7 p249で動かない問題を修正。
|
86
|
+
|
87
|
+
=== 感謝
|
88
|
+
|
89
|
+
* zundaさん
|
90
|
+
* kdmsnrさん
|
91
|
+
* 佐々木さん
|
6
92
|
|
7
93
|
== 0.6.2から0.6.3の変更点: 2009-12-16
|
8
94
|
|
data/README.en
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
= README.en
|
4
4
|
|
5
|
-
$Id: README.en
|
5
|
+
$Id: README.en 1357 2010-01-29 13:50:12Z kou $
|
6
6
|
|
7
7
|
== Name
|
8
8
|
|
@@ -642,6 +642,7 @@ sample/theme-bench-en.rab.
|
|
642
642
|
Rabbit searches for themes by using ruby's $LOAD_PATH. If you make
|
643
643
|
a theme, place it into
|
644
644
|
((|PATH_OF_INCLUDED_IN_$LOAD_PATH/rabbit/theme/THEME_NAME/THEME_NAME.rb|))
|
645
|
+
or ((|DIRECTORY_OF_SOURCE_FILE/THEME_NAME.rb|)).
|
645
646
|
|
646
647
|
=== How do I write a theme?
|
647
648
|
|
@@ -836,3 +837,4 @@ page from XXX.rd.
|
|
836
837
|
* Kazuhiro NISHIYAMA: Reported a bug.
|
837
838
|
* Masaki Suketa: Reported bugs related Ruby 1.9.
|
838
839
|
* kdmsnr: Reported a bug.
|
840
|
+
* Youhei SASAKI: The official Debian package maintainer.
|
data/README.ja
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
= README.ja
|
4
4
|
|
5
|
-
$Id: README.ja
|
5
|
+
$Id: README.ja 1355 2010-01-29 13:48:57Z kou $
|
6
6
|
|
7
7
|
== 名前
|
8
8
|
|
@@ -661,8 +661,9 @@ inline verbatimとして記述します.詳しくはsample/rabbit.rdを見
|
|
661
661
|
=== 置き場所
|
662
662
|
|
663
663
|
テーマはrubyの$LOAD_PATHから検索されます.新しくテーマを作成
|
664
|
-
した場合は((|$LOAD_PATHに含まれているパス/rabbit/theme
|
665
|
-
|
664
|
+
した場合は((|$LOAD_PATHに含まれているパス/rabbit/theme/テーマ
|
665
|
+
名/テーマ名.rb|))あるいは((|ソースがあるディレクトリ/テーマ
|
666
|
+
名.rb|))に置いてください.
|
666
667
|
|
667
668
|
=== 書き方
|
668
669
|
|
@@ -871,3 +872,4 @@ XXX.rdから1ページに8枚のスライドが入ったPDF(XXX_multi.pdf)
|
|
871
872
|
* 西山さん: バグレポートしてくれました。
|
872
873
|
* 助田さん: Ruby 1.9関連のバグを報告してくれました。
|
873
874
|
* kdmsnrさん: バグレポートしてくれました。
|
875
|
+
* 佐々木さん: Debianパッケージのメンテナンスをしてくれます。
|
data/bin/rabbit
CHANGED
@@ -63,6 +63,8 @@ def parse_args(args=ARGV, logger=nil)
|
|
63
63
|
options.migemo_dictionary_name = "migemo-dict"
|
64
64
|
options.use_gl = false
|
65
65
|
options.show_native_window_id = false
|
66
|
+
options.keep_above = false
|
67
|
+
options.source_filename = nil
|
66
68
|
|
67
69
|
|
68
70
|
opts.banner = "#{opts.banner} [SOURCE_INFOS]"
|
@@ -209,6 +211,12 @@ def parse_args(args=ARGV, logger=nil)
|
|
209
211
|
options.rss_base_uri = uri
|
210
212
|
end
|
211
213
|
|
214
|
+
opts.on("--source-filename=FILENAME",
|
215
|
+
_("Specify source filenam as [FILENAME]."),
|
216
|
+
"(#{options.source_filename})") do |filename|
|
217
|
+
options.source_filename = filename
|
218
|
+
end
|
219
|
+
|
212
220
|
opts.category _("Print")
|
213
221
|
|
214
222
|
opts.on("-p", "--print",
|
@@ -495,6 +503,14 @@ def parse_args(args=ARGV, logger=nil)
|
|
495
503
|
options.use_gl = bool
|
496
504
|
end
|
497
505
|
|
506
|
+
opts.category _("Display")
|
507
|
+
|
508
|
+
opts.on("--[no-]keep-above",
|
509
|
+
_("Specify whether to keep above window."),
|
510
|
+
"(#{options.keep_above})") do |bool|
|
511
|
+
options.keep_above = bool
|
512
|
+
end
|
513
|
+
|
498
514
|
opts.category _("Others")
|
499
515
|
|
500
516
|
opts.on("--[no-]show-native-window-id",
|
@@ -557,6 +573,7 @@ def setup_image_info(target, options)
|
|
557
573
|
target.output_html = options.output_html
|
558
574
|
target.output_index_html = options.output_index_html
|
559
575
|
target.rss_base_uri = options.rss_base_uri
|
576
|
+
target.source_filename = options.source_filename
|
560
577
|
end
|
561
578
|
|
562
579
|
def setup_print_info(target, options)
|
@@ -684,6 +701,7 @@ def do_display(options, logger)
|
|
684
701
|
canvas = make_canvas(options, logger, Rabbit::Renderer::Display)
|
685
702
|
frame = Rabbit::Frame.new(logger, canvas)
|
686
703
|
frame.geometry = options.geometry
|
704
|
+
frame.force_keep_above = options.keep_above
|
687
705
|
setup_paper_size(canvas, options)
|
688
706
|
setup_image_info(canvas, options)
|
689
707
|
setup_print_info(canvas, options)
|
data/lib/rabbit/canvas.rb
CHANGED
@@ -130,6 +130,7 @@ module Rabbit
|
|
130
130
|
|
131
131
|
attr_accessor :saved_image_type, :rss_base_uri
|
132
132
|
attr_accessor :output_html, :output_index_html
|
133
|
+
attr_accessor :source_filename
|
133
134
|
attr_accessor :migemo_dictionary_search_path, :migemo_dictionary_name
|
134
135
|
attr_accessor :font_resolution_ratio
|
135
136
|
|
@@ -145,7 +146,8 @@ module Rabbit
|
|
145
146
|
@apply_theme_request_queue = []
|
146
147
|
@auto_redraw_timer = nil
|
147
148
|
@output_html = false
|
148
|
-
@rss_base_uri =
|
149
|
+
@rss_base_uri = nil
|
150
|
+
@source_filename = nil
|
149
151
|
@migemo_dictionary_search_path = []
|
150
152
|
@migemo_dictionary_name = nil
|
151
153
|
@limit_time = nil
|
@@ -387,6 +389,7 @@ module Rabbit
|
|
387
389
|
@output_index_html,
|
388
390
|
@rss_base_uri)
|
389
391
|
generator.pdf_filename = filename if /\.pdf/i =~ filename.to_s
|
392
|
+
generator.source_filename = @source_filename
|
390
393
|
generator.save
|
391
394
|
end
|
392
395
|
end
|
data/lib/rabbit/element/base.rb
CHANGED
@@ -459,7 +459,7 @@ module Rabbit
|
|
459
459
|
|
460
460
|
def _draw(canvas, x, y, w, h, simulation)
|
461
461
|
around_draw_procs = @around_draw_procs.dup
|
462
|
-
around_draw_procs.concat(slide.waited_draw_procs(self))
|
462
|
+
around_draw_procs.concat(slide.waited_draw_procs(self)) if slide
|
463
463
|
_draw_rec(canvas, x, y, w, h, simulation, around_draw_procs)
|
464
464
|
end
|
465
465
|
|
data/lib/rabbit/element/image.rb
CHANGED
@@ -112,6 +112,7 @@ module Rabbit
|
|
112
112
|
private
|
113
113
|
def setup_draw_parameters(prop)
|
114
114
|
@draw_parameters = {}
|
115
|
+
|
115
116
|
@draw_parameters[:reflect] = {} if true_value?(prop["reflect"])
|
116
117
|
[:ratio, :alpha].each do |key|
|
117
118
|
name = "reflect_#{key}"
|
@@ -120,6 +121,9 @@ module Rabbit
|
|
120
121
|
@draw_parameters[:reflect] ||= {}
|
121
122
|
@draw_parameters[:reflect][key] = Float(value)
|
122
123
|
end
|
124
|
+
|
125
|
+
alpha = prop["alpha"]
|
126
|
+
@draw_parameters[:alpha] = Float(alpha) if alpha
|
123
127
|
end
|
124
128
|
|
125
129
|
def draw_image(canvas, x, y, w, h, simulation)
|
@@ -180,6 +180,18 @@ module Rabbit
|
|
180
180
|
@original_width, @original_height = layout.pixel_size
|
181
181
|
@first_line_width = @original_width / layout.line_count
|
182
182
|
@first_line_height = @original_height / layout.line_count
|
183
|
+
setup_layout(layout, w)
|
184
|
+
width, height = layout.pixel_size
|
185
|
+
if layout.width != -1 and
|
186
|
+
(layout.alignment == Pango::Layout::ALIGN_CENTER or
|
187
|
+
layout.alignment == Pango::Layout::ALIGN_RIGHT)
|
188
|
+
width = layout.width / Pango::SCALE
|
189
|
+
end
|
190
|
+
@width, @height = width, height
|
191
|
+
@layout = layout
|
192
|
+
end
|
193
|
+
|
194
|
+
def setup_layout(layout, w)
|
183
195
|
if @wrap_mode
|
184
196
|
layout.set_width(w * Pango::SCALE)
|
185
197
|
layout.set_wrap(@wrap_mode)
|
@@ -191,16 +203,8 @@ module Rabbit
|
|
191
203
|
layout.set_spacing(@spacing)
|
192
204
|
layout.justify = @justify
|
193
205
|
layout.context_changed
|
194
|
-
width, height = layout.pixel_size
|
195
|
-
if layout.width != -1 and
|
196
|
-
(layout.alignment == Pango::Layout::ALIGN_CENTER or
|
197
|
-
layout.alignment == Pango::Layout::ALIGN_RIGHT)
|
198
|
-
width = layout.width / Pango::SCALE
|
199
|
-
end
|
200
|
-
@width, @height = width, height
|
201
|
-
@layout = layout
|
202
206
|
end
|
203
|
-
|
207
|
+
|
204
208
|
def markup(str)
|
205
209
|
t = str
|
206
210
|
@prop.each do |name, formatter|
|
@@ -234,6 +238,19 @@ module Rabbit
|
|
234
238
|
end
|
235
239
|
|
236
240
|
def draw_layout(canvas, x, y)
|
241
|
+
shadow_color = self["shadow-color"]
|
242
|
+
if shadow_color
|
243
|
+
shadow_foreground = Format::Foreground.new(shadow_color)
|
244
|
+
shadow_text = markup(shadow_foreground.format(text))
|
245
|
+
shadow_layout = canvas.make_layout(shadow_text)
|
246
|
+
setup_layout(shadow_layout, @layout.width / Pango::SCALE)
|
247
|
+
line_height = shadow_layout.pixel_size[1] / shadow_layout.line_count
|
248
|
+
shadow_x = self["shadow-x"] || (line_height * 0.08)
|
249
|
+
shadow_y = self["shadow-y"] || (line_height * 0.06)
|
250
|
+
canvas.draw_layout(shadow_layout, x + shadow_x, y + shadow_y,
|
251
|
+
shadow_color)
|
252
|
+
end
|
253
|
+
|
237
254
|
color = prop_get("foreground")
|
238
255
|
color = color.value if color
|
239
256
|
canvas.draw_layout(@layout, x, y, color)
|
@@ -241,6 +258,7 @@ module Rabbit
|
|
241
258
|
|
242
259
|
def dynamic_font_size_computation(proc_name, compute_max_size,
|
243
260
|
&make_params)
|
261
|
+
return if text.empty?
|
244
262
|
computed = false
|
245
263
|
min_width = nil
|
246
264
|
add_pre_draw_proc(proc_name) do |canvas, x, y, w, h, simulation|
|
data/lib/rabbit/frame.rb
CHANGED
@@ -27,12 +27,13 @@ module Rabbit
|
|
27
27
|
def_delegators(:@canvas, :rss_base_uri=, :use_gl?, :use_gl=)
|
28
28
|
|
29
29
|
attr_reader :window, :logger
|
30
|
-
attr_accessor :geometry
|
30
|
+
attr_accessor :geometry, :force_keep_above
|
31
31
|
|
32
32
|
def initialize(logger, canvas)
|
33
33
|
@logger = logger
|
34
34
|
@canvas = canvas
|
35
35
|
@geometry = nil
|
36
|
+
@force_keep_above = nil
|
36
37
|
end
|
37
38
|
|
38
39
|
def destroyed?
|
@@ -101,7 +102,11 @@ module Rabbit
|
|
101
102
|
@fullscreen = false
|
102
103
|
@iconify = false
|
103
104
|
@main_window = main_window
|
104
|
-
|
105
|
+
if @main_window
|
106
|
+
@window.keep_above = @force_keep_above unless @force_keep_above.nil?
|
107
|
+
else
|
108
|
+
@window.keep_above = true
|
109
|
+
end
|
105
110
|
@window.show
|
106
111
|
@canvas.post_init_gui
|
107
112
|
end
|
@@ -131,6 +136,15 @@ module Rabbit
|
|
131
136
|
set_window_signal_destroy
|
132
137
|
end
|
133
138
|
|
139
|
+
def update_keep_above(keep_above=nil)
|
140
|
+
if @main_window
|
141
|
+
keep_above = @force_keep_above unless @force_keep_above.nil?
|
142
|
+
@window.keep_above = keep_above unless keep_above.nil?
|
143
|
+
else
|
144
|
+
@window.keep_above = true
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
134
148
|
def set_window_signal_window_state_event
|
135
149
|
@window.signal_connect("window_state_event") do |widget, event|
|
136
150
|
if event.changed_mask.fullscreen?
|
@@ -139,7 +153,7 @@ module Rabbit
|
|
139
153
|
@window.keep_above = true
|
140
154
|
@canvas.fullscreened
|
141
155
|
else
|
142
|
-
|
156
|
+
update_keep_above(false)
|
143
157
|
@canvas.unfullscreened
|
144
158
|
end
|
145
159
|
@window.present
|
@@ -235,6 +249,7 @@ module Rabbit
|
|
235
249
|
def_null_methods(:icon, :icon=, :set_icon)
|
236
250
|
def_null_methods(:icon_list, :icon_list=, :set_icon_list)
|
237
251
|
def_null_methods(:update_title, :geometry, :geometry=)
|
252
|
+
def_null_methods(:force_keep_above, :force_keep_above=)
|
238
253
|
|
239
254
|
def_null_methods(:fullscreen?, :quit)
|
240
255
|
|
@@ -23,7 +23,7 @@ module Rabbit
|
|
23
23
|
erb = File.open(template_path) {|f| ERB.new(f.read, nil, "-")}
|
24
24
|
erb.def_method(self, "to_html", template_path)
|
25
25
|
|
26
|
-
attr_accessor :pdf_filename
|
26
|
+
attr_accessor :pdf_filename, :source_filename
|
27
27
|
def initialize(canvas, base_name, image_type,
|
28
28
|
output_html, output_index_html, rss_base_uri)
|
29
29
|
@canvas = canvas
|
@@ -38,6 +38,7 @@ module Rabbit
|
|
38
38
|
@output_html = output_html
|
39
39
|
@output_index_html = output_index_html
|
40
40
|
@pdf_filename = nil
|
41
|
+
@source_filename = nil
|
41
42
|
FileUtils.mkdir_p(to_filename_encoding(@base_dir))
|
42
43
|
end
|
43
44
|
|
@@ -292,7 +293,7 @@ module Rabbit
|
|
292
293
|
img
|
293
294
|
else
|
294
295
|
href = next_href(slide_number)
|
295
|
-
"<a href=\"#{href}\"
|
296
|
+
"<a href=\"#{href}\">#{img}</a>"
|
296
297
|
end
|
297
298
|
end
|
298
299
|
|
@@ -397,6 +398,10 @@ module Rabbit
|
|
397
398
|
result << HTML.a_link("<a href=\"#{h(@pdf_filename)}\">",
|
398
399
|
h(_("PDF")), false)
|
399
400
|
end
|
401
|
+
if @source_filename
|
402
|
+
result << HTML.a_link("<a href=\"#{h(@source_filename)}\">",
|
403
|
+
h(_("Source")), false)
|
404
|
+
end
|
400
405
|
unless result.empty?
|
401
406
|
result = "<div class=\"navi\">\n#{result}\n</div>"
|
402
407
|
end
|
data/lib/rabbit/parser/pdf.rb
CHANGED
data/lib/rabbit/rabbit.rb
CHANGED
@@ -300,8 +300,12 @@ module Rabbit
|
|
300
300
|
|
301
301
|
def draw_slide(slide, simulation, &block)
|
302
302
|
super do |*args|
|
303
|
-
block.call(*args)
|
304
|
-
magnify {block.call(*args)} unless simulation
|
303
|
+
# block.call(*args)
|
304
|
+
# magnify {block.call(*args)} unless simulation
|
305
|
+
## the below codes are workaround for
|
306
|
+
## http://redmine.ruby-lang.org/issues/show/2600
|
307
|
+
yield(*args)
|
308
|
+
magnify {yield(*args)} unless simulation
|
305
309
|
end
|
306
310
|
end
|
307
311
|
|
data/lib/rabbit/theme/applier.rb
CHANGED
@@ -608,6 +608,18 @@ module Rabbit
|
|
608
608
|
def entity(key)
|
609
609
|
Parser::Ext::Entity::TABLE[key]
|
610
610
|
end
|
611
|
+
|
612
|
+
def base_directory
|
613
|
+
canvas.full_path(".")
|
614
|
+
end
|
615
|
+
|
616
|
+
def theme_load_path
|
617
|
+
super + [base_directory].compact
|
618
|
+
end
|
619
|
+
|
620
|
+
def image_load_path
|
621
|
+
super + [base_directory].compact
|
622
|
+
end
|
611
623
|
end
|
612
624
|
end
|
613
625
|
end
|
@@ -3,11 +3,10 @@
|
|
3
3
|
match(Slide) do |slides|
|
4
4
|
slides.each do |slide|
|
5
5
|
slide.margin_set(@margin_top, @margin_right, @margin_bottom, @margin_left)
|
6
|
-
slide.headline.hide if slide.hide_title?
|
7
6
|
end
|
8
7
|
end
|
9
8
|
|
10
|
-
match(Slide, HeadLine) do
|
9
|
+
match(Slide, HeadLine) do |headlines|
|
11
10
|
name = "head-line"
|
12
11
|
|
13
12
|
delete_post_draw_proc_by_name(name)
|
@@ -21,6 +20,15 @@ match(Slide, HeadLine) do
|
|
21
20
|
end
|
22
21
|
[x, y, w, h]
|
23
22
|
end
|
23
|
+
|
24
|
+
headlines.each do |headline|
|
25
|
+
slide = headline.slide
|
26
|
+
headline.hide if slide.hide_title?
|
27
|
+
color = slide["headline-color"]
|
28
|
+
headline.prop_set("foreground", color) if color
|
29
|
+
shadow_color = slide["headline-shadow-color"]
|
30
|
+
headline["shadow-color"] = shadow_color if shadow_color
|
31
|
+
end
|
24
32
|
end
|
25
33
|
|
26
34
|
match(Slide, Body) do |bodies|
|
data/lib/rabbit/theme/entry.rb
CHANGED
@@ -47,11 +47,10 @@ module Rabbit
|
|
47
47
|
attr_reader :dependencies, :parameters
|
48
48
|
attr_accessor :logger
|
49
49
|
|
50
|
-
def initialize(theme_dir,
|
50
|
+
def initialize(theme_dir, name)
|
51
51
|
@logger = nil
|
52
52
|
@theme_dir = theme_dir
|
53
|
-
@
|
54
|
-
@name = File.basename(@theme_dir)
|
53
|
+
@name = name
|
55
54
|
@title = @name
|
56
55
|
@category = nil
|
57
56
|
@abstract = nil
|
@@ -68,7 +67,7 @@ module Rabbit
|
|
68
67
|
def property_editable?
|
69
68
|
File.writable?(property_file)
|
70
69
|
end
|
71
|
-
|
70
|
+
|
72
71
|
def theme_file
|
73
72
|
File.join(@theme_dir, "#{@name}.rb")
|
74
73
|
end
|
@@ -80,7 +79,7 @@ module Rabbit
|
|
80
79
|
def have_file?(target)
|
81
80
|
File.exist?(full_path(target))
|
82
81
|
end
|
83
|
-
|
82
|
+
|
84
83
|
def full_path(target)
|
85
84
|
File.join(@theme_dir, target)
|
86
85
|
end
|
@@ -90,7 +89,7 @@ module Rabbit
|
|
90
89
|
end
|
91
90
|
|
92
91
|
def image_theme?
|
93
|
-
|
92
|
+
false
|
94
93
|
end
|
95
94
|
|
96
95
|
def files
|
@@ -104,7 +103,7 @@ module Rabbit
|
|
104
103
|
def property_file
|
105
104
|
File.join(@theme_dir, "#{PROPERTY_BASE_NAME}.rb")
|
106
105
|
end
|
107
|
-
|
106
|
+
|
108
107
|
def parse_property
|
109
108
|
file = property_file
|
110
109
|
if File.exist?(file)
|
@@ -117,5 +116,39 @@ module Rabbit
|
|
117
116
|
end
|
118
117
|
end
|
119
118
|
end
|
119
|
+
|
120
|
+
class DirectoryEntry < Entry
|
121
|
+
def initialize(theme_dir)
|
122
|
+
super(theme_dir, File.basename(theme_dir))
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
class ImageDirectoryEntry < DirectoryEntry
|
127
|
+
def image_theme?
|
128
|
+
true
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
class SingleFileEntry < Entry
|
133
|
+
def initialize(theme_dir, name)
|
134
|
+
super(theme_dir, name)
|
135
|
+
end
|
136
|
+
|
137
|
+
def property_editable?
|
138
|
+
false
|
139
|
+
end
|
140
|
+
|
141
|
+
def files
|
142
|
+
[]
|
143
|
+
end
|
144
|
+
|
145
|
+
def have_file?(target)
|
146
|
+
name == target
|
147
|
+
end
|
148
|
+
|
149
|
+
private
|
150
|
+
def parse_property
|
151
|
+
end
|
152
|
+
end
|
120
153
|
end
|
121
154
|
end
|