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.
Files changed (167) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +24 -0
  3. data/README.adoc +136 -0
  4. data/exe/emf +113 -0
  5. data/lib/emf/binary/codec.rb +19 -0
  6. data/lib/emf/binary/types.rb +105 -0
  7. data/lib/emf/binary.rb +10 -0
  8. data/lib/emf/detector.rb +58 -0
  9. data/lib/emf/emf_plus/binary.rb +8 -0
  10. data/lib/emf/emf_plus/parser.rb +13 -0
  11. data/lib/emf/emf_plus/serializer.rb +13 -0
  12. data/lib/emf/emf_plus.rb +9 -0
  13. data/lib/emf/emr/binary/header.rb +41 -0
  14. data/lib/emf/emr/binary/record.rb +17 -0
  15. data/lib/emf/emr/binary/records/abort_path.rb +16 -0
  16. data/lib/emf/emr/binary/records/alpha_blend.rb +17 -0
  17. data/lib/emf/emr/binary/records/angle_arc.rb +19 -0
  18. data/lib/emf/emr/binary/records/arc.rb +19 -0
  19. data/lib/emf/emr/binary/records/arc_to.rb +19 -0
  20. data/lib/emf/emr/binary/records/begin_path.rb +16 -0
  21. data/lib/emf/emr/binary/records/bit_blt.rb +37 -0
  22. data/lib/emf/emr/binary/records/chord.rb +19 -0
  23. data/lib/emf/emr/binary/records/close_figure.rb +16 -0
  24. data/lib/emf/emr/binary/records/color_correct_palette.rb +17 -0
  25. data/lib/emf/emr/binary/records/colormatch_to_target_w.rb +17 -0
  26. data/lib/emf/emr/binary/records/comment.rb +20 -0
  27. data/lib/emf/emr/binary/records/create_brush_indirect.rb +20 -0
  28. data/lib/emf/emr/binary/records/create_colorspace.rb +17 -0
  29. data/lib/emf/emr/binary/records/create_colorspace_w.rb +17 -0
  30. data/lib/emf/emr/binary/records/create_dib_pattern_brush_pt.rb +25 -0
  31. data/lib/emf/emr/binary/records/create_font_indirect_w.rb +18 -0
  32. data/lib/emf/emr/binary/records/create_mono_brush.rb +25 -0
  33. data/lib/emf/emr/binary/records/create_palette.rb +17 -0
  34. data/lib/emf/emr/binary/records/create_pen.rb +20 -0
  35. data/lib/emf/emr/binary/records/delete_colorspace.rb +17 -0
  36. data/lib/emf/emr/binary/records/delete_object.rb +16 -0
  37. data/lib/emf/emr/binary/records/draw_escape.rb +17 -0
  38. data/lib/emf/emr/binary/records/ellipse.rb +18 -0
  39. data/lib/emf/emr/binary/records/end_path.rb +16 -0
  40. data/lib/emf/emr/binary/records/eof.rb +21 -0
  41. data/lib/emf/emr/binary/records/exclude_clip_rect.rb +16 -0
  42. data/lib/emf/emr/binary/records/ext_create_pen.rb +17 -0
  43. data/lib/emf/emr/binary/records/ext_escape.rb +17 -0
  44. data/lib/emf/emr/binary/records/ext_flood_fill.rb +17 -0
  45. data/lib/emf/emr/binary/records/ext_select_clip_rgn.rb +19 -0
  46. data/lib/emf/emr/binary/records/ext_text_out_a.rb +27 -0
  47. data/lib/emf/emr/binary/records/ext_text_out_w.rb +41 -0
  48. data/lib/emf/emr/binary/records/fill_path.rb +16 -0
  49. data/lib/emf/emr/binary/records/fill_rgn.rb +17 -0
  50. data/lib/emf/emr/binary/records/flatten_path.rb +16 -0
  51. data/lib/emf/emr/binary/records/force_ufi_mapping.rb +17 -0
  52. data/lib/emf/emr/binary/records/frame_rgn.rb +17 -0
  53. data/lib/emf/emr/binary/records/gls_bounded_record.rb +17 -0
  54. data/lib/emf/emr/binary/records/gls_record.rb +17 -0
  55. data/lib/emf/emr/binary/records/gradient_fill.rb +19 -0
  56. data/lib/emf/emr/binary/records/intersect_clip_rect.rb +16 -0
  57. data/lib/emf/emr/binary/records/invert_rgn.rb +17 -0
  58. data/lib/emf/emr/binary/records/line_to.rb +16 -0
  59. data/lib/emf/emr/binary/records/mask_blt.rb +17 -0
  60. data/lib/emf/emr/binary/records/modify_world_transform.rb +17 -0
  61. data/lib/emf/emr/binary/records/move_to_ex.rb +16 -0
  62. data/lib/emf/emr/binary/records/named_escape.rb +17 -0
  63. data/lib/emf/emr/binary/records/offset_clip_rgn.rb +16 -0
  64. data/lib/emf/emr/binary/records/paint_rgn.rb +17 -0
  65. data/lib/emf/emr/binary/records/pie.rb +19 -0
  66. data/lib/emf/emr/binary/records/pixel_format.rb +17 -0
  67. data/lib/emf/emr/binary/records/plg_blt.rb +17 -0
  68. data/lib/emf/emr/binary/records/poly_bezier.rb +17 -0
  69. data/lib/emf/emr/binary/records/poly_bezier16.rb +17 -0
  70. data/lib/emf/emr/binary/records/poly_bezier_to.rb +17 -0
  71. data/lib/emf/emr/binary/records/poly_bezier_to16.rb +17 -0
  72. data/lib/emf/emr/binary/records/poly_draw.rb +18 -0
  73. data/lib/emf/emr/binary/records/poly_draw16.rb +18 -0
  74. data/lib/emf/emr/binary/records/poly_polygon.rb +19 -0
  75. data/lib/emf/emr/binary/records/poly_polygon16.rb +19 -0
  76. data/lib/emf/emr/binary/records/poly_polyline.rb +19 -0
  77. data/lib/emf/emr/binary/records/poly_polyline16.rb +19 -0
  78. data/lib/emf/emr/binary/records/poly_textout_a.rb +17 -0
  79. data/lib/emf/emr/binary/records/poly_textout_w.rb +17 -0
  80. data/lib/emf/emr/binary/records/polygon.rb +17 -0
  81. data/lib/emf/emr/binary/records/polygon16.rb +17 -0
  82. data/lib/emf/emr/binary/records/polyline.rb +17 -0
  83. data/lib/emf/emr/binary/records/polyline16.rb +17 -0
  84. data/lib/emf/emr/binary/records/polyline_to.rb +17 -0
  85. data/lib/emf/emr/binary/records/polyline_to16.rb +17 -0
  86. data/lib/emf/emr/binary/records/raw.rb +19 -0
  87. data/lib/emf/emr/binary/records/realize_palette.rb +15 -0
  88. data/lib/emf/emr/binary/records/rectangle.rb +18 -0
  89. data/lib/emf/emr/binary/records/resize_palette.rb +17 -0
  90. data/lib/emf/emr/binary/records/restore_dc.rb +17 -0
  91. data/lib/emf/emr/binary/records/round_rect.rb +19 -0
  92. data/lib/emf/emr/binary/records/save_dc.rb +16 -0
  93. data/lib/emf/emr/binary/records/scale_viewport_ext_ex.rb +19 -0
  94. data/lib/emf/emr/binary/records/scale_window_ext_ex.rb +19 -0
  95. data/lib/emf/emr/binary/records/select_clip_path.rb +20 -0
  96. data/lib/emf/emr/binary/records/select_object.rb +16 -0
  97. data/lib/emf/emr/binary/records/select_palette.rb +16 -0
  98. data/lib/emf/emr/binary/records/set_arc_direction.rb +16 -0
  99. data/lib/emf/emr/binary/records/set_bk_color.rb +16 -0
  100. data/lib/emf/emr/binary/records/set_bk_mode.rb +16 -0
  101. data/lib/emf/emr/binary/records/set_brush_org_ex.rb +16 -0
  102. data/lib/emf/emr/binary/records/set_colorspace.rb +17 -0
  103. data/lib/emf/emr/binary/records/set_dibits_to_device.rb +17 -0
  104. data/lib/emf/emr/binary/records/set_icm_mode.rb +16 -0
  105. data/lib/emf/emr/binary/records/set_icm_profile_a.rb +17 -0
  106. data/lib/emf/emr/binary/records/set_icm_profile_w.rb +17 -0
  107. data/lib/emf/emr/binary/records/set_layout.rb +16 -0
  108. data/lib/emf/emr/binary/records/set_linked_ufis.rb +17 -0
  109. data/lib/emf/emr/binary/records/set_map_mode.rb +16 -0
  110. data/lib/emf/emr/binary/records/set_mapper_flags.rb +16 -0
  111. data/lib/emf/emr/binary/records/set_metargn.rb +16 -0
  112. data/lib/emf/emr/binary/records/set_miter_limit.rb +16 -0
  113. data/lib/emf/emr/binary/records/set_palette_entries.rb +17 -0
  114. data/lib/emf/emr/binary/records/set_pixel_v.rb +18 -0
  115. data/lib/emf/emr/binary/records/set_poly_fill_mode.rb +16 -0
  116. data/lib/emf/emr/binary/records/set_rop2.rb +16 -0
  117. data/lib/emf/emr/binary/records/set_stretch_blt_mode.rb +16 -0
  118. data/lib/emf/emr/binary/records/set_text_align.rb +16 -0
  119. data/lib/emf/emr/binary/records/set_text_color.rb +17 -0
  120. data/lib/emf/emr/binary/records/set_text_justification.rb +17 -0
  121. data/lib/emf/emr/binary/records/set_viewport_ext_ex.rb +16 -0
  122. data/lib/emf/emr/binary/records/set_viewport_org_ex.rb +16 -0
  123. data/lib/emf/emr/binary/records/set_window_ext_ex.rb +16 -0
  124. data/lib/emf/emr/binary/records/set_window_org_ex.rb +16 -0
  125. data/lib/emf/emr/binary/records/set_world_transform.rb +16 -0
  126. data/lib/emf/emr/binary/records/small_text_out.rb +28 -0
  127. data/lib/emf/emr/binary/records/stretch_blt.rb +39 -0
  128. data/lib/emf/emr/binary/records/stretch_dibits.rb +42 -0
  129. data/lib/emf/emr/binary/records/stroke_and_fill_path.rb +16 -0
  130. data/lib/emf/emr/binary/records/stroke_path.rb +16 -0
  131. data/lib/emf/emr/binary/records/transparent_blt.rb +17 -0
  132. data/lib/emf/emr/binary/records/widen_path.rb +16 -0
  133. data/lib/emf/emr/binary/records.rb +258 -0
  134. data/lib/emf/emr/binary/type_codes.rb +132 -0
  135. data/lib/emf/emr/binary/with_bounds.rb +15 -0
  136. data/lib/emf/emr/binary.rb +13 -0
  137. data/lib/emf/emr/parser.rb +185 -0
  138. data/lib/emf/emr/path_association.rb +16 -0
  139. data/lib/emf/emr/serializer.rb +24 -0
  140. data/lib/emf/emr.rb +10 -0
  141. data/lib/emf/error.rb +19 -0
  142. data/lib/emf/model/emr/header.rb +93 -0
  143. data/lib/emf/model/emr/records.rb +48 -0
  144. data/lib/emf/model/emr.rb +10 -0
  145. data/lib/emf/model/geometry/color.rb +67 -0
  146. data/lib/emf/model/geometry/matrix.rb +52 -0
  147. data/lib/emf/model/geometry/point.rb +41 -0
  148. data/lib/emf/model/geometry/point_f.rb +33 -0
  149. data/lib/emf/model/geometry/point_s.rb +33 -0
  150. data/lib/emf/model/geometry/rect.rb +57 -0
  151. data/lib/emf/model/geometry/rect_s.rb +49 -0
  152. data/lib/emf/model/geometry/size.rb +33 -0
  153. data/lib/emf/model/geometry.rb +16 -0
  154. data/lib/emf/model/metafile.rb +34 -0
  155. data/lib/emf/model/record.rb +19 -0
  156. data/lib/emf/model/visitor.rb +42 -0
  157. data/lib/emf/model.rb +11 -0
  158. data/lib/emf/version.rb +5 -0
  159. data/lib/emf/visitors/dump.rb +57 -0
  160. data/lib/emf/visitors/stats.rb +63 -0
  161. data/lib/emf/visitors.rb +8 -0
  162. data/lib/emf/wmf/binary.rb +9 -0
  163. data/lib/emf/wmf/parser.rb +13 -0
  164. data/lib/emf/wmf/serializer.rb +13 -0
  165. data/lib/emf/wmf.rb +9 -0
  166. data/lib/emf.rb +56 -0
  167. 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