From 26e21b9c15d5bd57078a2870ba62387947387875 Mon Sep 17 00:00:00 2001 From: yoya Date: Thu, 3 Mar 2011 12:55:52 +0000 Subject: [PATCH] =?utf8?q?-=20replaceMovieClip=20=E3=81=AE=E3=82=AC?= =?utf8?q?=E3=83=AF=E3=81=A0=E3=81=91=E4=BD=9C=E6=88=90=20-=20version=20?= =?utf8?q?=E3=82=92=200.31=20=E3=81=8B=E3=82=89=200.32a=20=E3=81=AB?= =?utf8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/swfed/trunk@373 7c90b180-03d5-4157-b861-58a559ae9d1e --- src/php_swfed.c | 23 ++++++++++++++++++++++- src/php_swfed.h | 1 + src/swf_object.c | 29 ++++++++++++++++++++++++++++- src/swf_object.h | 5 +++++ 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/src/php_swfed.c b/src/php_swfed.c index 0b5009f..7edb98b 100644 --- a/src/php_swfed.c +++ b/src/php_swfed.c @@ -84,12 +84,13 @@ zend_function_entry swfed_functions[] = { PHP_ME(swfed, getActionData, NULL, 0) PHP_ME(swfed, disasmActionData, NULL, 0) PHP_ME(swfed, setActionVariables, NULL, 0) + PHP_ME(swfed, replaceMovieClip, NULL, 0) PHP_ME(swfed, swfInfo, NULL, 0) {NULL, NULL, NULL} /* Must be the last line in swfed_functions[] */ }; /* }}} */ -#define SWFED_VERSION "0.31" +#define SWFED_VERSION "0.32a" /* {{{ swfed_module_entry */ @@ -1107,6 +1108,26 @@ PHP_METHOD(swfed, setActionVariables) { RETURN_TRUE; } +PHP_METHOD(swfed, replaceMovieClip) { + char *instance_name = NULL, *swf_data = NULL; + int instance_name_len = 0, swf_data_len = 0; + swf_object_t *swf = NULL; + int result = 0; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", + &instance_name, &instance_name_len, + &swf_data, &swf_data_len) == FAILURE) { + RETURN_FALSE; + } + swf = get_swf_object(getThis() TSRMLS_CC); + result = swf_object_replace_movieclip(swf, instance_name, + instance_name_len, + swf_data, swf_data_len); + if (result) { + RETURN_FALSE; + } + RETURN_TRUE; +} + PHP_METHOD(swfed, swfInfo) { swf_object_t *swf = get_swf_object(getThis() TSRMLS_CC); swf_object_print(swf); diff --git a/src/php_swfed.h b/src/php_swfed.h index 9d84ea5..110fbcd 100644 --- a/src/php_swfed.h +++ b/src/php_swfed.h @@ -79,6 +79,7 @@ PHP_METHOD(swfed, replaceEditString); PHP_METHOD(swfed, getActionData); PHP_METHOD(swfed, disasmActionData); PHP_METHOD(swfed, setActionVariables); +PHP_METHOD(swfed, replaceMovieClip); PHP_METHOD(swfed, swfInfo); /* diff --git a/src/swf_object.c b/src/swf_object.c index 651de17..537f2b6 100644 --- a/src/swf_object.c +++ b/src/swf_object.c @@ -735,6 +735,7 @@ swf_object_get_editstring(swf_object_t *swf, } return data; } + int swf_object_replace_editstring(swf_object_t *swf, char *variable_name, @@ -796,7 +797,7 @@ swf_object_insert_action_setvariables(swf_object_t *swf, for (tag=swf->tag ; tag ; tag=tag->next) { switch (tag->tag) { case 69: // FileAttributs - case 9: // SetBackgroundColor + case 9: // SetBackgroundColor case 24: // Protect break; default: @@ -827,6 +828,32 @@ swf_object_insert_action_setvariables(swf_object_t *swf, return 0; // SUCCESS } +int +swf_object_replace_movieclip(swf_object_t *swf, + char *instance_name, int instancee_name_len, + char *swf_data, int swf_data_len) { + int result = 1; + swf_tag_t *tag; + if (swf == NULL) { + fprintf(stderr, "swf_object_replace_movieclip: swf == NULL\n"); + return 1; + } + for (tag=swf->tag ; tag ; tag=tag->next) { + ; // searchPlaceTagByInstanceName; + } + for (tag=swf->tag ; tag ; tag=tag->next) { + ; // searchSpriteTagByCID + } + +/* + result = swf_tag_replace_movieclip(tag, + instance_name, instance_name_len, + swf_data, swf_data__len, + swf); +*/ + + return result; +} int swf_object_apply_shapematrix_factor(swf_object_t *swf, int shape_id, diff --git a/src/swf_object.h b/src/swf_object.h index 73bd3b1..5665ab9 100644 --- a/src/swf_object.h +++ b/src/swf_object.h @@ -97,6 +97,11 @@ extern unsigned char *swf_object_get_actiondata(swf_object_t *swf, unsigned long extern int swf_object_insert_action_setvariables(swf_object_t *swf, y_keyvalue_t *kv); +extern int swf_object_replace_movieclip(swf_object_t *swf, + char *instance_name, + int instancee_name_len, + char *swf_data, int swf_data_len); + extern int swf_object_apply_shapematrix_factor(swf_object_t *swf,int shape_id, double scale_x, double scale_y, -- 2.11.0