yass-css 0.2.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/CHANGELOG.md +11 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/Cargo.lock +1447 -0
- data/Cargo.toml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +139 -0
- data/Rakefile +130 -0
- data/codegen/ruby_module_tree.rb +178 -0
- data/codegen/rust_file_set.rb +84 -0
- data/codegen/utils.rb +27 -0
- data/dockerfiles/windows.dockerfile +3 -0
- data/examples/basic_example.rb +32 -0
- data/examples/font_example.rb +19 -0
- data/examples/media_example.rb +31 -0
- data/examples/visitor_example.rb +41 -0
- data/ext/.DS_Store +0 -0
- data/ext/yass/Cargo.toml +24 -0
- data/ext/yass/extconf.rb +6 -0
- data/ext/yass/src/.DS_Store +0 -0
- data/ext/yass/src/cached_value.rs +48 -0
- data/ext/yass/src/cached_value_list.rs +63 -0
- data/ext/yass/src/declarations/.DS_Store +0 -0
- data/ext/yass/src/declarations/align_content.rs +19 -0
- data/ext/yass/src/declarations/align_flags.rs +26 -0
- data/ext/yass/src/declarations/align_items.rs +37 -0
- data/ext/yass/src/declarations/align_self.rs +19 -0
- data/ext/yass/src/declarations/alignment_baseline.rs +27 -0
- data/ext/yass/src/declarations/angle.rs +25 -0
- data/ext/yass/src/declarations/animation/auto.rs +8 -0
- data/ext/yass/src/declarations/animation/init.rs +40 -0
- data/ext/yass/src/declarations/animation/inset.rs +50 -0
- data/ext/yass/src/declarations/animation/length_auto.rs +8 -0
- data/ext/yass/src/declarations/animation/mod.rs +11 -0
- data/ext/yass/src/declarations/animation/range_value.rs +47 -0
- data/ext/yass/src/declarations/animation/scroll_axis.rs +22 -0
- data/ext/yass/src/declarations/animation/scroll_function.rs +40 -0
- data/ext/yass/src/declarations/animation/scroller.rs +21 -0
- data/ext/yass/src/declarations/animation/timeline_name.rs +16 -0
- data/ext/yass/src/declarations/animation/timing_function/cubic_bezier.rs +60 -0
- data/ext/yass/src/declarations/animation/timing_function/init.rs +29 -0
- data/ext/yass/src/declarations/animation/timing_function/keyword.rs +23 -0
- data/ext/yass/src/declarations/animation/timing_function/mod.rs +5 -0
- data/ext/yass/src/declarations/animation/timing_function/piecewise_linear_function.rs +49 -0
- data/ext/yass/src/declarations/animation/timing_function/steps.rs +30 -0
- data/ext/yass/src/declarations/animation/view_function.rs +40 -0
- data/ext/yass/src/declarations/animation_composition.rs +29 -0
- data/ext/yass/src/declarations/animation_delay.rs +30 -0
- data/ext/yass/src/declarations/animation_direction.rs +30 -0
- data/ext/yass/src/declarations/animation_duration.rs +67 -0
- data/ext/yass/src/declarations/animation_fill_mode.rs +30 -0
- data/ext/yass/src/declarations/animation_iteration_count.rs +33 -0
- data/ext/yass/src/declarations/animation_name.rs +23 -0
- data/ext/yass/src/declarations/animation_play_state.rs +28 -0
- data/ext/yass/src/declarations/animation_range_end.rs +30 -0
- data/ext/yass/src/declarations/animation_range_start.rs +30 -0
- data/ext/yass/src/declarations/animation_timeline.rs +42 -0
- data/ext/yass/src/declarations/animation_timing_function.rs +46 -0
- data/ext/yass/src/declarations/aspect_ratio.rs +43 -0
- data/ext/yass/src/declarations/backdrop_filter.rs +30 -0
- data/ext/yass/src/declarations/backface_visibility.rs +20 -0
- data/ext/yass/src/declarations/background_attachment.rs +25 -0
- data/ext/yass/src/declarations/background_blend_mode.rs +42 -0
- data/ext/yass/src/declarations/background_clip.rs +25 -0
- data/ext/yass/src/declarations/background_color.rs +30 -0
- data/ext/yass/src/declarations/background_image.rs +30 -0
- data/ext/yass/src/declarations/background_origin.rs +29 -0
- data/ext/yass/src/declarations/background_position_x.rs +30 -0
- data/ext/yass/src/declarations/background_position_y.rs +30 -0
- data/ext/yass/src/declarations/background_repeat.rs +58 -0
- data/ext/yass/src/declarations/background_size.rs +120 -0
- data/ext/yass/src/declarations/baseline_shift.rs +63 -0
- data/ext/yass/src/declarations/baseline_source.rs +21 -0
- data/ext/yass/src/declarations/block_size.rs +30 -0
- data/ext/yass/src/declarations/border_block_end_color.rs +30 -0
- data/ext/yass/src/declarations/border_block_end_style.rs +19 -0
- data/ext/yass/src/declarations/border_block_end_width.rs +24 -0
- data/ext/yass/src/declarations/border_block_start_color.rs +30 -0
- data/ext/yass/src/declarations/border_block_start_style.rs +19 -0
- data/ext/yass/src/declarations/border_block_start_width.rs +24 -0
- data/ext/yass/src/declarations/border_bottom_color.rs +30 -0
- data/ext/yass/src/declarations/border_bottom_left_radius.rs +40 -0
- data/ext/yass/src/declarations/border_bottom_right_radius.rs +40 -0
- data/ext/yass/src/declarations/border_bottom_style.rs +19 -0
- data/ext/yass/src/declarations/border_bottom_width.rs +24 -0
- data/ext/yass/src/declarations/border_collapse.rs +20 -0
- data/ext/yass/src/declarations/border_end_end_radius.rs +40 -0
- data/ext/yass/src/declarations/border_end_start_radius.rs +40 -0
- data/ext/yass/src/declarations/border_image_outset.rs +73 -0
- data/ext/yass/src/declarations/border_image_repeat.rs +30 -0
- data/ext/yass/src/declarations/border_image_slice.rs +78 -0
- data/ext/yass/src/declarations/border_image_source.rs +28 -0
- data/ext/yass/src/declarations/border_image_width.rs +85 -0
- data/ext/yass/src/declarations/border_inline_end_color.rs +30 -0
- data/ext/yass/src/declarations/border_inline_end_style.rs +19 -0
- data/ext/yass/src/declarations/border_inline_end_width.rs +24 -0
- data/ext/yass/src/declarations/border_inline_start_color.rs +30 -0
- data/ext/yass/src/declarations/border_inline_start_style.rs +19 -0
- data/ext/yass/src/declarations/border_inline_start_width.rs +24 -0
- data/ext/yass/src/declarations/border_left_color.rs +30 -0
- data/ext/yass/src/declarations/border_left_style.rs +19 -0
- data/ext/yass/src/declarations/border_left_width.rs +24 -0
- data/ext/yass/src/declarations/border_right_color.rs +30 -0
- data/ext/yass/src/declarations/border_right_style.rs +19 -0
- data/ext/yass/src/declarations/border_right_width.rs +24 -0
- data/ext/yass/src/declarations/border_spacing.rs +51 -0
- data/ext/yass/src/declarations/border_start_end_radius.rs +40 -0
- data/ext/yass/src/declarations/border_start_start_radius.rs +40 -0
- data/ext/yass/src/declarations/border_style.rs +17 -0
- data/ext/yass/src/declarations/border_top_color.rs +30 -0
- data/ext/yass/src/declarations/border_top_left_radius.rs +40 -0
- data/ext/yass/src/declarations/border_top_right_radius.rs +40 -0
- data/ext/yass/src/declarations/border_top_style.rs +19 -0
- data/ext/yass/src/declarations/border_top_width.rs +24 -0
- data/ext/yass/src/declarations/bottom.rs +28 -0
- data/ext/yass/src/declarations/box_shadow.rs +113 -0
- data/ext/yass/src/declarations/box_sizing.rs +20 -0
- data/ext/yass/src/declarations/calc/abs.rs +32 -0
- data/ext/yass/src/declarations/calc/anchor_function.rs +96 -0
- data/ext/yass/src/declarations/calc/anchor_size_function.rs +84 -0
- data/ext/yass/src/declarations/calc/clamp.rs +58 -0
- data/ext/yass/src/declarations/calc/hypot.rs +30 -0
- data/ext/yass/src/declarations/calc/init.rs +72 -0
- data/ext/yass/src/declarations/calc/invert.rs +32 -0
- data/ext/yass/src/declarations/calc/leaf.rs +36 -0
- data/ext/yass/src/declarations/calc/min_max.rs +40 -0
- data/ext/yass/src/declarations/calc/mod.rs +118 -0
- data/ext/yass/src/declarations/calc/mod_rem.rs +57 -0
- data/ext/yass/src/declarations/calc/negate.rs +32 -0
- data/ext/yass/src/declarations/calc/product.rs +30 -0
- data/ext/yass/src/declarations/calc/round.rs +59 -0
- data/ext/yass/src/declarations/calc/sign.rs +32 -0
- data/ext/yass/src/declarations/calc/sum.rs +30 -0
- data/ext/yass/src/declarations/caption_side.rs +20 -0
- data/ext/yass/src/declarations/caret_color.rs +32 -0
- data/ext/yass/src/declarations/channel_keyword.rs +31 -0
- data/ext/yass/src/declarations/clear.rs +24 -0
- data/ext/yass/src/declarations/clip.rs +135 -0
- data/ext/yass/src/declarations/clip_path/circle_ellipse.rs +168 -0
- data/ext/yass/src/declarations/clip_path/init.rs +267 -0
- data/ext/yass/src/declarations/clip_path/mod.rs +419 -0
- data/ext/yass/src/declarations/clip_path/path.rs +734 -0
- data/ext/yass/src/declarations/clip_path/rect.rs +288 -0
- data/ext/yass/src/declarations/clip_path/shape.rs +672 -0
- data/ext/yass/src/declarations/clip_path/shape_box.rs +71 -0
- data/ext/yass/src/declarations/color/absolute.rs +46 -0
- data/ext/yass/src/declarations/color/absolute_color.rs +53 -0
- data/ext/yass/src/declarations/color/auto.rs +8 -0
- data/ext/yass/src/declarations/color/color.rs +38 -0
- data/ext/yass/src/declarations/color/color_components.rs +25 -0
- data/ext/yass/src/declarations/color/color_function.rs +151 -0
- data/ext/yass/src/declarations/color/color_function_component.rs +61 -0
- data/ext/yass/src/declarations/color/color_interpolation_method.rs +29 -0
- data/ext/yass/src/declarations/color/color_mix.rs +60 -0
- data/ext/yass/src/declarations/color/color_mix_item.rs +43 -0
- data/ext/yass/src/declarations/color/current_color.rs +8 -0
- data/ext/yass/src/declarations/color/init.rs +60 -0
- data/ext/yass/src/declarations/color/light_dark.rs +43 -0
- data/ext/yass/src/declarations/color/mod.rs +69 -0
- data/ext/yass/src/declarations/color/stored_color_function_component.rs +70 -0
- data/ext/yass/src/declarations/color/system_color.rs +60 -0
- data/ext/yass/src/declarations/color_scheme.rs +26 -0
- data/ext/yass/src/declarations/column_count.rs +37 -0
- data/ext/yass/src/declarations/column_gap.rs +74 -0
- data/ext/yass/src/declarations/column_span.rs +20 -0
- data/ext/yass/src/declarations/column_width.rs +70 -0
- data/ext/yass/src/declarations/contain.rs +106 -0
- data/ext/yass/src/declarations/container_name.rs +32 -0
- data/ext/yass/src/declarations/container_type.rs +52 -0
- data/ext/yass/src/declarations/content.rs +309 -0
- data/ext/yass/src/declarations/counter_increment.rs +60 -0
- data/ext/yass/src/declarations/counter_reset.rs +60 -0
- data/ext/yass/src/declarations/csswide_keyword.rs +28 -0
- data/ext/yass/src/declarations/cursor.rs +125 -0
- data/ext/yass/src/declarations/custom.rs +108 -0
- data/ext/yass/src/declarations/declaration.rs +716 -0
- data/ext/yass/src/declarations/direction.rs +20 -0
- data/ext/yass/src/declarations/display.rs +74 -0
- data/ext/yass/src/declarations/empty_cells.rs +20 -0
- data/ext/yass/src/declarations/filter/blur.rs +28 -0
- data/ext/yass/src/declarations/filter/brightness.rs +30 -0
- data/ext/yass/src/declarations/filter/contrast.rs +30 -0
- data/ext/yass/src/declarations/filter/drop_shadow.rs +68 -0
- data/ext/yass/src/declarations/filter/grayscale.rs +30 -0
- data/ext/yass/src/declarations/filter/hue_rotate.rs +28 -0
- data/ext/yass/src/declarations/filter/init.rs +43 -0
- data/ext/yass/src/declarations/filter/invert.rs +30 -0
- data/ext/yass/src/declarations/filter/mod.rs +80 -0
- data/ext/yass/src/declarations/filter/opacity.rs +30 -0
- data/ext/yass/src/declarations/filter/saturate.rs +30 -0
- data/ext/yass/src/declarations/filter/sepia.rs +30 -0
- data/ext/yass/src/declarations/flex_basis.rs +71 -0
- data/ext/yass/src/declarations/flex_direction.rs +22 -0
- data/ext/yass/src/declarations/flex_grow.rs +30 -0
- data/ext/yass/src/declarations/flex_shrink.rs +30 -0
- data/ext/yass/src/declarations/flex_wrap.rs +21 -0
- data/ext/yass/src/declarations/float.rs +23 -0
- data/ext/yass/src/declarations/font_family.rs +28 -0
- data/ext/yass/src/declarations/font_language_override.rs +30 -0
- data/ext/yass/src/declarations/font_optical_sizing.rs +20 -0
- data/ext/yass/src/declarations/font_size.rs +126 -0
- data/ext/yass/src/declarations/font_stretch.rs +102 -0
- data/ext/yass/src/declarations/font_style.rs +101 -0
- data/ext/yass/src/declarations/font_synthesis_weight.rs +20 -0
- data/ext/yass/src/declarations/font_variant_caps.rs +20 -0
- data/ext/yass/src/declarations/font_variation_settings.rs +54 -0
- data/ext/yass/src/declarations/font_weight.rs +85 -0
- data/ext/yass/src/declarations/grid_auto_columns.rs +32 -0
- data/ext/yass/src/declarations/grid_auto_flow.rs +35 -0
- data/ext/yass/src/declarations/grid_auto_rows.rs +33 -0
- data/ext/yass/src/declarations/grid_column_end.rs +39 -0
- data/ext/yass/src/declarations/grid_column_start.rs +39 -0
- data/ext/yass/src/declarations/grid_row_end.rs +39 -0
- data/ext/yass/src/declarations/grid_row_start.rs +39 -0
- data/ext/yass/src/declarations/grid_template.rs +355 -0
- data/ext/yass/src/declarations/grid_template_areas.rs +131 -0
- data/ext/yass/src/declarations/grid_template_columns.rs +31 -0
- data/ext/yass/src/declarations/grid_template_rows.rs +31 -0
- data/ext/yass/src/declarations/height.rs +30 -0
- data/ext/yass/src/declarations/horizontal_position_component.rs +93 -0
- data/ext/yass/src/declarations/image_rendering.rs +21 -0
- data/ext/yass/src/declarations/images/angle_or_percentage.rs +35 -0
- data/ext/yass/src/declarations/images/circle.rs +72 -0
- data/ext/yass/src/declarations/images/conic_gradient.rs +80 -0
- data/ext/yass/src/declarations/images/cross_fade.rs +33 -0
- data/ext/yass/src/declarations/images/cross_fade_element.rs +44 -0
- data/ext/yass/src/declarations/images/cross_fade_image.rs +68 -0
- data/ext/yass/src/declarations/images/ellipse.rs +67 -0
- data/ext/yass/src/declarations/images/ending_shape.rs +38 -0
- data/ext/yass/src/declarations/images/gradient_angle_or_percentage_item.rs +103 -0
- data/ext/yass/src/declarations/images/gradient_length_percentage_item.rs +106 -0
- data/ext/yass/src/declarations/images/image_set.rs +30 -0
- data/ext/yass/src/declarations/images/image_set_item.rs +53 -0
- data/ext/yass/src/declarations/images/init.rs +145 -0
- data/ext/yass/src/declarations/images/light_dark.rs +40 -0
- data/ext/yass/src/declarations/images/line_direction.rs +100 -0
- data/ext/yass/src/declarations/images/linear_gradient.rs +75 -0
- data/ext/yass/src/declarations/images/mod.rs +93 -0
- data/ext/yass/src/declarations/images/none.rs +8 -0
- data/ext/yass/src/declarations/images/position.rs +40 -0
- data/ext/yass/src/declarations/images/radial_gradient.rs +86 -0
- data/ext/yass/src/declarations/images/url.rs +28 -0
- data/ext/yass/src/declarations/init.rs +1620 -0
- data/ext/yass/src/declarations/inline_size.rs +30 -0
- data/ext/yass/src/declarations/inset.rs +114 -0
- data/ext/yass/src/declarations/inset_block_end.rs +28 -0
- data/ext/yass/src/declarations/inset_block_start.rs +28 -0
- data/ext/yass/src/declarations/inset_inline_end.rs +28 -0
- data/ext/yass/src/declarations/inset_inline_start.rs +28 -0
- data/ext/yass/src/declarations/isolation.rs +20 -0
- data/ext/yass/src/declarations/justify_content.rs +19 -0
- data/ext/yass/src/declarations/justify_items.rs +37 -0
- data/ext/yass/src/declarations/justify_self.rs +19 -0
- data/ext/yass/src/declarations/left.rs +28 -0
- data/ext/yass/src/declarations/length.rs +230 -0
- data/ext/yass/src/declarations/letter_spacing.rs +47 -0
- data/ext/yass/src/declarations/line_break.rs +23 -0
- data/ext/yass/src/declarations/line_height.rs +51 -0
- data/ext/yass/src/declarations/list_style_image.rs +28 -0
- data/ext/yass/src/declarations/list_style_position.rs +20 -0
- data/ext/yass/src/declarations/list_style_type.rs +132 -0
- data/ext/yass/src/declarations/margin.rs +103 -0
- data/ext/yass/src/declarations/margin_block_end.rs +28 -0
- data/ext/yass/src/declarations/margin_block_start.rs +28 -0
- data/ext/yass/src/declarations/margin_bottom.rs +28 -0
- data/ext/yass/src/declarations/margin_inline_end.rs +28 -0
- data/ext/yass/src/declarations/margin_inline_start.rs +28 -0
- data/ext/yass/src/declarations/margin_left.rs +28 -0
- data/ext/yass/src/declarations/margin_right.rs +28 -0
- data/ext/yass/src/declarations/margin_top.rs +28 -0
- data/ext/yass/src/declarations/mask_image.rs +30 -0
- data/ext/yass/src/declarations/max_block_size.rs +30 -0
- data/ext/yass/src/declarations/max_height.rs +30 -0
- data/ext/yass/src/declarations/max_inline_size.rs +30 -0
- data/ext/yass/src/declarations/max_width.rs +30 -0
- data/ext/yass/src/declarations/min_block_size.rs +30 -0
- data/ext/yass/src/declarations/min_height.rs +30 -0
- data/ext/yass/src/declarations/min_inline_size.rs +30 -0
- data/ext/yass/src/declarations/min_width.rs +30 -0
- data/ext/yass/src/declarations/mix_blend_mode.rs +35 -0
- data/ext/yass/src/declarations/mod.rs +257 -0
- data/ext/yass/src/declarations/number.rs +16 -0
- data/ext/yass/src/declarations/object_fit.rs +23 -0
- data/ext/yass/src/declarations/object_position.rs +40 -0
- data/ext/yass/src/declarations/offset_path.rs +275 -0
- data/ext/yass/src/declarations/opacity.rs +39 -0
- data/ext/yass/src/declarations/order.rs +17 -0
- data/ext/yass/src/declarations/outline_color.rs +30 -0
- data/ext/yass/src/declarations/outline_offset.rs +22 -0
- data/ext/yass/src/declarations/outline_style.rs +22 -0
- data/ext/yass/src/declarations/outline_width.rs +24 -0
- data/ext/yass/src/declarations/overflow.rs +12 -0
- data/ext/yass/src/declarations/overflow_block.rs +19 -0
- data/ext/yass/src/declarations/overflow_clip_margin.rs +40 -0
- data/ext/yass/src/declarations/overflow_inline.rs +19 -0
- data/ext/yass/src/declarations/overflow_wrap.rs +21 -0
- data/ext/yass/src/declarations/overflow_x.rs +19 -0
- data/ext/yass/src/declarations/overflow_y.rs +19 -0
- data/ext/yass/src/declarations/padding_block_end.rs +30 -0
- data/ext/yass/src/declarations/padding_block_start.rs +30 -0
- data/ext/yass/src/declarations/padding_bottom.rs +30 -0
- data/ext/yass/src/declarations/padding_inline_end.rs +30 -0
- data/ext/yass/src/declarations/padding_inline_start.rs +30 -0
- data/ext/yass/src/declarations/padding_left.rs +30 -0
- data/ext/yass/src/declarations/padding_right.rs +30 -0
- data/ext/yass/src/declarations/padding_top.rs +30 -0
- data/ext/yass/src/declarations/percentage.rs +16 -0
- data/ext/yass/src/declarations/perspective.rs +72 -0
- data/ext/yass/src/declarations/perspective_origin.rs +41 -0
- data/ext/yass/src/declarations/pointer_events.rs +20 -0
- data/ext/yass/src/declarations/position.rs +23 -0
- data/ext/yass/src/declarations/position_area.rs +82 -0
- data/ext/yass/src/declarations/position_try_fallbacks.rs +175 -0
- data/ext/yass/src/declarations/quotes.rs +107 -0
- data/ext/yass/src/declarations/resolution.rs +17 -0
- data/ext/yass/src/declarations/right.rs +28 -0
- data/ext/yass/src/declarations/rotate.rs +103 -0
- data/ext/yass/src/declarations/row_gap.rs +74 -0
- data/ext/yass/src/declarations/scale.rs +90 -0
- data/ext/yass/src/declarations/servo_overflow_clip_box.rs +20 -0
- data/ext/yass/src/declarations/servo_top_layer.rs +20 -0
- data/ext/yass/src/declarations/size/anchor_max_size_function.rs +53 -0
- data/ext/yass/src/declarations/size/anchor_size_function.rs +56 -0
- data/ext/yass/src/declarations/size/anchor_size_keyword.rs +25 -0
- data/ext/yass/src/declarations/size/init.rs +45 -0
- data/ext/yass/src/declarations/size/mod.rs +227 -0
- data/ext/yass/src/declarations/table_layout.rs +20 -0
- data/ext/yass/src/declarations/text_align.rs +31 -0
- data/ext/yass/src/declarations/text_align_last.rs +25 -0
- data/ext/yass/src/declarations/text_decoration_color.rs +30 -0
- data/ext/yass/src/declarations/text_decoration_line.rs +77 -0
- data/ext/yass/src/declarations/text_decoration_style.rs +24 -0
- data/ext/yass/src/declarations/text_indent.rs +40 -0
- data/ext/yass/src/declarations/text_justify.rs +22 -0
- data/ext/yass/src/declarations/text_overflow.rs +86 -0
- data/ext/yass/src/declarations/text_rendering.rs +22 -0
- data/ext/yass/src/declarations/text_shadow.rs +98 -0
- data/ext/yass/src/declarations/text_transform.rs +50 -0
- data/ext/yass/src/declarations/text_wrap_mode.rs +20 -0
- data/ext/yass/src/declarations/time.rs +21 -0
- data/ext/yass/src/declarations/top.rs +28 -0
- data/ext/yass/src/declarations/track_breadth.rs +88 -0
- data/ext/yass/src/declarations/track_size.rs +71 -0
- data/ext/yass/src/declarations/transform.rs +844 -0
- data/ext/yass/src/declarations/transform_origin.rs +99 -0
- data/ext/yass/src/declarations/transform_style.rs +20 -0
- data/ext/yass/src/declarations/transition_behavior.rs +28 -0
- data/ext/yass/src/declarations/transition_delay.rs +30 -0
- data/ext/yass/src/declarations/transition_duration.rs +30 -0
- data/ext/yass/src/declarations/transition_property.rs +122 -0
- data/ext/yass/src/declarations/transition_timing_function.rs +46 -0
- data/ext/yass/src/declarations/translate.rs +84 -0
- data/ext/yass/src/declarations/unicode_bidi.rs +24 -0
- data/ext/yass/src/declarations/vertical_position_component.rs +93 -0
- data/ext/yass/src/declarations/view_transition_class.rs +31 -0
- data/ext/yass/src/declarations/view_transition_name.rs +18 -0
- data/ext/yass/src/declarations/visibility.rs +21 -0
- data/ext/yass/src/declarations/webkit_text_security.rs +22 -0
- data/ext/yass/src/declarations/white_space_collapse.rs +22 -0
- data/ext/yass/src/declarations/width.rs +30 -0
- data/ext/yass/src/declarations/will_change.rs +83 -0
- data/ext/yass/src/declarations/with_variables.rs +35 -0
- data/ext/yass/src/declarations/word_break.rs +21 -0
- data/ext/yass/src/declarations/word_spacing.rs +47 -0
- data/ext/yass/src/declarations/writing_mode.rs +21 -0
- data/ext/yass/src/declarations/xlang.rs +21 -0
- data/ext/yass/src/declarations/zindex.rs +61 -0
- data/ext/yass/src/declarations/zoom.rs +87 -0
- data/ext/yass/src/general/init.rs +15 -0
- data/ext/yass/src/general/mod.rs +43 -0
- data/ext/yass/src/lib.rs +72 -0
- data/ext/yass/src/optional_cached_value.rs +33 -0
- data/ext/yass/src/rules/font_face_rule.rs +206 -0
- data/ext/yass/src/rules/fonts/family.rs +98 -0
- data/ext/yass/src/rules/fonts/init.rs +81 -0
- data/ext/yass/src/rules/fonts/metrics.rs +26 -0
- data/ext/yass/src/rules/fonts/mod.rs +7 -0
- data/ext/yass/src/rules/fonts/source.rs +126 -0
- data/ext/yass/src/rules/fonts/stretch.rs +96 -0
- data/ext/yass/src/rules/fonts/style.rs +59 -0
- data/ext/yass/src/rules/fonts/weight.rs +74 -0
- data/ext/yass/src/rules/init.rs +89 -0
- data/ext/yass/src/rules/media_rule.rs +474 -0
- data/ext/yass/src/rules/mod.rs +6 -0
- data/ext/yass/src/rules/rule.rs +33 -0
- data/ext/yass/src/rules/style_rule.rs +82 -0
- data/ext/yass/src/selectors/an_plus_b.rs +21 -0
- data/ext/yass/src/selectors/attribute_in_no_namespace.rs +34 -0
- data/ext/yass/src/selectors/attribute_in_no_namespace_exists.rs +16 -0
- data/ext/yass/src/selectors/attribute_other.rs +41 -0
- data/ext/yass/src/selectors/class.rs +16 -0
- data/ext/yass/src/selectors/combinator.rs +49 -0
- data/ext/yass/src/selectors/default_namespace.rs +16 -0
- data/ext/yass/src/selectors/has.rs +31 -0
- data/ext/yass/src/selectors/host.rs +35 -0
- data/ext/yass/src/selectors/id.rs +16 -0
- data/ext/yass/src/selectors/init.rs +146 -0
- data/ext/yass/src/selectors/is.rs +27 -0
- data/ext/yass/src/selectors/local_name.rs +18 -0
- data/ext/yass/src/selectors/mod.rs +54 -0
- data/ext/yass/src/selectors/namespace.rs +21 -0
- data/ext/yass/src/selectors/negation.rs +27 -0
- data/ext/yass/src/selectors/non_ts_pseudo_class.rs +63 -0
- data/ext/yass/src/selectors/nth.rs +51 -0
- data/ext/yass/src/selectors/nth_of.rs +43 -0
- data/ext/yass/src/selectors/part.rs +22 -0
- data/ext/yass/src/selectors/relative_selector.rs +40 -0
- data/ext/yass/src/selectors/selector.rs +230 -0
- data/ext/yass/src/selectors/selector_child.rs +460 -0
- data/ext/yass/src/selectors/selector_list.rs +27 -0
- data/ext/yass/src/selectors/slotted.rs +28 -0
- data/ext/yass/src/selectors/specific_namespace_constraint.rs +21 -0
- data/ext/yass/src/selectors/unit_selectors.rs +87 -0
- data/ext/yass/src/selectors/where.rs +27 -0
- data/ext/yass/src/sheet.rs +42 -0
- data/ext/yass/src/utils.rs +9 -0
- data/lib/yass/declarations.rb +7975 -0
- data/lib/yass/general.rb +31 -0
- data/lib/yass/node.rb +9 -0
- data/lib/yass/rules.rb +515 -0
- data/lib/yass/selectors.rb +325 -0
- data/lib/yass/stylesheet.rb +13 -0
- data/lib/yass/version.rb +5 -0
- data/lib/yass/visitor.rb +2463 -0
- data/lib/yass.rb +49 -0
- data/scripts/build_all.sh +44 -0
- data/scripts/detect.rb +39 -0
- data/scripts/wpt.rb +20 -0
- metadata +486 -0
|
@@ -0,0 +1,844 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Error, IntoValue, RArray, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::{
|
|
3
|
+
computed::Percentage,
|
|
4
|
+
generics::transform::{Matrix, Matrix3D, PerspectiveFunction},
|
|
5
|
+
specified::{Angle, Integer, Length, LengthPercentage, Number, Transform, transform::TransformOperation},
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
use crate::{
|
|
9
|
+
cached_value::CachedValue,
|
|
10
|
+
cached_value_list::CachedValueList,
|
|
11
|
+
declarations::{
|
|
12
|
+
angle::YAngle,
|
|
13
|
+
length::length_to_value,
|
|
14
|
+
number::YNumber,
|
|
15
|
+
percentage::YPercentage,
|
|
16
|
+
size::YLengthPercentage,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
fn number_to_value(number: &Number, ruby: &Ruby) -> Value {
|
|
21
|
+
YNumber::new(number.get()).into_value_with(ruby)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
fn angle_to_value(angle: &Angle, ruby: &Ruby) -> Value {
|
|
25
|
+
YAngle::new(*angle).into_value_with(ruby)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
fn length_percentage_to_value(length_percentage: &LengthPercentage, ruby: &Ruby) -> Value {
|
|
29
|
+
YLengthPercentage::new(length_percentage.clone()).into_value_with(ruby)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
fn make_perspective_value(perspective_function: &PerspectiveFunction<Length>, ruby: &Ruby) -> Value {
|
|
33
|
+
match perspective_function {
|
|
34
|
+
PerspectiveFunction::None => YTransformPerspectiveNone::new().into_value_with(ruby),
|
|
35
|
+
PerspectiveFunction::Length(length) => {
|
|
36
|
+
YTransformPerspectiveLength::new(length.clone()).into_value_with(ruby)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fn make_transform_operation(operation: &TransformOperation, ruby: &Ruby) -> Value {
|
|
42
|
+
match operation {
|
|
43
|
+
TransformOperation::Matrix(matrix) => YTransformMatrix::new(*matrix).into_value_with(ruby),
|
|
44
|
+
TransformOperation::Matrix3D(matrix) => {
|
|
45
|
+
YTransformMatrix3D::new(*matrix).into_value_with(ruby)
|
|
46
|
+
}
|
|
47
|
+
TransformOperation::Skew(x, y) => YTransformSkew::new(*x, *y).into_value_with(ruby),
|
|
48
|
+
TransformOperation::SkewX(angle) => YTransformSkewX::new(*angle).into_value_with(ruby),
|
|
49
|
+
TransformOperation::SkewY(angle) => YTransformSkewY::new(*angle).into_value_with(ruby),
|
|
50
|
+
TransformOperation::Translate(x, y) => {
|
|
51
|
+
YTransformTranslate::new(x.clone(), y.clone()).into_value_with(ruby)
|
|
52
|
+
}
|
|
53
|
+
TransformOperation::TranslateX(value) => {
|
|
54
|
+
YTransformTranslateX::new(value.clone()).into_value_with(ruby)
|
|
55
|
+
}
|
|
56
|
+
TransformOperation::TranslateY(value) => {
|
|
57
|
+
YTransformTranslateY::new(value.clone()).into_value_with(ruby)
|
|
58
|
+
}
|
|
59
|
+
TransformOperation::TranslateZ(value) => {
|
|
60
|
+
YTransformTranslateZ::new(value.clone()).into_value_with(ruby)
|
|
61
|
+
}
|
|
62
|
+
TransformOperation::Translate3D(x, y, z) => {
|
|
63
|
+
YTransformTranslate3D::new(x.clone(), y.clone(), z.clone()).into_value_with(ruby)
|
|
64
|
+
}
|
|
65
|
+
TransformOperation::Scale(x, y) => YTransformScale::new(*x, *y).into_value_with(ruby),
|
|
66
|
+
TransformOperation::ScaleX(value) => YTransformScaleX::new(*value).into_value_with(ruby),
|
|
67
|
+
TransformOperation::ScaleY(value) => YTransformScaleY::new(*value).into_value_with(ruby),
|
|
68
|
+
TransformOperation::ScaleZ(value) => YTransformScaleZ::new(*value).into_value_with(ruby),
|
|
69
|
+
TransformOperation::Scale3D(x, y, z) => {
|
|
70
|
+
YTransformScale3D::new(*x, *y, *z).into_value_with(ruby)
|
|
71
|
+
}
|
|
72
|
+
TransformOperation::Rotate(angle) => YTransformRotate::new(*angle).into_value_with(ruby),
|
|
73
|
+
TransformOperation::RotateX(angle) => YTransformRotateX::new(*angle).into_value_with(ruby),
|
|
74
|
+
TransformOperation::RotateY(angle) => YTransformRotateY::new(*angle).into_value_with(ruby),
|
|
75
|
+
TransformOperation::RotateZ(angle) => YTransformRotateZ::new(*angle).into_value_with(ruby),
|
|
76
|
+
TransformOperation::Rotate3D(x, y, z, angle) => {
|
|
77
|
+
YTransformRotate3D::new(*x, *y, *z, *angle).into_value_with(ruby)
|
|
78
|
+
}
|
|
79
|
+
TransformOperation::Perspective(perspective_function) => {
|
|
80
|
+
YTransformPerspective::new(perspective_function.clone()).into_value_with(ruby)
|
|
81
|
+
}
|
|
82
|
+
TransformOperation::InterpolateMatrix {
|
|
83
|
+
from_list,
|
|
84
|
+
to_list,
|
|
85
|
+
progress,
|
|
86
|
+
} => YTransformInterpolateMatrix::new(
|
|
87
|
+
from_list.clone(),
|
|
88
|
+
to_list.clone(),
|
|
89
|
+
*progress,
|
|
90
|
+
)
|
|
91
|
+
.into_value_with(ruby),
|
|
92
|
+
TransformOperation::AccumulateMatrix {
|
|
93
|
+
from_list,
|
|
94
|
+
to_list,
|
|
95
|
+
count,
|
|
96
|
+
} => YTransformAccumulateMatrix::new(from_list.clone(), to_list.clone(), *count)
|
|
97
|
+
.into_value_with(ruby),
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
#[derive(TypedData)]
|
|
102
|
+
#[magnus(class = "Yass::Declarations::Transform", mark)]
|
|
103
|
+
pub struct YTransform {
|
|
104
|
+
operations: CachedValueList<TransformOperation>,
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
impl YTransform {
|
|
108
|
+
pub fn new(transform: Transform) -> Self {
|
|
109
|
+
Self {
|
|
110
|
+
operations: CachedValueList::new(transform.0.to_vec(), |operation, _ctx, ruby| {
|
|
111
|
+
make_transform_operation(operation, ruby)
|
|
112
|
+
}),
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
pub fn operations(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
117
|
+
rb_self.operations.to_a(ruby)
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
impl DataTypeFunctions for YTransform {
|
|
122
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
123
|
+
self.operations.mark(marker);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
#[derive(TypedData)]
|
|
128
|
+
#[magnus(class = "Yass::Declarations::Transform::Matrix", mark)]
|
|
129
|
+
pub struct YTransformMatrix {
|
|
130
|
+
a: CachedValue<Number>,
|
|
131
|
+
b: CachedValue<Number>,
|
|
132
|
+
c: CachedValue<Number>,
|
|
133
|
+
d: CachedValue<Number>,
|
|
134
|
+
e: CachedValue<Number>,
|
|
135
|
+
f: CachedValue<Number>,
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
impl YTransformMatrix {
|
|
139
|
+
pub fn new(matrix: Matrix<Number>) -> Self {
|
|
140
|
+
Self {
|
|
141
|
+
a: CachedValue::new(matrix.a, number_to_value),
|
|
142
|
+
b: CachedValue::new(matrix.b, number_to_value),
|
|
143
|
+
c: CachedValue::new(matrix.c, number_to_value),
|
|
144
|
+
d: CachedValue::new(matrix.d, number_to_value),
|
|
145
|
+
e: CachedValue::new(matrix.e, number_to_value),
|
|
146
|
+
f: CachedValue::new(matrix.f, number_to_value),
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
pub fn a(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
151
|
+
rb_self.a.get(ruby)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
pub fn b(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
155
|
+
rb_self.b.get(ruby)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
pub fn c(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
159
|
+
rb_self.c.get(ruby)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
pub fn d(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
163
|
+
rb_self.d.get(ruby)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
pub fn e(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
167
|
+
rb_self.e.get(ruby)
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
pub fn f(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
171
|
+
rb_self.f.get(ruby)
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
impl DataTypeFunctions for YTransformMatrix {
|
|
176
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
177
|
+
self.a.mark(marker);
|
|
178
|
+
self.b.mark(marker);
|
|
179
|
+
self.c.mark(marker);
|
|
180
|
+
self.d.mark(marker);
|
|
181
|
+
self.e.mark(marker);
|
|
182
|
+
self.f.mark(marker);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
#[derive(TypedData)]
|
|
187
|
+
#[magnus(class = "Yass::Declarations::Transform::Matrix3D", mark)]
|
|
188
|
+
pub struct YTransformMatrix3D {
|
|
189
|
+
m11: CachedValue<Number>,
|
|
190
|
+
m12: CachedValue<Number>,
|
|
191
|
+
m13: CachedValue<Number>,
|
|
192
|
+
m14: CachedValue<Number>,
|
|
193
|
+
m21: CachedValue<Number>,
|
|
194
|
+
m22: CachedValue<Number>,
|
|
195
|
+
m23: CachedValue<Number>,
|
|
196
|
+
m24: CachedValue<Number>,
|
|
197
|
+
m31: CachedValue<Number>,
|
|
198
|
+
m32: CachedValue<Number>,
|
|
199
|
+
m33: CachedValue<Number>,
|
|
200
|
+
m34: CachedValue<Number>,
|
|
201
|
+
m41: CachedValue<Number>,
|
|
202
|
+
m42: CachedValue<Number>,
|
|
203
|
+
m43: CachedValue<Number>,
|
|
204
|
+
m44: CachedValue<Number>,
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
impl YTransformMatrix3D {
|
|
208
|
+
pub fn new(matrix: Matrix3D<Number>) -> Self {
|
|
209
|
+
Self {
|
|
210
|
+
m11: CachedValue::new(matrix.m11, number_to_value),
|
|
211
|
+
m12: CachedValue::new(matrix.m12, number_to_value),
|
|
212
|
+
m13: CachedValue::new(matrix.m13, number_to_value),
|
|
213
|
+
m14: CachedValue::new(matrix.m14, number_to_value),
|
|
214
|
+
m21: CachedValue::new(matrix.m21, number_to_value),
|
|
215
|
+
m22: CachedValue::new(matrix.m22, number_to_value),
|
|
216
|
+
m23: CachedValue::new(matrix.m23, number_to_value),
|
|
217
|
+
m24: CachedValue::new(matrix.m24, number_to_value),
|
|
218
|
+
m31: CachedValue::new(matrix.m31, number_to_value),
|
|
219
|
+
m32: CachedValue::new(matrix.m32, number_to_value),
|
|
220
|
+
m33: CachedValue::new(matrix.m33, number_to_value),
|
|
221
|
+
m34: CachedValue::new(matrix.m34, number_to_value),
|
|
222
|
+
m41: CachedValue::new(matrix.m41, number_to_value),
|
|
223
|
+
m42: CachedValue::new(matrix.m42, number_to_value),
|
|
224
|
+
m43: CachedValue::new(matrix.m43, number_to_value),
|
|
225
|
+
m44: CachedValue::new(matrix.m44, number_to_value),
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
pub fn m11(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m11.get(ruby) }
|
|
230
|
+
pub fn m12(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m12.get(ruby) }
|
|
231
|
+
pub fn m13(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m13.get(ruby) }
|
|
232
|
+
pub fn m14(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m14.get(ruby) }
|
|
233
|
+
pub fn m21(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m21.get(ruby) }
|
|
234
|
+
pub fn m22(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m22.get(ruby) }
|
|
235
|
+
pub fn m23(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m23.get(ruby) }
|
|
236
|
+
pub fn m24(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m24.get(ruby) }
|
|
237
|
+
pub fn m31(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m31.get(ruby) }
|
|
238
|
+
pub fn m32(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m32.get(ruby) }
|
|
239
|
+
pub fn m33(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m33.get(ruby) }
|
|
240
|
+
pub fn m34(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m34.get(ruby) }
|
|
241
|
+
pub fn m41(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m41.get(ruby) }
|
|
242
|
+
pub fn m42(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m42.get(ruby) }
|
|
243
|
+
pub fn m43(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m43.get(ruby) }
|
|
244
|
+
pub fn m44(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.m44.get(ruby) }
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
impl DataTypeFunctions for YTransformMatrix3D {
|
|
248
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
249
|
+
self.m11.mark(marker);
|
|
250
|
+
self.m12.mark(marker);
|
|
251
|
+
self.m13.mark(marker);
|
|
252
|
+
self.m14.mark(marker);
|
|
253
|
+
self.m21.mark(marker);
|
|
254
|
+
self.m22.mark(marker);
|
|
255
|
+
self.m23.mark(marker);
|
|
256
|
+
self.m24.mark(marker);
|
|
257
|
+
self.m31.mark(marker);
|
|
258
|
+
self.m32.mark(marker);
|
|
259
|
+
self.m33.mark(marker);
|
|
260
|
+
self.m34.mark(marker);
|
|
261
|
+
self.m41.mark(marker);
|
|
262
|
+
self.m42.mark(marker);
|
|
263
|
+
self.m43.mark(marker);
|
|
264
|
+
self.m44.mark(marker);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
#[derive(TypedData)]
|
|
269
|
+
#[magnus(class = "Yass::Declarations::Transform::Skew", mark)]
|
|
270
|
+
pub struct YTransformSkew {
|
|
271
|
+
x: CachedValue<Angle>,
|
|
272
|
+
y: CachedValue<Angle>,
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
impl YTransformSkew {
|
|
276
|
+
pub fn new(x: Angle, y: Angle) -> Self {
|
|
277
|
+
Self {
|
|
278
|
+
x: CachedValue::new(x, angle_to_value),
|
|
279
|
+
y: CachedValue::new(y, angle_to_value),
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
pub fn x(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.x.get(ruby) }
|
|
284
|
+
pub fn y(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.y.get(ruby) }
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
impl DataTypeFunctions for YTransformSkew {
|
|
288
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
289
|
+
self.x.mark(marker);
|
|
290
|
+
self.y.mark(marker);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
#[derive(TypedData)]
|
|
295
|
+
#[magnus(class = "Yass::Declarations::Transform::SkewX", mark)]
|
|
296
|
+
pub struct YTransformSkewX {
|
|
297
|
+
angle: CachedValue<Angle>,
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
impl YTransformSkewX {
|
|
301
|
+
pub fn new(angle: Angle) -> Self {
|
|
302
|
+
Self {
|
|
303
|
+
angle: CachedValue::new(angle, angle_to_value),
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
pub fn angle(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.angle.get(ruby) }
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
impl DataTypeFunctions for YTransformSkewX {
|
|
311
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
312
|
+
self.angle.mark(marker);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
#[derive(TypedData)]
|
|
317
|
+
#[magnus(class = "Yass::Declarations::Transform::SkewY", mark)]
|
|
318
|
+
pub struct YTransformSkewY {
|
|
319
|
+
angle: CachedValue<Angle>,
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
impl YTransformSkewY {
|
|
323
|
+
pub fn new(angle: Angle) -> Self {
|
|
324
|
+
Self {
|
|
325
|
+
angle: CachedValue::new(angle, angle_to_value),
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
pub fn angle(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.angle.get(ruby) }
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
impl DataTypeFunctions for YTransformSkewY {
|
|
333
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
334
|
+
self.angle.mark(marker);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
#[derive(TypedData)]
|
|
339
|
+
#[magnus(class = "Yass::Declarations::Transform::Translate", mark)]
|
|
340
|
+
pub struct YTransformTranslate {
|
|
341
|
+
x: CachedValue<LengthPercentage>,
|
|
342
|
+
y: CachedValue<LengthPercentage>,
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
impl YTransformTranslate {
|
|
346
|
+
pub fn new(x: LengthPercentage, y: LengthPercentage) -> Self {
|
|
347
|
+
Self {
|
|
348
|
+
x: CachedValue::new(x, length_percentage_to_value),
|
|
349
|
+
y: CachedValue::new(y, length_percentage_to_value),
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
pub fn x(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.x.get(ruby) }
|
|
354
|
+
pub fn y(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.y.get(ruby) }
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
impl DataTypeFunctions for YTransformTranslate {
|
|
358
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
359
|
+
self.x.mark(marker);
|
|
360
|
+
self.y.mark(marker);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
#[derive(TypedData)]
|
|
365
|
+
#[magnus(class = "Yass::Declarations::Transform::TranslateX", mark)]
|
|
366
|
+
pub struct YTransformTranslateX {
|
|
367
|
+
value: CachedValue<LengthPercentage>,
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
impl YTransformTranslateX {
|
|
371
|
+
pub fn new(value: LengthPercentage) -> Self {
|
|
372
|
+
Self {
|
|
373
|
+
value: CachedValue::new(value, length_percentage_to_value),
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.value.get(ruby) }
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
impl DataTypeFunctions for YTransformTranslateX {
|
|
381
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
382
|
+
self.value.mark(marker);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
#[derive(TypedData)]
|
|
387
|
+
#[magnus(class = "Yass::Declarations::Transform::TranslateY", mark)]
|
|
388
|
+
pub struct YTransformTranslateY {
|
|
389
|
+
value: CachedValue<LengthPercentage>,
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
impl YTransformTranslateY {
|
|
393
|
+
pub fn new(value: LengthPercentage) -> Self {
|
|
394
|
+
Self {
|
|
395
|
+
value: CachedValue::new(value, length_percentage_to_value),
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.value.get(ruby) }
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
impl DataTypeFunctions for YTransformTranslateY {
|
|
403
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
404
|
+
self.value.mark(marker);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
#[derive(TypedData)]
|
|
409
|
+
#[magnus(class = "Yass::Declarations::Transform::TranslateZ", mark)]
|
|
410
|
+
pub struct YTransformTranslateZ {
|
|
411
|
+
value: CachedValue<Length>,
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
impl YTransformTranslateZ {
|
|
415
|
+
pub fn new(value: Length) -> Self {
|
|
416
|
+
Self {
|
|
417
|
+
value: CachedValue::new(value, |length, ruby| length_to_value(length, ruby)),
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.value.get(ruby) }
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
impl DataTypeFunctions for YTransformTranslateZ {
|
|
425
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
426
|
+
self.value.mark(marker);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
#[derive(TypedData)]
|
|
431
|
+
#[magnus(class = "Yass::Declarations::Transform::Translate3D", mark)]
|
|
432
|
+
pub struct YTransformTranslate3D {
|
|
433
|
+
x: CachedValue<LengthPercentage>,
|
|
434
|
+
y: CachedValue<LengthPercentage>,
|
|
435
|
+
z: CachedValue<Length>,
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
impl YTransformTranslate3D {
|
|
439
|
+
pub fn new(x: LengthPercentage, y: LengthPercentage, z: Length) -> Self {
|
|
440
|
+
Self {
|
|
441
|
+
x: CachedValue::new(x, length_percentage_to_value),
|
|
442
|
+
y: CachedValue::new(y, length_percentage_to_value),
|
|
443
|
+
z: CachedValue::new(z, |length, ruby| length_to_value(length, ruby)),
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
pub fn x(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.x.get(ruby) }
|
|
448
|
+
pub fn y(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.y.get(ruby) }
|
|
449
|
+
pub fn z(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.z.get(ruby) }
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
impl DataTypeFunctions for YTransformTranslate3D {
|
|
453
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
454
|
+
self.x.mark(marker);
|
|
455
|
+
self.y.mark(marker);
|
|
456
|
+
self.z.mark(marker);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
#[derive(TypedData)]
|
|
461
|
+
#[magnus(class = "Yass::Declarations::Transform::Scale", mark)]
|
|
462
|
+
pub struct YTransformScale {
|
|
463
|
+
x: CachedValue<Number>,
|
|
464
|
+
y: CachedValue<Number>,
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
impl YTransformScale {
|
|
468
|
+
pub fn new(x: Number, y: Number) -> Self {
|
|
469
|
+
Self {
|
|
470
|
+
x: CachedValue::new(x, number_to_value),
|
|
471
|
+
y: CachedValue::new(y, number_to_value),
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
pub fn x(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.x.get(ruby) }
|
|
476
|
+
pub fn y(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.y.get(ruby) }
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
impl DataTypeFunctions for YTransformScale {
|
|
480
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
481
|
+
self.x.mark(marker);
|
|
482
|
+
self.y.mark(marker);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
#[derive(TypedData)]
|
|
487
|
+
#[magnus(class = "Yass::Declarations::Transform::ScaleX", mark)]
|
|
488
|
+
pub struct YTransformScaleX {
|
|
489
|
+
value: CachedValue<Number>,
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
impl YTransformScaleX {
|
|
493
|
+
pub fn new(value: Number) -> Self {
|
|
494
|
+
Self {
|
|
495
|
+
value: CachedValue::new(value, number_to_value),
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.value.get(ruby) }
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
impl DataTypeFunctions for YTransformScaleX {
|
|
503
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
504
|
+
self.value.mark(marker);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
#[derive(TypedData)]
|
|
509
|
+
#[magnus(class = "Yass::Declarations::Transform::ScaleY", mark)]
|
|
510
|
+
pub struct YTransformScaleY {
|
|
511
|
+
value: CachedValue<Number>,
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
impl YTransformScaleY {
|
|
515
|
+
pub fn new(value: Number) -> Self {
|
|
516
|
+
Self {
|
|
517
|
+
value: CachedValue::new(value, number_to_value),
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.value.get(ruby) }
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
impl DataTypeFunctions for YTransformScaleY {
|
|
525
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
526
|
+
self.value.mark(marker);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
#[derive(TypedData)]
|
|
531
|
+
#[magnus(class = "Yass::Declarations::Transform::ScaleZ", mark)]
|
|
532
|
+
pub struct YTransformScaleZ {
|
|
533
|
+
value: CachedValue<Number>,
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
impl YTransformScaleZ {
|
|
537
|
+
pub fn new(value: Number) -> Self {
|
|
538
|
+
Self {
|
|
539
|
+
value: CachedValue::new(value, number_to_value),
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.value.get(ruby) }
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
impl DataTypeFunctions for YTransformScaleZ {
|
|
547
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
548
|
+
self.value.mark(marker);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
#[derive(TypedData)]
|
|
553
|
+
#[magnus(class = "Yass::Declarations::Transform::Scale3D", mark)]
|
|
554
|
+
pub struct YTransformScale3D {
|
|
555
|
+
x: CachedValue<Number>,
|
|
556
|
+
y: CachedValue<Number>,
|
|
557
|
+
z: CachedValue<Number>,
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
impl YTransformScale3D {
|
|
561
|
+
pub fn new(x: Number, y: Number, z: Number) -> Self {
|
|
562
|
+
Self {
|
|
563
|
+
x: CachedValue::new(x, number_to_value),
|
|
564
|
+
y: CachedValue::new(y, number_to_value),
|
|
565
|
+
z: CachedValue::new(z, number_to_value),
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
pub fn x(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.x.get(ruby) }
|
|
570
|
+
pub fn y(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.y.get(ruby) }
|
|
571
|
+
pub fn z(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.z.get(ruby) }
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
impl DataTypeFunctions for YTransformScale3D {
|
|
575
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
576
|
+
self.x.mark(marker);
|
|
577
|
+
self.y.mark(marker);
|
|
578
|
+
self.z.mark(marker);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
#[derive(TypedData)]
|
|
583
|
+
#[magnus(class = "Yass::Declarations::Transform::Rotate", mark)]
|
|
584
|
+
pub struct YTransformRotate {
|
|
585
|
+
angle: CachedValue<Angle>,
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
impl YTransformRotate {
|
|
589
|
+
pub fn new(angle: Angle) -> Self {
|
|
590
|
+
Self {
|
|
591
|
+
angle: CachedValue::new(angle, angle_to_value),
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
pub fn angle(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.angle.get(ruby) }
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
impl DataTypeFunctions for YTransformRotate {
|
|
599
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
600
|
+
self.angle.mark(marker);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
#[derive(TypedData)]
|
|
605
|
+
#[magnus(class = "Yass::Declarations::Transform::RotateX", mark)]
|
|
606
|
+
pub struct YTransformRotateX {
|
|
607
|
+
angle: CachedValue<Angle>,
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
impl YTransformRotateX {
|
|
611
|
+
pub fn new(angle: Angle) -> Self {
|
|
612
|
+
Self {
|
|
613
|
+
angle: CachedValue::new(angle, angle_to_value),
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
pub fn angle(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.angle.get(ruby) }
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
impl DataTypeFunctions for YTransformRotateX {
|
|
621
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
622
|
+
self.angle.mark(marker);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
#[derive(TypedData)]
|
|
627
|
+
#[magnus(class = "Yass::Declarations::Transform::RotateY", mark)]
|
|
628
|
+
pub struct YTransformRotateY {
|
|
629
|
+
angle: CachedValue<Angle>,
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
impl YTransformRotateY {
|
|
633
|
+
pub fn new(angle: Angle) -> Self {
|
|
634
|
+
Self {
|
|
635
|
+
angle: CachedValue::new(angle, angle_to_value),
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
pub fn angle(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.angle.get(ruby) }
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
impl DataTypeFunctions for YTransformRotateY {
|
|
643
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
644
|
+
self.angle.mark(marker);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
#[derive(TypedData)]
|
|
649
|
+
#[magnus(class = "Yass::Declarations::Transform::RotateZ", mark)]
|
|
650
|
+
pub struct YTransformRotateZ {
|
|
651
|
+
angle: CachedValue<Angle>,
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
impl YTransformRotateZ {
|
|
655
|
+
pub fn new(angle: Angle) -> Self {
|
|
656
|
+
Self {
|
|
657
|
+
angle: CachedValue::new(angle, angle_to_value),
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
pub fn angle(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.angle.get(ruby) }
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
impl DataTypeFunctions for YTransformRotateZ {
|
|
665
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
666
|
+
self.angle.mark(marker);
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
#[derive(TypedData)]
|
|
671
|
+
#[magnus(class = "Yass::Declarations::Transform::Rotate3D", mark)]
|
|
672
|
+
pub struct YTransformRotate3D {
|
|
673
|
+
x: CachedValue<Number>,
|
|
674
|
+
y: CachedValue<Number>,
|
|
675
|
+
z: CachedValue<Number>,
|
|
676
|
+
angle: CachedValue<Angle>,
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
impl YTransformRotate3D {
|
|
680
|
+
pub fn new(x: Number, y: Number, z: Number, angle: Angle) -> Self {
|
|
681
|
+
Self {
|
|
682
|
+
x: CachedValue::new(x, number_to_value),
|
|
683
|
+
y: CachedValue::new(y, number_to_value),
|
|
684
|
+
z: CachedValue::new(z, number_to_value),
|
|
685
|
+
angle: CachedValue::new(angle, angle_to_value),
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
pub fn x(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.x.get(ruby) }
|
|
690
|
+
pub fn y(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.y.get(ruby) }
|
|
691
|
+
pub fn z(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.z.get(ruby) }
|
|
692
|
+
pub fn angle(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.angle.get(ruby) }
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
impl DataTypeFunctions for YTransformRotate3D {
|
|
696
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
697
|
+
self.x.mark(marker);
|
|
698
|
+
self.y.mark(marker);
|
|
699
|
+
self.z.mark(marker);
|
|
700
|
+
self.angle.mark(marker);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
#[derive(TypedData)]
|
|
705
|
+
#[magnus(class = "Yass::Declarations::Transform::Perspective", mark)]
|
|
706
|
+
pub struct YTransformPerspective {
|
|
707
|
+
value: CachedValue<PerspectiveFunction<Length>>,
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
impl YTransformPerspective {
|
|
711
|
+
pub fn new(value: PerspectiveFunction<Length>) -> Self {
|
|
712
|
+
Self {
|
|
713
|
+
value: CachedValue::new(value, make_perspective_value),
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.value.get(ruby) }
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
impl DataTypeFunctions for YTransformPerspective {
|
|
721
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
722
|
+
self.value.mark(marker);
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
#[magnus::wrap(class = "Yass::Declarations::Transform::Perspective::None")]
|
|
727
|
+
pub struct YTransformPerspectiveNone {}
|
|
728
|
+
|
|
729
|
+
impl YTransformPerspectiveNone {
|
|
730
|
+
pub fn new() -> Self {
|
|
731
|
+
Self {}
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
#[derive(TypedData)]
|
|
736
|
+
#[magnus(class = "Yass::Declarations::Transform::Perspective::Length", mark)]
|
|
737
|
+
pub struct YTransformPerspectiveLength {
|
|
738
|
+
value: CachedValue<Length>,
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
impl YTransformPerspectiveLength {
|
|
742
|
+
pub fn new(value: Length) -> Self {
|
|
743
|
+
Self {
|
|
744
|
+
value: CachedValue::new(value, |length, ruby| length_to_value(length, ruby)),
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value { rb_self.value.get(ruby) }
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
impl DataTypeFunctions for YTransformPerspectiveLength {
|
|
752
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
753
|
+
self.value.mark(marker);
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
#[derive(TypedData)]
|
|
758
|
+
#[magnus(class = "Yass::Declarations::Transform::InterpolateMatrix", mark)]
|
|
759
|
+
pub struct YTransformInterpolateMatrix {
|
|
760
|
+
from_list: CachedValue<Transform>,
|
|
761
|
+
to_list: CachedValue<Transform>,
|
|
762
|
+
progress: CachedValue<Percentage>,
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
impl YTransformInterpolateMatrix {
|
|
766
|
+
pub fn new(from_list: Transform, to_list: Transform, progress: Percentage) -> Self {
|
|
767
|
+
Self {
|
|
768
|
+
from_list: CachedValue::new(from_list, |transform, ruby| {
|
|
769
|
+
YTransform::new(transform.clone()).into_value_with(ruby)
|
|
770
|
+
}),
|
|
771
|
+
|
|
772
|
+
to_list: CachedValue::new(to_list, |transform, ruby| {
|
|
773
|
+
YTransform::new(transform.clone()).into_value_with(ruby)
|
|
774
|
+
}),
|
|
775
|
+
|
|
776
|
+
progress: CachedValue::new(progress, |percentage, ruby| {
|
|
777
|
+
YPercentage::new(percentage.0).into_value_with(ruby)
|
|
778
|
+
}),
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
pub fn from_list(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
783
|
+
rb_self.from_list.get(ruby)
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
pub fn to_list(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
787
|
+
rb_self.to_list.get(ruby)
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
pub fn progress(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
791
|
+
rb_self.progress.get(ruby)
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
impl DataTypeFunctions for YTransformInterpolateMatrix {
|
|
796
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
797
|
+
self.from_list.mark(marker);
|
|
798
|
+
self.to_list.mark(marker);
|
|
799
|
+
self.progress.mark(marker);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
#[derive(TypedData)]
|
|
804
|
+
#[magnus(class = "Yass::Declarations::Transform::AccumulateMatrix", mark)]
|
|
805
|
+
pub struct YTransformAccumulateMatrix {
|
|
806
|
+
from_list: CachedValue<Transform>,
|
|
807
|
+
to_list: CachedValue<Transform>,
|
|
808
|
+
count: Integer,
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
impl YTransformAccumulateMatrix {
|
|
812
|
+
pub fn new(from_list: Transform, to_list: Transform, count: Integer) -> Self {
|
|
813
|
+
Self {
|
|
814
|
+
from_list: CachedValue::new(from_list, |transform, ruby| {
|
|
815
|
+
YTransform::new(transform.clone()).into_value_with(ruby)
|
|
816
|
+
}),
|
|
817
|
+
|
|
818
|
+
to_list: CachedValue::new(to_list, |transform, ruby| {
|
|
819
|
+
YTransform::new(transform.clone()).into_value_with(ruby)
|
|
820
|
+
}),
|
|
821
|
+
|
|
822
|
+
count,
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
pub fn from_list(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
827
|
+
rb_self.from_list.get(ruby)
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
pub fn to_list(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
831
|
+
rb_self.to_list.get(ruby)
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
pub fn count(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> i32 {
|
|
835
|
+
rb_self.count.value()
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
impl DataTypeFunctions for YTransformAccumulateMatrix {
|
|
840
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
841
|
+
self.from_list.mark(marker);
|
|
842
|
+
self.to_list.mark(marker);
|
|
843
|
+
}
|
|
844
|
+
}
|