📄 ming-dev.c
字号:
}/* }}} *//* {{{ proto void swfbutton_addShape(SWFCharacter character, int flags) Sets the character to display for the condition described in flags */PHP_FUNCTION(swfbutton_addShape){ zval **zchar, **flags; SWFButton button = getButton(getThis() TSRMLS_CC); SWFCharacter character; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zchar, &flags) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_object_ex(zchar); character = getCharacter(*zchar TSRMLS_CC); convert_to_long_ex(flags); SWFButton_addShape(button, character, Z_LVAL_PP(flags));}/* }}} *//* {{{ proto void swfbutton_setAction(SWFAction) Sets the action to perform when button is pressed */PHP_FUNCTION(swfbutton_setAction){ zval **zaction; SWFButton button = getButton(getThis() TSRMLS_CC); SWFAction action; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &zaction) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_object_ex(zaction); action = getAction(*zaction TSRMLS_CC); SWFButton_addAction(button, action, SWFBUTTON_OVERDOWNTOOVERUP);}/* }}} *//* {{{ proto void swfbutton_addAction(SWFAction action, int flags) Sets the action to perform when conditions described in flags is met */PHP_FUNCTION(swfbutton_addAction){ zval **zaction, **flags; SWFButton button = getButton(getThis() TSRMLS_CC); SWFAction action; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zaction, &flags) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_object_ex(zaction); action = getAction(*zaction TSRMLS_CC); convert_to_long_ex(flags); SWFButton_addAction(button, action, Z_LVAL_PP(flags));}/* }}} *//* {{{ proto int swfbutton_keypress(string str) Returns the action flag for keyPress(char) */PHP_FUNCTION(swfbutton_keypress){ zval **key; char c; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &key) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(key); if (Z_STRLEN_PP(key) > 1) { php_error(E_ERROR, "SWFBUTTON_KEYPRESS expects only one character!"); } c = Z_STRVAL_PP(key)[0]; RETURN_LONG((c&0x7f)<<9);}/* }}} *//* }}} *//* {{{ SWFDisplayitem*/static zend_function_entry swfdisplayitem_functions[] = { PHP_FALIAS(moveto, swfdisplayitem_moveTo, NULL) PHP_FALIAS(move, swfdisplayitem_move, NULL) PHP_FALIAS(scaleto, swfdisplayitem_scaleTo, NULL) PHP_FALIAS(scale, swfdisplayitem_scale, NULL) PHP_FALIAS(rotateto, swfdisplayitem_rotateTo, NULL) PHP_FALIAS(rotate, swfdisplayitem_rotate, NULL) PHP_FALIAS(skewxto, swfdisplayitem_skewXTo, NULL) PHP_FALIAS(skewx, swfdisplayitem_skewX, NULL) PHP_FALIAS(skewyto, swfdisplayitem_skewYTo, NULL) PHP_FALIAS(skewy, swfdisplayitem_skewY, NULL) PHP_FALIAS(setmatrix, swfdisplayitem_setMatrix, NULL) PHP_FALIAS(setdepth, swfdisplayitem_setDepth, NULL) PHP_FALIAS(setratio, swfdisplayitem_setRatio, NULL) PHP_FALIAS(addcolor, swfdisplayitem_addColor, NULL) PHP_FALIAS(multcolor, swfdisplayitem_multColor, NULL) PHP_FALIAS(setname, swfdisplayitem_setName, NULL) PHP_FALIAS(addaction, swfdisplayitem_addAction, NULL) { NULL, NULL, NULL }};/* {{{ internal function getDisplayItem Returns the SWFDisplayItem contained in zval *id */static SWFDisplayItem getDisplayItem(zval *id TSRMLS_DC){ void *item = SWFgetProperty(id, "displayitem", 11, le_swfdisplayitemp TSRMLS_CC); if (!item) { php_error(E_ERROR, "called object is not an SWFDisplayItem!"); } return (SWFDisplayItem)item;}/* }}} *//* {{{ proto void swfdisplayitem_moveTo(int x, int y) Moves this SWFDisplayItem to movie coordinates (x, y) */PHP_FUNCTION(swfdisplayitem_moveTo){ zval **x, **y; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); convert_to_double_ex(y); SWFDisplayItem_moveTo(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(x), Z_DVAL_PP(y));}/* }}} *//* {{{ proto void swfdisplayitem_move(int dx, int dy) Displaces this SWFDisplayItem by (dx, dy) in movie coordinates */PHP_FUNCTION(swfdisplayitem_move){ zval **x, **y; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); convert_to_double_ex(y); SWFDisplayItem_move(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(x), Z_DVAL_PP(y));}/* }}} *//* {{{ proto void swfdisplayitem_scaleTo(float xScale [, float yScale]) Scales this SWFDisplayItem by xScale in the x direction, yScale in the y, or both to xScale if only one arg */PHP_FUNCTION(swfdisplayitem_scaleTo){ zval **x, **y; if (ZEND_NUM_ARGS() == 1) { if (zend_get_parameters_ex(1, &x) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); SWFDisplayItem_scaleTo(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(x), Z_DVAL_PP(x)); } else if (ZEND_NUM_ARGS() == 2) { if (zend_get_parameters_ex(2, &x, &y) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); convert_to_double_ex(y); SWFDisplayItem_scaleTo(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(x), Z_DVAL_PP(y)); } else { WRONG_PARAM_COUNT; }}/* }}} *//* {{{ proto void swfdisplayitem_scale(float xScale, float yScale) Multiplies this SWFDisplayItem's current x scale by xScale, its y scale by yScale */PHP_FUNCTION(swfdisplayitem_scale){ zval **x, **y; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); convert_to_double_ex(y); SWFDisplayItem_scale(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(x), Z_DVAL_PP(y));}/* }}} *//* {{{ proto void swfdisplayitem_rotateTo(float degrees) Rotates this SWFDisplayItem the given (clockwise) degrees from its original orientation */PHP_FUNCTION(swfdisplayitem_rotateTo){ zval **degrees; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, °rees) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(degrees); SWFDisplayItem_rotateTo(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(degrees));}/* }}} *//* {{{ proto void swfdisplayitem_rotate(float degrees) Rotates this SWFDisplayItem the given (clockwise) degrees from its current orientation */PHP_FUNCTION(swfdisplayitem_rotate){ zval **degrees; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, °rees) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(degrees); SWFDisplayItem_rotate(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(degrees));}/* }}} *//* {{{ proto void swfdisplayitem_skewXTo(float xSkew) Sets this SWFDisplayItem's x skew value to xSkew */PHP_FUNCTION(swfdisplayitem_skewXTo){ zval **x; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &x) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); SWFDisplayItem_skewXTo(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(x));}/* }}} *//* {{{ proto void swfdisplayitem_skewX(float xSkew) Adds xSkew to this SWFDisplayItem's x skew value */PHP_FUNCTION(swfdisplayitem_skewX){ zval **x; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &x) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); SWFDisplayItem_skewX(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(x));}/* }}} *//* {{{ proto void swfdisplayitem_skewYTo(float ySkew) Sets this SWFDisplayItem's y skew value to ySkew */PHP_FUNCTION(swfdisplayitem_skewYTo){ zval **y; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &y) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(y); SWFDisplayItem_skewYTo(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(y));}/* }}} *//* {{{ proto void swfdisplayitem_skewY(float ySkew) Adds ySkew to this SWFDisplayItem's y skew value */PHP_FUNCTION(swfdisplayitem_skewY){ zval **y; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &y) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(y); SWFDisplayItem_skewY(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(y));}/* }}} *//* {{{ proto void swfdisplayitem_setMatrix(float a, float b, float c, float d, float x, float y) Sets the item's transform matrix */PHP_FUNCTION(swfdisplayitem_setMatrix){ zval **a, **b, **c, **d, **x, **y; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &a, &b, &c, &d, &x, &y) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(a); convert_to_double_ex(b); convert_to_double_ex(c); convert_to_double_ex(d); convert_to_double_ex(x); convert_to_double_ex(y); SWFDisplayItem_setMatrix( getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(a), Z_DVAL_PP(b), Z_DVAL_PP(c), Z_DVAL_PP(d), Z_DVAL_PP(x), Z_DVAL_PP(y) );}/* }}} *//* {{{ proto void swfdisplayitem_setDepth(int depth) Sets this SWFDisplayItem's z-depth to depth. Items with higher depth values are drawn on top of those with lower values */PHP_FUNCTION(swfdisplayitem_setDepth){ zval **depth; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &depth) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(depth); SWFDisplayItem_setDepth(getDisplayItem(getThis() TSRMLS_CC), Z_LVAL_PP(depth));}/* }}} *//* {{{ proto void swfdisplayitem_setRatio(float ratio) Sets this SWFDisplayItem's ratio to ratio. Obviously only does anything if displayitem was created from an SWFMorph */PHP_FUNCTION(swfdisplayitem_setRatio){ zval **ratio; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &ratio) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(ratio); SWFDisplayItem_setRatio(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(ratio));}/* }}} *//* {{{ proto void swfdisplayitem_addColor(int r, int g, int b [, int a]) Sets the add color part of this SWFDisplayItem's CXform to (r, g, b [, a]), a defaults to 0 */PHP_FUNCTION(swfdisplayitem_addColor){ zval **r, **g, **b, **za; int a = 0; if (ZEND_NUM_ARGS() == 4) { if (zend_get_parameters_ex(4, &r, &g, &b, &za) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(za); a = Z_LVAL_PP(za); } else if (ZEND_NUM_ARGS() == 3) { if (zend_get_parameters_ex(3, &r, &g, &b) == FAILURE) { WRONG_PARAM_COUNT; } } else { WRONG_PARAM_COUNT; } convert_to_long_ex(r); convert_to_long_ex(g); convert_to_long_ex(b); SWFDisplayItem_setColorAdd(getDisplayItem(getThis() TSRMLS_CC), Z_LVAL_PP(r), Z_LVAL_PP(g), Z_LVAL_PP(b), a);}/* }}} *//* {{{ proto void swfdisplayitem_multColor(float r, float g, float b [, float a]) Sets the multiply color part of this SWFDisplayItem's CXform to (r, g, b [, a]), a defaults to 1.0 */PHP_FUNCTION(swfdisplayitem_multColor){ zval **r, **g, **b, **za; float a = 1.0; if (ZEND_NUM_ARGS() == 4) { if (zend_get_parameters_ex(4, &r, &g, &b, &za) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(za); a = Z_DVAL_PP(za); } else if(ZEND_NUM_ARGS() == 3) { if (zend_get_parameters_ex(3, &r, &g, &b) == FAILURE) { WRONG_PARAM_COUNT; } } else { WRONG_PARAM_COUNT; } convert_to_double_ex(r); convert_to_double_ex(g); convert_to_double_ex(b); SWFDisplayItem_setColorMult(getDisplayItem(getThis() TSRMLS_CC), Z_DVAL_PP(r), Z_DVAL_PP(g), Z_DVAL_PP(b), a);}/* }}} *//* {{{ proto void swfdisplayitem_setName(string name) Sets this SWFDisplayItem's name to name */PHP_FUNCTION(swfdisplayitem_setName){ zval **name; SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &name) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(name); SWFDisplayItem_setName(item, Z_STRVAL_PP(name));}/* }}} *//* {{{ proto void swfdisplayitem_addAction(SWFAction action, int flags) Adds this SWFAction to the given SWFSprite instance */PHP_FUNCTION(swfdisplayitem_addAction){ zval **zaction, **flags; SWFAction action; SWFDisplayItem item = getDisplayItem(getThis() TSRMLS_CC); if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &zaction, &flags) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_object_ex(zaction); convert_to_long_ex(flags); action = (SWFBlock)getAction(*zaction TSRMLS_CC); SWFDisplayItem_addAction(item, action, Z_LVAL_PP(flags));}/* }}} *//* }}} *//* {{{ SWFFill*/static zend_function_entry swffill_functions[] = { PHP_FALIAS(swffill, swffill_init, NULL) PHP_FALIAS(moveto, swffill_moveTo, NULL) PHP_FALIAS(scaleto, swffill_scaleTo, NULL) PHP_FALIAS(rotateto, swffill_rotateTo, NULL) PHP_FALIAS(skewxto, swffill_skewXTo, NULL) PHP_FALIAS(skewyto, swffill_skewYTo, NULL) { NULL, NULL, NULL }};/* {{{ proto class swffill_init(void) Returns a new SWFFill object */PHP_FUNCTION(swffill_init){ php_error(E_ERROR, "Instantiating SWFFill won't do any good- use SWFShape::addFill() instead!");}static void destroy_SWFFill_resource(zend_rsrc_list_entry *resource TSRMLS_DC){ /* this only destroys the shallow wrapper for SWFFillStyle, which SWFShape destroys. So everything's okay. I hope. */ destroySWFFill((SWFFill)resource->ptr);}/* }}} *//* {{{ internal function getFill Returns the SWFFill object contained in zval *id */static SWFFill getFill(zval *id TSRMLS_DC){ void *fill = SWFgetProperty(id, "fill", 4, le_swffillp TSRMLS_CC); if (!fill) { php_error(E_ERROR, "called object is not an SWFFill!"); } return (SWFFill)fill;}/* }}} *//* {{{ proto void swffill_moveTo(int x, int y) Moves this SWFFill to shape coordinates (x,y) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -