2 +----------------------------------------------------------------------+
3 | Author: yoya@awm.jp |
4 +----------------------------------------------------------------------+
7 #ifndef __SWF_TAG_SHAPE__H__
8 #define __SWF_TAG_SHAPE__H__
11 #include "swf_morph_shape_with_style.h"
12 #include "swf_shape_with_style.h"
15 typedef struct swf_tag_shape_detail_ {
19 unsigned char is_morph:1; // DefineMorphShape, DefineMorphShape2
20 unsigned char has_strokes:1; // Defineshape4, DefineMorphShape2
22 swf_rect_t rect_morph; // MorphShape(1) or 2
24 swf_rect_t stroke_rect; // Shape4 or MorphShape4
26 swf_rect_t stroke_rect_morph; // & MorphShape(1) or 2
28 unsigned char define_shape_reserved : 6; // 6bit reserved area
29 unsigned char define_shape_non_scaling_strokes : 1;
30 unsigned char define_shape_scaling_strokes : 1;
32 unsigned long offset_morph;
33 swf_morph_shape_with_style_t morph_shape_with_style;
35 swf_shape_with_style_t shape_with_style;
39 swf_styles_count_t _current_styles_count;
40 int _current_fill_style_num;
41 int _current_line_style_num;
42 signed /* twips */ _current_x, _current_y;
44 #define SWF_TAG_SHAPE_PARSE_CONDITION_BITMAP 1
45 } swf_tag_shape_detail_t;
47 extern swf_tag_detail_handler_t *swf_tag_shape_detail_handler(void);
48 extern swf_tag_detail_handler_t *swf_tag_shape_cid_handler(void);
50 extern void *swf_tag_shape_create_detail(void);
51 extern int swf_tag_shape_input_detail(swf_tag_t *tag, struct swf_object_ *swf);
52 extern int swf_tag_shape_get_cid_detail(swf_tag_t *tag);
53 extern int swf_tag_shape_replace_cid_detail(swf_tag_t *tag, int id);
54 extern int *swf_tag_shape_bitmap_get_refcid_list(swf_tag_t *tag, int *cid_list_num);
55 extern int swf_tag_shape_bitmap_replace_refcid_list(swf_tag_t *tag, int from_cid, int to_cid);
57 extern int swf_tag_shape_bitmap_get_refcid(int x);
58 extern int swf_tag_shape_bitmap_replace_refcid(int y);
60 extern unsigned char *swf_tag_shape_output_detail(swf_tag_t *tag,
61 unsigned long *length,
62 struct swf_object_ *swf);
63 extern void swf_tag_shape_print_detail(swf_tag_t *tag,
64 struct swf_object_ *swf,
66 extern void swf_tag_shape_destroy_detail(swf_tag_t *tag);
68 extern int swf_tag_shape_apply_matrix_factor(void *detail, int shape_id,
69 double scale_x, double scale_y,
71 signed int trans_x, signed int trans_y);
72 extern int swf_tag_shape_apply_rect_factor(void *detail, int shape_id,
73 double scale_x, double scale_y,
74 signed int trans_x, signed int trans_y);
75 extern int swf_tag_shape_apply_type_tilled(void *detail, int shape_id);
77 #endif /* __SWF_TAG_SHAPE__H__ */