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

📄 action_external.c.svn-base

📁 A Flash Player with ActionScript support. Write in C and C++. It have two part, one is Player and an
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
#include <stdio.h>#include <sys/types.h>#include <stdlib.h>#include <strings.h>#include <string.h>#include <errno.h>#include <assert.h>#include "action_external.h"#include "player_pub.h"#include "swf_file_pub.h"#include "base_types.h"#include "instance.h"#include "movie_clips_ins.h"#include "dynamic_text_def.h"#include "dynamic_text_ins.h"#include "dynamic_var.h"extern player_t *player_p;/*--------------------------------------------------------------------*/int get_alpha(const char *name,double *value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    node_p = ins_name_to_node(swf_p->_root_p,name);    if (!node_p)        return -1;    *value = ins_get_alpha(node_p);    fprintf(stdout,"\t\t get_alpha(name=%s)\n",name);    return 0;}/*---------------------------------------------------------------------*/int get_currentframe(const char *name,int *value) {    fprintf(stdout,"\t\t get_currentframe(name=%s)\n",name);    *value = 666;    return 0;};/*----------------------------------------------------*/int get_droptarget(const char *name,char *buff,size_t length) {    fprintf(stdout,"\t\t get_droptarget(name=%s)\n",name);    snprintf(buff,length,"%s","/droptarget1");    return 0;};/*-----------------------------------------------------*/int get_framesloaded(const char *name,int *value) {    fprintf(stdout,"\t\t get_framesloaded(name=%s)\n",name);    *value = player_p->_level0_p->frame_count;    return 0;}/*-----------------------------------------------------*/int get_height(const char *name,double *value) {    fprintf(stdout,"\t\t get_height(name=%s)\n",name);    *value = 663;    return 0;}/*-----------------------------------------------------*/char * get_name(const char *name) {    static char tmp[]="get_name";    fprintf(stdout,"\t\t get_name(name=%s)\n",name);    return tmp;}/*----------------------------------------------------------*/int get_rotation(const char *name,double * value ) {    fprintf(stdout,"\t\t get_rotation(name=%s)\n",name);    *value = 66.0;    return 0;}char * get_target(const char *name,char *buff,size_t length) {    fprintf(stdout,"\t\t get_target(name=%s)\n",name);    snprintf(buff,length,"%s",name);    return buff;}int get_totalframes(const char *name,int *value) {    fprintf(stdout,"\t\t get_totalframes(name=%s)\n",name);    *value = *value = player_p->_level0_p->frame_count;    return 0;}char * get_url(const char *name,char *buff,size_t length) {    fprintf(stdout,"\t\t get_url(name=%s)\n",name);    snprintf(buff,length,"_level1.geturl_ret");    return buff;}int get_visible(const char *name,int *value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    fprintf(stdout,"\t\t get_visible(name=%s)\n",name);    node_p = ins_name_to_node(swf_p->_root_p,name);    if (!node_p)        return -1;    *value = ((instance_t*)node_p->data)->visible;    return 0;}int get_width(const char *name,double *value ) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    node_p = ins_name_to_node(swf_p->_root_p,name);    *value = ins_get_width(node_p);    fprintf(stdout,"\t\t get_width(name=%s) %f \n",name,*value);    return 0;}int get_x(const char *name,double * value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    fprintf(stdout,"\t\t get_x(name=%s)\n",name);    node_p = ins_name_to_node(swf_p->_root_p,name);    *value = ins_get_x(node_p);    return 0;}int get_xmouse(const char *name,int *value) {    fprintf(stdout,"\t\t get_xmouse(name=%s)\n",name);    *value = 66;    return 0;}int get_xscale(const char *name,double *value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    node_p = ins_name_to_node(swf_p->_root_p,name);    if (!node_p)        return -1;    *value = ins_get_xscale(node_p);    fprintf(stdout,"\t\t get_xscale(name=%s)\n",name);    return 0;}int get_y(const char *name,double *value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    fprintf(stdout,"\t\t get_y(name=%s)\n",name);    node_p = ins_name_to_node(swf_p->_root_p,name);    *value = ins_get_y(node_p);    return 0;}int get_ymouse(const char *name,int *value) {    fprintf(stdout,"\t\t get_ymouse(name=%s)\n",name);    *value = 66;    return 0;}int get_yscale(const char *name,double *value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    node_p = ins_name_to_node(swf_p->_root_p,name);    if (!node_p)        return -1;    *value = ins_get_yscale(node_p);    fprintf(stdout,"\t\t get_yscale(name=%s)\n",name);    return 0;}int set_alpha(const char *name,const double value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    node_p = ins_name_to_node(swf_p->_root_p,name);    if (!node_p)        return -1;    ins_set_alpha(node_p,value);    fprintf(stdout,"\t\t set_alpha(name=%s)\n",name);    return 0;}int set_height(const char *name,const double value) {    fprintf(stdout,"\t\t set_height(name=%s)\n",name);    return 66;}int set_name(const char *name,const char *value) {    fprintf(stdout,"\t\t set_name(name=%s)\n",name);    return 66;}int set_rotation(const char *name,const double value) {    fprintf(stdout,"\t\t set_rotation(name=%s)\n",name);    return 66.0;}int set_visible(const char *name,const int value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    fprintf(stdout,"\t\t set_visible(name=%s)\n",name);    node_p = ins_name_to_node(swf_p->_root_p,name);    if (!node_p)        return -1;    ins_set_visible(node_p,value);    return 0;}int set_width(const char *name,const double value) {    fprintf(stdout,"\t\t set_width(name=%s)\n",name);    return 66;}int set_x(const char *name,const double value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    fprintf(stdout,"\t\t set_x(name=%s) %f\n",name,value);    node_p = ins_name_to_node(swf_p->_root_p,name);    ins_set_x(node_p,value);    return 0;}int set_xscale(const char *name,const double value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    node_p = ins_name_to_node(swf_p->_root_p,name);    if (!node_p)        return -1;    ins_set_xscale(node_p,value);    fprintf(stdout,"\t\t set_xscale(name=%s,%f)\n",name,value);    return 0;}int set_y(const char *name,const double value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    fprintf(stdout,"\t\t set_y(name=%s)\n",name);    node_p = ins_name_to_node(swf_p->_root_p,name);    ins_set_y(node_p,value);    return 0;}int set_yscale(const char *name,const double value) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    node_p = ins_name_to_node(swf_p->_root_p,name);    if (!node_p)        return -1;    ins_set_xscale(node_p,value);    fprintf(stdout,"\t\t set_yscale(name=%s,%f)\n",name,value);    return 0;}/*---_------------------------------------------------*/int get_focusrect() {    return 1;}/*----------------------------------------------------*/int get_highquality() {    return 2;}/*----------------------------------------------------*/char * get_quality() {    static char name[]="MEDIUM";    return name;}/*----------------------------------------------------*/int get_soundbuftime() {    return 118;}/*----------------------------------------------------*/int set_focusrect(const int focus) {    fprintf(stdout,"\t\tset_focusrect(%d)\n",focus);    return 0;}/*----------------------------------------------------*/int set_highquality(const int quality) {    fprintf(stdout,"\t\tset_highquality(%d)\n",quality);    return 0;}/*----------------------------------------------------*/int set_quality(const char * quality) {    fprintf(stdout,"\t\tset_quality(%s)\n",quality);    return 0;}/*----------------------------------------------------*/int set_soundbuftime(const int buftime) {    fprintf(stdout,"\t\tset_soundbuftime(%d)\n",buftime);    return 0;}/*----------------------------------------------------*/int getAscii() {    fprintf(stdout,"\t\tgetAscii\n");    return 36;}/*----------------------------------------------------*/int getCode() {    return 16;}/*----------------------------------------------------*/int getKeyStat(const int keycode) {    fprintf(stdout,"\t\tgetKeyStat(%d)\n",keycode);    return 0;}/*====================================================*/int find_MovieClip_onPool(const char *name) {    swf_file_t		*swf_p = player_p->_level0_p;    GNode		*node_p;    char		*p;    printf("\t\tfind --%s--", name);    node_p = ins_name_to_node(swf_p->_root_p,name);    if (node_p)        switch (((instance_t*)(node_p->data))->ins_type) {        case INS_DTX:            printf(" DTX found\n");            return 128;        case INS_MC:        case INS_BTN:            printf(" MC or BTN found\n");            return 64;        };    assert(name);    if (dvar_get_value(name)) {        printf(" DTX var found\n");        return 128;    };    printf(" not found\n");    return 0;}int MouseObject_Show() {    fprintf(stdout,"\t\t Call MouseObject_Show();\n");    return 0;}int MouseObject_Hide() {    fprintf(stdout,"\t\t Call MouseObject_Hide();\n");    return 0;}/*================================================================*/int set_ColorObject_Transform(const char * name,Transform * form) {    int i=0;    fprintf(stdout,"\t\tset_ColorObject_Transform(%s",name);    for(i=0;i<8;i++) {        fprintf(stdout,",%s=%d",form[i].name,form[i].value);    }    fprintf(stdout,")\n");    return 0;}int get_ColorObject_Transform(const char * name,Transform * form) {    int i=0;    fprintf(stdout,"\t\tget_ColorObject_Transform(%s)\n",name);    for(i=0;i<8;i++) {        form[i].value=i;    }    return 0;}int set_ColorObject_RGB(const char *name,int32_t rgb) {    fprintf(stdout,"\t\tset_ColorObject_RGB(%s,%x)\n",name,rgb);    return 0;}int get_ColorObject_RGB(const char *name,int32_t *rgb) {    if(rgb)        *rgb=0x888888;    fprintf(stdout,"\t\tset_ColorObject_RGB(%s,return %x)\n",name,*rgb);    return 0;}int MovieClip_AttachMovie(const char * name, const char * symbolIdentifier,const char *newName,int32_t depth) {    swf_file_t          *swf_p = player_p->_level0_p;    int 		char_id = swf_sym_to_char_id(swf_p,symbolIdentifier);    GNode		*node_p = NULL ;    assert(char_id>=0);    node_p = ins_name_to_node(swf_p->_root_p,name);    mc_ins_attach(node_p,char_id,newName,depth);    fprintf(stdout,"\t\tMovieClip_AttachMovie(name = %s, %s, %s, %d)\n",name,symbolIdentifier,newName,depth);    return 0;}int MovieClip_DuplicateMovieClip(const char * name, const char *newName,int32_t depth) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = NULL ;    fprintf(stdout,"\t\tMovieClip_DuplicateMovieClip(name = %s, %s, %d)\n",name,newName,depth);    node_p = ins_name_to_node(swf_p->_root_p,name);    mc_ins_duplicate(node_p,newName,depth);    return 0;}int MovieClip_GetBounds(const char *name,const char * target, int32_t *xMin, int32_t *xMax, int32_t *yMin, int32_t *yMax) {    fprintf(stdout,"\t\tMovieClip_GetBounds(name = %s,%s %d, %d, %d, %d)\n",name,target,*xMin,*xMax,*yMin,*yMax);    *xMin = 9;    *xMax = 8;    *yMin = 7;    *yMax = 6;    return 0;}int32_t MovieClip_GetBytesLoaded(const char *name) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = NULL ;    long		loaded = 0;    fprintf(stdout,"\t\tMovieClip_GetBytesLoaded(name = %s)\n",name);    node_p = ins_name_to_node(swf_p->_root_p,name);    if (node_p) {        loaded = mc_ins_get_bytes_loaded(node_p);        printf("loaded %d \n",loaded);        return loaded;    } else {        return -1;    };}int32_t MovieClip_GetBytesTotal(const char *name) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = NULL ;    long		total = 0;    fprintf(stdout,"\t\tMovieClip_GetBytesTotal(name = %s)\n",name);    node_p = ins_name_to_node(swf_p->_root_p,name);    if (node_p) {        total = mc_ins_get_bytes_total(node_p);        printf("total %d \n",total);        return total;    } else {        return -1;    };}int MovieClip_GetURL(const char *name,const char * url,const char * window,const char *method) {    char *url_p = strdup(url);    assert(pthread_mutex_lock(&player_p->urlq_mutex)==0);    player_p->urlq_p=g_slist_append(player_p->urlq_p,url_p);    pthread_cond_signal(&player_p->urlq_cond);    assert(pthread_mutex_unlock(&player_p->urlq_mutex)==0);    fprintf(stdout,"\t\tMovieClip_GetURL(name = %s, %s, %s, %s)\n",name,url,window,method);    return 0;}int MovieClip_GlobalToLocal(const char *name,double *x,double *y) {    fprintf(stdout,"\t\tMovieClip_GlobalToLocal(name = %s, %f, %f)\n",name,*x,*y);    *x = 66.66;    *y = 666.666;    return 0;}int MovieClip_GotoAndPlay_Number(const char *name,int frameNumber) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;    fprintf(stdout,"\t\tMovieClip_GotoAndPlay_Number(name = %s, %d)\n",name,frameNumber);    node_p = ins_name_to_node(swf_p->_root_p,name);    if (node_p) {        mc_ins_go_and_play(node_p,frameNumber);        return 0;    } else {        return -1;    };    return 0;}int MovieClip_GotoAndPlay_Label(const char *name,const char *frameLabel, const int Scene) {    swf_file_t          *swf_p = player_p->_level0_p;    GNode		*node_p = swf_p->_root_p;

⌨️ 快捷键说明

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