📄 movie.xs
字号:
/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author: whamann $ * $Id: Movie.xs,v 1.7 2003/06/18 10:26:58 whamann Exp $ */#include "EXTERN.h"#include "perl.h"#include "XSUB.h"#include "SWF.h"#include "perl_swf.h"MODULE = SWF::Movie PACKAGE = SWF::Movie PREFIX = SWFMovie_PROTOTYPES: ENABLEvoiddestroySWFMovie(movie) SWF::Movie movie ALIAS: SWF::Movie::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "Movie DESTROY CALLED\n")); swf_stash_refcnt_dec((SV*)SvRV(ST(0))); destroySWFMovie(movie);SWF::MovieSWFMovie_new(package="SWF::Movie") char *package CODE: RETVAL = newSWFMovie(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL);SWF::MovienewSWFMovieWithVersion(version) int versionvoidSWFMovie_setRate(movie, rate) SWF::Movie movie float ratevoidSWFMovie_setDimension(movie, x, y) SWF::Movie movie int x int yvoidSWFMovie_setNumberOfFrames(movie, frames) SWF::Movie movie int frames ALIAS: SWF::Movie::setFrames = 1voidSWFMovie_setBackground(movie, r, g, b) SWF::Movie movie int r int g int bvoidSWFMovie_protect(movie) SWF::Movie movievoidSWFMovie_nextFrame(movie) SWF::Movie movievoidSWFMovie_labelFrame(movie, label) SWF::Movie movie char * labelint SWFMovie_xs_output(movie, compresslevel=-1) SWF::Movie movie int compresslevel CODE: RETVAL = SWFMovie_output(movie, fileOutputMethod, stdout, compresslevel);int SWFMovie_save(movie, filename, compresslevel=-1) SWF::Movie movie char * filename int compresslevel PREINIT: FILE *f; CODE: if (!(f = fopen(filename, "wb"))) { fprintf(stderr, "Unable to open %s\n", filename); ST(0) = &sv_undef; }else{ RETVAL = SWFMovie_output(movie, fileOutputMethod, f, compresslevel); fclose(f); } OUTPUT: RETVALvoid SWFMovie_addExport(movie, block, name) SWF::Movie movie SWF::Block block = (SWF__Block) SvIV((SV*)SvRV(ST(1))); char *name CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); SWFMovie_addExport(movie, block, name);voidSWFMovie_writeExports(movie) SWF::Movie movieSWF::DisplayItemSWFMovie_add(movie, block) SWF::Movie movie SWF::Block block = (SWF__Block) SvIV((SV*)SvRV(ST(1))); CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); RETVAL = SWFMovie_add(movie, block); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::DisplayItem", (void*)RETVAL);voidSWFMovie_remove(movie, item) SWF::Movie movie SWF::DisplayItem itemvoidSWFMovie_setSoundStream(movie, sound) SWF::Movie movie SWF::Sound sound CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); SWFMovie_setSoundStream(movie, sound);SWF::SoundInstanceSWFMovie_startSound(movie, sound) SWF::Movie movie SWF::Sound sound CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); RETVAL = SWFMovie_startSound(movie, sound); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::SoundInstance", (void*)RETVAL);voidSWFMovie_stopSound(movie, sound) SWF::Movie movie SWF::Sound sound CODE: SWFMovie_stopSound(movie, sound);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -