rabbit 2.1.6 → 2.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/data/locale/ja/LC_MESSAGES/rabbit.mo +0 -0
  3. data/doc/_config.yml +2 -2
  4. data/doc/_layouts/en.html +1 -1
  5. data/doc/_layouts/ja.html +1 -1
  6. data/doc/_layouts/skeleton.html +22 -17
  7. data/doc/css/rabbit.css +62 -4
  8. data/doc/en/development.rd +2 -2
  9. data/doc/en/news.rd +65 -2
  10. data/doc/index.html.en +15 -15
  11. data/doc/index.html.ja +20 -20
  12. data/doc/ja/development.rd +2 -2
  13. data/doc/ja/index.rd +4 -4
  14. data/doc/ja/news.rd +61 -2
  15. data/lib/rabbit/command/rabbit.rb +7 -62
  16. data/lib/rabbit/cursor-manager.rb +29 -22
  17. data/lib/rabbit/element/index-slide.rb +1 -1
  18. data/lib/rabbit/error.rb +224 -0
  19. data/lib/rabbit/frame.rb +6 -10
  20. data/lib/rabbit/graffiti/config-dialog.rb +4 -4
  21. data/lib/rabbit/gtk.rb +173 -3
  22. data/lib/rabbit/image/pdf.rb +1 -3
  23. data/lib/rabbit/image/svg.rb +1 -3
  24. data/lib/rabbit/info-window.rb +37 -30
  25. data/lib/rabbit/keys.rb +70 -70
  26. data/lib/rabbit/logger/gui.rb +3 -10
  27. data/lib/rabbit/menu.rb +22 -8
  28. data/lib/rabbit/parser.rb +4 -2
  29. data/lib/rabbit/parser/base.rb +0 -6
  30. data/lib/rabbit/parser/image.rb +4 -0
  31. data/lib/rabbit/parser/markdown.rb +33 -7
  32. data/lib/rabbit/parser/markdown/converter.rb +15 -4
  33. data/lib/rabbit/parser/pdf.rb +4 -0
  34. data/lib/rabbit/parser/rd.rb +4 -0
  35. data/lib/rabbit/parser/rd/ext/block-verbatim.rb +47 -34
  36. data/lib/rabbit/parser/wiki.rb +4 -0
  37. data/lib/rabbit/parser/wiki/output.rb +42 -15
  38. data/lib/rabbit/progress.rb +1 -1
  39. data/lib/rabbit/rabbit.rb +8 -225
  40. data/lib/rabbit/renderer/base.rb +1 -1
  41. data/lib/rabbit/renderer/display/base.rb +10 -3
  42. data/lib/rabbit/renderer/display/button-handler.rb +3 -3
  43. data/lib/rabbit/renderer/display/clutter-embed.rb +9 -9
  44. data/lib/rabbit/renderer/display/drawing-area-base.rb +19 -24
  45. data/lib/rabbit/renderer/display/drawing-area-primitive.rb +22 -13
  46. data/lib/rabbit/renderer/display/drawing-area-view-only.rb +1 -1
  47. data/lib/rabbit/renderer/display/drawing-area.rb +1 -1
  48. data/lib/rabbit/renderer/display/gesture.rb +1 -1
  49. data/lib/rabbit/renderer/display/key-handler.rb +19 -19
  50. data/lib/rabbit/renderer/display/magnifier.rb +1 -1
  51. data/lib/rabbit/renderer/display/mask.rb +16 -21
  52. data/lib/rabbit/renderer/display/search.rb +1 -1
  53. data/lib/rabbit/renderer/display/spotlight.rb +1 -1
  54. data/lib/rabbit/renderer/engine.rb +1 -18
  55. data/lib/rabbit/renderer/engine/cairo.rb +0 -6
  56. data/lib/rabbit/renderer/pixmap.rb +1 -25
  57. data/lib/rabbit/renderer/pixmap/cairo.rb +1 -9
  58. data/lib/rabbit/renderer/print/cairo.rb +1 -10
  59. data/lib/rabbit/search-window.rb +2 -2
  60. data/lib/rabbit/source-generator/markdown.rb +1 -1
  61. data/lib/rabbit/stock.rb +3 -3
  62. data/lib/rabbit/task/slide.rb +1 -1
  63. data/lib/rabbit/theme/applier.rb +1 -1
  64. data/lib/rabbit/theme/clear-blue/clear-blue.rb +0 -8
  65. data/lib/rabbit/theme/image-slide-number/image-slide-number.rb +7 -5
  66. data/lib/rabbit/theme/image-timer/image-timer.rb +4 -1
  67. data/lib/rabbit/utils.rb +20 -3
  68. data/lib/rabbit/version.rb +1 -1
  69. data/lib/rabbit/video-window.rb +3 -3
  70. data/po/en/rabbit.edit.po +187 -199
  71. data/po/en/rabbit.po +58 -67
  72. data/po/fr/rabbit.edit.po +187 -199
  73. data/po/fr/rabbit.po +58 -67
  74. data/po/ja/rabbit.edit.po +204 -205
  75. data/po/ja/rabbit.po +64 -73
  76. data/rabbit.gemspec +2 -0
  77. data/sample/rabbit-en.md +2 -2
  78. data/sample/rabbit.md +2 -2
  79. data/test/image/test-dia.rb +2 -2
  80. data/test/image/test-eps.rb +2 -2
  81. data/test/parser/test-markdown.rb +71 -25
  82. data/test/parser/test-wiki.rb +73 -0
  83. data/test/rabbit-test-utils.rb +3 -7
  84. data/test/rabbit-test-utils/fixture.rb +24 -0
  85. data/test/rabbit-test-utils/parser.rb +48 -0
  86. data/test/source-generator/test-markdown.rb +1 -1
  87. metadata +37 -7
  88. data/README +0 -1
  89. data/doc/images/jp.png +0 -0
  90. data/doc/images/us.png +0 -0
  91. data/lib/rabbit/renderer/engine/gdk.rb +0 -230
  92. data/lib/rabbit/renderer/pixmap/gdk.rb +0 -29
@@ -12,12 +12,12 @@ Rabbitはテキスト形式でプレゼン資料を作成できるので、常
12
12
  ンテーションツールです。
13
13
 
14
14
  また、キーボードによるインターフェイスが充実していることもプ
15
- ログラマにはうれしい機能です。スライドをKeynoteや他のプレゼン
16
- テーションツールで作成しているユーザでも、スライド表示だけを
17
- Rabbitを使うことができます。見栄えの調整などスライド作成は
15
+ ログラマにはうれしい機能です。Keynoteや他のプレゼンテーションツールで
16
+ スライドを作成しているユーザでも、スライド表示にRabbitを使う
17
+ ことができます。具体的には、見栄えの調整などのスライド作成は
18
18
  GUIのプレゼンテーションツールで行い、スライド表示・操作のイン
19
19
  ターフェイスだけキーボード操作に強いRabbitを使う、というよう
20
- な使い分けができるということです。
20
+ に使い分けられます。
21
21
 
22
22
  さらに、Rabbitではスライドの見た目をRubyでカスタマイズできま
23
23
  す。プレゼンテーションの時もプログラムできるなんて、Rubyistに
@@ -4,6 +4,62 @@ title: お知らせ
4
4
  apply_data: false
5
5
  ---
6
6
  {% raw %}
7
+ == 2.1.7: 2015-09-05
8
+
9
+ Markdownでのノートマークアップ対応リリース。
10
+
11
+ === 改良
12
+
13
+ ==== rabbit
14
+
15
+ * GDKレンダリングエンジンを削除。(だいぶ前からcairoが必須になってい
16
+ てGDKレンダリングエンジンがなくても問題なくなっていたため。)
17
+ * GTK+ 3対応を進めた。(まだ完成していない。) [okkezさんがパッチ提供]
18
+ * 使われていない(({--server}))オプションを削除。
19
+ * Wikiマークアップ: 未サポートの書き方のときのエラーメッセージを改善。
20
+ * Markdownマークアップ: 1つの段落内に複数の画像を指定したときに「未
21
+ サポートである」とメッセージを出力するようにした。
22
+ [GitHub#71][Colin Deanさんが報告]
23
+ * Markdownマークアップ: ノートマークアップ対応。 [yoku0825さんが提案]
24
+
25
+ 書式は(('{::note}...{:/note}'))です。
26
+
27
+ 例:
28
+
29
+ 普通のテキスト{::note}ノート{:/note}普通のテキスト
30
+
31
+ ==== テーマ
32
+
33
+ * image-timer: メモリー使用量を削減。
34
+ * image-slide-number: メモリー使用量を削減。
35
+ * clear-blue: 引用ブロックでの最初の行のインデントをやめた。
36
+
37
+ ==== ドキュメント
38
+
39
+ * READMEをMarkdownでマークアップした。
40
+ [GitHub#72][Toshi MARUYAMAさんがパッチ提供]
41
+ * Rabbitの概要の説明を改良。 [GitHub#74][YU-TAYUさんがパッチ提供]
42
+
43
+ === 修正
44
+
45
+ ==== rabbit-slide
46
+
47
+ * 不正なMarkdownを出力する問題を修正。 [Matafumi Yokoyamaさん]
48
+
49
+ ==== ドキュメント
50
+
51
+ * サイドメニューが隠れている問題を修正。
52
+ [GitHub#75][YU-TAYUさんが報告]
53
+
54
+ === 感謝
55
+
56
+ * okkezさん
57
+ * Matafumi Yokoyamaさん
58
+ * Colin Deanさん
59
+ * Toshi MARUYAMAさん
60
+ * YU-TAYUさん
61
+ * yoku0825さん
62
+
7
63
  == 2.1.6: 2015-02-26
8
64
 
9
65
  2.1.5のバグフィックスリリース。
@@ -82,14 +138,17 @@ Markdownサポートを改善したリリース。
82
138
  ~~~ruby
83
139
  # Rubyコード
84
140
  ~~~
85
- * GitHub Flavor Markdownスタイルの例:
141
+ * GitHub Flavored Markdownスタイルの例:
86
142
  ```ruby
87
143
  # Rubyコード
88
144
  ```
89
145
  * Markdown: シンタックスハイライトの言語指定の属性名として
90
146
  (({language}))もサポート。
91
147
  * 例:
92
- # Rubyコード
148
+ # タイトル
149
+
150
+ def hello
151
+ end
93
152
  {: language="ruby"}
94
153
  * Markdown: blockdiagに対応。
95
154
  * 例:
@@ -48,10 +48,12 @@ module Rabbit
48
48
  require "rabbit/canvas"
49
49
  GC.enable
50
50
 
51
- succeeded = __send__("do_#{@options.action}")
52
-
53
- ::Rabbit.cleanup
54
-
51
+ application = ::Rabbit.application
52
+ succeeded = false
53
+ application.signal_connect("activate") do
54
+ succeeded = __send__("do_#{@options.action}")
55
+ end
56
+ application.run
55
57
  succeeded
56
58
  end
57
59
 
@@ -510,14 +512,6 @@ module Rabbit
510
512
  options.xmlrpc_port = port
511
513
  end
512
514
 
513
- parser.category _("Server")
514
-
515
- parser.on("--server",
516
- _("Specify whether to run as server."),
517
- "(#{options.server})") do
518
- options.action = :server
519
- end
520
-
521
515
  parser.category _("Public level")
522
516
 
523
517
  levels = Front::PublicLevel.constants.sort_by do |const|
@@ -818,11 +812,8 @@ module Rabbit
818
812
  end
819
813
 
820
814
  def do_save_as_image
821
- Renderer::Pixmap.init
822
- ::Rabbit.gui_init
823
-
824
815
  source = make_source
825
- canvas = make_canvas(Renderer::Pixmap)
816
+ canvas = make_canvas(Renderer::Pixmap::Cairo)
826
817
  setup_size(canvas)
827
818
  setup_image_info(canvas)
828
819
  setup_print_info(canvas)
@@ -843,7 +834,6 @@ module Rabbit
843
834
  display_init_options[:preferred_class_name] = "ClutterEmbed"
844
835
  end
845
836
  Renderer::Display.init(display_init_options)
846
- ::Rabbit.gui_init
847
837
 
848
838
  source = make_source
849
839
  canvas = make_canvas(Renderer::Display)
@@ -871,51 +861,6 @@ module Rabbit
871
861
  setup_soap(front) if @options.use_soap
872
862
  setup_xmlrpc(front) if @options.use_xmlrpc
873
863
 
874
- Gtk.main
875
-
876
- true
877
- end
878
-
879
- def do_server
880
- ::Rabbit.gui_init
881
-
882
- # GLib::Log.cancel_handler
883
- # GLib::Log.set_handler(nil, GLib::Log::LEVEL_ERROR)
884
-
885
- source = make_source
886
- canvas = make_canvas(Renderer::Pixmap)
887
- setup_size(canvas)
888
- setup_paper_size(canvas)
889
- setup_image_info(canvas)
890
- setup_print_info(canvas)
891
- setup_3d_info(canvas)
892
- apply_theme_if_need(canvas)
893
- parse(canvas, source)
894
-
895
- soap_server_thread = nil
896
- xmlrpc_server_thread = nil
897
-
898
- front = make_front(canvas)
899
- setup_druby(front) if @options.use_druby
900
- if @options.use_soap
901
- soap_server_thread = setup_soap(front)
902
- end
903
- if @options.use_xmlrpc
904
- xmlrpc_server_thread = setup_xmlrpc(front)
905
- end
906
-
907
- soap_server_thread.join if soap_server_thread
908
- xmlrpc_server_thread.join if xmlrpc_server_thread
909
- if @options.use_druby
910
- prev = trap(:INT) do
911
- @logger.info(_("going to shutdown..."))
912
- DRb.thread.exit
913
- @logger.info(_("DRb.thread done."))
914
- trap(:INT, prev)
915
- end
916
- DRb.thread.join
917
- end
918
-
919
864
  true
920
865
  end
921
866
 
@@ -1,18 +1,37 @@
1
- require 'rabbit/gtk'
2
-
3
- require 'rabbit/rabbit'
1
+ # Copyright (C) 2006-2015 Kouhei Sutou <kou@cozmixng.org>
2
+ #
3
+ # This program is free software; you can redistribute it and/or modify
4
+ # it under the terms of the GNU General Public License as published by
5
+ # the Free Software Foundation; either version 2 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License along
14
+ # with this program; if not, write to the Free Software Foundation, Inc.,
15
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
4
16
 
5
17
  module Rabbit
6
18
  class CursorManager
7
- @@blank_cursor = nil
19
+ @@cursors = nil
20
+
21
+ class << self
22
+ def cursors
23
+ @@cursors ||= {
24
+ :blank => Gdk::Cursor.new(:blank_cursor),
25
+ :pencil => Gdk::Cursor.new(:pencil),
26
+ :hand => Gdk::Cursor.new(:hand1),
27
+ }
28
+ end
29
+ end
8
30
 
9
31
  attr_accessor :current
10
32
  def initialize
11
33
  @stocks = {}
12
34
  @current = nil
13
- @blank_cursor = blank_cursor
14
- @pencil_cursor = Gdk::Cursor.new(Gdk::Cursor::PENCIL)
15
- @hand_cursor = Gdk::Cursor.new(Gdk::Cursor::HAND1)
16
35
  end
17
36
 
18
37
  def keep(name)
@@ -38,24 +57,12 @@ module Rabbit
38
57
  if type.nil?
39
58
  nil
40
59
  else
41
- name = "@#{type}_cursor"
42
- unless instance_variable_defined?(name)
60
+ cursor = self.class.cursors[type]
61
+ if cursor.nil?
43
62
  raise UnknownCursorTypeError.new(type)
44
63
  end
45
- instance_variable_get(name)
46
- end
47
- end
48
-
49
- def blank_cursor
50
- if @@blank_cursor.nil?
51
- source = Gdk::Pixmap.new(nil, 1, 1, 1)
52
- mask = Gdk::Pixmap.new(nil, 1, 1, 1)
53
- gc = Gdk::GC.new(source)
54
- fg = gc.foreground
55
- bg = gc.background
56
- @@blank_cursor = Gdk::Cursor.new(source, mask, fg, bg, 1, 1)
64
+ cursor
57
65
  end
58
- @@blank_cursor
59
66
  end
60
67
  end
61
68
  end
@@ -87,7 +87,7 @@ module Rabbit
87
87
 
88
88
  private
89
89
  def make_thumbnail_maker(canvas, width, height)
90
- new_canvas = Canvas.new(canvas.logger, Renderer::Pixmap)
90
+ new_canvas = Canvas.new(canvas.logger, Renderer::Pixmap::Cairo)
91
91
  new_canvas.width = width
92
92
  new_canvas.height = height
93
93
  new_canvas.pango_context = canvas.create_pango_context
@@ -0,0 +1,224 @@
1
+ # Copyright (C) 2004-2015 Kouhei Sutou <kou@cozmixng.org>
2
+ #
3
+ # This program is free software; you can redistribute it and/or modify
4
+ # it under the terms of the GNU General Public License as published by
5
+ # the Free Software Foundation; either version 2 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License along
14
+ # with this program; if not, write to the Free Software Foundation, Inc.,
15
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
+
17
+ module Rabbit
18
+ class Error < StandardError
19
+ include GetText
20
+ end
21
+
22
+ class ImageLoadError < Error
23
+ end
24
+
25
+ class ImageFileDoesNotExistError < ImageLoadError
26
+ attr_reader :filename
27
+ def initialize(filename)
28
+ @filename = filename
29
+ super(_("no such file: %s") % filename)
30
+ end
31
+ end
32
+
33
+ class ImageLoadWithExternalCommandError < ImageLoadError
34
+ attr_reader :type, :command
35
+ def initialize(type, command, additional_info=nil)
36
+ @type = type
37
+ @command = command
38
+ format =
39
+ _("can't handle %s because the following command " \
40
+ "can't be run successfully: %s")
41
+ msg = format % [@type, @command]
42
+ msg << "\n#{additional_info}" if additional_info
43
+ super(msg)
44
+ end
45
+ end
46
+
47
+ class EPSCanNotHandleError < ImageLoadWithExternalCommandError
48
+ def initialize(command, tried_commands)
49
+ format = _("tried gs commands: %s")
50
+ additional_info = format % tried_commands.inspect
51
+ super("EPS", command, additional_info)
52
+ end
53
+ end
54
+
55
+ class DiaCanNotHandleError < ImageLoadWithExternalCommandError
56
+ def initialize(command, tried_commands)
57
+ format = _("tried dia commands: %s")
58
+ additional_info = format % tried_commands.inspect
59
+ super("Dia", command, additional_info)
60
+ end
61
+ end
62
+
63
+ class GIMPCanNotHandleError < ImageLoadWithExternalCommandError
64
+ def initialize(command, tried_commands)
65
+ format = _("tried gimp commands: %s")
66
+ additional_info = format % tried_commands.inspect
67
+ super("GIMP", command, additional_info)
68
+ end
69
+ end
70
+
71
+ class TeXCanNotHandleError < ImageLoadWithExternalCommandError
72
+ def initialize(command, additional_info=nil)
73
+ super("TeX", command, additional_info)
74
+ end
75
+ end
76
+
77
+ class AAFigureCanNotHandleError < ImageLoadWithExternalCommandError
78
+ def initialize(command, additional_info=nil)
79
+ super("aafigure", command, additional_info)
80
+ end
81
+ end
82
+
83
+ class BlockDiagCanNotHandleError < ImageLoadWithExternalCommandError
84
+ def initialize(command, additional_info=nil)
85
+ super("blockdiag", command, additional_info)
86
+ end
87
+ end
88
+
89
+ class UnknownPropertyError < Error
90
+ attr_reader :name
91
+ def initialize(name)
92
+ @name = name
93
+ super(_("Unknown property: %s") % name)
94
+ end
95
+ end
96
+
97
+ class CantAllocateColorError < Error
98
+ attr_reader :color
99
+ def initialize(color)
100
+ @color = color
101
+ super(_("can't allocate color: %s"), color)
102
+ end
103
+ end
104
+
105
+ class SourceUnreadableError < Error
106
+ end
107
+
108
+ class NotExistError < SourceUnreadableError
109
+ attr_reader :name
110
+ def initialize(name)
111
+ @name = name
112
+ super(_("not exist: %s") % @name)
113
+ end
114
+ end
115
+
116
+ class NotFileError < SourceUnreadableError
117
+ attr_reader :name
118
+ def initialize(name)
119
+ @name = name
120
+ super(_("not a file: %s") % @name)
121
+ end
122
+ end
123
+
124
+ class NotReadableError < SourceUnreadableError
125
+ attr_reader :name
126
+ def initialize(name)
127
+ @name = name
128
+ super(_("can not be read: %s") % @name)
129
+ end
130
+ end
131
+
132
+ class ImmutableSourceTypeError < Error
133
+ attr_reader :source_type
134
+ def initialize(source_type)
135
+ @source_type = source_type
136
+ super(_("immutable source type: %s") % @source_type)
137
+ end
138
+ end
139
+
140
+ class ThemeExit < Error
141
+ def initialize(message=nil)
142
+ @have_message = !message.nil?
143
+ super
144
+ end
145
+
146
+ def have_message?
147
+ @have_message
148
+ end
149
+ end
150
+
151
+ class NotAvailableInterfaceError < Error
152
+ attr_reader :name
153
+ def initialize(name)
154
+ @name = name
155
+ super(_("not available interface: %s") % @name)
156
+ end
157
+ end
158
+
159
+ class CantFindHTMLTemplate < Error
160
+ attr_reader :name
161
+ def initialize(name)
162
+ @name = name
163
+ super(_("can't find HTML template: %s") % @name)
164
+ end
165
+ end
166
+
167
+ class CantFindThemeRDTemplate < Error
168
+ attr_reader :name
169
+ def initialize(name)
170
+ @name = name
171
+ super(_("can't find theme RD template: %s") % @name)
172
+ end
173
+ end
174
+
175
+ class InvalidMotionError < Error
176
+ attr_reader :motion
177
+ def initialize(motion)
178
+ @motion = motion
179
+ super(_("invalid motion: %s") % @motion)
180
+ end
181
+ end
182
+
183
+ class InvalidImageSizeError < Error
184
+ attr_reader :filename, :prop_name, :value
185
+ def initialize(filename, prop_name, value)
186
+ @filename = filename
187
+ @prop_name = prop_name
188
+ @value = value
189
+ params = {
190
+ :filename => filename,
191
+ :prop_name => prop_name,
192
+ :value => value,
193
+ }
194
+ super(_("invalid value of size property \"%{prop_name}\" " \
195
+ "of image \"%{filename}\": %{value}") % params)
196
+ end
197
+ end
198
+
199
+ class ParseFinish < Error
200
+ end
201
+
202
+ class ParseError < Error
203
+ end
204
+
205
+ class UnsupportedFormatError < Error
206
+ end
207
+
208
+ class ApplyFinish < Error
209
+ end
210
+
211
+ class UnknownCursorTypeError < Error
212
+ attr_reader :type
213
+ def intialize(type)
214
+ @type = type
215
+ super(_("unknown cursor type: %s") % @type)
216
+ end
217
+ end
218
+
219
+ class NoPrintSupportError < Error
220
+ def initialize
221
+ super(_("print isn't supported"))
222
+ end
223
+ end
224
+ end