rabbit 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/NEWS.en +40 -1
  2. data/NEWS.ja +40 -1
  3. data/data/rabbit/image/debian-images/bottom.png +0 -0
  4. data/data/rabbit/image/debian-images/debian-images.rb +2 -0
  5. data/data/rabbit/image/debian-images/debian-logo-pink.png +0 -0
  6. data/data/rabbit/image/debian-images/debian-logo.png +0 -0
  7. data/data/rabbit/image/debian-images/debian-whirl.png +0 -0
  8. data/data/rabbit/image/debian-images/item1.png +0 -0
  9. data/data/rabbit/image/debian-images/property.rb +4 -0
  10. data/data/rabbit/image/debian-images/top.png +0 -0
  11. data/data/rabbit/image/ranguba-images/ranguba-bar.png +0 -0
  12. data/data/rabbit/image/ranguba-images/ranguba-bar.svg +153 -0
  13. data/data/rabbit/image/ranguba-images/ranguba-images.rb +0 -0
  14. data/data/rabbit/image/ranguba-images/ranguba-item-mark-mini.png +0 -0
  15. data/data/rabbit/image/ranguba-images/ranguba-item-mark.png +0 -0
  16. data/data/rabbit/image/ranguba-images/ranguba-item-mark.svg +400 -0
  17. data/data/rabbit/image/ranguba-images/ranguba-mark.png +0 -0
  18. data/data/rabbit/image/ranguba-images/ranguba-mark.svg +587 -0
  19. data/lib/rabbit/canvas.rb +2 -2
  20. data/lib/rabbit/dependency-canvas.rb +2 -1
  21. data/lib/rabbit/element/slide.rb +1 -1
  22. data/lib/rabbit/info-window.rb +74 -25
  23. data/lib/rabbit/rabbit.rb +1 -1
  24. data/lib/rabbit/renderer/base.rb +0 -48
  25. data/lib/rabbit/renderer/display/base.rb +10 -1
  26. data/lib/rabbit/renderer/display/clutter-embed.rb +7 -8
  27. data/lib/rabbit/renderer/display/comment-drawing-area.rb +4 -4
  28. data/lib/rabbit/renderer/display/comment.rb +1 -1
  29. data/lib/rabbit/renderer/display/drawing-area-base.rb +14 -27
  30. data/lib/rabbit/renderer/display/drawing-area-primitive.rb +1 -1
  31. data/lib/rabbit/renderer/display/drawing-area-view-only.rb +20 -3
  32. data/lib/rabbit/renderer/display/graffiti.rb +1 -1
  33. data/lib/rabbit/renderer/display/hook-handler.rb +60 -0
  34. data/lib/rabbit/renderer/display/magnifier.rb +1 -1
  35. data/lib/rabbit/renderer/display/scroll-handler.rb +36 -0
  36. data/lib/rabbit/renderer/display/spotlight.rb +1 -1
  37. data/lib/rabbit/renderer/engine/cairo.rb +34 -7
  38. data/lib/rabbit/theme/applier.rb +13 -5
  39. data/lib/rabbit/theme/debian/debian.rb +253 -0
  40. data/lib/rabbit/theme/debian/property.rb +3 -0
  41. data/lib/rabbit/theme/default-slide/default-slide.rb +24 -5
  42. data/lib/rabbit/theme/ranguba/property.rb +3 -0
  43. data/lib/rabbit/theme/ranguba/ranguba.rb +230 -0
  44. data/lib/rabbit/theme/slide-logo/slide-logo.rb +22 -4
  45. data/lib/rabbit/theme/tag/tag.rb +4 -0
  46. data/misc/make-image-sample.rb +1 -0
  47. data/sample/info-window.png +0 -0
  48. metadata +27 -4
@@ -0,0 +1,3 @@
1
+ @category = N_("Theme")
2
+ @title = N_("Debian Theme")
3
+ @description = N_("Debian GNU/Linux Theme")
@@ -1,4 +1,9 @@
1
1
  @default_headline_line_color ||= "#ff9933"
2
+ @default_headline_line_params ||= {}
3
+ @default_headline_line_width ||= 1
4
+ unless defined?(@default_headline_line_expand)
5
+ @default_headline_line_expand = false
6
+ end
2
7
 
3
8
  match(Slide) do |slides|
4
9
  slides.each do |slide|
@@ -8,15 +13,29 @@ end
8
13
 
9
14
  match(Slide, HeadLine) do |headlines|
10
15
  name = "head-line"
11
-
16
+
12
17
  delete_post_draw_proc_by_name(name)
13
18
 
14
19
  space = @space / 2.0
15
- margin_with(:bottom => space * 3)
16
- add_post_draw_proc(name) do |text, canvas, x, y, w, h, simulation|
20
+ top_space = space + @default_headline_line_width / 2.0
21
+ margin_with(:bottom => top_space * 2)
22
+ add_post_draw_proc(name) do |headline, canvas, x, y, w, h, simulation|
17
23
  unless simulation
18
- canvas.draw_line(x, y + space, x + w, y + space,
19
- @default_headline_line_color)
24
+ if @default_headline_line_expand
25
+ line_x, line_w = 0, canvas.width
26
+ else
27
+ line_x, line_w = x, w
28
+ end
29
+ if @default_headline_line_params.respond_to?(:call)
30
+ params = @default_headline_line_params.call(headline, canvas,
31
+ line_x, y + top_space,
32
+ line_w, h - top_space)
33
+ else
34
+ params = @default_headline_line_params
35
+ end
36
+ canvas.draw_line(line_x, y + top_space, line_x + line_w, y + top_space,
37
+ @default_headline_line_color,
38
+ params.merge(:line_width => @default_headline_line_width))
20
39
  end
21
40
  [x, y, w, h]
22
41
  end
@@ -0,0 +1,3 @@
1
+ @category = N_("Theme")
2
+ @title = N_("Ranguba")
3
+ @description = N_("Ranguba theme")
@@ -0,0 +1,230 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ @font_family =
4
+ find_font_family("モトヤLマルベリ3等幅") ||
5
+ @font_family
6
+
7
+ rroonga_color = "#ff5151"
8
+ ranguba_color = "#f57900"
9
+ background_color = "#ffffff"
10
+
11
+ set_graffiti_color("#{rroonga_color}99")
12
+ set_graffiti_line_width(30)
13
+
14
+ set_progress_foreground(ranguba_color)
15
+ set_progress_background(background_color)
16
+
17
+ @title_slide_title_font_size = @x_large_font_size * 1.3
18
+ @title_slide_content_source_font_size = @x_small_font_size
19
+ @title_slide_date_font_size = @x_small_font_size
20
+
21
+ @default_emphasis_color = rroonga_color
22
+
23
+ add_image_path("ranguba-images")
24
+
25
+ @block_quote_image_background_alpha = 0.3
26
+
27
+ bar_line_width = @margin_bottom
28
+ bar = ImageLoader.new(find_file("ranguba-bar.png"))
29
+ bar.keep_ratio = true
30
+ bar.resize(bar.width, bar_line_width)
31
+ bar_pixbuf = bar.pixbuf.scale(bar.width, bar.height)
32
+ @default_headline_line_width = bar_line_width
33
+ @default_headline_line_params = Proc.new do |headline, canvas, x, y, w, h|
34
+ {
35
+ :line_cap => :square,
36
+ :pattern => {
37
+ :type => :pixbuf,
38
+ :pixbuf => bar_pixbuf,
39
+ :extend => :repeat,
40
+ :transformations => [
41
+ [:translate, -x, -(y + bar.height / 2)],
42
+ ],
43
+ },
44
+ }
45
+ end
46
+ @default_headline_line_expand = true
47
+
48
+ @description_term_line_color = ranguba_color
49
+ @default_description_item1_mark_color = ranguba_color
50
+ @default_block_quote_item1_mark_color = ranguba_color
51
+
52
+ @slide_number_uninstall = !print?
53
+
54
+ include_theme("default")
55
+
56
+ @icon_images = ["ranguba-mark.png"]
57
+ include_theme("icon")
58
+
59
+ @slide_logo_image = "ranguba-mark.png"
60
+ @slide_logo_position = Proc.new do |slide, canvas|
61
+ [slide.margin_left, slide.margin_top]
62
+ end
63
+ @slide_logo_height = Proc.new do |slide, canvas|
64
+ slide[0].first_line_height
65
+ end
66
+ include_theme("slide-logo")
67
+
68
+ unless print?
69
+ @image_slide_number_image ||= "mini-usa-taro.png"
70
+ @image_slide_number_show_text = true
71
+ include_theme("image-slide-number")
72
+ if canvas.allotted_time
73
+ @image_timer_image ||= "mini-kame-taro.png"
74
+ include_theme("image-timer")
75
+ end
76
+ end
77
+
78
+ @slide_footer_info_left_text ||= canvas.title.gsub(/\n+/, ' ')
79
+ @slide_footer_info_right_text ||= "Powered by Rabbit #{Rabbit::VERSION}"
80
+ include_theme("slide-footer-info")
81
+
82
+ match(TitleSlide, Author) do |authors|
83
+ authors.horizontal_centering = false
84
+ authors.align = :left
85
+
86
+ authors.add_post_draw_proc do |author, canvas, x, y, w, h, simulation|
87
+ cancel_height = author.height + author.margin_bottom
88
+ [x, y - cancel_height, w, h + cancel_height]
89
+ end
90
+ end
91
+
92
+ match(TitleSlide, Institution) do |institutions|
93
+ institutions.horizontal_centering = false
94
+ institutions.align = :right
95
+ end
96
+
97
+ match(TitleSlide, Date) do |dates|
98
+ dates.horizontal_centering = false
99
+ dates.align = :right
100
+ end
101
+
102
+ match(TitleSlide, ContentSource) do |sources|
103
+ sources.horizontal_centering = false
104
+ sources.align = :right
105
+
106
+ sources.margin_top = @space
107
+ sources.margin_bottom = 0
108
+ end
109
+
110
+ match(Slide, HeadLine) do |heads|
111
+ heads.horizontal_centering = true
112
+ end
113
+
114
+ match(Slide, Body) do |bodies|
115
+ bodies.vertical_centering = true
116
+ bodies.each do |body|
117
+ next if body.elements.all? {|element| element.is_a?(Image)}
118
+ next if body.elements.any? {|element| element.is_a?(BlockQuote)}
119
+ next if body.elements.any? {|element| element.is_a?(PreformattedBlock)}
120
+ next if body.elements.any? {|element| element.is_a?(Table)}
121
+ body.margin_left = canvas.width * 0.01
122
+ body.margin_right = canvas.width * 0.01
123
+ end
124
+ end
125
+
126
+ slide_body = [Slide, Body]
127
+ item_list_item = [ItemList, ItemListItem]
128
+
129
+ match(*(slide_body + (item_list_item * 1))) do |items|
130
+ name = "item1"
131
+
132
+ items.delete_pre_draw_proc_by_name(name)
133
+ items.delete_post_draw_proc_by_name(name)
134
+
135
+ draw_image_mark(items, "ranguba-item-mark.png", name)
136
+ end
137
+
138
+ match(*(slide_body + (item_list_item * 2))) do |items|
139
+ name = "item2"
140
+
141
+ items.delete_pre_draw_proc_by_name(name)
142
+ items.delete_post_draw_proc_by_name(name)
143
+
144
+ draw_image_mark(items, "ranguba-item-mark-mini.png", name)
145
+ end
146
+
147
+ # match(*(slide_body + (item_list_item * 3))) do |items|
148
+ # name = "item3"
149
+
150
+ # items.delete_pre_draw_proc_by_name(name)
151
+ # items.delete_post_draw_proc_by_name(name)
152
+
153
+ # draw_image_mark(items, "green-item.png", name)
154
+ # end
155
+
156
+ # enum_list_item = [EnumList, EnumListItem]
157
+
158
+ # match(*(slide_body + enum_list_item + item_list_item)) do |items|
159
+ # name = "enum-item1"
160
+
161
+ # items.delete_pre_draw_proc_by_name(name)
162
+ # items.delete_post_draw_proc_by_name(name)
163
+
164
+ # draw_image_mark(items, "red-item2.png", name)
165
+ # end
166
+
167
+ # match(*(slide_body + enum_list_item + (item_list_item * 2))) do |items|
168
+ # name = "enum-item2"
169
+
170
+ # items.delete_pre_draw_proc_by_name(name)
171
+ # items.delete_post_draw_proc_by_name(name)
172
+
173
+ # draw_image_mark(items, "green-item.png", name)
174
+ # end
175
+
176
+ desc_list_content = [DescriptionList, DescriptionListItem, DescriptionContent]
177
+
178
+ match(*(slide_body + desc_list_content + item_list_item)) do |items|
179
+ name = "description-item1"
180
+
181
+ items.delete_pre_draw_proc_by_name(name)
182
+ items.delete_post_draw_proc_by_name(name)
183
+
184
+ draw_image_mark(items, "ranguba-item-mark.png", name,
185
+ :indent => Proc.new {|item, loader| loader.width})
186
+ end
187
+
188
+ match(*(slide_body + desc_list_content + item_list_item * 2)) do |items|
189
+ name = "description-item2"
190
+
191
+ items.delete_pre_draw_proc_by_name(name)
192
+ items.delete_post_draw_proc_by_name(name)
193
+
194
+ draw_image_mark(items, "ranguba-item-mark-mini.png", name,
195
+ :indent => Proc.new {|item, loader| loader.width})
196
+ end
197
+
198
+ @lightning_talk_proc_name = "lightning-clear-code"
199
+ @lightning_talk_as_large_as_possible = true
200
+ include_theme("lightning-talk-toolkit")
201
+
202
+ match(Slide) do |slides|
203
+ slides.each_with_index do |slide, i|
204
+ if slide.lightning_talk?
205
+ slide.lightning_talk
206
+ end
207
+ end
208
+ end
209
+
210
+ # match(Slide, Body) do |bodies|
211
+ # bodies.each do |body|
212
+ # if body.elements.collect {|element| element.class} == [Paragraph]
213
+ # body.elements.each do |element|
214
+ # element.horizontal_centering = true
215
+ # if element.text.size > 50
216
+ # element.prop_set("size", @large_font_size)
217
+ # else
218
+ # element.prop_set("size", @x_large_font_size)
219
+ # end
220
+ # # element.as_large_as_possible("one-paragraph")
221
+ # end
222
+ # end
223
+ # body.margin_left *= 0.7
224
+ # body.margin_right *= 0.7
225
+ # end
226
+ # end
227
+
228
+ # match("**", Table, TableBody, TableRow, TableCell) do |cells|
229
+ # cells.horizontal_centering = true
230
+ # end
@@ -14,16 +14,34 @@ match(SlideElement) do
14
14
  break if @slide_logo_image_uninstall
15
15
 
16
16
  loader = ImageLoader.new(find_file(@slide_logo_image))
17
- loader.resize(@slide_logo_width, @slide_logo_height)
18
17
 
19
18
  add_pre_draw_proc(name) do |slide, canvas, x, y, w, h, simulation|
20
19
  unless simulation
21
- if @slide_logo_position == :right
20
+ slide_logo_width = @slide_logo_width
21
+ slide_logo_height = @slide_logo_height
22
+ if slide_logo_width.respond_to?(:call)
23
+ slide_logo_width = slide_logo_width.call(slide, canvas)
24
+ end
25
+ if slide_logo_height.respond_to?(:call)
26
+ slide_logo_height = slide_logo_height.call(slide, canvas)
27
+ end
28
+ loader.resize(slide_logo_width, slide_logo_height)
29
+
30
+ case @slide_logo_position
31
+ when :right
22
32
  logo_x = canvas.width - loader.width
23
- else
33
+ logo_y = 0
34
+ when :left
24
35
  logo_x = 0
36
+ logo_y = 0
37
+ else
38
+ if @slide_logo_position.respond_to?(:call)
39
+ logo_x, logo_y = @slide_logo_position.call(slide, canvas)
40
+ else
41
+ logo_x, logo_y = @slide_logo_position
42
+ end
25
43
  end
26
- loader.draw(canvas, logo_x, 0)
44
+ loader.draw(canvas, logo_x, logo_y)
27
45
  end
28
46
  [x, y, w, h]
29
47
  end
@@ -29,6 +29,10 @@ match("**", CustomTag) do |tags|
29
29
  find_block_element.call(tag).align = "right"
30
30
  when "x-large"
31
31
  find_markup_target.call(tag).prop_set("size", @x_large_font_size)
32
+ when "margin-top"
33
+ find_block_element.call(tag).margin_top += @space
34
+ when "margin-bottom"
35
+ find_block_element.call(tag).margin_bottom += @space
32
36
  end
33
37
  end
34
38
  end
@@ -47,6 +47,7 @@ ARGV.each do |rd|
47
47
  "blue-circle", "green-circle",
48
48
  "ruby-gnome2", "lightning-rabbit",
49
49
  "day-white", "night-black", "cozmixng",
50
+ "debian", "ranguba",
50
51
  ])
51
52
  end
52
53
  themes.each do |theme, option|
Binary file
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabbit
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 63
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 1
10
- version: 0.9.1
9
+ - 2
10
+ version: 0.9.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kouhei Sutou
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-10-25 00:00:00 +09:00
18
+ date: 2010-12-31 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -161,6 +161,14 @@ files:
161
161
  - data/rabbit/image/cozmixng-images/cozmixng-images.rb
162
162
  - data/rabbit/image/cozmixng-images/powered-by-cozmixng.png
163
163
  - data/rabbit/image/cozmixng-images/property.rb
164
+ - data/rabbit/image/debian-images/bottom.png
165
+ - data/rabbit/image/debian-images/debian-images.rb
166
+ - data/rabbit/image/debian-images/debian-logo-pink.png
167
+ - data/rabbit/image/debian-images/debian-logo.png
168
+ - data/rabbit/image/debian-images/debian-whirl.png
169
+ - data/rabbit/image/debian-images/item1.png
170
+ - data/rabbit/image/debian-images/property.rb
171
+ - data/rabbit/image/debian-images/top.png
164
172
  - data/rabbit/image/rabbit-images/blue-item.png
165
173
  - data/rabbit/image/rabbit-images/close-quote-blue.png
166
174
  - data/rabbit/image/rabbit-images/close-quote-brown.png
@@ -200,6 +208,14 @@ files:
200
208
  - data/rabbit/image/rabbit-images/usa-taro.png
201
209
  - data/rabbit/image/rabbit-images/usagi.png
202
210
  - data/rabbit/image/rabbit-images/yukiusa.png
211
+ - data/rabbit/image/ranguba-images/ranguba-bar.png
212
+ - data/rabbit/image/ranguba-images/ranguba-bar.svg
213
+ - data/rabbit/image/ranguba-images/ranguba-images.rb
214
+ - data/rabbit/image/ranguba-images/ranguba-item-mark-mini.png
215
+ - data/rabbit/image/ranguba-images/ranguba-item-mark.png
216
+ - data/rabbit/image/ranguba-images/ranguba-item-mark.svg
217
+ - data/rabbit/image/ranguba-images/ranguba-mark.png
218
+ - data/rabbit/image/ranguba-images/ranguba-mark.svg
203
219
  - data/rabbit/image/ruby-images/property.rb
204
220
  - data/rabbit/image/ruby-images/ruby-images.rb
205
221
  - data/rabbit/image/ruby-images/ruby-pink-circle-icon.png
@@ -363,12 +379,14 @@ files:
363
379
  - lib/rabbit/renderer/display/gesture.rb
364
380
  - lib/rabbit/renderer/display/gl.rb
365
381
  - lib/rabbit/renderer/display/graffiti.rb
382
+ - lib/rabbit/renderer/display/hook-handler.rb
366
383
  - lib/rabbit/renderer/display/info.rb
367
384
  - lib/rabbit/renderer/display/key-handler.rb
368
385
  - lib/rabbit/renderer/display/magnifier.rb
369
386
  - lib/rabbit/renderer/display/mask.rb
370
387
  - lib/rabbit/renderer/display/menu.rb
371
388
  - lib/rabbit/renderer/display/progress.rb
389
+ - lib/rabbit/renderer/display/scroll-handler.rb
372
390
  - lib/rabbit/renderer/display/search.rb
373
391
  - lib/rabbit/renderer/display/spotlight.rb
374
392
  - lib/rabbit/renderer/engine.rb
@@ -458,6 +476,8 @@ files:
458
476
  - lib/rabbit/theme/cozmixng/property.rb
459
477
  - lib/rabbit/theme/day-white/day-white.rb
460
478
  - lib/rabbit/theme/day-white/property.rb
479
+ - lib/rabbit/theme/debian/debian.rb
480
+ - lib/rabbit/theme/debian/property.rb
461
481
  - lib/rabbit/theme/default-block-quote/default-block-quote.rb
462
482
  - lib/rabbit/theme/default-block-quote/property.rb
463
483
  - lib/rabbit/theme/default-description/default-description.rb
@@ -551,6 +571,8 @@ files:
551
571
  - lib/rabbit/theme/rabbit-title-logo/rabbit-title-logo.rb
552
572
  - lib/rabbit/theme/rabbit/property.rb
553
573
  - lib/rabbit/theme/rabbit/rabbit.rb
574
+ - lib/rabbit/theme/ranguba/property.rb
575
+ - lib/rabbit/theme/ranguba/ranguba.rb
554
576
  - lib/rabbit/theme/red-frame/property.rb
555
577
  - lib/rabbit/theme/red-frame/red-frame.rb
556
578
  - lib/rabbit/theme/rotate-zoom-effect/property.rb
@@ -639,6 +661,7 @@ files:
639
661
  - sample/gl-sample.rd
640
662
  - sample/html_and_wiki.png
641
663
  - sample/html_and_wiki.svg
664
+ - sample/info-window.png
642
665
  - sample/join_cozmixng.png
643
666
  - sample/join_cozmixng.svg
644
667
  - sample/kof2005/gesture-flow.svg