📄 swfnative.cc
字号:
JNIEXPORT jint JNICALL Java_SWFMovieClip_nNew (JNIEnv *, jobject){ return (jint)newSWFMovieClip();}JNIEXPORT void JNICALL Java_SWFMovieClip_nDestroy (JNIEnv *, jobject, jint handle){ destroySWFMovieClip ((SWFMovieClip)handle);}JNIEXPORT void JNICALL Java_SWFMovieClip_nSetFrames (JNIEnv *, jobject, jint handle, jint v){ SWFMovieClip_setNumberOfFrames ((SWFMovieClip)handle, v);}JNIEXPORT jint JNICALL Java_SWFMovieClip_nAdd (JNIEnv *, jobject, jint handle, jint Hobject){ return (jint)SWFMovieClip_add ((SWFMovieClip)handle, (SWFBlock)Hobject);}JNIEXPORT void JNICALL Java_SWFMovieClip_nRemove (JNIEnv *, jobject, jint handle, jint Hobject){ SWFMovieClip_remove ((SWFMovieClip)handle, (SWFBlock)Hobject);}JNIEXPORT void JNICALL Java_SWFMovieClip_nNextFrame (JNIEnv *, jobject, jint handle){ SWFMovieClip_nextFrame ((SWFMovieClip)handle);}JNIEXPORT void JNICALL Java_SWFMovieClip_nLabelFrame (JNIEnv* env, jobject, jint handle, jstring name){ const char* sname = env->GetStringUTFChars (name, NULL); SWFMovieClip_labelFrame ((SWFMovieClip)handle, (char*)sname); env->ReleaseStringUTFChars (name, sname);}//// SWFMorph Methods//JNIEXPORT jint JNICALL Java_SWFMorph_nNew (JNIEnv *, jobject){ return (jint)newSWFMorphShape();}JNIEXPORT void JNICALL Java_SWFMorph_nDestroy (JNIEnv *, jobject, jint handle){ destroySWFMorph ((SWFMorph)handle);}JNIEXPORT jint JNICALL Java_SWFMorph_nGetShape1 (JNIEnv *, jobject, jint handle){ return (jint)SWFMorph_getShape1 ((SWFMorph)handle);}JNIEXPORT jint JNICALL Java_SWFMorph_nGetShape2 (JNIEnv *, jobject, jint handle){ return (jint)SWFMorph_getShape2 ((SWFMorph)handle);}//// SWFFont Methods//JNIEXPORT jint JNICALL Java_SWFFont_nNewFileFont (JNIEnv* env, jobject, jstring font){ const char* sfont = env->GetStringUTFChars (font, NULL); FILE* file = fopen (sfont, "rb"); jint obj = (jint)loadSWFFontFromFile (file); env->ReleaseStringUTFChars (font, sfont); return obj;}JNIEXPORT jint JNICALL Java_SWFFont_nNewBrowserFont (JNIEnv* env, jobject, jstring font){ const char* sfont = env->GetStringUTFChars (font, NULL); jint obj = (jint)newSWFBrowserFont ((char*)sfont); env->ReleaseStringUTFChars (font, sfont); return obj;}JNIEXPORT void JNICALL Java_SWFFont_nDestroyFileFont (JNIEnv *, jobject, jint handle){ destroySWFFont ((SWFFont)handle);}JNIEXPORT void JNICALL Java_SWFFont_nDestroyBrowserFont (JNIEnv *, jobject, jint handle){ destroySWFBrowserFont ((SWFFont)handle);}JNIEXPORT jfloat JNICALL Java_SWFFont_nGetStringWidth (JNIEnv* env, jobject, jint handle, jstring str){ const char* sstr = env->GetStringUTFChars (str, NULL); jfloat w = SWFFont_getStringWidth ((SWFFont)handle, sstr); env->ReleaseStringUTFChars (str, sstr); return w;}JNIEXPORT jfloat JNICALL Java_SWFFont_nGetAscent (JNIEnv *, jobject, jint handle){ return SWFFont_getAscent ((SWFFont)handle);}JNIEXPORT jfloat JNICALL Java_SWFFont_nGetDescent (JNIEnv *, jobject, jint handle){ return SWFFont_getDescent ((SWFFont)handle);}JNIEXPORT jfloat JNICALL Java_SWFFont_nGetLeading (JNIEnv *, jobject, jint handle){ return SWFFont_getLeading ((SWFFont)handle);}//// SWFBitmap Methods//JNIEXPORT jint JNICALL Java_SWFBitmap_nNewDblBitmap (JNIEnv* env, jobject, jstring filename){ const char* sfilename = env->GetStringUTFChars (filename, NULL); FILE* file = fopen (sfilename, "rb"); jint obj = (jint)newSWFDBLBitmap (file); env->ReleaseStringUTFChars (filename, sfilename); return obj;}JNIEXPORT jint JNICALL Java_SWFBitmap_nNewJpegBitmap (JNIEnv* env, jobject, jstring filename){ const char* sfilename = env->GetStringUTFChars (filename, NULL); FILE* file = fopen (sfilename, "rb"); jint obj = (jint)newSWFJpegBitmap (file); env->ReleaseStringUTFChars (filename, sfilename); return obj;}JNIEXPORT jint JNICALL Java_SWFBitmap_nNewDataBitmap (JNIEnv* env, jobject, jbyteArray array){ jboolean copy = true; int len = env->GetArrayLength(array); jbyte* data = env->GetByteArrayElements(array, ©); // create input for image SWFInput input = newSWFInput_allocedBuffer ((unsigned char*)data, len); // create image jint obj = (jint)newSWFJpegBitmap_fromInput (input); return obj;}JNIEXPORT jint JNICALL Java_SWFBitmap_nNewJpegWithAlpha (JNIEnv* env, jobject, jstring bitmap, jstring alpha){ const char* sbitmap = env->GetStringUTFChars (bitmap, NULL); const char* salpha = env->GetStringUTFChars (alpha, NULL); FILE* Bfile = fopen (sbitmap, "rb"); FILE* Afile = fopen (salpha, "rb"); jint obj = (jint)newSWFJpegWithAlpha (Bfile, Afile); env->ReleaseStringUTFChars (bitmap, sbitmap); env->ReleaseStringUTFChars (alpha, salpha); return obj;}JNIEXPORT void JNICALL Java_SWFBitmap_nDestroy (JNIEnv *, jobject, jint handle){ destroySWFBitmap ((SWFBitmap)handle);}JNIEXPORT jfloat JNICALL Java_SWFBitmap_nGetWidth (JNIEnv *, jobject, jint handle){ return SWFBitmap_getWidth ((SWFBitmap)handle);}JNIEXPORT jfloat JNICALL Java_SWFBitmap_nGetHeight (JNIEnv *, jobject, jint handle){ return SWFBitmap_getHeight ((SWFBitmap)handle);}//// SWFText Methods//JNIEXPORT jint JNICALL Java_SWFText_nNew (JNIEnv *, jobject){ return (jint)newSWFText2();}JNIEXPORT void JNICALL Java_SWFText_nDestroy (JNIEnv *, jobject, jint handle){ destroySWFText ((SWFText)handle);}JNIEXPORT void JNICALL Java_SWFText_nSetFont (JNIEnv *, jobject, jint handle, jint Hfont){ SWFText_setFont ((SWFText)handle, (SWFFont)Hfont);}JNIEXPORT void JNICALL Java_SWFText_nSetColor (JNIEnv *, jobject, jint handle, jint r, jint g, jint b, jint alpha){ SWFText_setColor ((SWFText)handle, r,g,b, alpha);}JNIEXPORT void JNICALL Java_SWFText_nAddString (JNIEnv* env, jobject, jint handle, jstring text){ const char* stext = env->GetStringUTFChars (text, NULL); SWFText_addString ((SWFText)handle, stext, NULL); env->ReleaseStringUTFChars (text, stext);}JNIEXPORT void JNICALL Java_SWFText_nSetHeight (JNIEnv *, jobject, jint handle, jfloat height){ SWFText_setHeight ((SWFText)handle, height);}JNIEXPORT void JNICALL Java_SWFText_nSetSpacing (JNIEnv *, jobject, jint handle, jfloat spacing){ SWFText_setSpacing ((SWFText)handle, spacing);}JNIEXPORT jfloat JNICALL Java_SWFText_nGetAscent (JNIEnv *, jobject, jint handle){ return SWFText_getAscent ((SWFText)handle);}JNIEXPORT jfloat JNICALL Java_SWFText_nGetDescent (JNIEnv *, jobject, jint handle){ return SWFText_getDescent ((SWFText)handle);}JNIEXPORT jfloat JNICALL Java_SWFText_nGetLeading (JNIEnv *, jobject, jint handle){ return SWFText_getLeading ((SWFText)handle);}JNIEXPORT void JNICALL Java_SWFText_nMoveTo (JNIEnv *, jobject, jint handle, jfloat x, jfloat y){ SWFText_moveTo ((SWFText)handle, x, y);}//// SWFTextField Methods//JNIEXPORT jint JNICALL Java_SWFTextField_nNew (JNIEnv *, jobject){ return (jint)newSWFTextField();}JNIEXPORT void JNICALL Java_SWFTextField_nDestroy (JNIEnv *, jobject, jint handle){ destroySWFTextField ((SWFTextField)handle);}JNIEXPORT void JNICALL Java_SWFTextField_nSetFont (JNIEnv *, jobject, jint handle, jint Hfont){ SWFTextField_setFont ((SWFTextField)handle, (SWFFont)Hfont);}JNIEXPORT void JNICALL Java_SWFTextField_nSetColor (JNIEnv *, jobject, jint handle, jint r, jint g, jint b, jint alpha){ SWFTextField_setColor ((SWFTextField)handle, r,g,b, alpha);}JNIEXPORT void JNICALL Java_SWFTextField_nAddString (JNIEnv* env, jobject, jint handle, jstring text){ const char* stext = env->GetStringUTFChars (text, NULL); SWFTextField_addString ((SWFTextField)handle, (char*)stext); env->ReleaseStringUTFChars (text, stext);}JNIEXPORT void JNICALL Java_SWFTextField_nSetBounds (JNIEnv *, jobject, jint handle, jfloat width, jfloat height){ SWFTextField_setBounds ((SWFTextField)handle, width, height);}JNIEXPORT void JNICALL Java_SWFTextField_nSetFlags (JNIEnv *, jobject, jint handle, jlong flags){ SWFTextField_setFlags ((SWFTextField)handle, flags);}JNIEXPORT void JNICALL Java_SWFTextField_nSetAlignment (JNIEnv *, jobject, jint handle, jint align){ SWFTextField_setAlignment ((SWFTextField)handle, (SWFTextFieldAlignment)align);}JNIEXPORT void JNICALL Java_SWFTextField_nSetVariableName (JNIEnv* env, jobject, jint handle, jstring name){ const char* sname = env->GetStringUTFChars (name, NULL); SWFTextField_setVariableName ((SWFTextField)handle, (char*)sname); env->ReleaseStringUTFChars (name, sname);}JNIEXPORT void JNICALL Java_SWFTextField_nSetLeftMargin (JNIEnv *, jobject, jint handle, jfloat v){ SWFTextField_setLeftMargin ((SWFTextField)handle, v);}JNIEXPORT void JNICALL Java_SWFTextField_nSetRightMargin (JNIEnv *, jobject, jint handle, jfloat v){ SWFTextField_setRightMargin ((SWFTextField)handle, v);}JNIEXPORT void JNICALL Java_SWFTextField_nSetIndentation (JNIEnv *, jobject, jint handle, jfloat v){ SWFTextField_setIndentation ((SWFTextField)handle, v);}JNIEXPORT void JNICALL Java_SWFTextField_nSetLineSpacing (JNIEnv *, jobject, jint handle, jfloat v){ SWFTextField_setLineSpacing ((SWFTextField)handle, v);}JNIEXPORT void JNICALL Java_SWFTextField_nSetLength (JNIEnv *, jobject, jint handle, jint len){ SWFTextField_setLength ((SWFTextField)handle, len);}//// SWFSound Methods//JNIEXPORT jint JNICALL Java_SWFSound_nNew (JNIEnv* env, jobject, jstring filename){ const char* sfilename = env->GetStringUTFChars (filename, NULL); FILE* file = fopen (sfilename, "rb"); jint obj = (jint)newSWFSound (file); env->ReleaseStringUTFChars (filename, sfilename); return obj;}//// SWFGradient Methods//JNIEXPORT jint JNICALL Java_SWFGradient_nNew (JNIEnv *, jobject){ return (jint)newSWFGradient();}JNIEXPORT void JNICALL Java_SWFGradient_nDestroy (JNIEnv *, jobject, jint handle){ destroySWFGradient ((SWFGradient)handle);}JNIEXPORT void JNICALL Java_SWFGradient_nAddEntry (JNIEnv *, jobject, jint handle, jfloat ratio, jint r, jint g, jint b, jint alpha){ SWFGradient_addEntry ((SWFGradient)handle, ratio, r,g,b, alpha);}//// SWFButton Methods//JNIEXPORT jint JNICALL Java_SWFButton_nNew (JNIEnv *, jobject){ return (jint)newSWFButton();}JNIEXPORT void JNICALL Java_SWFButton_nDestroy (JNIEnv *, jobject, jint handle){ destroySWFButton ((SWFButton)handle);}JNIEXPORT void JNICALL Java_SWFButton_nAddShape (JNIEnv *, jobject, jint handle, jint Hshape, jint flags){ SWFButton_addShape ((SWFButton)handle, (SWFBlock)Hshape, flags);}JNIEXPORT void JNICALL Java_SWFButton_nAddAction (JNIEnv *, jobject, jint handle, jint Haction, jint flags){ SWFButton_addAction ((SWFButton)handle, (SWFAction)Haction, flags);}//// SWFAction Methods//JNIEXPORT jint JNICALL Java_SWFAction_nNew (JNIEnv* env, jobject, jstring script){ const char* sscript = env->GetStringUTFChars (script, NULL); jint obj = (jint)compileSWFActionCode ((char*)sscript); env->ReleaseStringUTFChars (script, sscript); return obj;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -