svnno****@sourc*****
svnno****@sourc*****
2009年 5月 28日 (木) 02:17:44 JST
Revision: 134 http://svn.sourceforge.jp/view?root=swfed&view=rev&rev=134 Author: yoya Date: 2009-05-28 02:17:43 +0900 (Thu, 28 May 2009) Log Message: ----------- - DefinShape の詳細構造の処理を追加 - parse の引数に swf_tag_t *tag を追加 (必要に応じて) Modified Paths: -------------- trunk/src/config.m4 trunk/src/swf_fill_style_array.h trunk/src/swf_shape_with_style.c trunk/src/swf_shape_with_style.h trunk/src/swf_styles.h trunk/src/swf_tag_edit.c Added Paths: ----------- trunk/src/swf_fill_style_array.c trunk/src/swf_styles.c -------------- next part -------------- Modified: trunk/src/config.m4 =================================================================== --- trunk/src/config.m4 2009-05-26 14:48:34 UTC (rev 133) +++ trunk/src/config.m4 2009-05-27 17:17:43 UTC (rev 134) @@ -61,5 +61,6 @@ dnl dnl PHP_SUBST(SWFED_SHARED_LIBADD) - PHP_NEW_EXTENSION(swfed, swfed.c swf_object.c swf_header.c swf_rect.c swf_tag.c swf_tag_jpeg.c swf_tag_edit.c swf_tag_action.c swf_tag_lossless.c swf_tag_sound.c swf_tag_sprite.c swf_tag_shape.c swf_rgb.c swf_rgba.c swf_argb.c swf_xrgb.c swf_action.c swf_jpeg.c bitstream.c jpeg_segment.c swf_png.c swf_gif.c swf_shape_with_style.c swf_debug.c, $ext_shared) + PHP_NEW_EXTENSION(swfed, swfed.c swf_object.c swf_header.c swf_rect.c swf_tag.c swf_tag_jpeg.c swf_tag_edit.c swf_tag_action.c swf_tag_lossless.c swf_tag_sound.c swf_tag_sprite.c swf_tag_shape.c swf_rgb.c swf_rgba.c swf_argb.c swf_xrgb.c swf_action.c swf_jpeg.c bitstream.c jpeg_segment.c swf_png.c swf_gif.c swf_shape_with_style.c swf_styles.c swf_fill_style_array.c swf_debug.c, $ext_shared) fi + Added: trunk/src/swf_fill_style_array.c =================================================================== --- trunk/src/swf_fill_style_array.c (rev 0) +++ trunk/src/swf_fill_style_array.c 2009-05-27 17:17:43 UTC (rev 134) @@ -0,0 +1,35 @@ +#include <stdio.h> +#include "bitstream.h" +#include "swf_fill_style_array.h" + +int +swf_fill_style_array_parse(bitstream_t *bs, + swf_fill_style_array_t *shape_with_style, + swf_tag_t *tag) { + int i; + shape_with_style->count = bitstream_getbyte(bs); + if (tag->tag != 2 || // DefineShape + shape_with_style->count == 255) { + shape_with_style->count = bitstream_getbytesLE(bs, 2); + } + for (i = 0 ; i < shape_with_style->count ; i++) { + ; // swf_fill_style_parse(bs, &(shape_with_style->line_styles)); + } + return 0; +} + +int +swf_fill_style_array_build(bitstream_t *bs, swf_fill_style_array_t *shape_with_style) { +// swf_fill_style_array_build(bs, &(shape_with_style->fill_styles)); +// swf_line_style_array_build(bs, &(shape_with_style->line_styles)); +// swf_fill_style_array_count_build(bs, &(shape_with_style->line_styles)); + return 0; +} + +int +swf_fill_style_array_print(swf_fill_style_array_t *shape_with_style, int indent_depth) { +// swf_fill_style_array_print(&(shape_with_style->fill_styles), indent_depth); +// swf_line_style_array_print(&(shape_with_style->line_styles), indent_depth); +// swf_fill_style_array_count_print(&(shape_with_style->line_styles), indent_depth); + return 0; +} Modified: trunk/src/swf_fill_style_array.h =================================================================== --- trunk/src/swf_fill_style_array.h 2009-05-26 14:48:34 UTC (rev 133) +++ trunk/src/swf_fill_style_array.h 2009-05-27 17:17:43 UTC (rev 134) @@ -7,6 +7,7 @@ #ifndef __SWF_FILL_STYLE_ARRAY_H__ #define __SWF_FILL_STYLE_ARRAY_H__ +#include "swf_tag.h" #include "swf_fill_style.h" typedef struct swf_fill_style_array_ { @@ -14,7 +15,7 @@ swf_fill_style_t *fill_style; } swf_fill_style_array_t; -extern int swf_fill_style_array_parse(bitstream_t *bs, swf_fill_style_array_t *color); +extern int swf_fill_style_array_parse(bitstream_t *bs, swf_fill_style_array_t *color, swf_tag_t *tag); extern int swf_fill_style_array_build(bitstream_t *bs, swf_fill_style_array_t *color); extern int swf_fill_style_array_print(swf_fill_style_array_t *color, int indent_depth); Modified: trunk/src/swf_shape_with_style.c =================================================================== --- trunk/src/swf_shape_with_style.c 2009-05-26 14:48:34 UTC (rev 133) +++ trunk/src/swf_shape_with_style.c 2009-05-27 17:17:43 UTC (rev 134) @@ -1,11 +1,12 @@ #include <stdio.h> #include "bitstream.h" #include "swf_shape_with_style.h" -#include "swf_styles.h" -#include "swf_shape_record.h" -swf_shape_with_style_parse(bitstream_t *bs, swf_shape_with_style_t *shape_with_style) { -// swf_styles_parse(bs, &(shape_with_style->styles)); + +swf_shape_with_style_parse(bitstream_t *bs, + swf_shape_with_style_t *shape_with_style, + swf_tag_t *tag) { + swf_styles_parse(bs, &(shape_with_style->styles), tag); // swf_shape_record_parse(bs, &(shape_with_style->shape_records)); return 0; } @@ -19,7 +20,7 @@ int swf_shape_with_style_print(swf_shape_with_style_t *shape_with_style, int indent_depth) { -// swf_styles_print(&(shape_with_style->styles), indent_depth); + swf_styles_print(&(shape_with_style->styles), indent_depth); // swf_shape_record_print(&(shape_with_style->shape_records), indent_depth); return 0; } Modified: trunk/src/swf_shape_with_style.h =================================================================== --- trunk/src/swf_shape_with_style.h 2009-05-26 14:48:34 UTC (rev 133) +++ trunk/src/swf_shape_with_style.h 2009-05-27 17:17:43 UTC (rev 134) @@ -15,7 +15,9 @@ swf_shape_record_t *shape_records; } swf_shape_with_style_t; -extern int swf_shape_with_style_parse(bitstream_t *bs, swf_shape_with_style_t *color); +extern int swf_shape_with_style_parse(bitstream_t *bs, + swf_shape_with_style_t *color, + swf_tag_t *tag); extern int swf_shape_with_style_build(bitstream_t *bs, swf_shape_with_style_t *color); extern int swf_shape_with_style_print(swf_shape_with_style_t *color, int indent_depth); Added: trunk/src/swf_styles.c =================================================================== --- trunk/src/swf_styles.c (rev 0) +++ trunk/src/swf_styles.c 2009-05-27 17:17:43 UTC (rev 134) @@ -0,0 +1,28 @@ +#include <stdio.h> +#include "bitstream.h" +#include "swf_styles.h" + +int +swf_styles_parse(bitstream_t *bs, swf_styles_t *shape_with_style, + swf_tag_t *tag) { + swf_fill_style_array_parse(bs, &(shape_with_style->fill_styles), tag); +// swf_line_style_array_parse(bs, &(shape_with_style->line_styles)); +// swf_styles_count_parse(bs, &(shape_with_style->line_styles)); + return 0; +} + +int +swf_styles_build(bitstream_t *bs, swf_styles_t *shape_with_style) { + swf_fill_style_array_build(bs, &(shape_with_style->fill_styles)); +// swf_line_style_array_build(bs, &(shape_with_style->line_styles)); +// swf_styles_count_build(bs, &(shape_with_style->line_styles)); + return 0; +} + +int +swf_styles_print(swf_styles_t *shape_with_style, int indent_depth) { + swf_fill_style_array_print(&(shape_with_style->fill_styles), indent_depth); +// swf_line_style_array_print(&(shape_with_style->line_styles), indent_depth); +// swf_styles_count_print(&(shape_with_style->line_styles), indent_depth); + return 0; +} Modified: trunk/src/swf_styles.h =================================================================== --- trunk/src/swf_styles.h 2009-05-26 14:48:34 UTC (rev 133) +++ trunk/src/swf_styles.h 2009-05-27 17:17:43 UTC (rev 134) @@ -7,6 +7,7 @@ #ifndef __SWF_STYLES_H__ #define __SWF_STYLES_H__ +#include "swf_tag.h" #include "swf_fill_style_array.h" #include "swf_line_style_array.h" #include "swf_styles_count.h" @@ -17,7 +18,8 @@ swf_styles_count_t styles_count; } swf_styles_t; -extern int swf_styles_parse(bitstream_t *bs, swf_styles_t *color); +extern int swf_styles_parse(bitstream_t *bs, swf_styles_t *color, + swf_tag_t *tag); extern int swf_styles_build(bitstream_t *bs, swf_styles_t *color); extern int swf_styles_print(swf_styles_t *color, int indent_depth); Modified: trunk/src/swf_tag_edit.c =================================================================== --- trunk/src/swf_tag_edit.c 2009-05-26 14:48:34 UTC (rev 133) +++ trunk/src/swf_tag_edit.c 2009-05-27 17:17:43 UTC (rev 134) @@ -266,7 +266,7 @@ swf_tag_edit_detail_t *swf_tag_edit = (swf_tag_edit_detail_t *) detail; char *data, *initial_text; int initial_text_len = 0; - if (strcmp(swf_tag_edit->edit_variable_name, variable_name)) { + if (strncmp(swf_tag_edit->edit_variable_name, variable_name, variable_name_len)) { if (atoi(variable_name) != swf_tag_edit->edit_id) { return NULL; }