thinreports 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CONTRIBUTING.md +2 -0
- data/.travis.yml +3 -3
- data/CHANGELOG.md +98 -1
- data/README.md +0 -9
- data/Rakefile +1 -2
- data/examples/character_spacing/character_spacing.tlf +293 -1
- data/examples/dynamic_image/dynamic_image.tlf +661 -1
- data/examples/dynamic_style/dynamic_style.rb +4 -4
- data/examples/dynamic_style/dynamic_style.tlf +1835 -1
- data/examples/dynamic_style/dynamic_style_in_list.tlf +344 -1
- data/examples/eudc/eudc.tlf +180 -1
- data/examples/hidden_shapes/hidden_shapes.tlf +449 -1
- data/examples/list_events/list_events.rb +1 -28
- data/examples/list_events/list_events.tlf +361 -0
- data/examples/list_manual_generation/list_manual_generation.tlf +132 -1
- data/examples/list_page_number/list_page_number.tlf +254 -1
- data/examples/page_number/page_number.tlf +215 -1
- data/examples/palleted_png/palleted_png.rb +2 -0
- data/examples/palleted_png/palleted_png.tlf +47 -1
- data/examples/password_setting/password_setting.tlf +45 -1
- data/examples/report_callbacks/report_callbacks.rb +1 -18
- data/examples/report_callbacks/report_callbacks.tlf +147 -1
- data/examples/single_line_tblock/single_line_tblock.tlf +170 -1
- data/examples/tblock_overflow/tblock_overflow.tlf +538 -1
- data/examples/tblock_styles/font_size.tlf +383 -1
- data/examples/tblock_styles/tblock_styles.tlf +889 -1
- data/examples/text_align/text_align.tlf +241 -1
- data/examples/typeB_page_size/B4_ISO.tlf +45 -1
- data/examples/typeB_page_size/B4_JIS.tlf +45 -1
- data/examples/word_wrap/word_wrap.tlf +297 -1
- data/lib/thinreports.rb +0 -1
- data/lib/thinreports/config.rb +3 -0
- data/lib/thinreports/core/errors.rb +0 -3
- data/lib/thinreports/core/format/base.rb +4 -4
- data/lib/thinreports/core/shape.rb +1 -9
- data/lib/thinreports/core/shape/basic.rb +3 -3
- data/lib/thinreports/core/shape/basic/block_format.rb +1 -1
- data/lib/thinreports/core/shape/basic/format.rb +2 -14
- data/lib/thinreports/core/shape/basic/internal.rb +2 -2
- data/lib/thinreports/core/shape/image_block.rb +3 -3
- data/lib/thinreports/core/shape/image_block/format.rb +0 -2
- data/lib/thinreports/core/shape/image_block/internal.rb +1 -1
- data/lib/thinreports/core/shape/list.rb +3 -7
- data/lib/thinreports/core/shape/list/format.rb +37 -24
- data/lib/thinreports/core/shape/list/manager.rb +1 -36
- data/lib/thinreports/core/shape/list/page.rb +0 -15
- data/lib/thinreports/core/shape/list/page_state.rb +1 -1
- data/lib/thinreports/core/shape/list/section_format.rb +14 -12
- data/lib/thinreports/core/shape/list/section_internal.rb +4 -7
- data/lib/thinreports/core/shape/manager/format.rb +0 -2
- data/lib/thinreports/core/shape/manager/internal.rb +1 -1
- data/lib/thinreports/core/shape/page_number.rb +1 -1
- data/lib/thinreports/core/shape/page_number/format.rb +9 -6
- data/lib/thinreports/core/shape/page_number/interface.rb +1 -1
- data/lib/thinreports/core/shape/page_number/internal.rb +2 -6
- data/lib/thinreports/core/shape/style/base.rb +11 -13
- data/lib/thinreports/core/shape/style/basic.rb +4 -4
- data/lib/thinreports/core/shape/style/graphic.rb +4 -10
- data/lib/thinreports/core/shape/style/text.rb +36 -69
- data/lib/thinreports/core/shape/text.rb +3 -3
- data/lib/thinreports/core/shape/text/format.rb +3 -13
- data/lib/thinreports/core/shape/text/internal.rb +2 -2
- data/lib/thinreports/core/shape/text_block.rb +3 -3
- data/lib/thinreports/core/shape/text_block/format.rb +9 -6
- data/lib/thinreports/core/shape/text_block/interface.rb +7 -7
- data/lib/thinreports/core/shape/text_block/internal.rb +1 -1
- data/lib/thinreports/generator/pdf.rb +0 -1
- data/lib/thinreports/generator/pdf/document.rb +2 -2
- data/lib/thinreports/generator/pdf/document/draw_shape.rb +25 -51
- data/lib/thinreports/generator/pdf/document/draw_template_items.rb +66 -0
- data/lib/thinreports/generator/pdf/document/font.rb +3 -8
- data/lib/thinreports/generator/pdf/document/graphics/attributes.rb +97 -77
- data/lib/thinreports/generator/pdf/document/graphics/basic.rb +18 -13
- data/lib/thinreports/generator/pdf/document/graphics/image.rb +17 -12
- data/lib/thinreports/generator/pdf/document/page.rb +1 -1
- data/lib/thinreports/generator/pdf/drawer/list.rb +5 -1
- data/lib/thinreports/generator/pdf/drawer/list_section.rb +1 -4
- data/lib/thinreports/generator/pdf/drawer/page.rb +9 -9
- data/lib/thinreports/layout.rb +3 -3
- data/lib/thinreports/layout/base.rb +0 -16
- data/lib/thinreports/layout/format.rb +38 -57
- data/lib/thinreports/layout/legacy_schema.rb +354 -0
- data/lib/thinreports/layout/version.rb +1 -1
- data/lib/thinreports/report.rb +0 -1
- data/lib/thinreports/report/base.rb +3 -17
- data/lib/thinreports/report/internal.rb +13 -55
- data/lib/thinreports/report/page.rb +1 -1
- data/lib/thinreports/version.rb +1 -1
- data/test/data/legacy_layout/all-items.tlf +1 -0
- data/test/schema_helper.rb +121 -0
- data/test/test_helper.rb +13 -50
- data/test/unit/core/format/test_base.rb +35 -31
- data/test/unit/core/shape/base/test_internal.rb +1 -1
- data/test/unit/core/shape/basic/test_block_format.rb +23 -0
- data/test/unit/core/shape/basic/{test_basic_interface.rb → test_block_interface.rb} +1 -1
- data/test/unit/core/shape/basic/{test_basic_internal.rb → test_block_internal.rb} +4 -7
- data/test/unit/core/shape/basic/test_format.rb +25 -47
- data/test/unit/core/shape/basic/test_interface.rb +5 -5
- data/test/unit/core/shape/basic/test_internal.rb +6 -11
- data/test/unit/core/shape/image_block/test_interface.rb +5 -5
- data/test/unit/core/shape/image_block/test_internal.rb +2 -2
- data/test/unit/core/shape/list/test_format.rb +86 -44
- data/test/unit/core/shape/list/test_manager.rb +10 -65
- data/test/unit/core/shape/list/test_page.rb +10 -61
- data/test/unit/core/shape/list/test_page_state.rb +1 -1
- data/test/unit/core/shape/list/test_section_format.rb +19 -28
- data/test/unit/core/shape/list/test_section_interface.rb +14 -6
- data/test/unit/core/shape/list/test_section_internal.rb +17 -23
- data/test/unit/core/shape/manager/test_format.rb +1 -1
- data/test/unit/core/shape/manager/test_internal.rb +59 -98
- data/test/unit/core/shape/manager/test_target.rb +21 -30
- data/test/unit/core/shape/page_number/test_format.rb +34 -52
- data/test/unit/core/shape/page_number/test_interface.rb +1 -1
- data/test/unit/core/shape/page_number/test_internal.rb +2 -2
- data/test/unit/core/shape/styles/test_base.rb +16 -41
- data/test/unit/core/shape/styles/test_basic.rb +7 -7
- data/test/unit/core/shape/styles/test_graphic.rb +27 -32
- data/test/unit/core/shape/styles/test_text.rb +68 -311
- data/test/unit/core/shape/text/test_format.rb +30 -59
- data/test/unit/core/shape/text/test_internal.rb +5 -5
- data/test/unit/core/shape/text_block/formatter/test_datetime.rb +13 -13
- data/test/unit/core/shape/text_block/test_format.rb +145 -146
- data/test/unit/core/shape/text_block/test_interface.rb +9 -9
- data/test/unit/core/shape/text_block/test_internal.rb +9 -9
- data/test/unit/core/test_shape.rb +19 -31
- data/test/unit/generator/pdf/document/graphics/test_attributes.rb +112 -122
- data/test/unit/generator/pdf/document/graphics/test_basic.rb +45 -0
- data/test/unit/generator/pdf/document/graphics/test_image.rb +5 -5
- data/test/unit/generator/pdf/document/test_font.rb +4 -10
- data/test/unit/generator/pdf/document/test_page.rb +13 -11
- data/test/unit/generator/pdf/document/test_parse_color.rb +5 -5
- data/test/unit/generator/test_base.rb +5 -5
- data/test/unit/generator/test_configuration.rb +4 -8
- data/test/unit/generator/test_pdf.rb +3 -2
- data/test/unit/layout/test_base.rb +16 -22
- data/test/unit/layout/test_format.rb +66 -86
- data/test/unit/layout/test_legacy_schema.rb +587 -0
- data/test/unit/layout/test_version.rb +20 -20
- data/test/unit/report/test_base.rb +32 -45
- data/test/unit/report/test_internal.rb +43 -99
- data/test/unit/test_config.rb +4 -2
- data/test/unit/test_layout.rb +1 -1
- metadata +20 -48
- data/examples/list_events/list_events_0_7_7.tlf +0 -1
- data/examples/list_events/list_events_0_8.tlf +0 -1
- data/lib/thinreports/core/events.rb +0 -69
- data/lib/thinreports/core/format/builder.rb +0 -62
- data/lib/thinreports/core/shape/list/configuration.rb +0 -54
- data/lib/thinreports/core/shape/list/events.rb +0 -47
- data/lib/thinreports/core/shape/list/store.rb +0 -33
- data/lib/thinreports/generator/pdf/configuration.rb +0 -33
- data/lib/thinreports/generator/pdf/document/parse_svg.rb +0 -104
- data/lib/thinreports/layout/configuration.rb +0 -29
- data/test/data/layout_block.tlf +0 -1
- data/test/data/layout_list.tlf +0 -1
- data/test/data/layout_list_noheader.tlf +0 -1
- data/test/data/layout_text1.tlf +0 -1
- data/test/data/layout_text2.tlf +0 -1
- data/test/unit/core/format/test_builder.rb +0 -109
- data/test/unit/core/shape/basic/test_basic_format.rb +0 -30
- data/test/unit/core/shape/image_block/test_format.rb +0 -58
- data/test/unit/core/shape/list/test_configuration.rb +0 -69
- data/test/unit/core/shape/list/test_events.rb +0 -36
- data/test/unit/core/shape/list/test_store.rb +0 -41
- data/test/unit/core/test_events.rb +0 -93
- data/test/unit/generator/pdf/document/test_draw_shape.rb +0 -44
- data/test/unit/generator/pdf/test_configuration.rb +0 -31
- data/test/unit/layout/test_configuration.rb +0 -21
- data/test/unit/report/test_events.rb +0 -22
data/lib/thinreports.rb
CHANGED
@@ -8,7 +8,6 @@ require 'thinreports/version'
|
|
8
8
|
require 'thinreports/config'
|
9
9
|
require 'thinreports/core/utils'
|
10
10
|
require 'thinreports/core/errors'
|
11
|
-
require 'thinreports/core/events'
|
12
11
|
require 'thinreports/core/format/base'
|
13
12
|
require 'thinreports/core/shape'
|
14
13
|
require 'thinreports/core/utils'
|
data/lib/thinreports/config.rb
CHANGED
@@ -43,7 +43,10 @@ module Thinreports
|
|
43
43
|
# config.convert_palleted_transparency_png = true
|
44
44
|
# config.convert_palleted_transparency_png = false # default
|
45
45
|
# @see https://github.com/thinreports/thinreports-generator/pull/32
|
46
|
+
# @deprecated convert_palleted_transparency_png is deprecated and will be removed in thinreports-generator 1.0 with no replacement
|
46
47
|
def convert_palleted_transparency_png=(enable)
|
48
|
+
warn '[DEPRECATION] convert_palleted_transparency_png is deprecated' \
|
49
|
+
' and will be removed in thinreports-generator 1.0 with no replacement.' if enable
|
47
50
|
@convert_palleted_transparency_png = enable
|
48
51
|
end
|
49
52
|
|
@@ -1,13 +1,9 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
require 'thinreports/core/format/builder'
|
3
|
-
|
4
2
|
module Thinreports::Core
|
5
3
|
module Format
|
6
4
|
|
7
5
|
# @abstract
|
8
6
|
class Base
|
9
|
-
extend Format::Builder
|
10
|
-
|
11
7
|
class << self
|
12
8
|
def config_reader(*configs, &block)
|
13
9
|
each_configs(*configs) do |m, location|
|
@@ -60,6 +56,10 @@ module Thinreports::Core
|
|
60
56
|
block.call(self) if ::Kernel.block_given?
|
61
57
|
end
|
62
58
|
|
59
|
+
def attributes
|
60
|
+
@config
|
61
|
+
end
|
62
|
+
|
63
63
|
private
|
64
64
|
|
65
65
|
def find(*keys)
|
@@ -12,15 +12,7 @@ module Thinreports
|
|
12
12
|
find_by_type(type)::Format
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
klass = find_by_type(type)
|
17
|
-
unless klass.const_defined?(:Configuration)
|
18
|
-
raise Thinreports::Errors::NoConfigurationFound, type
|
19
|
-
end
|
20
|
-
klass.const_get(:Configuration)
|
21
|
-
end
|
22
|
-
|
23
|
-
module_function :Interface, :Format, :Configuration
|
15
|
+
module_function :Interface, :Format
|
24
16
|
|
25
17
|
def self.find_by_type(type)
|
26
18
|
case type
|
@@ -7,20 +7,8 @@ module Thinreports
|
|
7
7
|
include Utils
|
8
8
|
|
9
9
|
config_reader :type, :id
|
10
|
-
config_reader
|
11
|
-
|
12
|
-
|
13
|
-
config_checker 'true', :display
|
14
|
-
|
15
|
-
class << self
|
16
|
-
private
|
17
|
-
|
18
|
-
# @param [Hash] raw_format
|
19
|
-
# @return [Thinreports::Core::Shape::Basic::Format]
|
20
|
-
def build_internal(raw_format)
|
21
|
-
new(raw_format)
|
22
|
-
end
|
23
|
-
end
|
10
|
+
config_reader :style
|
11
|
+
config_checker true, :display
|
24
12
|
end
|
25
13
|
|
26
14
|
end
|
@@ -5,14 +5,14 @@ module Thinreports
|
|
5
5
|
|
6
6
|
class Basic::Internal < Base::Internal
|
7
7
|
# Delegate to Format's methods
|
8
|
-
format_delegators :id, :
|
8
|
+
format_delegators :id, :type
|
9
9
|
|
10
10
|
def style
|
11
11
|
@style ||= Style::Graphic.new(format)
|
12
12
|
end
|
13
13
|
|
14
14
|
def type_of?(type_name)
|
15
|
-
[
|
15
|
+
[:basic, self.type].include?(type_name)
|
16
16
|
end
|
17
17
|
|
18
18
|
def identifier
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
module Thinreports
|
4
4
|
module Core::Shape
|
5
|
-
|
5
|
+
|
6
6
|
module List
|
7
|
-
TYPE_NAME = '
|
7
|
+
TYPE_NAME = 'list'
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
@@ -19,7 +19,3 @@ require 'thinreports/core/shape/list/page_state'
|
|
19
19
|
require 'thinreports/core/shape/list/section_format'
|
20
20
|
require 'thinreports/core/shape/list/section_interface'
|
21
21
|
require 'thinreports/core/shape/list/section_internal'
|
22
|
-
|
23
|
-
require 'thinreports/core/shape/list/store'
|
24
|
-
require 'thinreports/core/shape/list/events'
|
25
|
-
require 'thinreports/core/shape/list/configuration'
|
@@ -5,26 +5,34 @@ module Thinreports
|
|
5
5
|
|
6
6
|
class List::Format < Basic::Format
|
7
7
|
config_reader height: %w( content-height )
|
8
|
-
config_checker
|
8
|
+
config_checker true, auto_page_break: %w( auto-page-break )
|
9
9
|
|
10
|
+
# @deprecated
|
10
11
|
config_reader :header,
|
11
12
|
:detail,
|
12
13
|
:footer
|
14
|
+
# @deprecated
|
13
15
|
config_reader page_footer: %w( page-footer )
|
14
16
|
|
15
|
-
config_checker
|
16
|
-
config_checker
|
17
|
-
config_checker
|
17
|
+
config_checker true, has_header: %w( header enabled )
|
18
|
+
config_checker true, has_footer: %w( footer enabled )
|
19
|
+
config_checker true, has_page_footer: %w( page-footer enabled )
|
18
20
|
|
19
21
|
config_reader page_footer_height: %w( page-footer height )
|
20
22
|
config_reader footer_height: %w( footer height )
|
21
23
|
config_reader header_height: %w( header height )
|
22
24
|
config_reader detail_height: %w( detail height )
|
23
25
|
|
24
|
-
|
26
|
+
attr_reader :sections
|
27
|
+
|
28
|
+
def initialize(*)
|
29
|
+
super
|
30
|
+
initialize_sections
|
31
|
+
end
|
25
32
|
|
26
33
|
# @param [Symbol] section_name
|
27
34
|
# @return [Hash]
|
35
|
+
# @deprecated
|
28
36
|
def section(section_name)
|
29
37
|
__send__(section_name)
|
30
38
|
end
|
@@ -41,29 +49,34 @@ module Thinreports
|
|
41
49
|
has_section?(section_name) ? __send__(:"#{section_name}_height") : 0
|
42
50
|
end
|
43
51
|
|
44
|
-
|
52
|
+
# @param [:detai, :header, :page_footer, :footer] section_name
|
53
|
+
# @return [Numeric]
|
54
|
+
def section_base_position_top(section_name)
|
55
|
+
section = @sections[section_name]
|
56
|
+
return 0 unless has_section?(section_name)
|
45
57
|
|
46
|
-
|
58
|
+
top = section.relative_top
|
47
59
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
build_section(:footer, f) if f.has_footer?
|
56
|
-
build_section(:page_footer, f) if f.has_page_footer?
|
57
|
-
end
|
60
|
+
case section_name
|
61
|
+
when :page_footer
|
62
|
+
top - section_height(:detail)
|
63
|
+
when :footer
|
64
|
+
top - section_height(:detail) - section_height(:page_footer)
|
65
|
+
else
|
66
|
+
top
|
58
67
|
end
|
68
|
+
end
|
59
69
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
70
|
+
private
|
71
|
+
|
72
|
+
def initialize_sections
|
73
|
+
@sections = {
|
74
|
+
detail: List::SectionFormat.new(attributes['detail'])
|
75
|
+
}
|
76
|
+
|
77
|
+
@sections[:header] = List::SectionFormat.new(attributes['header']) if has_section?(:header)
|
78
|
+
@sections[:page_footer] = List::SectionFormat.new(attributes['page-footer']) if has_section?(:page_footer)
|
79
|
+
@sections[:footer] = List::SectionFormat.new(attributes['footer']) if has_section?(:footer)
|
67
80
|
end
|
68
81
|
end
|
69
82
|
|
@@ -6,9 +6,6 @@ module Thinreports
|
|
6
6
|
class List::Manager
|
7
7
|
include Utils
|
8
8
|
|
9
|
-
# @return [Thinreports::Core::Shape::List::Configuration]
|
10
|
-
attr_reader :config
|
11
|
-
|
12
9
|
# @return [Thinreports::Core::Shape:::List::Page]
|
13
10
|
attr_reader :current_page
|
14
11
|
|
@@ -31,7 +28,6 @@ module Thinreports
|
|
31
28
|
def initialize(page)
|
32
29
|
switch_current!(page)
|
33
30
|
|
34
|
-
@config = init_config
|
35
31
|
@finalized = false
|
36
32
|
@page_count = 0
|
37
33
|
|
@@ -159,16 +155,6 @@ module Thinreports
|
|
159
155
|
end
|
160
156
|
end
|
161
157
|
|
162
|
-
# @return [Thinreports::Core::Shape::List::Store]
|
163
|
-
def store
|
164
|
-
config.store
|
165
|
-
end
|
166
|
-
|
167
|
-
# @return [Thinreports::Core::Shape::List::Events]
|
168
|
-
def events
|
169
|
-
config.internal_events
|
170
|
-
end
|
171
|
-
|
172
158
|
# @return [Boolean]
|
173
159
|
def auto_page_break?
|
174
160
|
format.auto_page_break?
|
@@ -184,22 +170,10 @@ module Thinreports
|
|
184
170
|
|
185
171
|
if !options[:ignore_page_footer] && format.has_page_footer?
|
186
172
|
page_footer = insert_row(init_section(:page_footer))
|
187
|
-
|
188
|
-
# [DEPRECATION] Use List::Interface#on_page_footer_insert instead.
|
189
|
-
events.
|
190
|
-
dispatch(List::Events::SectionEvent.new(:page_footer_insert,
|
191
|
-
page_footer, store))
|
192
|
-
# In 0.8 or later
|
193
173
|
@page_footer_handler.call(page_footer) if @page_footer_handler
|
194
174
|
end
|
195
|
-
current_page_state.finalized!
|
196
175
|
|
197
|
-
|
198
|
-
events.
|
199
|
-
dispatch(List::Events::PageEvent.new(:page_finalize,
|
200
|
-
current_page,
|
201
|
-
current_page_state.parent))
|
202
|
-
# In 0.8 or later
|
176
|
+
current_page_state.finalized!
|
203
177
|
@page_finalize_handler.call if @page_finalize_handler
|
204
178
|
|
205
179
|
@page_count += 1
|
@@ -213,10 +187,6 @@ module Thinreports
|
|
213
187
|
if format.has_footer?
|
214
188
|
footer = init_section(:footer)
|
215
189
|
|
216
|
-
# [DEPRECATION] Use List::Interface#on_footer_insert instead.
|
217
|
-
events.dispatch(List::Events::SectionEvent.new(:footer_insert, footer, store))
|
218
|
-
|
219
|
-
# In 0.8 or later
|
220
190
|
@footer_handler.call(footer) if @footer_handler
|
221
191
|
|
222
192
|
if auto_page_break? && overflow_with?(:footer)
|
@@ -250,11 +220,6 @@ module Thinreports
|
|
250
220
|
def format
|
251
221
|
current_page_state.format
|
252
222
|
end
|
253
|
-
|
254
|
-
# @return [Thinreports::Core::Shape::List::Configuration]
|
255
|
-
def init_config
|
256
|
-
layout.config.activate(current_page.id) || List::Configuration.new
|
257
|
-
end
|
258
223
|
end
|
259
224
|
|
260
225
|
end
|
@@ -69,21 +69,6 @@ module Thinreports
|
|
69
69
|
manager.overflow_with?(:detail)
|
70
70
|
end
|
71
71
|
|
72
|
-
# @return [Thinreports::Core::Shape::List::Configuration]
|
73
|
-
def config
|
74
|
-
manager.config
|
75
|
-
end
|
76
|
-
|
77
|
-
# @return [Thinreports::Core::Shape::List::Store]
|
78
|
-
def store
|
79
|
-
config.store
|
80
|
-
end
|
81
|
-
|
82
|
-
# @return [Thinreports::Core::Shape::List::Events]
|
83
|
-
def events
|
84
|
-
config.events
|
85
|
-
end
|
86
|
-
|
87
72
|
# @param [Thinreports::Report::Page] new_parent
|
88
73
|
# @return [Thinreports::Core::Shape::List::Page]
|
89
74
|
def copy(new_parent)
|
@@ -7,24 +7,26 @@ module Thinreports
|
|
7
7
|
config_reader :height
|
8
8
|
config_reader relative_left: %w( translate x ),
|
9
9
|
relative_top: %w( translate y )
|
10
|
+
config_reader :style
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
# For compatible 0.8.x format API
|
13
|
+
config_checker true, display: %w( enabled )
|
14
|
+
|
15
|
+
def initialize(*)
|
16
|
+
super
|
17
|
+
initialize_items(attributes['items'])
|
18
|
+
end
|
14
19
|
|
15
|
-
class << self
|
16
20
|
private
|
17
21
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
22
|
+
def initialize_items(item_schemas)
|
23
|
+
item_schemas.each do |item_schema|
|
24
|
+
id, type = item_schema.values_at 'id', 'type'
|
25
|
+
next if id.empty?
|
26
|
+
|
27
|
+
self.shapes[id.to_sym] = Core::Shape::Format(type).new(item_schema)
|
25
28
|
end
|
26
29
|
end
|
27
|
-
|
28
30
|
end
|
29
31
|
|
30
32
|
end
|