1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "javax_microedition_m3g_Background.h" |
|
19 |
|
20 JNIEXPORT jboolean JNICALL Java_javax_microedition_m3g_Background__1isEnabled |
|
21 (JNIEnv* aEnv, jclass, jint aHandle, jint aWhich) |
|
22 { |
|
23 M3G_DO_LOCK |
|
24 jboolean enabled = (jboolean)m3gIsBgEnabled((M3GBackground)aHandle, aWhich); |
|
25 M3G_DO_UNLOCK(aEnv) |
|
26 return enabled; |
|
27 } |
|
28 |
|
29 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Background__1setCrop |
|
30 (JNIEnv* aEnv, jclass, jint aHandle, jint aCropX, jint aCropY, jint aWidth, jint aHeight) |
|
31 { |
|
32 M3G_DO_LOCK |
|
33 m3gSetBgCrop((M3GBackground)aHandle, (M3Gint)aCropX, (M3Gint)aCropY, (M3Gint)aWidth, (M3Gint)aHeight); |
|
34 M3G_DO_UNLOCK(aEnv) |
|
35 } |
|
36 |
|
37 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Background__1setImageMode |
|
38 (JNIEnv* aEnv, jclass, jint aHandle, jint aModeX, jint aModeY) |
|
39 { |
|
40 M3G_DO_LOCK |
|
41 m3gSetBgMode((M3GBackground)aHandle, aModeX, aModeY); |
|
42 M3G_DO_UNLOCK(aEnv) |
|
43 } |
|
44 |
|
45 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Background__1ctor |
|
46 (JNIEnv* aEnv, jclass, jint aM3g) |
|
47 { |
|
48 M3G_DO_LOCK |
|
49 jint handle = (jint)m3gCreateBackground((M3GInterface)aM3g); |
|
50 M3G_DO_UNLOCK(aEnv) |
|
51 return handle; |
|
52 } |
|
53 |
|
54 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Background__1getCrop |
|
55 (JNIEnv* aEnv, jclass, jint aHandle, jint aWhich) |
|
56 { |
|
57 M3G_DO_LOCK |
|
58 jint crop = (jint)m3gGetBgCrop((M3GBackground)aHandle, aWhich); |
|
59 M3G_DO_UNLOCK(aEnv) |
|
60 return crop; |
|
61 } |
|
62 |
|
63 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Background__1getImageMode |
|
64 (JNIEnv* aEnv, jclass, jint aHandle, jint aWhich) |
|
65 { |
|
66 M3G_DO_LOCK |
|
67 jint mode = (jint)m3gGetBgMode((M3GBackground)aHandle, aWhich); |
|
68 M3G_DO_UNLOCK(aEnv) |
|
69 return mode; |
|
70 } |
|
71 |
|
72 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Background__1setImage |
|
73 (JNIEnv* aEnv, jclass, jint aHandle, jint aHImage) |
|
74 { |
|
75 M3G_DO_LOCK |
|
76 m3gSetBgImage((M3GBackground)aHandle, (M3GImage)aHImage); |
|
77 M3G_DO_UNLOCK(aEnv) |
|
78 } |
|
79 |
|
80 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Background__1setColor |
|
81 (JNIEnv* aEnv, jclass, jint aHandle, jint aARGB) |
|
82 { |
|
83 M3G_DO_LOCK |
|
84 m3gSetBgColor((M3GBackground)aHandle, aARGB); |
|
85 M3G_DO_UNLOCK(aEnv) |
|
86 } |
|
87 |
|
88 JNIEXPORT void JNICALL Java_javax_microedition_m3g_Background__1enable |
|
89 (JNIEnv* aEnv, jclass, jint aHandle, jint aWhich, jboolean aEnable) |
|
90 { |
|
91 M3G_DO_LOCK |
|
92 m3gSetBgEnable((M3GBackground)aHandle, aWhich, aEnable); |
|
93 M3G_DO_UNLOCK(aEnv) |
|
94 } |
|
95 |
|
96 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Background__1getImage |
|
97 (JNIEnv* aEnv, jclass, jint aHandle) |
|
98 { |
|
99 M3G_DO_LOCK |
|
100 jint image = (jint)m3gGetBgImage((M3GBackground)aHandle); |
|
101 M3G_DO_UNLOCK(aEnv) |
|
102 return image; |
|
103 } |
|
104 |
|
105 JNIEXPORT jint JNICALL Java_javax_microedition_m3g_Background__1getColor |
|
106 (JNIEnv* aEnv, jclass, jint aHandle) |
|
107 { |
|
108 M3G_DO_LOCK |
|
109 jint color = (jint)m3gGetBgColor((M3GBackground)aHandle); |
|
110 M3G_DO_UNLOCK(aEnv) |
|
111 return color; |
|
112 } |
|