⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 swf.c

📁 php-4.4.7学习linux时下载的源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
/* {{{ proto void swf_enddoaction(void)   Ends the list of actions to perform for the current frame */PHP_FUNCTION(swf_enddoaction){	swf_enddoaction();}/* }}} */ /* {{{ proto void swf_actiongotoframe(int frame_number)   Causes the Flash movie to display the specified frame, frame_number, and then stop. */PHP_FUNCTION(swf_actiongotoframe){	zval **frameno;	if (ZEND_NUM_ARGS() != 1 ||	    zend_get_parameters_ex(1, &frameno) == FAILURE) {	    WRONG_PARAM_COUNT;	}	convert_to_long_ex(frameno);	swf_actionGotoFrame(Z_LVAL_PP(frameno));}/* }}} *//* {{{ proto void swf_actiongeturl(string url, string target)   Gets the specified url */PHP_FUNCTION(swf_actiongeturl){	zval **url, **target;	if (ZEND_NUM_ARGS() != 2 ||	    zend_get_parameters_ex(2, &url, &target) == FAILURE) {	    WRONG_PARAM_COUNT;	}	convert_to_string_ex(url);	convert_to_string_ex(target);		swf_actionGetURL(Z_STRVAL_PP(url), Z_STRVAL_PP(target));}/* }}} *//* {{{ proto void swf_actionnextframe(void)   Goes foward one frame */PHP_FUNCTION(swf_actionnextframe){	swf_actionNextFrame();}/* }}} *//* {{{ proto void swf_actionprevframe(void)   Goes backward one frame */PHP_FUNCTION(swf_actionprevframe){	swf_actionPrevFrame();}/* }}} *//* {{{ proto void swf_actionplay(void)   Starts playing the Flash movie from the current frame */PHP_FUNCTION(swf_actionplay){	swf_actionPlay();}/* }}} *//* {{{ proto void swf_actionstop(void)   Stops playing the Flash movie at the current frame */PHP_FUNCTION(swf_actionstop){	swf_actionStop();}/* }}} *//* {{{ proto void swf_actiontogglequality(void)   Toggles between high and low quality */PHP_FUNCTION(swf_actiontogglequality){	swf_actionToggleQuality();}/* }}} *//* {{{ proto void swf_actionwaitforframe(int frame, int skipcount)   If the specified frame has not been loaded, skip the specified number of actions in the action list */PHP_FUNCTION(swf_actionwaitforframe){	zval **frame, **skipcount;	if (ZEND_NUM_ARGS() != 2 ||	    zend_get_parameters_ex(2, &frame, &skipcount) == FAILURE) {	    WRONG_PARAM_COUNT;	}		convert_to_long_ex(frame);	convert_to_long_ex(skipcount);	swf_actionWaitForFrame(Z_LVAL_PP(frame), Z_LVAL_PP(skipcount));}/* }}} *//* {{{ proto void swf_actionsettarget(string target)   Sets the context for actions */PHP_FUNCTION(swf_actionsettarget){	zval **target;	if (ZEND_NUM_ARGS() != 1 ||	    zend_get_parameters_ex(1, &target) == FAILURE) {	    WRONG_PARAM_COUNT;	}		convert_to_string_ex(target);	swf_actionSetTarget(Z_STRVAL_PP(target));}/* }}} *//* {{{ proto void swf_actiongotolabel(string label)   Causes the flash movie to display the frame with the given label and then stop */PHP_FUNCTION(swf_actiongotolabel){	zval **label;	if (ZEND_NUM_ARGS() != 1 ||	    zend_get_parameters_ex(1, &label) == FAILURE) {	    WRONG_PARAM_COUNT;	}	convert_to_string_ex(label);	swf_actionGoToLabel(Z_STRVAL_PP(label));}/* }}} *//* {{{ php_swf_define */void php_swf_define(INTERNAL_FUNCTION_PARAMETERS, int opt){	zval **objid, **x1, **y1, **x2, **y2, **width;	if (ZEND_NUM_ARGS() != 6 ||	    zend_get_parameters_ex(6, &objid, &x1, &y1, &x2, &y2, &width) == FAILURE) {	    WRONG_PARAM_COUNT;	}		convert_to_long_ex(objid);	convert_to_double_ex(x1);	convert_to_double_ex(y1);	convert_to_double_ex(x2);	convert_to_double_ex(y2);	convert_to_double_ex(width);		if (opt) {		swf_defineline(Z_LVAL_PP(objid), (float)Z_DVAL_PP(x1), (float)Z_DVAL_PP(y1),	 	               (float)Z_DVAL_PP(x2), (float)Z_DVAL_PP(y2), (float)Z_DVAL_PP(width));	} else {		swf_definerect(Z_LVAL_PP(objid), (float)Z_DVAL_PP(x1), (float)Z_DVAL_PP(y1),	 	               (float)Z_DVAL_PP(x2), (float)Z_DVAL_PP(y2), (float)Z_DVAL_PP(width));	}}/* }}} *//* {{{ proto void swf_defineline(int objid, float x1, float y1, float x2, float y2, float width)   Create a line with object id, objid, starting from x1, y1 and going to x2, y2 with width, width */PHP_FUNCTION(swf_defineline){	php_swf_define(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);}/* }}} *//* {{{ proto void swf_definerect(int objid, float x1, float y1, float x2, float y2, float width)   Create a rectangle with object id, objid, the upper lefthand coordinate is given by x1, y1 the bottom right coordinate is x2, y2 and with is the width of the line */PHP_FUNCTION(swf_definerect){	php_swf_define(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);}/* }}} *//* {{{ proto void swf_definepoly(int obj_id, array coords, int npoints, float width)   Define a Polygon from an array of x,y coordinates, coords. */PHP_FUNCTION(swf_definepoly){	zval **obj_id, **coordinates, **NumPoints, **width, **var;	int npoints, i;	float coords[256][2];		if (ZEND_NUM_ARGS() != 4 ||	    zend_get_parameters_ex(4, &obj_id, &coordinates, &NumPoints, &width) == FAILURE) {		WRONG_PARAM_COUNT;	}	convert_to_long_ex(obj_id);	convert_to_long_ex(NumPoints);	convert_to_double_ex(width);		if (Z_TYPE_PP(coordinates) != IS_ARRAY) {		php_error(E_WARNING, "Wrong datatype of second argument to swf_definepoly");		RETURN_FALSE;	}	if (Z_LVAL_PP(NumPoints) > 256) {		php_error(E_WARNING, "The npoints value cannot be larger then 256.");		RETURN_FALSE;	}		npoints = Z_LVAL_PP(NumPoints);	for (i = 0; i < npoints; i++)	{		if (zend_hash_index_find(Z_ARRVAL_PP(coordinates), (i * 2), (void **)&var) == SUCCESS) {			SEPARATE_ZVAL(var);			convert_to_double_ex(var);			coords[i][0] = (float)Z_DVAL_PP(var);		}				if (zend_hash_index_find(Z_ARRVAL_PP(coordinates), (i * 2) + 1, (void **)&var) == SUCCESS) {			SEPARATE_ZVAL(var);			convert_to_double_ex(var);			coords[i][1] = (float)Z_DVAL_PP(var);		}			}	swf_definepoly(Z_LVAL_PP(obj_id), coords, npoints, (float)Z_DVAL_PP(width));}/* }}} *//* {{{ proto void swf_startshape(int objid)   Initialize a new shape with object id, objid */PHP_FUNCTION(swf_startshape){	zval **objid;	if (ZEND_NUM_ARGS() != 1 ||	    zend_get_parameters_ex(1, &objid) == FAILURE) {	    WRONG_PARAM_COUNT;	}	convert_to_long_ex(objid);	swf_startshape(Z_LVAL_PP(objid));}/* }}} *//* {{{ proto void swf_shapelinesolid(float r, float g, float b, float a, float width)   Create a line with color defined by rgba, and a width of width */PHP_FUNCTION(swf_shapelinesolid){	zval **r, **g, **b, **a, **width;	if (ZEND_NUM_ARGS() != 5 ||	    zend_get_parameters_ex(5, &r, &g, &b, &a, &width) == FAILURE) {	    WRONG_PARAM_COUNT;	}	convert_to_double_ex(r);	convert_to_double_ex(g);	convert_to_double_ex(b);	convert_to_double_ex(a);	convert_to_double_ex(width);	swf_shapelinesolid((float)Z_DVAL_PP(r), (float)Z_DVAL_PP(g), (float)Z_DVAL_PP(b), (float)Z_DVAL_PP(a),				   (float)Z_DVAL_PP(width));}/* }}} *//* {{{ proto void swf_shapefilloff(void)   Turns off filling */PHP_FUNCTION(swf_shapefilloff){	swf_shapefilloff();}/* }}} *//* {{{ proto void swf_shapefillsolid(float r, float g, float b, float a)   Sets the current fill style to a solid fill with the specified rgba color */PHP_FUNCTION(swf_shapefillsolid){	zval **r, **g, **b, **a;	if (ZEND_NUM_ARGS() != 4 ||	    zend_get_parameters_ex(4, &r, &g, &b, &a) == FAILURE) {	    WRONG_PARAM_COUNT;	}		convert_to_double_ex(r);	convert_to_double_ex(g);	convert_to_double_ex(b);	convert_to_double_ex(a);		swf_shapefillsolid((float)Z_DVAL_PP(r), (float)Z_DVAL_PP(g), (float)Z_DVAL_PP(b), (float)Z_DVAL_PP(a));}/* }}} *//* {{{ php_swf_fill_bitmap */void php_swf_fill_bitmap(INTERNAL_FUNCTION_PARAMETERS, int opt){	zval **bitmapid;	if (ZEND_NUM_ARGS() != 1 ||	    zend_get_parameters_ex(1, &bitmapid) == FAILURE) {	    WRONG_PARAM_COUNT;	}	convert_to_long_ex(bitmapid);		if (opt) {		swf_shapefillbitmapclip(Z_LVAL_PP(bitmapid));	} else {		swf_shapefillbitmaptile(Z_LVAL_PP(bitmapid));	}}/* }}} *//* {{{ proto void swf_shapefillbitmapclip(int bitmapid)   Sets the current fill mode to clipped bitmap fill. Pixels from the previously defined bitmapid will be used to fill areas */PHP_FUNCTION(swf_shapefillbitmapclip){	php_swf_fill_bitmap(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);}/* }}} *//* {{{ proto void swf_shapefillbitmaptile(int bitmapid)   Sets the current fill mode to tiled bitmap fill. Pixels from the previously defined bitmapid will be used to fill areas */PHP_FUNCTION(swf_shapefillbitmaptile){	php_swf_fill_bitmap(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);}/* }}} *//* {{{ php_swf_shape */void php_swf_shape(INTERNAL_FUNCTION_PARAMETERS, int opt){	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);		if (opt) {		swf_shapemoveto((float)Z_DVAL_PP(x), (float)Z_DVAL_PP(y));	} else {		swf_shapelineto((float)Z_DVAL_PP(x), (float)Z_DVAL_PP(y));	}}/* }}} *//* {{{ proto void swf_shapemoveto(float x, float y)   swf_shapemoveto moves the current position to the given x,y. */PHP_FUNCTION(swf_shapemoveto){	php_swf_shape(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1);}/* }}} *//* {{{ proto void swf_shapelineto(float x, float y)   Draws a line from the current position to x,y, the current position is then set to x,y */PHP_FUNCTION(swf_shapelineto){	php_swf_shape(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);}/* }}} */ /* {{{ proto void swf_shapecurveto(float x1, float y1, float x2, float y2)   Draws a quadratic bezier curve starting at the current position using x1, y1 as an off curve control point and using x2, y2 as the end point. The current position is then set to x2, y2. */PHP_FUNCTION(swf_shapecurveto){	zval **x1, **y1, **x2, **y2;	if (ZEND_NUM_ARGS() != 4 ||	    zend_get_parameters_ex(4, &x1, &y1, &x2, &y2) == FAILURE) {	    WRONG_PARAM_COUNT;	}	convert_to_double_ex(x1);	convert_to_double_ex(y1);	convert_to_double_ex(x2);	convert_to_double_ex(y2);		swf_shapecurveto((float)Z_DVAL_PP(x1), (float)Z_DVAL_PP(y1), (float)Z_DVAL_PP(x2), (float)Z_DVAL_PP(y2));}/* }}} *//* {{{ proto void swf_shapecurveto3(float x1, float y1, float x2, float y2, float x3, float y3)   Draws a cubic bezier curve starting at the current position using x1, y1 and x2, y2 as off curve control points and using x3,y3 as the end point.  The current position is then sent to x3, y3 */PHP_FUNCTION(swf_shapecurveto3){	zval **x1, **y1, **x2, **y2, **x3, **y3;	if (ZEND_NUM_ARGS() != 6 ||	    zend_get_parameters_ex(6, &x1, &y1, &x2, &y2, &x3, &y3) == FAILURE) {	    WRONG_PARAM_COUNT;	}	convert_to_double_ex(x1);	convert_to_double_ex(y1);	convert_to_double_ex(x2);	convert_to_double_ex(y2);	convert_to_double_ex(x3);	convert_to_double_ex(y3);		swf_shapecurveto3((float)Z_DVAL_PP(x1), (float)Z_DVAL_PP(y1), (float)Z_DVAL_PP(x2), (float)Z_DVAL_PP(y2),				  (float)Z_DVAL_PP(x3), (float)Z_DVAL_PP(y3));}/* }}} *//* {{{ proto void swf_shapearc(float x, float y, float r, float ang1, float ang2)   Draws a circular arc from ang1 to ang2. The center of the circle is given by x, and y. r specifies the radius of the arc */PHP_FUNCTION(swf_shapearc){	zval **x, **y, **r, **ang1, **ang2;	if (ZEND_NUM_ARGS() != 5 ||	    zend_get_parameters_ex(5, &x, &y, &r, &ang1, &ang2) == FAILURE) {	    WRONG_PARAM_COUNT;	}	convert_to_double_ex(x);	convert_to_double_ex(y);	convert_to_double_ex(r);	convert_to_double_ex(ang1);	convert_to_double_ex(ang2);		swf_shapearc((float)Z_DVAL_PP(x), (float)Z_DVAL_PP(y), (float)Z_DVAL_PP(r), (float)Z_DVAL_PP(ang1),	             (float)Z_DVAL_PP(ang2));}/* }}} *//* {{{ proto void swf_endshape(void)   Completes the definition of the current shape */PHP_FUNCTION(swf_endshape){	swf_endshape();}/* }}} *//* {{{ proto void swf_definefont(int fontid, string name)   Defines a font. name specifies the PostScript name of the font to use. This font also becomes the current font.  */PHP_FUNCTION(swf_definefont){	zval **fontid, **name;	if (ZEND_NUM_ARGS() != 2 ||	    zend_get_parameters_ex(2, &fontid, &name) == FAILURE) {	    WRONG_PARAM_COUNT;	}	convert_to_long_ex(fontid);	convert_to_string_ex(name);		swf_definefont(Z_LVAL_PP(fontid), Z_STRVAL_PP(name));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -