emf 0.1.0
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.
- checksums.yaml +7 -0
- data/LICENSE.txt +24 -0
- data/README.adoc +136 -0
- data/exe/emf +113 -0
- data/lib/emf/binary/codec.rb +19 -0
- data/lib/emf/binary/types.rb +105 -0
- data/lib/emf/binary.rb +10 -0
- data/lib/emf/detector.rb +58 -0
- data/lib/emf/emf_plus/binary.rb +8 -0
- data/lib/emf/emf_plus/parser.rb +13 -0
- data/lib/emf/emf_plus/serializer.rb +13 -0
- data/lib/emf/emf_plus.rb +9 -0
- data/lib/emf/emr/binary/header.rb +41 -0
- data/lib/emf/emr/binary/record.rb +17 -0
- data/lib/emf/emr/binary/records/abort_path.rb +16 -0
- data/lib/emf/emr/binary/records/alpha_blend.rb +17 -0
- data/lib/emf/emr/binary/records/angle_arc.rb +19 -0
- data/lib/emf/emr/binary/records/arc.rb +19 -0
- data/lib/emf/emr/binary/records/arc_to.rb +19 -0
- data/lib/emf/emr/binary/records/begin_path.rb +16 -0
- data/lib/emf/emr/binary/records/bit_blt.rb +37 -0
- data/lib/emf/emr/binary/records/chord.rb +19 -0
- data/lib/emf/emr/binary/records/close_figure.rb +16 -0
- data/lib/emf/emr/binary/records/color_correct_palette.rb +17 -0
- data/lib/emf/emr/binary/records/colormatch_to_target_w.rb +17 -0
- data/lib/emf/emr/binary/records/comment.rb +20 -0
- data/lib/emf/emr/binary/records/create_brush_indirect.rb +20 -0
- data/lib/emf/emr/binary/records/create_colorspace.rb +17 -0
- data/lib/emf/emr/binary/records/create_colorspace_w.rb +17 -0
- data/lib/emf/emr/binary/records/create_dib_pattern_brush_pt.rb +25 -0
- data/lib/emf/emr/binary/records/create_font_indirect_w.rb +18 -0
- data/lib/emf/emr/binary/records/create_mono_brush.rb +25 -0
- data/lib/emf/emr/binary/records/create_palette.rb +17 -0
- data/lib/emf/emr/binary/records/create_pen.rb +20 -0
- data/lib/emf/emr/binary/records/delete_colorspace.rb +17 -0
- data/lib/emf/emr/binary/records/delete_object.rb +16 -0
- data/lib/emf/emr/binary/records/draw_escape.rb +17 -0
- data/lib/emf/emr/binary/records/ellipse.rb +18 -0
- data/lib/emf/emr/binary/records/end_path.rb +16 -0
- data/lib/emf/emr/binary/records/eof.rb +21 -0
- data/lib/emf/emr/binary/records/exclude_clip_rect.rb +16 -0
- data/lib/emf/emr/binary/records/ext_create_pen.rb +17 -0
- data/lib/emf/emr/binary/records/ext_escape.rb +17 -0
- data/lib/emf/emr/binary/records/ext_flood_fill.rb +17 -0
- data/lib/emf/emr/binary/records/ext_select_clip_rgn.rb +19 -0
- data/lib/emf/emr/binary/records/ext_text_out_a.rb +27 -0
- data/lib/emf/emr/binary/records/ext_text_out_w.rb +41 -0
- data/lib/emf/emr/binary/records/fill_path.rb +16 -0
- data/lib/emf/emr/binary/records/fill_rgn.rb +17 -0
- data/lib/emf/emr/binary/records/flatten_path.rb +16 -0
- data/lib/emf/emr/binary/records/force_ufi_mapping.rb +17 -0
- data/lib/emf/emr/binary/records/frame_rgn.rb +17 -0
- data/lib/emf/emr/binary/records/gls_bounded_record.rb +17 -0
- data/lib/emf/emr/binary/records/gls_record.rb +17 -0
- data/lib/emf/emr/binary/records/gradient_fill.rb +19 -0
- data/lib/emf/emr/binary/records/intersect_clip_rect.rb +16 -0
- data/lib/emf/emr/binary/records/invert_rgn.rb +17 -0
- data/lib/emf/emr/binary/records/line_to.rb +16 -0
- data/lib/emf/emr/binary/records/mask_blt.rb +17 -0
- data/lib/emf/emr/binary/records/modify_world_transform.rb +17 -0
- data/lib/emf/emr/binary/records/move_to_ex.rb +16 -0
- data/lib/emf/emr/binary/records/named_escape.rb +17 -0
- data/lib/emf/emr/binary/records/offset_clip_rgn.rb +16 -0
- data/lib/emf/emr/binary/records/paint_rgn.rb +17 -0
- data/lib/emf/emr/binary/records/pie.rb +19 -0
- data/lib/emf/emr/binary/records/pixel_format.rb +17 -0
- data/lib/emf/emr/binary/records/plg_blt.rb +17 -0
- data/lib/emf/emr/binary/records/poly_bezier.rb +17 -0
- data/lib/emf/emr/binary/records/poly_bezier16.rb +17 -0
- data/lib/emf/emr/binary/records/poly_bezier_to.rb +17 -0
- data/lib/emf/emr/binary/records/poly_bezier_to16.rb +17 -0
- data/lib/emf/emr/binary/records/poly_draw.rb +18 -0
- data/lib/emf/emr/binary/records/poly_draw16.rb +18 -0
- data/lib/emf/emr/binary/records/poly_polygon.rb +19 -0
- data/lib/emf/emr/binary/records/poly_polygon16.rb +19 -0
- data/lib/emf/emr/binary/records/poly_polyline.rb +19 -0
- data/lib/emf/emr/binary/records/poly_polyline16.rb +19 -0
- data/lib/emf/emr/binary/records/poly_textout_a.rb +17 -0
- data/lib/emf/emr/binary/records/poly_textout_w.rb +17 -0
- data/lib/emf/emr/binary/records/polygon.rb +17 -0
- data/lib/emf/emr/binary/records/polygon16.rb +17 -0
- data/lib/emf/emr/binary/records/polyline.rb +17 -0
- data/lib/emf/emr/binary/records/polyline16.rb +17 -0
- data/lib/emf/emr/binary/records/polyline_to.rb +17 -0
- data/lib/emf/emr/binary/records/polyline_to16.rb +17 -0
- data/lib/emf/emr/binary/records/raw.rb +19 -0
- data/lib/emf/emr/binary/records/realize_palette.rb +15 -0
- data/lib/emf/emr/binary/records/rectangle.rb +18 -0
- data/lib/emf/emr/binary/records/resize_palette.rb +17 -0
- data/lib/emf/emr/binary/records/restore_dc.rb +17 -0
- data/lib/emf/emr/binary/records/round_rect.rb +19 -0
- data/lib/emf/emr/binary/records/save_dc.rb +16 -0
- data/lib/emf/emr/binary/records/scale_viewport_ext_ex.rb +19 -0
- data/lib/emf/emr/binary/records/scale_window_ext_ex.rb +19 -0
- data/lib/emf/emr/binary/records/select_clip_path.rb +20 -0
- data/lib/emf/emr/binary/records/select_object.rb +16 -0
- data/lib/emf/emr/binary/records/select_palette.rb +16 -0
- data/lib/emf/emr/binary/records/set_arc_direction.rb +16 -0
- data/lib/emf/emr/binary/records/set_bk_color.rb +16 -0
- data/lib/emf/emr/binary/records/set_bk_mode.rb +16 -0
- data/lib/emf/emr/binary/records/set_brush_org_ex.rb +16 -0
- data/lib/emf/emr/binary/records/set_colorspace.rb +17 -0
- data/lib/emf/emr/binary/records/set_dibits_to_device.rb +17 -0
- data/lib/emf/emr/binary/records/set_icm_mode.rb +16 -0
- data/lib/emf/emr/binary/records/set_icm_profile_a.rb +17 -0
- data/lib/emf/emr/binary/records/set_icm_profile_w.rb +17 -0
- data/lib/emf/emr/binary/records/set_layout.rb +16 -0
- data/lib/emf/emr/binary/records/set_linked_ufis.rb +17 -0
- data/lib/emf/emr/binary/records/set_map_mode.rb +16 -0
- data/lib/emf/emr/binary/records/set_mapper_flags.rb +16 -0
- data/lib/emf/emr/binary/records/set_metargn.rb +16 -0
- data/lib/emf/emr/binary/records/set_miter_limit.rb +16 -0
- data/lib/emf/emr/binary/records/set_palette_entries.rb +17 -0
- data/lib/emf/emr/binary/records/set_pixel_v.rb +18 -0
- data/lib/emf/emr/binary/records/set_poly_fill_mode.rb +16 -0
- data/lib/emf/emr/binary/records/set_rop2.rb +16 -0
- data/lib/emf/emr/binary/records/set_stretch_blt_mode.rb +16 -0
- data/lib/emf/emr/binary/records/set_text_align.rb +16 -0
- data/lib/emf/emr/binary/records/set_text_color.rb +17 -0
- data/lib/emf/emr/binary/records/set_text_justification.rb +17 -0
- data/lib/emf/emr/binary/records/set_viewport_ext_ex.rb +16 -0
- data/lib/emf/emr/binary/records/set_viewport_org_ex.rb +16 -0
- data/lib/emf/emr/binary/records/set_window_ext_ex.rb +16 -0
- data/lib/emf/emr/binary/records/set_window_org_ex.rb +16 -0
- data/lib/emf/emr/binary/records/set_world_transform.rb +16 -0
- data/lib/emf/emr/binary/records/small_text_out.rb +28 -0
- data/lib/emf/emr/binary/records/stretch_blt.rb +39 -0
- data/lib/emf/emr/binary/records/stretch_dibits.rb +42 -0
- data/lib/emf/emr/binary/records/stroke_and_fill_path.rb +16 -0
- data/lib/emf/emr/binary/records/stroke_path.rb +16 -0
- data/lib/emf/emr/binary/records/transparent_blt.rb +17 -0
- data/lib/emf/emr/binary/records/widen_path.rb +16 -0
- data/lib/emf/emr/binary/records.rb +258 -0
- data/lib/emf/emr/binary/type_codes.rb +132 -0
- data/lib/emf/emr/binary/with_bounds.rb +15 -0
- data/lib/emf/emr/binary.rb +13 -0
- data/lib/emf/emr/parser.rb +185 -0
- data/lib/emf/emr/path_association.rb +16 -0
- data/lib/emf/emr/serializer.rb +24 -0
- data/lib/emf/emr.rb +10 -0
- data/lib/emf/error.rb +19 -0
- data/lib/emf/model/emr/header.rb +93 -0
- data/lib/emf/model/emr/records.rb +48 -0
- data/lib/emf/model/emr.rb +10 -0
- data/lib/emf/model/geometry/color.rb +67 -0
- data/lib/emf/model/geometry/matrix.rb +52 -0
- data/lib/emf/model/geometry/point.rb +41 -0
- data/lib/emf/model/geometry/point_f.rb +33 -0
- data/lib/emf/model/geometry/point_s.rb +33 -0
- data/lib/emf/model/geometry/rect.rb +57 -0
- data/lib/emf/model/geometry/rect_s.rb +49 -0
- data/lib/emf/model/geometry/size.rb +33 -0
- data/lib/emf/model/geometry.rb +16 -0
- data/lib/emf/model/metafile.rb +34 -0
- data/lib/emf/model/record.rb +19 -0
- data/lib/emf/model/visitor.rb +42 -0
- data/lib/emf/model.rb +11 -0
- data/lib/emf/version.rb +5 -0
- data/lib/emf/visitors/dump.rb +57 -0
- data/lib/emf/visitors/stats.rb +63 -0
- data/lib/emf/visitors.rb +8 -0
- data/lib/emf/wmf/binary.rb +9 -0
- data/lib/emf/wmf/parser.rb +13 -0
- data/lib/emf/wmf/serializer.rb +13 -0
- data/lib/emf/wmf.rb +9 -0
- data/lib/emf.rb +56 -0
- metadata +226 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Control record with no payload (just iType and nSize).
|
|
11
|
+
class BeginPath < Emf::Emr::Binary::Record
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/with_bounds"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMRBITBLT (MS-EMF 2.3.1.2).
|
|
11
|
+
# Layout: emr, rclBounds, Dest, cDest, dwRop, Src, xformSrc (24
|
|
12
|
+
# bytes), crBkColorSrc, iUsageSrc, offBmiSrc, cbBmiSrc,
|
|
13
|
+
# offBitsSrc, cbBitsSrc, then trailing BMI/bitmap data.
|
|
14
|
+
# Only the fields the emfsvg renderer needs are declared; the
|
|
15
|
+
# 32-byte xform+bgcolor+usage blob in the middle is skipped via
|
|
16
|
+
# a fixed-length :string (NOT :rest, which would consume the
|
|
17
|
+
# whole tail).
|
|
18
|
+
class BitBlt < Emf::Emr::Binary::WithBounds
|
|
19
|
+
int32le :x_dest
|
|
20
|
+
int32le :y_dest
|
|
21
|
+
int32le :cx_dest
|
|
22
|
+
int32le :cy_dest
|
|
23
|
+
uint32le :dw_rop
|
|
24
|
+
int32le :x_src
|
|
25
|
+
int32le :y_src
|
|
26
|
+
# xformSrc (24) + crBkColorSrc (4) + iUsageSrc (4) = 32 bytes
|
|
27
|
+
string :xform_usage_etc, length: 32, read_trim_padding: true
|
|
28
|
+
uint32le :off_bmi_src
|
|
29
|
+
uint32le :cb_bmi_src
|
|
30
|
+
uint32le :off_bits_src
|
|
31
|
+
uint32le :cb_bits_src
|
|
32
|
+
rest :body
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMR_CHORD: emr + rclBox + ptlStart + ptlEnd (no rclBounds).
|
|
11
|
+
class Chord < Emf::Emr::Binary::Record
|
|
12
|
+
rectl :rcl_box
|
|
13
|
+
point_l :ptl_start
|
|
14
|
+
point_l :ptl_end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Control record with no payload (just iType and nSize).
|
|
11
|
+
class CloseFigure < Emf::Emr::Binary::Record
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Stub: preserves full body bytes. Full layout lands with TODO 10.
|
|
11
|
+
class ColorCorrectPalette < Emf::Emr::Binary::Record
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Stub: preserves full body bytes. Full layout lands with TODO 10.
|
|
11
|
+
class ColorMatchToTargetW < Emf::Emr::Binary::Record
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMR_COMMENT: iType, nSize, cbData, then Data[cbData].
|
|
11
|
+
# The Data may carry an EMF+ stream (identifier 0x2B464D45),
|
|
12
|
+
# a public comment, a spool comment, or arbitrary private data.
|
|
13
|
+
class Comment < Emf::Emr::Binary::Record
|
|
14
|
+
uint32 :cb_data
|
|
15
|
+
rest :data
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMR_CREATEBRUSHINDIRECT: iType, nSize, ihBrush, LOGBRUSH32.
|
|
11
|
+
class CreateBrushIndirect < Emf::Emr::Binary::Record
|
|
12
|
+
uint32 :ih_brush
|
|
13
|
+
uint32 :brush_style
|
|
14
|
+
color_ref :color
|
|
15
|
+
uint32 :brush_hatch
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Stub: preserves full body bytes. Full layout lands with TODO 10.
|
|
11
|
+
class CreateColorspace < Emf::Emr::Binary::Record
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Stub: preserves full body bytes. Full layout lands with TODO 10.
|
|
11
|
+
class CreateColorspaceW < Emf::Emr::Binary::Record
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMRCREATEDIBPATTERNBRUSHPT (MS-EMF 2.3.7.4).
|
|
11
|
+
# Layout: emr, ihBrush, iUsage, offBmi, cbBmi, offBits, cbBits,
|
|
12
|
+
# then trailing BMI/bitmap data.
|
|
13
|
+
class CreateDibPatternBrushPt < Emf::Emr::Binary::Record
|
|
14
|
+
uint32 :ih_brush
|
|
15
|
+
uint32 :i_usage
|
|
16
|
+
uint32 :off_bmi
|
|
17
|
+
uint32 :cb_bmi
|
|
18
|
+
uint32 :off_bits
|
|
19
|
+
uint32 :cb_bits
|
|
20
|
+
rest :body
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Stub: ihObject + body bytes; full LOGFONT_PANOSE layout in TODO 10.
|
|
11
|
+
class CreateFontIndirectW < Emf::Emr::Binary::Record
|
|
12
|
+
uint32 :ih_object
|
|
13
|
+
rest :body
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMRCREATEMONOBRUSH (MS-EMF 2.3.7.5).
|
|
11
|
+
# Layout: emr, ihBrush, iUsage, offBmi, cbBmi, offBits, cbBits,
|
|
12
|
+
# then trailing BMI/bitmap data.
|
|
13
|
+
class CreateMonoBrush < Emf::Emr::Binary::Record
|
|
14
|
+
uint32 :ih_brush
|
|
15
|
+
uint32 :i_usage
|
|
16
|
+
uint32 :off_bmi
|
|
17
|
+
uint32 :cb_bmi
|
|
18
|
+
uint32 :off_bits
|
|
19
|
+
uint32 :cb_bits
|
|
20
|
+
rest :body
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
class CreatePalette < Emf::Emr::Binary::Record
|
|
11
|
+
uint32 :ih_pal
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMR_CREATEPEN: iType, nSize, ihPen, LOGPEN{uint32 pen_style, uint32 width, ColorRef color}
|
|
11
|
+
class CreatePen < Emf::Emr::Binary::Record
|
|
12
|
+
uint32 :ih_pen
|
|
13
|
+
uint32 :pen_style
|
|
14
|
+
point_l :width
|
|
15
|
+
color_ref :color
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Stub: preserves full body bytes. Full layout lands with TODO 10.
|
|
11
|
+
class DeleteColorspace < Emf::Emr::Binary::Record
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
class DeleteObject < Emf::Emr::Binary::Record
|
|
11
|
+
uint32 :ih_object
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Stub: preserves full body bytes. Full layout lands with TODO 10.
|
|
11
|
+
class DrawEscape < Emf::Emr::Binary::Record
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMR_ELLIPSE: emr + rclBox per MS-EMF 2.3.5.
|
|
11
|
+
# No rclBounds.
|
|
12
|
+
class Ellipse < Emf::Emr::Binary::Record
|
|
13
|
+
rectl :rcl_box
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Control record with no payload (just iType and nSize).
|
|
11
|
+
class EndPath < Emf::Emr::Binary::Record
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMR_EOF: iType, nSize, nPalEntries, offPalEntries, nSizeLast,
|
|
11
|
+
# then optional palette data and description (per MS-EMF 2.3.3).
|
|
12
|
+
class Eof < Emf::Emr::Binary::Record
|
|
13
|
+
uint32 :n_pal_entries
|
|
14
|
+
uint32 :off_pal_entries
|
|
15
|
+
uint32 :n_size_last
|
|
16
|
+
rest :body
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
class ExcludeClipRect < Emf::Emr::Binary::Record
|
|
11
|
+
rectl :rcl_clip
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
class ExtCreatePen < Emf::Emr::Binary::Record
|
|
11
|
+
uint32 :ih_pen
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Stub: preserves full body bytes. Full layout lands with TODO 10.
|
|
11
|
+
class ExtEscape < Emf::Emr::Binary::Record
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Stub: preserves full body bytes. Full layout lands with TODO 10.
|
|
11
|
+
class ExtFloodFill < Emf::Emr::Binary::Record
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMR_EXTSELECTCLIPRGN: emr + cbRgnData + dwMode + RgnData[cbRgnData].
|
|
11
|
+
class ExtSelectClipRgn < Emf::Emr::Binary::Record
|
|
12
|
+
uint32 :cb_rgn_data
|
|
13
|
+
uint32 :dw_mode
|
|
14
|
+
rest :rgn_data
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/with_bounds"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMR_EXTTEXTOUTA per MS-EMF 2.3.8.1. Same EMRTEXT layout as
|
|
11
|
+
# ExtTextOutW except the string is 8-bit ANSI.
|
|
12
|
+
class ExtTextOutA < Emf::Emr::Binary::WithBounds
|
|
13
|
+
uint32 :i_graphics_mode
|
|
14
|
+
float :ex_scale
|
|
15
|
+
float :ey_scale
|
|
16
|
+
point_l :ptl_reference
|
|
17
|
+
uint32 :n_chars
|
|
18
|
+
uint32 :off_string
|
|
19
|
+
uint32 :f_options
|
|
20
|
+
rectl :rcl
|
|
21
|
+
uint32 :off_dx
|
|
22
|
+
rest :trailing
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/with_bounds"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMR_EXTTEXTOUTW per MS-EMF 2.3.8.2. The EMRTEXT struct follows:
|
|
11
|
+
# emr (8 bytes, in WithBounds header)
|
|
12
|
+
# rclBounds (16 bytes, in WithBounds)
|
|
13
|
+
# iGraphicsMode (uint32)
|
|
14
|
+
# exScale (float)
|
|
15
|
+
# eyScale (float)
|
|
16
|
+
# --- EMRTEXT starts ---
|
|
17
|
+
# ptlReference (POINTL: int32 x, int32 y) — text anchor point
|
|
18
|
+
# nChars (uint32)
|
|
19
|
+
# offString (uint32) — byte offset from record start
|
|
20
|
+
# fOptions (uint32) — ExtTextOutOptions flags
|
|
21
|
+
# rcl (RECTL) — clipping rectangle
|
|
22
|
+
# offDx (uint32) — byte offset to Dx array
|
|
23
|
+
# --- EMRTEXT ends ---
|
|
24
|
+
# ...string (UTF-16LE, nChars chars)...
|
|
25
|
+
# ...Dx array (uint32 per char)...
|
|
26
|
+
class ExtTextOutW < Emf::Emr::Binary::WithBounds
|
|
27
|
+
uint32 :i_graphics_mode
|
|
28
|
+
float :ex_scale
|
|
29
|
+
float :ey_scale
|
|
30
|
+
point_l :ptl_reference
|
|
31
|
+
uint32 :n_chars
|
|
32
|
+
uint32 :off_string
|
|
33
|
+
uint32 :f_options
|
|
34
|
+
rectl :rcl
|
|
35
|
+
uint32 :off_dx
|
|
36
|
+
rest :trailing
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/with_bounds"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# EMR_FILL_PATH: emr + rclBounds per MS-EMF 2.3.5.9/2.3.5.38/2.3.5.39.
|
|
11
|
+
class FillPath < Emf::Emr::Binary::WithBounds
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
class FillRgn < Emf::Emr::Binary::Record
|
|
11
|
+
uint32 :ih_brush
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Control record with no payload (just iType and nSize).
|
|
11
|
+
class FlattenPath < Emf::Emr::Binary::Record
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/emr/binary/record"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
module Records
|
|
10
|
+
# Stub: preserves full body bytes. Full layout lands with TODO 10.
|
|
11
|
+
class ForceUfiMapping < Emf::Emr::Binary::Record
|
|
12
|
+
rest :body
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|