1504 INCREASE_INSTANCE_COUNT_USE_DISPLAY(result, Image, display); |
1504 INCREASE_INSTANCE_COUNT_USE_DISPLAY(result, Image, display); |
1505 |
1505 |
1506 return reinterpret_cast<jint>(result); |
1506 return reinterpret_cast<jint>(result); |
1507 } |
1507 } |
1508 |
1508 |
|
1509 JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_symbian_OS_Image_1NewFromTheme(JNIEnv* aJniEnv, jclass, jint aDevice, jint aId) |
|
1510 { |
|
1511 ASwtDisplayBase* display = DisplayFromDevice(aDevice); |
|
1512 MSwtImage* result = NULL; |
|
1513 TRAPD(error, CallMethodL(result, display, &ASwtDisplayBase::NewImageFromThemeL, aId)); |
|
1514 ThrowIfError(error, aJniEnv); |
|
1515 |
|
1516 INCREASE_INSTANCE_COUNT_USE_DISPLAY(result, Image, display); |
|
1517 |
|
1518 return reinterpret_cast<jint>(result); |
|
1519 } |
|
1520 |
1509 JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_symbian_OS_Image_1Dispose(JNIEnv*, jclass, jint aDevice, jint aHandle) |
1521 JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_symbian_OS_Image_1Dispose(JNIEnv*, jclass, jint aDevice, jint aHandle) |
1510 { |
1522 { |
1511 CSwtDisplay* display = DisplayFromDevice(aDevice); |
1523 CSwtDisplay* display = DisplayFromDevice(aDevice); |
1512 MSwtImage* image = reinterpret_cast<MSwtImage*>(aHandle); |
1524 MSwtImage* image = reinterpret_cast<MSwtImage*>(aHandle); |
1513 CallMethod(image, &MSwtImage::Dispose, display); |
1525 CallMethod(image, &MSwtImage::Dispose, display); |
1551 ASSERT(aHandle); |
1563 ASSERT(aHandle); |
1552 const MSwtImage* image = reinterpret_cast<MSwtImage*>(aHandle); |
1564 const MSwtImage* image = reinterpret_cast<MSwtImage*>(aHandle); |
1553 CallMethod(static_cast<const MSwtRefCounted*>(image), &MSwtImage::RemoveRef); |
1565 CallMethod(static_cast<const MSwtRefCounted*>(image), &MSwtImage::RemoveRef); |
1554 } |
1566 } |
1555 |
1567 |
|
1568 JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_symbian_OS_Image_1Scale(JNIEnv* aJniEnv, jclass, |
|
1569 jint aDevice, jint aHandle, jint aWidth, jint aHeight, jboolean aKeepAspectRatio) |
|
1570 { |
|
1571 ASwtDisplayBase* display = DisplayFromDevice(aDevice); |
|
1572 const MSwtImage* image = reinterpret_cast<MSwtImage*>(aHandle); |
|
1573 const TSize size(aWidth, aHeight); |
|
1574 MSwtImage* result = NULL; |
|
1575 TRAPD(error, CallMethodL(result, display, &ASwtDisplayBase::ScaleImageL, *image, size, aKeepAspectRatio)); |
|
1576 ThrowIfError(error, aJniEnv); |
|
1577 |
|
1578 INCREASE_INSTANCE_COUNT_USE_DISPLAY(result, Image, display); |
|
1579 |
|
1580 return reinterpret_cast<jint>(result); |
|
1581 } |
1556 |
1582 |
1557 /* |
1583 /* |
1558 * Class Menu |
1584 * Class Menu |
1559 */ |
1585 */ |
1560 JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_symbian_OS_Menu_1New(JNIEnv* aJniEnv, jclass, jobject aPeer, jint aStyle) |
1586 JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_symbian_OS_Menu_1New(JNIEnv* aJniEnv, jclass, jobject aPeer, jint aStyle) |