emf 0.2.0-aarch64-linux-musl
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 +341 -0
- data/exe/emf +125 -0
- data/lib/emf/backend.rb +60 -0
- data/lib/emf/binary/class_field_accessors.rb +49 -0
- data/lib/emf/binary/codec.rb +19 -0
- data/lib/emf/binary/float32_le.rb +54 -0
- data/lib/emf/binary/types.rb +139 -0
- data/lib/emf/binary.rb +10 -0
- data/lib/emf/conformance/context.rb +36 -0
- data/lib/emf/conformance/diagnostic.rb +18 -0
- data/lib/emf/conformance/manifest/emf_bitmap_misc.yml +622 -0
- data/lib/emf/conformance/manifest/emf_control_buffers.yml +61 -0
- data/lib/emf/conformance/manifest/emf_core.yml +117 -0
- data/lib/emf/conformance/manifest/emf_corpus_rules.yml +21 -0
- data/lib/emf/conformance/manifest/emf_objects_geometry.yml +229 -0
- data/lib/emf/conformance/manifest/emf_plus.yml +357 -0
- data/lib/emf/conformance/manifest/emf_plus_core.yml +33 -0
- data/lib/emf/conformance/manifest/emf_state_path.yml +403 -0
- data/lib/emf/conformance/manifest/emf_text.yml +97 -0
- data/lib/emf/conformance/manifest/wmf.yml +874 -0
- data/lib/emf/conformance/manifest.rb +79 -0
- data/lib/emf/conformance/profile.rb +35 -0
- data/lib/emf/conformance/record_types.rb +24 -0
- data/lib/emf/conformance/registry.rb +76 -0
- data/lib/emf/conformance/report.rb +83 -0
- data/lib/emf/conformance/rule.rb +16 -0
- data/lib/emf/conformance/rules/emf_bitmap.rb +357 -0
- data/lib/emf/conformance/rules/emf_comment_escape.rb +309 -0
- data/lib/emf/conformance/rules/emf_control_buffers.rb +137 -0
- data/lib/emf/conformance/rules/emf_corpus_named.rb +83 -0
- data/lib/emf/conformance/rules/emf_framing.rb +94 -0
- data/lib/emf/conformance/rules/emf_geometry.rb +282 -0
- data/lib/emf/conformance/rules/emf_header.rb +114 -0
- data/lib/emf/conformance/rules/emf_objects.rb +291 -0
- data/lib/emf/conformance/rules/emf_parse_recovery.rb +97 -0
- data/lib/emf/conformance/rules/emf_path_clip.rb +165 -0
- data/lib/emf/conformance/rules/emf_plus.rb +75 -0
- data/lib/emf/conformance/rules/emf_plus_common.rb +58 -0
- data/lib/emf/conformance/rules/emf_plus_drawing.rb +78 -0
- data/lib/emf/conformance/rules/emf_plus_effects.rb +104 -0
- data/lib/emf/conformance/rules/emf_plus_fields.rb +169 -0
- data/lib/emf/conformance/rules/emf_plus_fields_b.rb +102 -0
- data/lib/emf/conformance/rules/emf_plus_framing.rb +172 -0
- data/lib/emf/conformance/rules/emf_plus_objects.rb +97 -0
- data/lib/emf/conformance/rules/emf_plus_payloads.rb +320 -0
- data/lib/emf/conformance/rules/emf_plus_properties.rb +96 -0
- data/lib/emf/conformance/rules/emf_plus_state.rb +77 -0
- data/lib/emf/conformance/rules/emf_state.rb +244 -0
- data/lib/emf/conformance/rules/emf_text.rb +221 -0
- data/lib/emf/conformance/rules/emf_transform.rb +85 -0
- data/lib/emf/conformance/rules/wmf_buffers.rb +259 -0
- data/lib/emf/conformance/rules/wmf_framing.rb +146 -0
- data/lib/emf/conformance/rules/wmf_layout_records.rb +112 -0
- data/lib/emf/conformance/rules/wmf_objects.rb +168 -0
- data/lib/emf/conformance/rules/wmf_records.rb +191 -0
- data/lib/emf/conformance/rules/wmf_rejections.rb +184 -0
- data/lib/emf/conformance/runner.rb +61 -0
- data/lib/emf/conformance/ternary_raster_operations.rb +52 -0
- data/lib/emf/conformance.rb +31 -0
- data/lib/emf/detector.rb +58 -0
- data/lib/emf/emf_plus/binary.rb +8 -0
- data/lib/emf/emf_plus/effects/blur.rb +24 -0
- data/lib/emf/emf_plus/effects/brightness_contrast.rb +22 -0
- data/lib/emf/emf_plus/effects/color_balance.rb +24 -0
- data/lib/emf/emf_plus/effects/color_curve.rb +24 -0
- data/lib/emf/emf_plus/effects/color_lookup_table.rb +26 -0
- data/lib/emf/emf_plus/effects/color_matrix.rb +23 -0
- data/lib/emf/emf_plus/effects/effect.rb +50 -0
- data/lib/emf/emf_plus/effects/hue_saturation_lightness.rb +24 -0
- data/lib/emf/emf_plus/effects/levels.rb +24 -0
- data/lib/emf/emf_plus/effects/opaque.rb +19 -0
- data/lib/emf/emf_plus/effects/red_eye_correction.rb +35 -0
- data/lib/emf/emf_plus/effects/sharpen.rb +24 -0
- data/lib/emf/emf_plus/effects/tint.rb +22 -0
- data/lib/emf/emf_plus/effects.rb +45 -0
- data/lib/emf/emf_plus/frame.rb +41 -0
- data/lib/emf/emf_plus/links/effect_link.rb +16 -0
- data/lib/emf/emf_plus/links/get_dc_span.rb +18 -0
- data/lib/emf/emf_plus/links/link_error.rb +15 -0
- data/lib/emf/emf_plus/links.rb +77 -0
- data/lib/emf/emf_plus/object_chain.rb +108 -0
- data/lib/emf/emf_plus/object_table.rb +182 -0
- data/lib/emf/emf_plus/objects/brush.rb +296 -0
- data/lib/emf/emf_plus/objects/custom_line_cap.rb +106 -0
- data/lib/emf/emf_plus/objects/font.rb +47 -0
- data/lib/emf/emf_plus/objects/image.rb +68 -0
- data/lib/emf/emf_plus/objects/image_attributes.rb +28 -0
- data/lib/emf/emf_plus/objects/opaque.rb +19 -0
- data/lib/emf/emf_plus/objects/parts.rb +103 -0
- data/lib/emf/emf_plus/objects/path.rb +21 -0
- data/lib/emf/emf_plus/objects/pen.rb +132 -0
- data/lib/emf/emf_plus/objects/region.rb +39 -0
- data/lib/emf/emf_plus/objects/string_format.rb +55 -0
- data/lib/emf/emf_plus/objects/typed.rb +50 -0
- data/lib/emf/emf_plus/objects.rb +46 -0
- data/lib/emf/emf_plus/parser.rb +75 -0
- data/lib/emf/emf_plus/records/base.rb +107 -0
- data/lib/emf/emf_plus/records/begin_container.rb +31 -0
- data/lib/emf/emf_plus/records/begin_container_no_params.rb +20 -0
- data/lib/emf/emf_plus/records/body.rb +16 -0
- data/lib/emf/emf_plus/records/clear.rb +22 -0
- data/lib/emf/emf_plus/records/clip_transform_flags.rb +26 -0
- data/lib/emf/emf_plus/records/comment.rb +21 -0
- data/lib/emf/emf_plus/records/draw_arc.rb +33 -0
- data/lib/emf/emf_plus/records/draw_beziers.rb +31 -0
- data/lib/emf/emf_plus/records/draw_closed_curve.rb +34 -0
- data/lib/emf/emf_plus/records/draw_curve.rb +38 -0
- data/lib/emf/emf_plus/records/draw_driver_string.rb +61 -0
- data/lib/emf/emf_plus/records/draw_ellipse.rb +28 -0
- data/lib/emf/emf_plus/records/draw_image.rb +42 -0
- data/lib/emf/emf_plus/records/draw_image_points.rb +62 -0
- data/lib/emf/emf_plus/records/draw_lines.rb +34 -0
- data/lib/emf/emf_plus/records/draw_path.rb +23 -0
- data/lib/emf/emf_plus/records/draw_pie.rb +33 -0
- data/lib/emf/emf_plus/records/draw_rects.rb +30 -0
- data/lib/emf/emf_plus/records/draw_string.rb +41 -0
- data/lib/emf/emf_plus/records/end_container.rb +20 -0
- data/lib/emf/emf_plus/records/end_of_file.rb +17 -0
- data/lib/emf/emf_plus/records/fill_brush.rb +21 -0
- data/lib/emf/emf_plus/records/fill_closed_curve.rb +38 -0
- data/lib/emf/emf_plus/records/fill_ellipse.rb +29 -0
- data/lib/emf/emf_plus/records/fill_path.rb +23 -0
- data/lib/emf/emf_plus/records/fill_pie.rb +34 -0
- data/lib/emf/emf_plus/records/fill_polygon.rb +32 -0
- data/lib/emf/emf_plus/records/fill_rects.rb +31 -0
- data/lib/emf/emf_plus/records/fill_region.rb +23 -0
- data/lib/emf/emf_plus/records/get_dc.rb +18 -0
- data/lib/emf/emf_plus/records/header.rb +35 -0
- data/lib/emf/emf_plus/records/multiply_world_transform.rb +24 -0
- data/lib/emf/emf_plus/records/object.rb +32 -0
- data/lib/emf/emf_plus/records/offset_clip.rb +24 -0
- data/lib/emf/emf_plus/records/primitives/argb.rb +20 -0
- data/lib/emf/emf_plus/records/primitives/bitmap.rb +32 -0
- data/lib/emf/emf_plus/records/primitives/bitmap_data.rb +21 -0
- data/lib/emf/emf_plus/records/primitives/blend_colors.rb +22 -0
- data/lib/emf/emf_plus/records/primitives/blend_factors.rb +21 -0
- data/lib/emf/emf_plus/records/primitives/bounded_array.rb +38 -0
- data/lib/emf/emf_plus/records/primitives/byte_reader.rb +25 -0
- data/lib/emf/emf_plus/records/primitives/character_range.rb +20 -0
- data/lib/emf/emf_plus/records/primitives/compressed_image.rb +17 -0
- data/lib/emf/emf_plus/records/primitives/focus_scale_data.rb +20 -0
- data/lib/emf/emf_plus/records/primitives/graphics_version.rb +21 -0
- data/lib/emf/emf_plus/records/primitives/language_identifier.rb +22 -0
- data/lib/emf/emf_plus/records/primitives/metafile.rb +19 -0
- data/lib/emf/emf_plus/records/primitives/palette.rb +21 -0
- data/lib/emf/emf_plus/records/primitives/path.rb +89 -0
- data/lib/emf/emf_plus/records/primitives/path_point_type.rb +21 -0
- data/lib/emf/emf_plus/records/primitives/path_point_type_rle.rb +23 -0
- data/lib/emf/emf_plus/records/primitives/point.rb +18 -0
- data/lib/emf/emf_plus/records/primitives/point_array.rb +42 -0
- data/lib/emf/emf_plus/records/primitives/point_f.rb +19 -0
- data/lib/emf/emf_plus/records/primitives/point_r.rb +19 -0
- data/lib/emf/emf_plus/records/primitives/rect.rb +20 -0
- data/lib/emf/emf_plus/records/primitives/rect_array.rb +24 -0
- data/lib/emf/emf_plus/records/primitives/rect_f.rb +21 -0
- data/lib/emf/emf_plus/records/primitives/region_node.rb +68 -0
- data/lib/emf/emf_plus/records/primitives/region_node_child_nodes.rb +22 -0
- data/lib/emf/emf_plus/records/primitives/region_node_path.rb +37 -0
- data/lib/emf/emf_plus/records/primitives/relative_coordinate.rb +32 -0
- data/lib/emf/emf_plus/records/primitives/string_format_data.rb +23 -0
- data/lib/emf/emf_plus/records/primitives/transform_matrix.rb +23 -0
- data/lib/emf/emf_plus/records/primitives.rb +41 -0
- data/lib/emf/emf_plus/records/reset_clip.rb +17 -0
- data/lib/emf/emf_plus/records/reset_world_transform.rb +17 -0
- data/lib/emf/emf_plus/records/restore.rb +20 -0
- data/lib/emf/emf_plus/records/rotate_world_transform.rb +24 -0
- data/lib/emf/emf_plus/records/save.rb +20 -0
- data/lib/emf/emf_plus/records/scale_world_transform.rb +26 -0
- data/lib/emf/emf_plus/records/serializable_object.rb +32 -0
- data/lib/emf/emf_plus/records/set_anti_alias_mode.rb +25 -0
- data/lib/emf/emf_plus/records/set_clip_path.rb +20 -0
- data/lib/emf/emf_plus/records/set_clip_rect.rb +24 -0
- data/lib/emf/emf_plus/records/set_clip_region.rb +20 -0
- data/lib/emf/emf_plus/records/set_compositing_mode.rb +21 -0
- data/lib/emf/emf_plus/records/set_compositing_quality.rb +21 -0
- data/lib/emf/emf_plus/records/set_interpolation_mode.rb +21 -0
- data/lib/emf/emf_plus/records/set_page_transform.rb +25 -0
- data/lib/emf/emf_plus/records/set_pixel_offset_mode.rb +21 -0
- data/lib/emf/emf_plus/records/set_rendering_origin.rb +22 -0
- data/lib/emf/emf_plus/records/set_text_contrast.rb +24 -0
- data/lib/emf/emf_plus/records/set_text_rendering_hint.rb +21 -0
- data/lib/emf/emf_plus/records/set_ts_clip.rb +40 -0
- data/lib/emf/emf_plus/records/set_ts_graphics.rb +88 -0
- data/lib/emf/emf_plus/records/set_world_transform.rb +22 -0
- data/lib/emf/emf_plus/records/shape_flags.rb +23 -0
- data/lib/emf/emf_plus/records/translate_world_transform.rb +26 -0
- data/lib/emf/emf_plus/records/unknown.rb +20 -0
- data/lib/emf/emf_plus/records.rb +107 -0
- data/lib/emf/emf_plus/serializer.rb +20 -0
- data/lib/emf/emf_plus/stream/conformance.rb +68 -0
- data/lib/emf/emf_plus/stream/editor.rb +21 -0
- data/lib/emf/emf_plus/stream/emf_gap.rb +20 -0
- data/lib/emf/emf_plus/stream/link_index.rb +30 -0
- data/lib/emf/emf_plus/stream/rebuild.rb +47 -0
- data/lib/emf/emf_plus/stream/record_handle.rb +26 -0
- data/lib/emf/emf_plus/stream/segment.rb +70 -0
- data/lib/emf/emf_plus/stream.rb +153 -0
- data/lib/emf/emf_plus.rb +18 -0
- data/lib/emf/emr/binary/dib_header.rb +142 -0
- data/lib/emf/emr/binary/ext_text_out_fields.rb +43 -0
- data/lib/emf/emr/binary/extended_pen_buffers.rb +23 -0
- data/lib/emf/emr/binary/fast_fill.rb +1164 -0
- data/lib/emf/emr/binary/font.rb +159 -0
- data/lib/emf/emr/binary/header.rb +41 -0
- data/lib/emf/emr/binary/lazy_utf16_array.rb +82 -0
- data/lib/emf/emr/binary/pack_plan.rb +144 -0
- data/lib/emf/emr/binary/pack_plan_check.rb +75 -0
- data/lib/emf/emr/binary/pack_plan_exact.rb +130 -0
- data/lib/emf/emr/binary/pack_plan_generate.rb +116 -0
- data/lib/emf/emr/binary/pack_plan_values.rb +92 -0
- data/lib/emf/emr/binary/palette_body.rb +19 -0
- data/lib/emf/emr/binary/palette_entry.rb +18 -0
- data/lib/emf/emr/binary/record.rb +50 -0
- data/lib/emf/emr/binary/records/abort_path.rb +16 -0
- data/lib/emf/emr/binary/records/alpha_blend.rb +60 -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 +51 -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 +71 -0
- data/lib/emf/emr/binary/records/colormatch_to_target_w.rb +92 -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 +83 -0
- data/lib/emf/emr/binary/records/create_colorspace_w.rb +106 -0
- data/lib/emf/emr/binary/records/create_dib_pattern_brush_pt.rb +39 -0
- data/lib/emf/emr/binary/records/create_font_indirect_w.rb +22 -0
- data/lib/emf/emr/binary/records/create_mono_brush.rb +39 -0
- data/lib/emf/emr/binary/records/create_palette.rb +35 -0
- data/lib/emf/emr/binary/records/create_pen.rb +20 -0
- data/lib/emf/emr/binary/records/delete_colorspace.rb +38 -0
- data/lib/emf/emr/binary/records/delete_object.rb +16 -0
- data/lib/emf/emr/binary/records/draw_escape.rb +61 -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 +30 -0
- data/lib/emf/emr/binary/records/exclude_clip_rect.rb +16 -0
- data/lib/emf/emr/binary/records/ext_create_pen.rb +96 -0
- data/lib/emf/emr/binary/records/ext_escape.rb +61 -0
- data/lib/emf/emr/binary/records/ext_flood_fill.rb +24 -0
- data/lib/emf/emr/binary/records/ext_select_clip_rgn.rb +27 -0
- data/lib/emf/emr/binary/records/ext_text_out_a.rb +40 -0
- data/lib/emf/emr/binary/records/ext_text_out_w.rb +52 -0
- data/lib/emf/emr/binary/records/fill_path.rb +16 -0
- data/lib/emf/emr/binary/records/fill_rgn.rb +26 -0
- data/lib/emf/emr/binary/records/flatten_path.rb +16 -0
- data/lib/emf/emr/binary/records/force_ufi_mapping.rb +54 -0
- data/lib/emf/emr/binary/records/frame_rgn.rb +27 -0
- data/lib/emf/emr/binary/records/gls_bounded_record.rb +77 -0
- data/lib/emf/emr/binary/records/gls_record.rb +58 -0
- data/lib/emf/emr/binary/records/gradient_fill.rb +26 -0
- data/lib/emf/emr/binary/records/intersect_clip_rect.rb +16 -0
- data/lib/emf/emr/binary/records/invert_rgn.rb +25 -0
- data/lib/emf/emr/binary/records/line_to.rb +16 -0
- data/lib/emf/emr/binary/records/mask_blt.rb +83 -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 +94 -0
- data/lib/emf/emr/binary/records/offset_clip_rgn.rb +16 -0
- data/lib/emf/emr/binary/records/paint_rgn.rb +25 -0
- data/lib/emf/emr/binary/records/pie.rb +19 -0
- data/lib/emf/emr/binary/records/pixel_format.rb +92 -0
- data/lib/emf/emr/binary/records/plg_blt.rb +83 -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 +144 -0
- data/lib/emf/emr/binary/records/poly_textout_w.rb +144 -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 +22 -0
- data/lib/emf/emr/binary/records/realize_palette.rb +16 -0
- data/lib/emf/emr/binary/records/rectangle.rb +18 -0
- data/lib/emf/emr/binary/records/resize_palette.rb +31 -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 +17 -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_color_adjustment.rb +136 -0
- data/lib/emf/emr/binary/records/set_colorspace.rb +38 -0
- data/lib/emf/emr/binary/records/set_dibits_to_device.rb +60 -0
- data/lib/emf/emr/binary/records/set_icm_mode.rb +16 -0
- data/lib/emf/emr/binary/records/set_icm_profile_a.rb +87 -0
- data/lib/emf/emr/binary/records/set_icm_profile_w.rb +87 -0
- data/lib/emf/emr/binary/records/set_layout.rb +16 -0
- data/lib/emf/emr/binary/records/set_linked_ufis.rb +65 -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 +35 -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 +23 -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 +79 -0
- data/lib/emf/emr/binary/records/stretch_blt.rb +53 -0
- data/lib/emf/emr/binary/records/stretch_dibits.rb +56 -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 +60 -0
- data/lib/emf/emr/binary/records/widen_path.rb +16 -0
- data/lib/emf/emr/binary/records.rb +260 -0
- data/lib/emf/emr/binary/region_data.rb +33 -0
- data/lib/emf/emr/binary/state_record_body.rb +33 -0
- data/lib/emf/emr/binary/thin_shell.rb +226 -0
- data/lib/emf/emr/binary/type_codes.rb +132 -0
- data/lib/emf/emr/binary/value_view/layout.rb +101 -0
- data/lib/emf/emr/binary/value_view/reader_source.rb +88 -0
- data/lib/emf/emr/binary/value_view.rb +173 -0
- data/lib/emf/emr/binary/variable_buffers.rb +87 -0
- data/lib/emf/emr/binary/with_bounds.rb +15 -0
- data/lib/emf/emr/binary.rb +17 -0
- data/lib/emf/emr/filled_record.rb +77 -0
- data/lib/emf/emr/parser.rb +374 -0
- data/lib/emf/emr/path_association.rb +16 -0
- data/lib/emf/emr/serializer.rb +23 -0
- data/lib/emf/emr.rb +11 -0
- data/lib/emf/error.rb +42 -0
- data/lib/emf/model/diagnostic.rb +41 -0
- data/lib/emf/model/emr/header.rb +132 -0
- data/lib/emf/model/emr/records.rb +184 -0
- data/lib/emf/model/emr/wire_values.rb +43 -0
- data/lib/emf/model/emr.rb +11 -0
- data/lib/emf/model/geometry/color.rb +85 -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 +54 -0
- data/lib/emf/model/record.rb +19 -0
- data/lib/emf/model/visitor.rb +42 -0
- data/lib/emf/model/wmf/bitmap_records.rb +155 -0
- data/lib/emf/model/wmf/brush_records.rb +45 -0
- data/lib/emf/model/wmf/dc_escape_records.rb +67 -0
- data/lib/emf/model/wmf/font_record.rb +40 -0
- data/lib/emf/model/wmf/geometry_records.rb +107 -0
- data/lib/emf/model/wmf/header.rb +36 -0
- data/lib/emf/model/wmf/object_records.rb +71 -0
- data/lib/emf/model/wmf/palette_records.rb +68 -0
- data/lib/emf/model/wmf/records.rb +247 -0
- data/lib/emf/model/wmf/region_records.rb +112 -0
- data/lib/emf/model/wmf/state_records.rb +188 -0
- data/lib/emf/model/wmf/text_records.rb +36 -0
- data/lib/emf/model/wmf.rb +11 -0
- data/lib/emf/model.rb +13 -0
- data/lib/emf/native/aarch64-linux-musl/libemf_ffi.so +0 -0
- data/lib/emf/native/bitmap_fields.rb +58 -0
- data/lib/emf/native/diagnostic_contract.rb +39 -0
- data/lib/emf/native/diagnostics.rb +81 -0
- data/lib/emf/native/emf_plus_loader.rb +35 -0
- data/lib/emf/native/emf_plus_snapshot.rb +96 -0
- data/lib/emf/native/emf_plus_source.rb +20 -0
- data/lib/emf/native/emf_plus_stream.rb +150 -0
- data/lib/emf/native/fields.rb +369 -0
- data/lib/emf/native/font_fields.rb +87 -0
- data/lib/emf/native/gradient_fields.rb +23 -0
- data/lib/emf/native/header.rb +35 -0
- data/lib/emf/native/header_errors.rb +30 -0
- data/lib/emf/native/hydrator.rb +151 -0
- data/lib/emf/native/lazy_wire.rb +100 -0
- data/lib/emf/native/legacy_state_fields.rb +22 -0
- data/lib/emf/native/library_path.rb +68 -0
- data/lib/emf/native/loader.rb +120 -0
- data/lib/emf/native/palette_fields.rb +45 -0
- data/lib/emf/native/platforms.json +6 -0
- data/lib/emf/native/poly_text_fields.rb +116 -0
- data/lib/emf/native/provenance.json +11 -0
- data/lib/emf/native/resource_failure.rb +28 -0
- data/lib/emf/native/small_text_fields.rb +27 -0
- data/lib/emf/native/snapshot.rb +102 -0
- data/lib/emf/native/wmf_bitmap_fields.rb +58 -0
- data/lib/emf/native/wmf_brush_fields.rb +62 -0
- data/lib/emf/native/wmf_fields.rb +117 -0
- data/lib/emf/native/wmf_hydrator.rb +143 -0
- data/lib/emf/native/wmf_loading.rb +49 -0
- data/lib/emf/native/wmf_palette_fields.rb +60 -0
- data/lib/emf/native/wmf_region_fields.rb +92 -0
- data/lib/emf/native/wmf_rejection.rb +84 -0
- data/lib/emf/native/wmf_remaining_fields.rb +70 -0
- data/lib/emf/native/wmf_snapshot.rb +51 -0
- data/lib/emf/native/wmf_text_fields.rb +56 -0
- data/lib/emf/native.rb +61 -0
- data/lib/emf/parse_evidence.rb +57 -0
- data/lib/emf/resource_budget/bitmap.rb +66 -0
- data/lib/emf/resource_budget/gradient.rb +30 -0
- data/lib/emf/resource_budget/poly_text.rb +85 -0
- data/lib/emf/resource_budget.rb +382 -0
- data/lib/emf/resource_limits/emf_records.rb +130 -0
- data/lib/emf/resource_limits.rb +58 -0
- data/lib/emf/version.rb +5 -0
- data/lib/emf/visitors/dump.rb +61 -0
- data/lib/emf/visitors/stats.rb +64 -0
- data/lib/emf/visitors.rb +8 -0
- data/lib/emf/wmf/binary.rb +158 -0
- data/lib/emf/wmf/bitmap_codec.rb +118 -0
- data/lib/emf/wmf/brush_codec.rb +102 -0
- data/lib/emf/wmf/dc_escape_codec.rb +75 -0
- data/lib/emf/wmf/dib.rb +187 -0
- data/lib/emf/wmf/embedded_emf.rb +137 -0
- data/lib/emf/wmf/escape_views.rb +89 -0
- data/lib/emf/wmf/evidence.rb +255 -0
- data/lib/emf/wmf/geometry_codec.rb +49 -0
- data/lib/emf/wmf/palette_codec.rb +85 -0
- data/lib/emf/wmf/parser.rb +158 -0
- data/lib/emf/wmf/recovery.rb +95 -0
- data/lib/emf/wmf/region_codec.rb +151 -0
- data/lib/emf/wmf/serializer.rb +175 -0
- data/lib/emf/wmf/text_codec.rb +123 -0
- data/lib/emf/wmf.rb +16 -0
- data/lib/emf.rb +60 -0
- metadata +520 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Ensure the shared bindata primitives (rectl, point_l, color_ref, etc.) are
|
|
4
|
+
# registered before any record class is parsed. Referencing the constant
|
|
5
|
+
# triggers autoload of emf/binary/types, which calls
|
|
6
|
+
# BinData::RegisteredClasses.register for each primitive.
|
|
7
|
+
|
|
8
|
+
module Emf
|
|
9
|
+
module Emr
|
|
10
|
+
module Binary
|
|
11
|
+
module Records
|
|
12
|
+
autoload :Raw, "emf/emr/binary/records/raw"
|
|
13
|
+
autoload :Eof, "emf/emr/binary/records/eof"
|
|
14
|
+
autoload :SetTextColor, "emf/emr/binary/records/set_text_color"
|
|
15
|
+
autoload :SetColorAdjustment, "emf/emr/binary/records/set_color_adjustment"
|
|
16
|
+
autoload :SetBkColor, "emf/emr/binary/records/set_bk_color"
|
|
17
|
+
autoload :SetBkMode, "emf/emr/binary/records/set_bk_mode"
|
|
18
|
+
autoload :SetMapMode, "emf/emr/binary/records/set_map_mode"
|
|
19
|
+
autoload :SetRop2, "emf/emr/binary/records/set_rop2"
|
|
20
|
+
autoload :SetPolyFillMode, "emf/emr/binary/records/set_poly_fill_mode"
|
|
21
|
+
autoload :SetTextAlign, "emf/emr/binary/records/set_text_align"
|
|
22
|
+
autoload :SetStretchBltMode, "emf/emr/binary/records/set_stretch_blt_mode"
|
|
23
|
+
autoload :SaveDc, "emf/emr/binary/records/save_dc"
|
|
24
|
+
autoload :RestoreDc, "emf/emr/binary/records/restore_dc"
|
|
25
|
+
autoload :SelectObject, "emf/emr/binary/records/select_object"
|
|
26
|
+
autoload :DeleteObject, "emf/emr/binary/records/delete_object"
|
|
27
|
+
autoload :CreatePen, "emf/emr/binary/records/create_pen"
|
|
28
|
+
autoload :CreateBrushIndirect, "emf/emr/binary/records/create_brush_indirect"
|
|
29
|
+
autoload :SetWindowOrgEx, "emf/emr/binary/records/set_window_org_ex"
|
|
30
|
+
autoload :SetWindowExtEx, "emf/emr/binary/records/set_window_ext_ex"
|
|
31
|
+
autoload :SetViewportOrgEx, "emf/emr/binary/records/set_viewport_org_ex"
|
|
32
|
+
autoload :SetViewportExtEx, "emf/emr/binary/records/set_viewport_ext_ex"
|
|
33
|
+
autoload :SetBrushOrgEx, "emf/emr/binary/records/set_brush_org_ex"
|
|
34
|
+
autoload :MoveToEx, "emf/emr/binary/records/move_to_ex"
|
|
35
|
+
autoload :LineTo, "emf/emr/binary/records/line_to"
|
|
36
|
+
autoload :Rectangle, "emf/emr/binary/records/rectangle"
|
|
37
|
+
autoload :Ellipse, "emf/emr/binary/records/ellipse"
|
|
38
|
+
autoload :RoundRect, "emf/emr/binary/records/round_rect"
|
|
39
|
+
autoload :Arc, "emf/emr/binary/records/arc"
|
|
40
|
+
autoload :ArcTo, "emf/emr/binary/records/arc_to"
|
|
41
|
+
autoload :Chord, "emf/emr/binary/records/chord"
|
|
42
|
+
autoload :Pie, "emf/emr/binary/records/pie"
|
|
43
|
+
autoload :AngleArc, "emf/emr/binary/records/angle_arc"
|
|
44
|
+
autoload :SetArcDirection, "emf/emr/binary/records/set_arc_direction"
|
|
45
|
+
autoload :Polygon, "emf/emr/binary/records/polygon"
|
|
46
|
+
autoload :Polyline, "emf/emr/binary/records/polyline"
|
|
47
|
+
autoload :PolyBezier, "emf/emr/binary/records/poly_bezier"
|
|
48
|
+
autoload :Polygon16, "emf/emr/binary/records/polygon16"
|
|
49
|
+
autoload :Polyline16, "emf/emr/binary/records/polyline16"
|
|
50
|
+
autoload :PolyBezier16, "emf/emr/binary/records/poly_bezier16"
|
|
51
|
+
autoload :PolyBezierTo, "emf/emr/binary/records/poly_bezier_to"
|
|
52
|
+
autoload :PolyBezierTo16, "emf/emr/binary/records/poly_bezier_to16"
|
|
53
|
+
autoload :PolylineTo, "emf/emr/binary/records/polyline_to"
|
|
54
|
+
autoload :PolylineTo16, "emf/emr/binary/records/polyline_to16"
|
|
55
|
+
autoload :PolyDraw, "emf/emr/binary/records/poly_draw"
|
|
56
|
+
autoload :PolyDraw16, "emf/emr/binary/records/poly_draw16"
|
|
57
|
+
autoload :PolyPolyline, "emf/emr/binary/records/poly_polyline"
|
|
58
|
+
autoload :PolyPolygon, "emf/emr/binary/records/poly_polygon"
|
|
59
|
+
autoload :PolyPolyline16, "emf/emr/binary/records/poly_polyline16"
|
|
60
|
+
autoload :PolyPolygon16, "emf/emr/binary/records/poly_polygon16"
|
|
61
|
+
autoload :Comment, "emf/emr/binary/records/comment"
|
|
62
|
+
autoload :SetWorldTransform, "emf/emr/binary/records/set_world_transform"
|
|
63
|
+
autoload :ModifyWorldTransform, "emf/emr/binary/records/modify_world_transform"
|
|
64
|
+
autoload :BeginPath, "emf/emr/binary/records/begin_path"
|
|
65
|
+
autoload :EndPath, "emf/emr/binary/records/end_path"
|
|
66
|
+
autoload :CloseFigure, "emf/emr/binary/records/close_figure"
|
|
67
|
+
autoload :FillPath, "emf/emr/binary/records/fill_path"
|
|
68
|
+
autoload :StrokePath, "emf/emr/binary/records/stroke_path"
|
|
69
|
+
autoload :StrokeAndFillPath, "emf/emr/binary/records/stroke_and_fill_path"
|
|
70
|
+
autoload :FlattenPath, "emf/emr/binary/records/flatten_path"
|
|
71
|
+
autoload :WidenPath, "emf/emr/binary/records/widen_path"
|
|
72
|
+
autoload :SelectClipPath, "emf/emr/binary/records/select_clip_path"
|
|
73
|
+
autoload :AbortPath, "emf/emr/binary/records/abort_path"
|
|
74
|
+
autoload :SetMiterLimit, "emf/emr/binary/records/set_miter_limit"
|
|
75
|
+
autoload :ExtTextOutW, "emf/emr/binary/records/ext_text_out_w"
|
|
76
|
+
autoload :ExtTextOutA, "emf/emr/binary/records/ext_text_out_a"
|
|
77
|
+
autoload :CreateFontIndirectW, "emf/emr/binary/records/create_font_indirect_w"
|
|
78
|
+
autoload :ExtCreatePen, "emf/emr/binary/records/ext_create_pen"
|
|
79
|
+
autoload :StretchDIBits, "emf/emr/binary/records/stretch_dibits"
|
|
80
|
+
autoload :SetPixelV, "emf/emr/binary/records/set_pixel_v"
|
|
81
|
+
autoload :SetMetArgn, "emf/emr/binary/records/set_metargn"
|
|
82
|
+
autoload :OffsetClipRgn, "emf/emr/binary/records/offset_clip_rgn"
|
|
83
|
+
autoload :ExcludeClipRect, "emf/emr/binary/records/exclude_clip_rect"
|
|
84
|
+
autoload :IntersectClipRect, "emf/emr/binary/records/intersect_clip_rect"
|
|
85
|
+
autoload :ExtSelectClipRgn, "emf/emr/binary/records/ext_select_clip_rgn"
|
|
86
|
+
autoload :ScaleViewportExtEx, "emf/emr/binary/records/scale_viewport_ext_ex"
|
|
87
|
+
autoload :ScaleWindowExtEx, "emf/emr/binary/records/scale_window_ext_ex"
|
|
88
|
+
autoload :SetMapperFlags, "emf/emr/binary/records/set_mapper_flags"
|
|
89
|
+
autoload :RealizePalette, "emf/emr/binary/records/realize_palette"
|
|
90
|
+
autoload :SelectPalette, "emf/emr/binary/records/select_palette"
|
|
91
|
+
autoload :CreatePalette, "emf/emr/binary/records/create_palette"
|
|
92
|
+
autoload :ResizePalette, "emf/emr/binary/records/resize_palette"
|
|
93
|
+
autoload :SetPaletteEntries, "emf/emr/binary/records/set_palette_entries"
|
|
94
|
+
autoload :ExtFloodFill, "emf/emr/binary/records/ext_flood_fill"
|
|
95
|
+
autoload :FillRgn, "emf/emr/binary/records/fill_rgn"
|
|
96
|
+
autoload :FrameRgn, "emf/emr/binary/records/frame_rgn"
|
|
97
|
+
autoload :InvertRgn, "emf/emr/binary/records/invert_rgn"
|
|
98
|
+
autoload :PaintRgn, "emf/emr/binary/records/paint_rgn"
|
|
99
|
+
autoload :BitBlt, "emf/emr/binary/records/bit_blt"
|
|
100
|
+
autoload :StretchBlt, "emf/emr/binary/records/stretch_blt"
|
|
101
|
+
autoload :MaskBlt, "emf/emr/binary/records/mask_blt"
|
|
102
|
+
autoload :PlgBlt, "emf/emr/binary/records/plg_blt"
|
|
103
|
+
autoload :SetDibitsToDevice, "emf/emr/binary/records/set_dibits_to_device"
|
|
104
|
+
autoload :AlphaBlend, "emf/emr/binary/records/alpha_blend"
|
|
105
|
+
autoload :TransparentBlt, "emf/emr/binary/records/transparent_blt"
|
|
106
|
+
autoload :SetLayout, "emf/emr/binary/records/set_layout"
|
|
107
|
+
autoload :SetIcmMode, "emf/emr/binary/records/set_icm_mode"
|
|
108
|
+
autoload :CreateMonoBrush, "emf/emr/binary/records/create_mono_brush"
|
|
109
|
+
autoload :CreateDibPatternBrushPt, "emf/emr/binary/records/create_dib_pattern_brush_pt"
|
|
110
|
+
autoload :GradientFill, "emf/emr/binary/records/gradient_fill"
|
|
111
|
+
autoload :SmallTextOut, "emf/emr/binary/records/small_text_out"
|
|
112
|
+
autoload :DrawEscape, "emf/emr/binary/records/draw_escape"
|
|
113
|
+
autoload :ExtEscape, "emf/emr/binary/records/ext_escape"
|
|
114
|
+
autoload :NamedEscape, "emf/emr/binary/records/named_escape"
|
|
115
|
+
autoload :ColorCorrectPalette, "emf/emr/binary/records/color_correct_palette"
|
|
116
|
+
autoload :SetIcmProfileA, "emf/emr/binary/records/set_icm_profile_a"
|
|
117
|
+
autoload :SetIcmProfileW, "emf/emr/binary/records/set_icm_profile_w"
|
|
118
|
+
autoload :ForceUfiMapping, "emf/emr/binary/records/force_ufi_mapping"
|
|
119
|
+
autoload :SetLinkedUfis, "emf/emr/binary/records/set_linked_ufis"
|
|
120
|
+
autoload :ColorMatchToTargetW, "emf/emr/binary/records/colormatch_to_target_w"
|
|
121
|
+
autoload :CreateColorspaceW, "emf/emr/binary/records/create_colorspace_w"
|
|
122
|
+
autoload :CreateColorspace, "emf/emr/binary/records/create_colorspace"
|
|
123
|
+
autoload :SetColorspace, "emf/emr/binary/records/set_colorspace"
|
|
124
|
+
autoload :DeleteColorspace, "emf/emr/binary/records/delete_colorspace"
|
|
125
|
+
autoload :GlsRecord, "emf/emr/binary/records/gls_record"
|
|
126
|
+
autoload :GlsBoundedRecord, "emf/emr/binary/records/gls_bounded_record"
|
|
127
|
+
autoload :PolyTextOutA, "emf/emr/binary/records/poly_textout_a"
|
|
128
|
+
autoload :PolyTextOutW, "emf/emr/binary/records/poly_textout_w"
|
|
129
|
+
autoload :PixelFormat, "emf/emr/binary/records/pixel_format"
|
|
130
|
+
autoload :SetTextJustification, "emf/emr/binary/records/set_text_justification"
|
|
131
|
+
|
|
132
|
+
TYPE_TO_NAME = {
|
|
133
|
+
Binary::TypeCodes::EOF => :Eof,
|
|
134
|
+
Binary::TypeCodes::SETTEXTCOLOR => :SetTextColor,
|
|
135
|
+
Binary::TypeCodes::SETBKCOLOR => :SetBkColor,
|
|
136
|
+
Binary::TypeCodes::SETBKMODE => :SetBkMode,
|
|
137
|
+
Binary::TypeCodes::SETMAPMODE => :SetMapMode,
|
|
138
|
+
Binary::TypeCodes::SETROP2 => :SetRop2,
|
|
139
|
+
Binary::TypeCodes::SETPOLYFILLMODE => :SetPolyFillMode,
|
|
140
|
+
Binary::TypeCodes::SETTEXTALIGN => :SetTextAlign,
|
|
141
|
+
Binary::TypeCodes::SETSTRETCHBLTMODE => :SetStretchBltMode,
|
|
142
|
+
Binary::TypeCodes::SAVEDC => :SaveDc,
|
|
143
|
+
Binary::TypeCodes::RESTOREDC => :RestoreDc,
|
|
144
|
+
Binary::TypeCodes::SELECTOBJECT => :SelectObject,
|
|
145
|
+
Binary::TypeCodes::DELETEOBJECT => :DeleteObject,
|
|
146
|
+
Binary::TypeCodes::CREATEPEN => :CreatePen,
|
|
147
|
+
Binary::TypeCodes::CREATEBRUSHINDIRECT => :CreateBrushIndirect,
|
|
148
|
+
Binary::TypeCodes::SETWINDOWORGEX => :SetWindowOrgEx,
|
|
149
|
+
Binary::TypeCodes::SETWINDOWEXTEX => :SetWindowExtEx,
|
|
150
|
+
Binary::TypeCodes::SETVIEWPORTORGEX => :SetViewportOrgEx,
|
|
151
|
+
Binary::TypeCodes::SETVIEWPORTEXTEX => :SetViewportExtEx,
|
|
152
|
+
Binary::TypeCodes::SETBRUSHORGEX => :SetBrushOrgEx,
|
|
153
|
+
Binary::TypeCodes::MOVETOEX => :MoveToEx,
|
|
154
|
+
Binary::TypeCodes::LINETO => :LineTo,
|
|
155
|
+
Binary::TypeCodes::RECTANGLE => :Rectangle,
|
|
156
|
+
Binary::TypeCodes::ELLIPSE => :Ellipse,
|
|
157
|
+
Binary::TypeCodes::ROUNDRECT => :RoundRect,
|
|
158
|
+
Binary::TypeCodes::ARC => :Arc,
|
|
159
|
+
Binary::TypeCodes::ARCTO => :ArcTo,
|
|
160
|
+
Binary::TypeCodes::CHORD => :Chord,
|
|
161
|
+
Binary::TypeCodes::PIE => :Pie,
|
|
162
|
+
Binary::TypeCodes::ANGLEARC => :AngleArc,
|
|
163
|
+
Binary::TypeCodes::SETARCDIRECTION => :SetArcDirection,
|
|
164
|
+
Binary::TypeCodes::POLYGON => :Polygon,
|
|
165
|
+
Binary::TypeCodes::POLYLINE => :Polyline,
|
|
166
|
+
Binary::TypeCodes::POLYBEZIER => :PolyBezier,
|
|
167
|
+
Binary::TypeCodes::POLYGON16 => :Polygon16,
|
|
168
|
+
Binary::TypeCodes::POLYLINE16 => :Polyline16,
|
|
169
|
+
Binary::TypeCodes::POLYBEZIER16 => :PolyBezier16,
|
|
170
|
+
Binary::TypeCodes::POLYBEZIERTO => :PolyBezierTo,
|
|
171
|
+
Binary::TypeCodes::POLYBEZIERTO16 => :PolyBezierTo16,
|
|
172
|
+
Binary::TypeCodes::POLYLINETO => :PolylineTo,
|
|
173
|
+
Binary::TypeCodes::POLYLINETO16 => :PolylineTo16,
|
|
174
|
+
Binary::TypeCodes::POLYDRAW => :PolyDraw,
|
|
175
|
+
Binary::TypeCodes::POLYDRAW16 => :PolyDraw16,
|
|
176
|
+
Binary::TypeCodes::POLYPOLYLINE => :PolyPolyline,
|
|
177
|
+
Binary::TypeCodes::POLYPOLYGON => :PolyPolygon,
|
|
178
|
+
Binary::TypeCodes::POLYPOLYLINE16 => :PolyPolyline16,
|
|
179
|
+
Binary::TypeCodes::POLYPOLYGON16 => :PolyPolygon16,
|
|
180
|
+
Binary::TypeCodes::COMMENT => :Comment,
|
|
181
|
+
Binary::TypeCodes::SETWORLDTRANSFORM => :SetWorldTransform,
|
|
182
|
+
Binary::TypeCodes::MODIFYWORLDTRANSFORM => :ModifyWorldTransform,
|
|
183
|
+
Binary::TypeCodes::BEGINPATH => :BeginPath,
|
|
184
|
+
Binary::TypeCodes::ENDPATH => :EndPath,
|
|
185
|
+
Binary::TypeCodes::CLOSEFIGURE => :CloseFigure,
|
|
186
|
+
Binary::TypeCodes::FILLPATH => :FillPath,
|
|
187
|
+
Binary::TypeCodes::STROKEPATH => :StrokePath,
|
|
188
|
+
Binary::TypeCodes::STROKEANDFILLPATH => :StrokeAndFillPath,
|
|
189
|
+
Binary::TypeCodes::FLATTENPATH => :FlattenPath,
|
|
190
|
+
Binary::TypeCodes::WIDENPATH => :WidenPath,
|
|
191
|
+
Binary::TypeCodes::SELECTCLIPPATH => :SelectClipPath,
|
|
192
|
+
Binary::TypeCodes::ABORTPATH => :AbortPath,
|
|
193
|
+
Binary::TypeCodes::SETMITERLIMIT => :SetMiterLimit,
|
|
194
|
+
Binary::TypeCodes::EXTTEXTOUTW => :ExtTextOutW,
|
|
195
|
+
Binary::TypeCodes::EXTTEXTOUTA => :ExtTextOutA,
|
|
196
|
+
Binary::TypeCodes::EXTCREATEFONTINDIRECTW => :CreateFontIndirectW,
|
|
197
|
+
Binary::TypeCodes::EXTCREATEPEN => :ExtCreatePen,
|
|
198
|
+
Binary::TypeCodes::STRETCHDIBITS => :StretchDIBits,
|
|
199
|
+
Binary::TypeCodes::SETPIXELV => :SetPixelV,
|
|
200
|
+
Binary::TypeCodes::OFFSETCLIPRGN => :OffsetClipRgn,
|
|
201
|
+
Binary::TypeCodes::SETMETARGN => :SetMetArgn,
|
|
202
|
+
Binary::TypeCodes::EXCLUDECLIPRECT => :ExcludeClipRect,
|
|
203
|
+
Binary::TypeCodes::INTERSECTCLIPRECT => :IntersectClipRect,
|
|
204
|
+
Binary::TypeCodes::SCALEVIEWPORTEXTEX => :ScaleViewportExtEx,
|
|
205
|
+
Binary::TypeCodes::SCALEWINDOWEXTEX => :ScaleWindowExtEx,
|
|
206
|
+
Binary::TypeCodes::SETMAPPERFLAGS => :SetMapperFlags,
|
|
207
|
+
Binary::TypeCodes::REALIZEPALETTE => :RealizePalette,
|
|
208
|
+
Binary::TypeCodes::SELECTPALETTE => :SelectPalette,
|
|
209
|
+
Binary::TypeCodes::CREATEPALETTE => :CreatePalette,
|
|
210
|
+
Binary::TypeCodes::RESIZEPALETTE => :ResizePalette,
|
|
211
|
+
Binary::TypeCodes::SETPALETTEENTRIES => :SetPaletteEntries,
|
|
212
|
+
Binary::TypeCodes::EXTFLOODFILL => :ExtFloodFill,
|
|
213
|
+
Binary::TypeCodes::EXTSELECTCLIPRGN => :ExtSelectClipRgn,
|
|
214
|
+
Binary::TypeCodes::FILLRGN => :FillRgn,
|
|
215
|
+
Binary::TypeCodes::FRAMERGN => :FrameRgn,
|
|
216
|
+
Binary::TypeCodes::INVERTRGN => :InvertRgn,
|
|
217
|
+
Binary::TypeCodes::PAINTRGN => :PaintRgn,
|
|
218
|
+
Binary::TypeCodes::BITBLT => :BitBlt,
|
|
219
|
+
Binary::TypeCodes::STRETCHBLT => :StretchBlt,
|
|
220
|
+
Binary::TypeCodes::MASKBLT => :MaskBlt,
|
|
221
|
+
Binary::TypeCodes::PLGBLT => :PlgBlt,
|
|
222
|
+
Binary::TypeCodes::SETDIBITSTODEVICE => :SetDibitsToDevice,
|
|
223
|
+
Binary::TypeCodes::ALPHABLEND => :AlphaBlend,
|
|
224
|
+
Binary::TypeCodes::SETLAYOUT => :SetLayout,
|
|
225
|
+
Binary::TypeCodes::TRANSPARENTBLT => :TransparentBlt,
|
|
226
|
+
Binary::TypeCodes::GRADIENTFILL => :GradientFill,
|
|
227
|
+
Binary::TypeCodes::SETICMMODE => :SetIcmMode,
|
|
228
|
+
Binary::TypeCodes::CREATEMONOBRUSH => :CreateMonoBrush,
|
|
229
|
+
Binary::TypeCodes::CREATEDIBPATTERNBRUSHPT => :CreateDibPatternBrushPt,
|
|
230
|
+
Binary::TypeCodes::SMALLTEXTOUT => :SmallTextOut,
|
|
231
|
+
Binary::TypeCodes::DRAWESCAPE => :DrawEscape,
|
|
232
|
+
Binary::TypeCodes::EXTESCAPE => :ExtEscape,
|
|
233
|
+
Binary::TypeCodes::NAMEDESCAPE => :NamedEscape,
|
|
234
|
+
Binary::TypeCodes::COLORCORRECTPALETTE => :ColorCorrectPalette,
|
|
235
|
+
Binary::TypeCodes::SETICMPROFILEA => :SetIcmProfileA,
|
|
236
|
+
Binary::TypeCodes::SETICMPROFILEW => :SetIcmProfileW,
|
|
237
|
+
Binary::TypeCodes::FORCEUFIMAPPING => :ForceUfiMapping,
|
|
238
|
+
Binary::TypeCodes::SETLINKEDUFIS => :SetLinkedUfis,
|
|
239
|
+
Binary::TypeCodes::COLORMATCHTOTARGETW => :ColorMatchToTargetW,
|
|
240
|
+
Binary::TypeCodes::CREATECOLORSPACEW => :CreateColorspaceW,
|
|
241
|
+
Binary::TypeCodes::CREATECOLORSPACE => :CreateColorspace,
|
|
242
|
+
Binary::TypeCodes::SETCOLORSPACE => :SetColorspace,
|
|
243
|
+
Binary::TypeCodes::SETCOLORADJUSTMENT => :SetColorAdjustment,
|
|
244
|
+
Binary::TypeCodes::DELETECOLORSPACE => :DeleteColorspace,
|
|
245
|
+
Binary::TypeCodes::GLSRECORD => :GlsRecord,
|
|
246
|
+
Binary::TypeCodes::GLSBOUNDEDRECORD => :GlsBoundedRecord,
|
|
247
|
+
Binary::TypeCodes::POLYTEXTOUTA => :PolyTextOutA,
|
|
248
|
+
Binary::TypeCodes::POLYTEXTOUTW => :PolyTextOutW,
|
|
249
|
+
Binary::TypeCodes::PIXELFORMAT => :PixelFormat,
|
|
250
|
+
Binary::TypeCodes::SETTEXTJUSTIFICATION => :SetTextJustification
|
|
251
|
+
}.freeze
|
|
252
|
+
|
|
253
|
+
def self.lookup(type_id)
|
|
254
|
+
name = TYPE_TO_NAME[type_id]
|
|
255
|
+
name ? const_get(name) : Raw
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "bindata"
|
|
4
|
+
require "emf/binary/types"
|
|
5
|
+
|
|
6
|
+
module Emf
|
|
7
|
+
module Emr
|
|
8
|
+
module Binary
|
|
9
|
+
# MS-EMF 2.2.24: a 32-byte header followed by RectL objects.
|
|
10
|
+
class RegionData < BinData::Record
|
|
11
|
+
mandatory_parameter :byte_length
|
|
12
|
+
endian :little
|
|
13
|
+
uint32 :header_size, initial_value: 32
|
|
14
|
+
uint32 :region_type
|
|
15
|
+
uint32 :count_rects
|
|
16
|
+
uint32 :rgn_size
|
|
17
|
+
rectl :bounds
|
|
18
|
+
array :rectangles, type: :rectl, initial_length: :bounded_rectangle_count
|
|
19
|
+
string :trailing, read_length: -> { [eval_parameter(:byte_length) - 32 - (count_rects * 16), 0].max }
|
|
20
|
+
|
|
21
|
+
def bounded_rectangle_count
|
|
22
|
+
length = eval_parameter(:byte_length)
|
|
23
|
+
count = count_rects.to_i
|
|
24
|
+
raise BinData::ValidityError, "region rectangles exceed declared region data length" if length < 32 || count * 16 > length - 32
|
|
25
|
+
|
|
26
|
+
count
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
BinData::RegisteredClasses.register("region_data", Emf::Emr::Binary::RegionData)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Emf
|
|
4
|
+
module Emr
|
|
5
|
+
module Binary
|
|
6
|
+
module StateRecordBody
|
|
7
|
+
class Body < String
|
|
8
|
+
def initialize(record, bytes)
|
|
9
|
+
@record = record
|
|
10
|
+
super(bytes)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def assign(bytes)
|
|
14
|
+
@record.body = bytes
|
|
15
|
+
replace(@record.body)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def body
|
|
20
|
+
Body.new(self, to_binary_s.byteslice(8..))
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def body=(value)
|
|
24
|
+
bytes = value.to_s
|
|
25
|
+
raise ArgumentError, "invalid state record body length" if bytes.bytesize < self.class::BODY_SIZE
|
|
26
|
+
|
|
27
|
+
replacement = self.class.read(to_binary_s.byteslice(0, 8) + bytes)
|
|
28
|
+
assign(replacement.snapshot)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Emf
|
|
4
|
+
module Emr
|
|
5
|
+
module Binary
|
|
6
|
+
# The lazy and thin shells of a Record (see FastFill). Included by
|
|
7
|
+
# Record, so every method here is BinData's with its @field_objs
|
|
8
|
+
# settled first.
|
|
9
|
+
module ThinShell
|
|
10
|
+
# A record `FastFill` returns is a thin shell: the record's bytes and
|
|
11
|
+
# offset, no @field_objs. Its fields are copied from the filler's
|
|
12
|
+
# template, with the unpacked value assigned, the first time anything
|
|
13
|
+
# asks for them (every BinData path to a field goes through
|
|
14
|
+
# instantiate_obj_at); that first ask also makes @field_objs, in
|
|
15
|
+
# place, so the record keeps its identity and every field object
|
|
16
|
+
# made afterwards is the one every later read answers. Nothing read
|
|
17
|
+
# straight from @field_objs may see an unmade field as a default, so
|
|
18
|
+
# clear and clear? settle the shell first.
|
|
19
|
+
LAZY_IVARS = %i[@lazy_filler @lazy_data @lazy_base @lazy_built @lazy_patched].freeze
|
|
20
|
+
|
|
21
|
+
def initialize_instance
|
|
22
|
+
@lazy_filler = @lazy_data = @lazy_base = @lazy_built = @lazy_patched = nil
|
|
23
|
+
super
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def clear
|
|
27
|
+
hydrate
|
|
28
|
+
@lazy_filler = nil
|
|
29
|
+
super
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def clear?
|
|
33
|
+
instantiate_all_objs if @lazy_filler
|
|
34
|
+
super
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# A frozen record cannot make @field_objs later, so it is made now;
|
|
38
|
+
# its fields still fill in lazily, as a BinData record's do.
|
|
39
|
+
def freeze
|
|
40
|
+
hydrate if @lazy_filler
|
|
41
|
+
super
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# BinData's dup is shallow: a copy shares @field_objs, so a field
|
|
45
|
+
# either record makes or edits is the other's too. A thin source has
|
|
46
|
+
# no @field_objs yet, so it is made first and shared. The two also
|
|
47
|
+
# share their bytes, so neither is untouched any more.
|
|
48
|
+
def initialize_copy(source)
|
|
49
|
+
super
|
|
50
|
+
return unless @lazy_filler
|
|
51
|
+
|
|
52
|
+
source.send(:hydrate)
|
|
53
|
+
@field_objs = source.instance_variable_get(:@field_objs)
|
|
54
|
+
@lazy_patched = true
|
|
55
|
+
source.instance_variable_set(:@lazy_patched, true) unless source.frozen?
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# The filler is generated code Marshal cannot dump, so a record is
|
|
59
|
+
# dumped as the plain BinData record it reads as: every field made,
|
|
60
|
+
# no lazy source.
|
|
61
|
+
def marshal_dump
|
|
62
|
+
instantiate_all_objs if @lazy_filler
|
|
63
|
+
@field_objs&.each { |field| field.settle_points if field.is_a?(FastFill::FlatPoints) }
|
|
64
|
+
(instance_variables - LAZY_IVARS).to_h { |name| [name, instance_variable_get(name)] }
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def marshal_load(ivars)
|
|
68
|
+
ivars.each { |name, value| instance_variable_set(name, value) }
|
|
69
|
+
LAZY_IVARS.each { |name| instance_variable_set(name, nil) }
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Fixed-layout records serialize with one Array#pack, as WireAdapter
|
|
73
|
+
# already does; a block or a layout with floats is BinData's writer.
|
|
74
|
+
def to_binary_s(&block)
|
|
75
|
+
packed = built_binary_s unless block
|
|
76
|
+
return packed if packed
|
|
77
|
+
|
|
78
|
+
return thin_binary_s if !block && thin_parsed?
|
|
79
|
+
|
|
80
|
+
packed = FastFill.for_class(self.class)&.pack(self) unless block
|
|
81
|
+
packed || super
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# [data, offset, untouched] of the bytes a shell is filled from, nil
|
|
85
|
+
# for any other record. `untouched` is true while no field has been
|
|
86
|
+
# made: a field not made is still its bytes, a field made may have
|
|
87
|
+
# been edited and is read from the wire.
|
|
88
|
+
def lazy_source
|
|
89
|
+
return unless @lazy_filler
|
|
90
|
+
|
|
91
|
+
[@lazy_data, @lazy_base, !@lazy_patched && (@field_objs.nil? || @field_objs.all?(&:nil?))]
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Makes a fresh record the thin shell of the record at `base` of
|
|
95
|
+
# `data`: no field made and no @field_objs. `params` and `names` are
|
|
96
|
+
# the template's, shared as a copy of it would share them. A built
|
|
97
|
+
# shell's data is the whole record, packed from the attributes.
|
|
98
|
+
def thin(data, base, filler, params, names, built)
|
|
99
|
+
@params = params
|
|
100
|
+
@field_names = names
|
|
101
|
+
@lazy_data = data
|
|
102
|
+
@lazy_base = base
|
|
103
|
+
@lazy_filler = filler
|
|
104
|
+
@lazy_built = built
|
|
105
|
+
self
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# The size of a built shell no field of which, bar n_size, has been made
|
|
109
|
+
# (fixed layouts never change size, a point array's size is its bytes').
|
|
110
|
+
def num_bytes
|
|
111
|
+
return @lazy_data.bytesize if built_clean?
|
|
112
|
+
return @lazy_filler.record_size(@lazy_data, @lazy_base) if thin_parsed?
|
|
113
|
+
|
|
114
|
+
super
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# The record's bytes while a built shell still is them (n_size patched
|
|
118
|
+
# in), else nil.
|
|
119
|
+
def built_binary_s
|
|
120
|
+
return unless built_clean?
|
|
121
|
+
|
|
122
|
+
bytes = @lazy_data.dup
|
|
123
|
+
size = patched_size
|
|
124
|
+
bytes[4, 4] = [size].pack("V") if size
|
|
125
|
+
bytes
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Appends `built_binary_s` to `out` and answers true, without the copy
|
|
129
|
+
# when n_size needs no patch; false (nothing appended) for any other
|
|
130
|
+
# record.
|
|
131
|
+
def append_built_to?(out)
|
|
132
|
+
return false unless built_clean?
|
|
133
|
+
|
|
134
|
+
out << (patched_size ? built_binary_s : @lazy_data)
|
|
135
|
+
true
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Appends the record's bytes to `out`: the built fast path, else
|
|
139
|
+
# `to_binary_s`.
|
|
140
|
+
def append_to(out)
|
|
141
|
+
return out if append_built_to?(out)
|
|
142
|
+
|
|
143
|
+
out << to_binary_s
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
private
|
|
147
|
+
|
|
148
|
+
# `n_size=` on a built shell whose n_size is not made: the new value
|
|
149
|
+
# goes into the shell's own bytes (only n_size is there) and the
|
|
150
|
+
# field is made, from them, if it is asked for. A value the bytes
|
|
151
|
+
# already hold writes nothing: a write would copy the buffer a
|
|
152
|
+
# `to_binary_s` dup still shares. Anything that is not
|
|
153
|
+
# a uint32 Integer is BinData's to assign (or to refuse); nil then,
|
|
154
|
+
# the assigned value otherwise.
|
|
155
|
+
def packed_assign(index, value)
|
|
156
|
+
return unless index == N_SIZE_INDEX && @lazy_built && @lazy_filler &&
|
|
157
|
+
value.instance_of?(Integer) && value >= 0 && value <= 0xFFFF_FFFF
|
|
158
|
+
|
|
159
|
+
@lazy_patched = true
|
|
160
|
+
data = @lazy_data
|
|
161
|
+
low = value & 0xFFFF
|
|
162
|
+
high = value >> 16
|
|
163
|
+
return value if data.getbyte(4) | (data.getbyte(5) << 8) == low &&
|
|
164
|
+
data.getbyte(6) | (data.getbyte(7) << 8) == high
|
|
165
|
+
|
|
166
|
+
data.setbyte(4, low & 0xFF)
|
|
167
|
+
data.setbyte(5, low >> 8)
|
|
168
|
+
data.setbyte(6, high & 0xFF)
|
|
169
|
+
data.setbyte(7, high >> 8)
|
|
170
|
+
value
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
N_SIZE_INDEX = 1
|
|
174
|
+
private_constant :N_SIZE_INDEX
|
|
175
|
+
|
|
176
|
+
# The n_size to patch into a built shell's bytes, nil when the bytes
|
|
177
|
+
# already hold it.
|
|
178
|
+
def patched_size
|
|
179
|
+
size = @field_objs&.[](N_SIZE_INDEX)&.value
|
|
180
|
+
size if size && size != @lazy_data.unpack1("V", offset: 4)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# A built shell whose bytes are still the record: only n_size, which
|
|
184
|
+
# is patched into them, may have been made.
|
|
185
|
+
def built_clean?
|
|
186
|
+
return false unless @lazy_built && @lazy_filler
|
|
187
|
+
return true if @field_objs.nil?
|
|
188
|
+
|
|
189
|
+
made = @field_objs.size - @field_objs.count(nil)
|
|
190
|
+
return true if made.zero?
|
|
191
|
+
|
|
192
|
+
# A value that is not an Integer is BinData's to write (or refuse).
|
|
193
|
+
made == 1 && @field_objs[N_SIZE_INDEX]&.value.instance_of?(Integer)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# A thin shell of a parsed record: its bytes are in the input.
|
|
197
|
+
def thin_parsed?
|
|
198
|
+
@field_objs.nil? && @lazy_filler && !@lazy_built
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def thin_binary_s
|
|
202
|
+
@lazy_data.byteslice(@lazy_base, @lazy_filler.record_size(@lazy_data, @lazy_base))
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Makes @field_objs of a thin shell: every slot unmade.
|
|
206
|
+
def hydrate
|
|
207
|
+
@field_objs = Array.new(@lazy_filler.field_count) if @field_objs.nil?
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
def find_index_of(obj)
|
|
211
|
+
hydrate
|
|
212
|
+
super
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
def instantiate_obj_at(index)
|
|
216
|
+
return super unless @lazy_filler
|
|
217
|
+
|
|
218
|
+
hydrate
|
|
219
|
+
return unless @field_objs[index].nil?
|
|
220
|
+
|
|
221
|
+
@field_objs[index] = @lazy_filler.lazy_field(index, self, @lazy_data, @lazy_base)
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
end
|