347 /**************************************************************************/ 348 349 JNIEXPORT jlong JNICALL OS_NATIVE(kCFAllocatorDefault) 350 (JNIEnv *env, jclass that) 351 { 352 return (jlong)kCFAllocatorDefault; 353 } 354 355 JNIEXPORT jlong JNICALL OS_NATIVE(CFStringCreateWithCharacters__J_3CJ) 356 (JNIEnv *env, jclass that, jlong arg0, jcharArray arg1, jlong arg2) 357 { 358 jchar *lparg1=NULL; 359 jlong rc = 0; 360 if (arg1) if ((lparg1 = (*env)->GetCharArrayElements(env, arg1, NULL)) == NULL) goto fail; 361 rc = (jlong)CFStringCreateWithCharacters((CFAllocatorRef)arg0, (UniChar*)lparg1, (CFIndex)arg2); 362 fail: 363 if (arg1 && lparg1) (*env)->ReleaseCharArrayElements(env, arg1, lparg1, 0); 364 return rc; 365 } 366 367 JNIEXPORT jlong JNICALL OS_NATIVE(CTFontCreateWithName) 368 (JNIEnv *env, jclass that, jlong arg0, jdouble arg1, jobject arg2) 369 { 370 CGAffineTransform _arg2, *lparg2=NULL; 371 jlong rc = 0; 372 if (arg2) if ((lparg2 = getCGAffineTransformFields(env, arg2, &_arg2)) == NULL) goto fail; 373 rc = (jlong)CTFontCreateWithName((CFStringRef)arg0, (CGFloat)arg1, (CGAffineTransform*)lparg2); 374 fail: 375 /* In only */ 376 // if (arg2 && lparg2) setCGAffineTransformFields(env, arg2, lparg2); 377 return rc; 378 } 379 380 JNIEXPORT void JNICALL OS_NATIVE(CFRelease) 381 (JNIEnv *env, jclass that, jlong arg0) 382 { 383 CFRelease((CFTypeRef)arg0); 384 } 385 386 JNIEXPORT jlong JNICALL OS_NATIVE(CFURLCreateWithFileSystemPath) 387 (JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2, jboolean arg3) 388 { 389 return (jlong)CFURLCreateWithFileSystemPath((CFAllocatorRef)arg0, (CFStringRef)arg1, (CFURLPathStyle)arg2, (Boolean)arg3); 390 } 391 392 JNIEXPORT jboolean JNICALL OS_NATIVE(CTFontManagerRegisterFontsForURL) 393 (JNIEnv *env, jclass that, jlong arg0, jint arg1, jlong arg2) 394 { 395 return (jboolean)CTFontManagerRegisterFontsForURL((CFURLRef)arg0, (CTFontManagerScope)arg1, (CFErrorRef*)arg2); 396 } 397 398 JNIEXPORT jlong JNICALL OS_NATIVE(CTFontCreatePathForGlyph) 399 (JNIEnv *env, jclass that, jlong arg0, jshort arg1, jobject arg2) 400 { 401 CGAffineTransform _arg2, *lparg2=NULL; 402 jlong rc = 0; 403 if (arg2) if ((lparg2 = getCGAffineTransformFields(env, arg2, &_arg2)) == NULL) goto fail; 404 rc = (jlong)CTFontCreatePathForGlyph((CTFontRef)arg0, (CGGlyph)arg1, (CGAffineTransform*)lparg2); 405 fail: 406 /* In Only */ 407 // if (arg2 && lparg2) setCGAffineTransformFields(env, arg2, lparg2); 408 return rc; 409 } 410 411 JNIEXPORT void JNICALL OS_NATIVE(CGPathRelease) 412 (JNIEnv *env, jclass that, jlong arg0) 413 { 414 CGPathRelease((CGPathRef)arg0); 415 } 416 417 JNIEXPORT jlong JNICALL OS_NATIVE(CGColorSpaceCreateDeviceRGB) 418 (JNIEnv *env, jclass that) 419 { 420 return (jlong)CGColorSpaceCreateDeviceRGB(); 421 } 422 423 JNIEXPORT jlong JNICALL OS_NATIVE(CGColorSpaceCreateDeviceGray) 424 (JNIEnv *env, jclass that) 425 { 426 return (jlong)CGColorSpaceCreateDeviceGray(); 427 } 428 429 JNIEXPORT jlong JNICALL OS_NATIVE(CGBitmapContextCreate) 430 (JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2, jlong arg3, jlong arg4, jlong arg5, jint arg6) 472 } 473 474 JNIEXPORT void JNICALL OS_NATIVE(CGContextTranslateCTM) 475 (JNIEnv *env, jclass that, jlong arg0, jdouble arg1, jdouble arg2) 476 { 477 CGContextTranslateCTM((CGContextRef)arg0, (CGFloat)arg1, (CGFloat)arg2); 478 } 479 480 JNIEXPORT void JNICALL OS_NATIVE(CGContextRelease) 481 (JNIEnv *env, jclass that, jlong arg0) 482 { 483 CGContextRelease((CGContextRef)arg0); 484 } 485 486 JNIEXPORT void JNICALL OS_NATIVE(CGColorSpaceRelease) 487 (JNIEnv *env, jclass that, jlong arg0) 488 { 489 CGColorSpaceRelease((CGColorSpaceRef)arg0); 490 } 491 492 JNIEXPORT jlong JNICALL OS_NATIVE(kCFTypeDictionaryKeyCallBacks) 493 (JNIEnv *env, jclass that) 494 { 495 return (jlong)&kCFTypeDictionaryKeyCallBacks; 496 } 497 498 JNIEXPORT jlong JNICALL OS_NATIVE(kCFTypeDictionaryValueCallBacks) 499 (JNIEnv *env, jclass that) 500 { 501 return (jlong)&kCFTypeDictionaryValueCallBacks; 502 } 503 504 JNIEXPORT jlong JNICALL OS_NATIVE(CFDictionaryCreateMutable) 505 (JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2, jlong arg3) 506 { 507 return (jlong)CFDictionaryCreateMutable((CFAllocatorRef)arg0, (CFIndex)arg1, (CFDictionaryKeyCallBacks*)arg2, (CFDictionaryValueCallBacks*)arg3); 508 } 509 510 JNIEXPORT void JNICALL OS_NATIVE(CFDictionaryAddValue) 511 (JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2) | 347 /**************************************************************************/ 348 349 JNIEXPORT jlong JNICALL OS_NATIVE(kCFAllocatorDefault) 350 (JNIEnv *env, jclass that) 351 { 352 return (jlong)kCFAllocatorDefault; 353 } 354 355 JNIEXPORT jlong JNICALL OS_NATIVE(CFStringCreateWithCharacters__J_3CJ) 356 (JNIEnv *env, jclass that, jlong arg0, jcharArray arg1, jlong arg2) 357 { 358 jchar *lparg1=NULL; 359 jlong rc = 0; 360 if (arg1) if ((lparg1 = (*env)->GetCharArrayElements(env, arg1, NULL)) == NULL) goto fail; 361 rc = (jlong)CFStringCreateWithCharacters((CFAllocatorRef)arg0, (UniChar*)lparg1, (CFIndex)arg2); 362 fail: 363 if (arg1 && lparg1) (*env)->ReleaseCharArrayElements(env, arg1, lparg1, 0); 364 return rc; 365 } 366 367 JNIEXPORT void JNICALL OS_NATIVE(CFRelease) 368 (JNIEnv *env, jclass that, jlong arg0) 369 { 370 CFRelease((CFTypeRef)arg0); 371 } 372 373 JNIEXPORT jlong JNICALL OS_NATIVE(CTFontCreateWithGraphicsFont) 374 (JNIEnv *env, jclass that, jlong cgFont, jdouble size, jobject matrix, jlong attributes) 375 { 376 CGAffineTransform transform; 377 if (matrix) { 378 getCGAffineTransformFields(env, matrix, &transform); 379 } else { 380 transform = CGAffineTransformIdentity; 381 } 382 return (jlong)CTFontCreateWithGraphicsFont((CGFontRef)cgFont, (CGFloat)size, &transform, (CTFontDescriptorRef)attributes); 383 } 384 385 JNIEXPORT jlong JNICALL OS_NATIVE(CTFontCreateWithName) 386 (JNIEnv *env, jclass that, jlong arg0, jdouble arg1, jobject arg2) 387 { 388 CGAffineTransform _arg2, *lparg2=NULL; 389 jlong rc = 0; 390 if (arg2) if ((lparg2 = getCGAffineTransformFields(env, arg2, &_arg2)) == NULL) goto fail; 391 rc = (jlong)CTFontCreateWithName((CFStringRef)arg0, (CGFloat)arg1, (CGAffineTransform*)lparg2); 392 fail: 393 /* In only */ 394 // if (arg2 && lparg2) setCGAffineTransformFields(env, arg2, lparg2); 395 return rc; 396 } 397 398 JNIEXPORT jlong JNICALL OS_NATIVE(CFURLCreateWithFileSystemPath) 399 (JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2, jboolean arg3) 400 { 401 return (jlong)CFURLCreateWithFileSystemPath((CFAllocatorRef)arg0, (CFStringRef)arg1, (CFURLPathStyle)arg2, (Boolean)arg3); 402 } 403 404 JNIEXPORT jboolean JNICALL OS_NATIVE(CTFontManagerRegisterFontsForURL) 405 (JNIEnv *env, jclass that, jlong arg0, jint arg1, jlong arg2) 406 { 407 return (jboolean)CTFontManagerRegisterFontsForURL((CFURLRef)arg0, (CTFontManagerScope)arg1, (CFErrorRef*)arg2); 408 } 409 410 JNIEXPORT jlong JNICALL OS_NATIVE(CTFontCreatePathForGlyph) 411 (JNIEnv *env, jclass that, jlong arg0, jshort arg1, jobject arg2) 412 { 413 CGAffineTransform _arg2, *lparg2=NULL; 414 jlong rc = 0; 415 if (arg2) if ((lparg2 = getCGAffineTransformFields(env, arg2, &_arg2)) == NULL) goto fail; 416 rc = (jlong)CTFontCreatePathForGlyph((CTFontRef)arg0, (CGGlyph)arg1, (CGAffineTransform*)lparg2); 417 fail: 418 /* In Only */ 419 // if (arg2 && lparg2) setCGAffineTransformFields(env, arg2, lparg2); 420 return rc; 421 } 422 423 JNIEXPORT jlong JNICALL OS_NATIVE(CGFontCreateWithDataProvider) 424 (JNIEnv *env, jclass that, jlong dataProvider) 425 { 426 return (jlong)CGFontCreateWithDataProvider((CGDataProviderRef)dataProvider); 427 } 428 429 JNIEXPORT void JNICALL OS_NATIVE(CGPathRelease) 430 (JNIEnv *env, jclass that, jlong arg0) 431 { 432 CGPathRelease((CGPathRef)arg0); 433 } 434 435 JNIEXPORT jlong JNICALL OS_NATIVE(CGColorSpaceCreateDeviceRGB) 436 (JNIEnv *env, jclass that) 437 { 438 return (jlong)CGColorSpaceCreateDeviceRGB(); 439 } 440 441 JNIEXPORT jlong JNICALL OS_NATIVE(CGColorSpaceCreateDeviceGray) 442 (JNIEnv *env, jclass that) 443 { 444 return (jlong)CGColorSpaceCreateDeviceGray(); 445 } 446 447 JNIEXPORT jlong JNICALL OS_NATIVE(CGBitmapContextCreate) 448 (JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2, jlong arg3, jlong arg4, jlong arg5, jint arg6) 490 } 491 492 JNIEXPORT void JNICALL OS_NATIVE(CGContextTranslateCTM) 493 (JNIEnv *env, jclass that, jlong arg0, jdouble arg1, jdouble arg2) 494 { 495 CGContextTranslateCTM((CGContextRef)arg0, (CGFloat)arg1, (CGFloat)arg2); 496 } 497 498 JNIEXPORT void JNICALL OS_NATIVE(CGContextRelease) 499 (JNIEnv *env, jclass that, jlong arg0) 500 { 501 CGContextRelease((CGContextRef)arg0); 502 } 503 504 JNIEXPORT void JNICALL OS_NATIVE(CGColorSpaceRelease) 505 (JNIEnv *env, jclass that, jlong arg0) 506 { 507 CGColorSpaceRelease((CGColorSpaceRef)arg0); 508 } 509 510 JNIEXPORT jlong JNICALL OS_NATIVE(CGDataProviderCreateWithURL) 511 (JNIEnv *env, jclass that, jlong cfURL) { 512 return (jlong)CGDataProviderCreateWithURL((CFURLRef)cfURL); 513 } 514 515 JNIEXPORT jlong JNICALL OS_NATIVE(kCFTypeDictionaryKeyCallBacks) 516 (JNIEnv *env, jclass that) 517 { 518 return (jlong)&kCFTypeDictionaryKeyCallBacks; 519 } 520 521 JNIEXPORT jlong JNICALL OS_NATIVE(kCFTypeDictionaryValueCallBacks) 522 (JNIEnv *env, jclass that) 523 { 524 return (jlong)&kCFTypeDictionaryValueCallBacks; 525 } 526 527 JNIEXPORT jlong JNICALL OS_NATIVE(CFDictionaryCreateMutable) 528 (JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2, jlong arg3) 529 { 530 return (jlong)CFDictionaryCreateMutable((CFAllocatorRef)arg0, (CFIndex)arg1, (CFDictionaryKeyCallBacks*)arg2, (CFDictionaryValueCallBacks*)arg3); 531 } 532 533 JNIEXPORT void JNICALL OS_NATIVE(CFDictionaryAddValue) 534 (JNIEnv *env, jclass that, jlong arg0, jlong arg1, jlong arg2) |