svnno****@sourc*****
svnno****@sourc*****
2011年 4月 1日 (金) 19:48:52 JST
Revision: 503 http://sourceforge.jp/projects/swfed/svn/view?view=rev&revision=503 Author: yoya Date: 2011-04-01 19:48:52 +0900 (Fri, 01 Apr 2011) Log Message: ----------- isShapeTagData, isBitmapTagData の実装 Modified Paths: -------------- trunk/src/php_swfed.c trunk/src/php_swfed.h -------------- next part -------------- Modified: trunk/src/php_swfed.c =================================================================== --- trunk/src/php_swfed.c 2011-04-01 10:42:59 UTC (rev 502) +++ trunk/src/php_swfed.c 2011-04-01 10:48:52 UTC (rev 503) @@ -93,6 +93,9 @@ PHP_ME(swfed, setCompressLevel, NULL, 0) PHP_ME(swfed, rebuild, NULL, 0) PHP_ME(swfed, purgeUselessContents, NULL, 0) + + PHP_ME(swfed, isShapeTagData, NULL, 0) + PHP_ME(swfed, isBitmapTagData, NULL, 0) {NULL, NULL, NULL} /* Must be the last line in swfed_functions[] */ }; /* }}} */ @@ -1255,6 +1258,35 @@ RETURN_TRUE; } +PHP_METHOD(swfed, isShapeTagData) { + swf_object_t *swf = get_swf_object(getThis() TSRMLS_CC); + char *data = NULL; + int data_len = 0; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, + "s", &data, &data_len) == FAILURE) { + RETURN_FALSE; + } + if (swf_object_is_shape_tagdata(data, data_len) == 0) { + RETURN_FALSE; + } + RETURN_TRUE; +} + +PHP_METHOD(swfed, isBitmapTagData) { + swf_object_t *swf = get_swf_object(getThis() TSRMLS_CC); + char *data = NULL; + int data_len = 0; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, + "s", &data, &data_len) == FAILURE) { + RETURN_FALSE; + } + if (swf_object_is_bitmap_tagdata(data, data_len) == 0) { + RETURN_FALSE; + } + RETURN_TRUE; +} + + static swf_object_t *get_swf_object(zval *obj TSRMLS_DC) { // zval *data, **tmp; zval **tmp = NULL; Modified: trunk/src/php_swfed.h =================================================================== --- trunk/src/php_swfed.h 2011-04-01 10:42:59 UTC (rev 502) +++ trunk/src/php_swfed.h 2011-04-01 10:48:52 UTC (rev 503) @@ -82,10 +82,13 @@ PHP_METHOD(swfed, disasmActionData); PHP_METHOD(swfed, setActionVariables); PHP_METHOD(swfed, replaceMovieClip); + PHP_METHOD(swfed, setCompressLevel); PHP_METHOD(swfed, rebuild); PHP_METHOD(swfed, purgeUselessContents); +PHP_METHOD(swfed, isShapeTagData); +PHP_METHOD(swfed, isBitmapTagData); /* Declare any global variables you may need between the BEGIN and END macros here: