Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
e6934aa2
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e6934aa2
编写于
3月 31, 2014
作者:
P
pchelko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8035325: [parfait] JNI exception pending in jdk/src/windows/native/sun/windows/awt_Component.cpp
Reviewed-by: anthony, serb
上级
b923a87c
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
134 addition
and
65 deletion
+134
-65
src/windows/native/sun/windows/awt_Component.cpp
src/windows/native/sun/windows/awt_Component.cpp
+134
-65
未找到文件。
src/windows/native/sun/windows/awt_Component.cpp
浏览文件 @
e6934aa2
/*
/*
* Copyright (c) 1996, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
4
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -467,6 +467,7 @@ void AwtComponent::InitPeerGraphicsConfig(JNIEnv *env, jobject peer)
...
@@ -467,6 +467,7 @@ void AwtComponent::InitPeerGraphicsConfig(JNIEnv *env, jobject peer)
jclass
win32GCCls
=
env
->
FindClass
(
"sun/awt/Win32GraphicsConfig"
);
jclass
win32GCCls
=
env
->
FindClass
(
"sun/awt/Win32GraphicsConfig"
);
DASSERT
(
win32GCCls
!=
NULL
);
DASSERT
(
win32GCCls
!=
NULL
);
DASSERT
(
env
->
IsInstanceOf
(
compGC
,
win32GCCls
));
DASSERT
(
env
->
IsInstanceOf
(
compGC
,
win32GCCls
));
CHECK_NULL
(
win32GCCls
);
env
->
SetObjectField
(
peer
,
AwtComponent
::
peerGCID
,
compGC
);
env
->
SetObjectField
(
peer
,
AwtComponent
::
peerGCID
,
compGC
);
}
}
}
}
...
@@ -530,11 +531,16 @@ AwtComponent::CreateHWnd(JNIEnv *env, LPCWSTR title,
...
@@ -530,11 +531,16 @@ AwtComponent::CreateHWnd(JNIEnv *env, LPCWSTR title,
if
(
dw
==
ERROR_OUTOFMEMORY
)
if
(
dw
==
ERROR_OUTOFMEMORY
)
{
{
jstring
errorMsg
=
JNU_NewStringPlatform
(
env
,
L"too many window handles"
);
jstring
errorMsg
=
JNU_NewStringPlatform
(
env
,
L"too many window handles"
);
if
(
errorMsg
==
NULL
||
env
->
ExceptionCheck
())
{
env
->
ExceptionClear
();
createError
=
JNU_NewObjectByName
(
env
,
"java/lang/OutOfMemoryError"
,
"()V"
);
}
else
{
createError
=
JNU_NewObjectByName
(
env
,
"java/lang/OutOfMemoryError"
,
createError
=
JNU_NewObjectByName
(
env
,
"java/lang/OutOfMemoryError"
,
"(Ljava/lang/String;)V"
,
"(Ljava/lang/String;)V"
,
errorMsg
);
errorMsg
);
env
->
DeleteLocalRef
(
errorMsg
);
env
->
DeleteLocalRef
(
errorMsg
);
}
}
}
else
else
{
{
TCHAR
*
buf
;
TCHAR
*
buf
;
...
@@ -542,14 +548,18 @@ AwtComponent::CreateHWnd(JNIEnv *env, LPCWSTR title,
...
@@ -542,14 +548,18 @@ AwtComponent::CreateHWnd(JNIEnv *env, LPCWSTR title,
NULL
,
dw
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
NULL
,
dw
,
MAKELANGID
(
LANG_NEUTRAL
,
SUBLANG_DEFAULT
),
(
LPTSTR
)
&
buf
,
0
,
NULL
);
(
LPTSTR
)
&
buf
,
0
,
NULL
);
jstring
s
=
JNU_NewStringPlatform
(
env
,
buf
);
jstring
s
=
JNU_NewStringPlatform
(
env
,
buf
);
if
(
s
==
NULL
||
env
->
ExceptionCheck
())
{
env
->
ExceptionClear
();
createError
=
JNU_NewObjectByName
(
env
,
"java/lang/InternalError"
,
"()V"
);
}
else
{
createError
=
JNU_NewObjectByName
(
env
,
"java/lang/InternalError"
,
createError
=
JNU_NewObjectByName
(
env
,
"java/lang/InternalError"
,
"(Ljava/lang/String;)V"
,
s
);
"(Ljava/lang/String;)V"
,
s
);
LocalFree
(
buf
);
env
->
DeleteLocalRef
(
s
);
env
->
DeleteLocalRef
(
s
);
}
}
LocalFree
(
buf
);
}
if
(
createError
!=
NULL
)
{
env
->
SetObjectField
(
peer
,
AwtObject
::
createErrorID
,
createError
);
env
->
SetObjectField
(
peer
,
AwtObject
::
createErrorID
,
createError
);
if
(
createError
!=
NULL
)
{
env
->
DeleteLocalRef
(
createError
);
env
->
DeleteLocalRef
(
createError
);
}
}
env
->
DeleteLocalRef
(
target
);
env
->
DeleteLocalRef
(
target
);
...
@@ -3309,10 +3319,7 @@ AwtComponent::BuildPrimaryDynamicTable() {
...
@@ -3309,10 +3319,7 @@ AwtComponent::BuildPrimaryDynamicTable() {
if
(
extKeyCodesCls
==
NULL
)
{
if
(
extKeyCodesCls
==
NULL
)
{
jclass
extKeyCodesClsLocal
=
env
->
FindClass
(
"sun/awt/ExtendedKeyCodes"
);
jclass
extKeyCodesClsLocal
=
env
->
FindClass
(
"sun/awt/ExtendedKeyCodes"
);
DASSERT
(
extKeyCodesClsLocal
);
DASSERT
(
extKeyCodesClsLocal
);
if
(
extKeyCodesClsLocal
==
NULL
)
{
CHECK_NULL
(
extKeyCodesClsLocal
);
/* exception already thrown */
return
;
}
extKeyCodesCls
=
(
jclass
)
env
->
NewGlobalRef
(
extKeyCodesClsLocal
);
extKeyCodesCls
=
(
jclass
)
env
->
NewGlobalRef
(
extKeyCodesClsLocal
);
env
->
DeleteLocalRef
(
extKeyCodesClsLocal
);
env
->
DeleteLocalRef
(
extKeyCodesClsLocal
);
}
}
...
@@ -3321,6 +3328,7 @@ AwtComponent::BuildPrimaryDynamicTable() {
...
@@ -3321,6 +3328,7 @@ AwtComponent::BuildPrimaryDynamicTable() {
getExtendedKeyCodeForChar
=
getExtendedKeyCodeForChar
=
env
->
GetStaticMethodID
(
extKeyCodesCls
,
"getExtendedKeyCodeForChar"
,
"(I)I"
);
env
->
GetStaticMethodID
(
extKeyCodesCls
,
"getExtendedKeyCodeForChar"
,
"(I)I"
);
DASSERT
(
getExtendedKeyCodeForChar
);
DASSERT
(
getExtendedKeyCodeForChar
);
CHECK_NULL
(
getExtendedKeyCodeForChar
);
}
}
jint
extJKC
;
//extended Java key code
jint
extJKC
;
//extended Java key code
...
@@ -3940,11 +3948,19 @@ void AwtComponent::SendInputMethodEvent(jint id, jstring text,
...
@@ -3940,11 +3948,19 @@ void AwtComponent::SendInputMethodEvent(jint id, jstring text,
if
(
cClause
&&
rgClauseBoundary
&&
rgClauseReading
)
{
if
(
cClause
&&
rgClauseBoundary
&&
rgClauseReading
)
{
// convert clause boundary offset array to java array
// convert clause boundary offset array to java array
clauseBoundary
=
env
->
NewIntArray
(
cClause
+
1
);
clauseBoundary
=
env
->
NewIntArray
(
cClause
+
1
);
DASSERT
(
clauseBoundary
);
CHECK_NULL
(
clauseBoundary
);
env
->
SetIntArrayRegion
(
clauseBoundary
,
0
,
cClause
+
1
,
(
jint
*
)
rgClauseBoundary
);
env
->
SetIntArrayRegion
(
clauseBoundary
,
0
,
cClause
+
1
,
(
jint
*
)
rgClauseBoundary
);
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
// convert clause reading string array to java array
// convert clause reading string array to java array
clauseReading
=
env
->
NewObjectArray
(
cClause
,
JNU_ClassString
(
env
),
NULL
);
jclass
stringCls
=
JNU_ClassString
(
env
);
DASSERT
(
stringCls
);
CHECK_NULL
(
stringCls
);
clauseReading
=
env
->
NewObjectArray
(
cClause
,
stringCls
,
NULL
);
env
->
DeleteLocalRef
(
stringCls
);
DASSERT
(
clauseReading
);
CHECK_NULL
(
clauseReading
);
for
(
int
i
=
0
;
i
<
cClause
;
i
++
)
env
->
SetObjectArrayElement
(
clauseReading
,
i
,
rgClauseReading
[
i
]);
for
(
int
i
=
0
;
i
<
cClause
;
i
++
)
env
->
SetObjectArrayElement
(
clauseReading
,
i
,
rgClauseReading
[
i
]);
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
}
}
...
@@ -3963,11 +3979,15 @@ void AwtComponent::SendInputMethodEvent(jint id, jstring text,
...
@@ -3963,11 +3979,15 @@ void AwtComponent::SendInputMethodEvent(jint id, jstring text,
if
(
cAttrBlock
&&
rgAttrBoundary
&&
rgAttrValue
)
{
if
(
cAttrBlock
&&
rgAttrBoundary
&&
rgAttrValue
)
{
// convert attribute boundary offset array to java array
// convert attribute boundary offset array to java array
attrBoundary
=
env
->
NewIntArray
(
cAttrBlock
+
1
);
attrBoundary
=
env
->
NewIntArray
(
cAttrBlock
+
1
);
DASSERT
(
attrBoundary
);
CHECK_NULL
(
attrBoundary
);
env
->
SetIntArrayRegion
(
attrBoundary
,
0
,
cAttrBlock
+
1
,
(
jint
*
)
rgAttrBoundary
);
env
->
SetIntArrayRegion
(
attrBoundary
,
0
,
cAttrBlock
+
1
,
(
jint
*
)
rgAttrBoundary
);
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
// convert attribute value byte array to java array
// convert attribute value byte array to java array
attrValue
=
env
->
NewByteArray
(
cAttrBlock
);
attrValue
=
env
->
NewByteArray
(
cAttrBlock
);
DASSERT
(
attrValue
);
CHECK_NULL
(
attrValue
);
env
->
SetByteArrayRegion
(
attrValue
,
0
,
cAttrBlock
,
(
jbyte
*
)
rgAttrValue
);
env
->
SetByteArrayRegion
(
attrValue
,
0
,
cAttrBlock
,
(
jbyte
*
)
rgAttrValue
);
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
}
}
...
@@ -3978,10 +3998,7 @@ void AwtComponent::SendInputMethodEvent(jint id, jstring text,
...
@@ -3978,10 +3998,7 @@ void AwtComponent::SendInputMethodEvent(jint id, jstring text,
if
(
wInputMethodCls
==
NULL
)
{
if
(
wInputMethodCls
==
NULL
)
{
jclass
wInputMethodClsLocal
=
env
->
FindClass
(
"sun/awt/windows/WInputMethod"
);
jclass
wInputMethodClsLocal
=
env
->
FindClass
(
"sun/awt/windows/WInputMethod"
);
DASSERT
(
wInputMethodClsLocal
);
DASSERT
(
wInputMethodClsLocal
);
if
(
wInputMethodClsLocal
==
NULL
)
{
CHECK_NULL
(
wInputMethodClsLocal
);
/* exception already thrown */
return
;
}
wInputMethodCls
=
(
jclass
)
env
->
NewGlobalRef
(
wInputMethodClsLocal
);
wInputMethodCls
=
(
jclass
)
env
->
NewGlobalRef
(
wInputMethodClsLocal
);
env
->
DeleteLocalRef
(
wInputMethodClsLocal
);
env
->
DeleteLocalRef
(
wInputMethodClsLocal
);
}
}
...
@@ -3992,6 +4009,7 @@ void AwtComponent::SendInputMethodEvent(jint id, jstring text,
...
@@ -3992,6 +4009,7 @@ void AwtComponent::SendInputMethodEvent(jint id, jstring text,
sendIMEventMid
=
env
->
GetMethodID
(
wInputMethodCls
,
"sendInputMethodEvent"
,
sendIMEventMid
=
env
->
GetMethodID
(
wInputMethodCls
,
"sendInputMethodEvent"
,
"(IJLjava/lang/String;[I[Ljava/lang/String;[I[BIII)V"
);
"(IJLjava/lang/String;[I[Ljava/lang/String;[I[BIII)V"
);
DASSERT
(
sendIMEventMid
);
DASSERT
(
sendIMEventMid
);
CHECK_NULL
(
sendIMEventMid
);
}
}
// call m_InputMethod.sendInputMethod()
// call m_InputMethod.sendInputMethod()
...
@@ -4017,10 +4035,7 @@ void AwtComponent::InquireCandidatePosition()
...
@@ -4017,10 +4035,7 @@ void AwtComponent::InquireCandidatePosition()
if
(
wInputMethodCls
==
NULL
)
{
if
(
wInputMethodCls
==
NULL
)
{
jclass
wInputMethodClsLocal
=
env
->
FindClass
(
"sun/awt/windows/WInputMethod"
);
jclass
wInputMethodClsLocal
=
env
->
FindClass
(
"sun/awt/windows/WInputMethod"
);
DASSERT
(
wInputMethodClsLocal
);
DASSERT
(
wInputMethodClsLocal
);
if
(
wInputMethodClsLocal
==
NULL
)
{
CHECK_NULL
(
wInputMethodClsLocal
);
/* exception already thrown */
return
;
}
wInputMethodCls
=
(
jclass
)
env
->
NewGlobalRef
(
wInputMethodClsLocal
);
wInputMethodCls
=
(
jclass
)
env
->
NewGlobalRef
(
wInputMethodClsLocal
);
env
->
DeleteLocalRef
(
wInputMethodClsLocal
);
env
->
DeleteLocalRef
(
wInputMethodClsLocal
);
}
}
...
@@ -4028,10 +4043,10 @@ void AwtComponent::InquireCandidatePosition()
...
@@ -4028,10 +4043,10 @@ void AwtComponent::InquireCandidatePosition()
// get method ID of sendInputMethodEvent() (run only once)
// get method ID of sendInputMethodEvent() (run only once)
static
jmethodID
inqCandPosMid
=
0
;
static
jmethodID
inqCandPosMid
=
0
;
if
(
inqCandPosMid
==
0
)
{
if
(
inqCandPosMid
==
0
)
{
inqCandPosMid
=
env
->
GetMethodID
(
wInputMethodCls
,
"inquireCandidatePosition"
,
inqCandPosMid
=
env
->
GetMethodID
(
wInputMethodCls
,
"inquireCandidatePosition"
,
"()V"
);
"()V"
);
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
inqCandPosMid
);
DASSERT
(
inqCandPosMid
);
CHECK_NULL
(
inqCandPosMid
);
}
}
// call m_InputMethod.sendInputMethod()
// call m_InputMethod.sendInputMethod()
...
@@ -4313,6 +4328,11 @@ void AwtComponent::DrawListItem(JNIEnv *env, DRAWITEMSTRUCT &drawInfo)
...
@@ -4313,6 +4328,11 @@ void AwtComponent::DrawListItem(JNIEnv *env, DRAWITEMSTRUCT &drawInfo)
if
((
int
)
(
drawInfo
.
itemID
)
>=
0
)
{
if
((
int
)
(
drawInfo
.
itemID
)
>=
0
)
{
jobject
font
=
GET_FONT
(
target
,
peer
);
jobject
font
=
GET_FONT
(
target
,
peer
);
jstring
text
=
GetItemString
(
env
,
target
,
drawInfo
.
itemID
);
jstring
text
=
GetItemString
(
env
,
target
,
drawInfo
.
itemID
);
if
(
env
->
ExceptionCheck
())
{
env
->
DeleteLocalRef
(
font
);
env
->
DeleteLocalRef
(
target
);
return
;
}
SIZE
size
=
AwtFont
::
getMFStringSize
(
hDC
,
font
,
text
);
SIZE
size
=
AwtFont
::
getMFStringSize
(
hDC
,
font
,
text
);
AwtFont
::
drawMFString
(
hDC
,
font
,
text
,
AwtFont
::
drawMFString
(
hDC
,
font
,
text
,
(
GetRTL
())
?
rect
.
right
-
size
.
cx
-
1
(
GetRTL
())
?
rect
.
right
-
size
.
cx
-
1
...
@@ -4772,6 +4792,7 @@ void AwtComponent::SendKeyEvent(jint id, jlong when, jint raw, jint cooked,
...
@@ -4772,6 +4792,7 @@ void AwtComponent::SendKeyEvent(jint id, jlong when, jint raw, jint cooked,
keyEventConst
=
env
->
GetMethodID
(
keyEventCls
,
"<init>"
,
keyEventConst
=
env
->
GetMethodID
(
keyEventCls
,
"<init>"
,
"(Ljava/awt/Component;IJIICI)V"
);
"(Ljava/awt/Component;IJIICI)V"
);
DASSERT
(
keyEventConst
);
DASSERT
(
keyEventConst
);
CHECK_NULL
(
keyEventConst
);
}
}
if
(
env
->
EnsureLocalCapacity
(
2
)
<
0
)
{
if
(
env
->
EnsureLocalCapacity
(
2
)
<
0
)
{
return
;
return
;
...
@@ -4783,6 +4804,10 @@ void AwtComponent::SendKeyEvent(jint id, jlong when, jint raw, jint cooked,
...
@@ -4783,6 +4804,10 @@ void AwtComponent::SendKeyEvent(jint id, jlong when, jint raw, jint cooked,
if
(
safe_ExceptionOccurred
(
env
))
env
->
ExceptionDescribe
();
if
(
safe_ExceptionOccurred
(
env
))
env
->
ExceptionDescribe
();
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
keyEvent
!=
NULL
);
DASSERT
(
keyEvent
!=
NULL
);
if
(
keyEvent
==
NULL
)
{
env
->
DeleteLocalRef
(
target
);
return
;
}
env
->
SetLongField
(
keyEvent
,
AwtKeyEvent
::
rawCodeID
,
nativeCode
);
env
->
SetLongField
(
keyEvent
,
AwtKeyEvent
::
rawCodeID
,
nativeCode
);
if
(
nativeCode
&&
nativeCode
<
256
)
{
if
(
nativeCode
&&
nativeCode
<
256
)
{
env
->
SetLongField
(
keyEvent
,
AwtKeyEvent
::
primaryLevelUnicodeID
,
(
jlong
)(
dynPrimaryKeymap
[
nativeCode
].
unicode
));
env
->
SetLongField
(
keyEvent
,
AwtKeyEvent
::
primaryLevelUnicodeID
,
(
jlong
)(
dynPrimaryKeymap
[
nativeCode
].
unicode
));
...
@@ -4866,10 +4891,7 @@ void AwtComponent::SendMouseEvent(jint id, jlong when, jint x, jint y,
...
@@ -4866,10 +4891,7 @@ void AwtComponent::SendMouseEvent(jint id, jlong when, jint x, jint y,
if
(
mouseEventCls
==
NULL
)
{
if
(
mouseEventCls
==
NULL
)
{
jclass
mouseEventClsLocal
=
jclass
mouseEventClsLocal
=
env
->
FindClass
(
"java/awt/event/MouseEvent"
);
env
->
FindClass
(
"java/awt/event/MouseEvent"
);
if
(
!
mouseEventClsLocal
)
{
CHECK_NULL
(
mouseEventClsLocal
);
/* exception already thrown */
return
;
}
mouseEventCls
=
(
jclass
)
env
->
NewGlobalRef
(
mouseEventClsLocal
);
mouseEventCls
=
(
jclass
)
env
->
NewGlobalRef
(
mouseEventClsLocal
);
env
->
DeleteLocalRef
(
mouseEventClsLocal
);
env
->
DeleteLocalRef
(
mouseEventClsLocal
);
}
}
...
@@ -4882,6 +4904,7 @@ void AwtComponent::SendMouseEvent(jint id, jlong when, jint x, jint y,
...
@@ -4882,6 +4904,7 @@ void AwtComponent::SendMouseEvent(jint id, jlong when, jint x, jint y,
env
->
GetMethodID
(
mouseEventCls
,
"<init>"
,
env
->
GetMethodID
(
mouseEventCls
,
"<init>"
,
"(Ljava/awt/Component;IJIIIIIIZI)V"
);
"(Ljava/awt/Component;IJIIIIIIZI)V"
);
DASSERT
(
mouseEventConst
);
DASSERT
(
mouseEventConst
);
CHECK_NULL
(
mouseEventConst
);
}
}
if
(
env
->
EnsureLocalCapacity
(
2
)
<
0
)
{
if
(
env
->
EnsureLocalCapacity
(
2
)
<
0
)
{
return
;
return
;
...
@@ -4903,6 +4926,7 @@ void AwtComponent::SendMouseEvent(jint id, jlong when, jint x, jint y,
...
@@ -4903,6 +4926,7 @@ void AwtComponent::SendMouseEvent(jint id, jlong when, jint x, jint y,
}
}
DASSERT
(
mouseEvent
!=
NULL
);
DASSERT
(
mouseEvent
!=
NULL
);
CHECK_NULL
(
mouseEvent
);
if
(
pMsg
!=
0
)
{
if
(
pMsg
!=
0
)
{
AwtAWTEvent
::
saveMSG
(
env
,
pMsg
,
mouseEvent
);
AwtAWTEvent
::
saveMSG
(
env
,
pMsg
,
mouseEvent
);
}
}
...
@@ -4931,10 +4955,7 @@ AwtComponent::SendMouseWheelEvent(jint id, jlong when, jint x, jint y,
...
@@ -4931,10 +4955,7 @@ AwtComponent::SendMouseWheelEvent(jint id, jlong when, jint x, jint y,
if
(
mouseWheelEventCls
==
NULL
)
{
if
(
mouseWheelEventCls
==
NULL
)
{
jclass
mouseWheelEventClsLocal
=
jclass
mouseWheelEventClsLocal
=
env
->
FindClass
(
"java/awt/event/MouseWheelEvent"
);
env
->
FindClass
(
"java/awt/event/MouseWheelEvent"
);
if
(
!
mouseWheelEventClsLocal
)
{
CHECK_NULL
(
mouseWheelEventClsLocal
);
/* exception already thrown */
return
;
}
mouseWheelEventCls
=
(
jclass
)
env
->
NewGlobalRef
(
mouseWheelEventClsLocal
);
mouseWheelEventCls
=
(
jclass
)
env
->
NewGlobalRef
(
mouseWheelEventClsLocal
);
env
->
DeleteLocalRef
(
mouseWheelEventClsLocal
);
env
->
DeleteLocalRef
(
mouseWheelEventClsLocal
);
}
}
...
@@ -4947,6 +4968,7 @@ AwtComponent::SendMouseWheelEvent(jint id, jlong when, jint x, jint y,
...
@@ -4947,6 +4968,7 @@ AwtComponent::SendMouseWheelEvent(jint id, jlong when, jint x, jint y,
env
->
GetMethodID
(
mouseWheelEventCls
,
"<init>"
,
env
->
GetMethodID
(
mouseWheelEventCls
,
"<init>"
,
"(Ljava/awt/Component;IJIIIIIIZIIID)V"
);
"(Ljava/awt/Component;IJIIIIIIZIIID)V"
);
DASSERT
(
mouseWheelEventConst
);
DASSERT
(
mouseWheelEventConst
);
CHECK_NULL
(
mouseWheelEventConst
);
}
}
if
(
env
->
EnsureLocalCapacity
(
2
)
<
0
)
{
if
(
env
->
EnsureLocalCapacity
(
2
)
<
0
)
{
return
;
return
;
...
@@ -4963,11 +4985,14 @@ AwtComponent::SendMouseWheelEvent(jint id, jlong when, jint x, jint y,
...
@@ -4963,11 +4985,14 @@ AwtComponent::SendMouseWheelEvent(jint id, jlong when, jint x, jint y,
clickCount
,
popupTrigger
,
clickCount
,
popupTrigger
,
scrollType
,
scrollAmount
,
scrollType
,
scrollAmount
,
roundedWheelRotation
,
preciseWheelRotation
);
roundedWheelRotation
,
preciseWheelRotation
);
if
(
safe_ExceptionOccurred
(
env
))
{
DASSERT
(
mouseWheelEvent
!=
NULL
);
if
(
mouseWheelEvent
==
NULL
||
safe_ExceptionOccurred
(
env
))
{
env
->
ExceptionDescribe
();
env
->
ExceptionDescribe
();
env
->
ExceptionClear
();
env
->
ExceptionClear
();
env
->
DeleteLocalRef
(
target
);
return
;
}
}
DASSERT
(
mouseWheelEvent
!=
NULL
);
if
(
pMsg
!=
NULL
)
{
if
(
pMsg
!=
NULL
)
{
AwtAWTEvent
::
saveMSG
(
env
,
pMsg
,
mouseWheelEvent
);
AwtAWTEvent
::
saveMSG
(
env
,
pMsg
,
mouseWheelEvent
);
}
}
...
@@ -4992,10 +5017,7 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
...
@@ -4992,10 +5017,7 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
jclass
focusEventClsLocal
jclass
focusEventClsLocal
=
env
->
FindClass
(
"java/awt/event/FocusEvent"
);
=
env
->
FindClass
(
"java/awt/event/FocusEvent"
);
DASSERT
(
focusEventClsLocal
);
DASSERT
(
focusEventClsLocal
);
if
(
focusEventClsLocal
==
NULL
)
{
CHECK_NULL
(
focusEventClsLocal
);
/* exception already thrown */
return
;
}
focusEventCls
=
(
jclass
)
env
->
NewGlobalRef
(
focusEventClsLocal
);
focusEventCls
=
(
jclass
)
env
->
NewGlobalRef
(
focusEventClsLocal
);
env
->
DeleteLocalRef
(
focusEventClsLocal
);
env
->
DeleteLocalRef
(
focusEventClsLocal
);
}
}
...
@@ -5006,6 +5028,7 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
...
@@ -5006,6 +5028,7 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
env
->
GetMethodID
(
focusEventCls
,
"<init>"
,
env
->
GetMethodID
(
focusEventCls
,
"<init>"
,
"(Ljava/awt/Component;IZLjava/awt/Component;)V"
);
"(Ljava/awt/Component;IZLjava/awt/Component;)V"
);
DASSERT
(
focusEventConst
);
DASSERT
(
focusEventConst
);
CHECK_NULL
(
focusEventConst
);
}
}
static
jclass
sequencedEventCls
;
static
jclass
sequencedEventCls
;
...
@@ -5013,10 +5036,7 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
...
@@ -5013,10 +5036,7 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
jclass
sequencedEventClsLocal
=
jclass
sequencedEventClsLocal
=
env
->
FindClass
(
"java/awt/SequencedEvent"
);
env
->
FindClass
(
"java/awt/SequencedEvent"
);
DASSERT
(
sequencedEventClsLocal
);
DASSERT
(
sequencedEventClsLocal
);
if
(
sequencedEventClsLocal
==
NULL
)
{
CHECK_NULL
(
sequencedEventClsLocal
);
/* exception already thrown */
return
;
}
sequencedEventCls
=
sequencedEventCls
=
(
jclass
)
env
->
NewGlobalRef
(
sequencedEventClsLocal
);
(
jclass
)
env
->
NewGlobalRef
(
sequencedEventClsLocal
);
env
->
DeleteLocalRef
(
sequencedEventClsLocal
);
env
->
DeleteLocalRef
(
sequencedEventClsLocal
);
...
@@ -5027,6 +5047,8 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
...
@@ -5027,6 +5047,8 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
sequencedEventConst
=
sequencedEventConst
=
env
->
GetMethodID
(
sequencedEventCls
,
"<init>"
,
env
->
GetMethodID
(
sequencedEventCls
,
"<init>"
,
"(Ljava/awt/AWTEvent;)V"
);
"(Ljava/awt/AWTEvent;)V"
);
DASSERT
(
sequencedEventConst
);
CHECK_NULL
(
sequencedEventConst
);
}
}
if
(
env
->
EnsureLocalCapacity
(
3
)
<
0
)
{
if
(
env
->
EnsureLocalCapacity
(
3
)
<
0
)
{
...
@@ -5049,6 +5071,7 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
...
@@ -5049,6 +5071,7 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
env
->
DeleteLocalRef
(
jOpposite
);
jOpposite
=
NULL
;
env
->
DeleteLocalRef
(
jOpposite
);
jOpposite
=
NULL
;
}
}
env
->
DeleteLocalRef
(
target
);
target
=
NULL
;
env
->
DeleteLocalRef
(
target
);
target
=
NULL
;
CHECK_NULL
(
focusEvent
);
jobject
sequencedEvent
=
env
->
NewObject
(
sequencedEventCls
,
jobject
sequencedEvent
=
env
->
NewObject
(
sequencedEventCls
,
sequencedEventConst
,
sequencedEventConst
,
...
@@ -5056,7 +5079,7 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
...
@@ -5056,7 +5079,7 @@ void AwtComponent::SendFocusEvent(jint id, HWND opposite)
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
sequencedEvent
!=
NULL
);
DASSERT
(
sequencedEvent
!=
NULL
);
env
->
DeleteLocalRef
(
focusEvent
);
focusEvent
=
NULL
;
env
->
DeleteLocalRef
(
focusEvent
);
focusEvent
=
NULL
;
CHECK_NULL
(
sequencedEvent
);
SendEvent
(
sequencedEvent
);
SendEvent
(
sequencedEvent
);
env
->
DeleteLocalRef
(
sequencedEvent
);
env
->
DeleteLocalRef
(
sequencedEvent
);
...
@@ -5227,7 +5250,7 @@ void AwtComponent::SynthesizeMouseMessage(JNIEnv *env, jobject mouseEvent)
...
@@ -5227,7 +5250,7 @@ void AwtComponent::SynthesizeMouseMessage(JNIEnv *env, jobject mouseEvent)
"getWheelRotation"
,
"getWheelRotation"
,
"()I"
).
i
;
"()I"
).
i
;
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
DASSERT
(
!
safe_ExceptionOccurred
(
env
));
//DASSERT(wheelAmt
);
JNU_CHECK_EXCEPTION
(
env
);
DTRACE_PRINTLN1
(
"wheelAmt = %i
\n
"
,
wheelAmt
);
DTRACE_PRINTLN1
(
"wheelAmt = %i
\n
"
,
wheelAmt
);
// convert Java wheel amount value to Win32
// convert Java wheel amount value to Win32
...
@@ -6306,10 +6329,12 @@ Java_java_awt_Component_initIDs(JNIEnv *env, jclass cls)
...
@@ -6306,10 +6329,12 @@ Java_java_awt_Component_initIDs(JNIEnv *env, jclass cls)
{
{
TRY
;
TRY
;
jclass
inputEventClazz
=
env
->
FindClass
(
"java/awt/event/InputEvent"
);
jclass
inputEventClazz
=
env
->
FindClass
(
"java/awt/event/InputEvent"
);
CHECK_NULL
(
inputEventClazz
);
jmethodID
getButtonDownMasksID
=
env
->
GetStaticMethodID
(
inputEventClazz
,
"getButtonDownMasks"
,
"()[I"
);
jmethodID
getButtonDownMasksID
=
env
->
GetStaticMethodID
(
inputEventClazz
,
"getButtonDownMasks"
,
"()[I"
);
CHECK_NULL
(
getButtonDownMasksID
);
jintArray
obj
=
(
jintArray
)
env
->
CallStaticObjectMethod
(
inputEventClazz
,
getButtonDownMasksID
);
jintArray
obj
=
(
jintArray
)
env
->
CallStaticObjectMethod
(
inputEventClazz
,
getButtonDownMasksID
);
jint
*
tmp
=
env
->
GetIntArrayElements
(
obj
,
JNI_FALSE
);
jint
*
tmp
=
env
->
GetIntArrayElements
(
obj
,
JNI_FALSE
);
CHECK_NULL
(
tmp
);
jsize
len
=
env
->
GetArrayLength
(
obj
);
jsize
len
=
env
->
GetArrayLength
(
obj
);
AwtComponent
::
masks
=
SAFE_SIZE_NEW_ARRAY
(
jint
,
len
);
AwtComponent
::
masks
=
SAFE_SIZE_NEW_ARRAY
(
jint
,
len
);
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
...
@@ -6322,68 +6347,112 @@ Java_java_awt_Component_initIDs(JNIEnv *env, jclass cls)
...
@@ -6322,68 +6347,112 @@ Java_java_awt_Component_initIDs(JNIEnv *env, jclass cls)
jclass
peerCls
=
env
->
FindClass
(
"sun/awt/windows/WComponentPeer"
);
jclass
peerCls
=
env
->
FindClass
(
"sun/awt/windows/WComponentPeer"
);
DASSERT
(
peerCls
);
DASSERT
(
peerCls
);
CHECK_NULL
(
peerCls
);
/* field ids */
/* field ids */
AwtComponent
::
peerID
=
AwtComponent
::
peerID
=
env
->
GetFieldID
(
cls
,
"peer"
,
"Ljava/awt/peer/ComponentPeer;"
);
env
->
GetFieldID
(
cls
,
"peer"
,
"Ljava/awt/peer/ComponentPeer;"
);
DASSERT
(
AwtComponent
::
peerID
);
CHECK_NULL
(
AwtComponent
::
peerID
);
AwtComponent
::
xID
=
env
->
GetFieldID
(
cls
,
"x"
,
"I"
);
AwtComponent
::
xID
=
env
->
GetFieldID
(
cls
,
"x"
,
"I"
);
DASSERT
(
AwtComponent
::
xID
);
CHECK_NULL
(
AwtComponent
::
xID
);
AwtComponent
::
yID
=
env
->
GetFieldID
(
cls
,
"y"
,
"I"
);
AwtComponent
::
yID
=
env
->
GetFieldID
(
cls
,
"y"
,
"I"
);
DASSERT
(
AwtComponent
::
yID
);
CHECK_NULL
(
AwtComponent
::
yID
);
AwtComponent
::
heightID
=
env
->
GetFieldID
(
cls
,
"height"
,
"I"
);
AwtComponent
::
heightID
=
env
->
GetFieldID
(
cls
,
"height"
,
"I"
);
DASSERT
(
AwtComponent
::
heightID
);
CHECK_NULL
(
AwtComponent
::
heightID
);
AwtComponent
::
widthID
=
env
->
GetFieldID
(
cls
,
"width"
,
"I"
);
AwtComponent
::
widthID
=
env
->
GetFieldID
(
cls
,
"width"
,
"I"
);
DASSERT
(
AwtComponent
::
widthID
);
CHECK_NULL
(
AwtComponent
::
widthID
);
AwtComponent
::
visibleID
=
env
->
GetFieldID
(
cls
,
"visible"
,
"Z"
);
AwtComponent
::
visibleID
=
env
->
GetFieldID
(
cls
,
"visible"
,
"Z"
);
DASSERT
(
AwtComponent
::
visibleID
);
CHECK_NULL
(
AwtComponent
::
visibleID
);
AwtComponent
::
backgroundID
=
AwtComponent
::
backgroundID
=
env
->
GetFieldID
(
cls
,
"background"
,
"Ljava/awt/Color;"
);
env
->
GetFieldID
(
cls
,
"background"
,
"Ljava/awt/Color;"
);
DASSERT
(
AwtComponent
::
backgroundID
);
CHECK_NULL
(
AwtComponent
::
backgroundID
);
AwtComponent
::
foregroundID
=
AwtComponent
::
foregroundID
=
env
->
GetFieldID
(
cls
,
"foreground"
,
"Ljava/awt/Color;"
);
env
->
GetFieldID
(
cls
,
"foreground"
,
"Ljava/awt/Color;"
);
DASSERT
(
AwtComponent
::
foregroundID
);
CHECK_NULL
(
AwtComponent
::
foregroundID
);
AwtComponent
::
enabledID
=
env
->
GetFieldID
(
cls
,
"enabled"
,
"Z"
);
AwtComponent
::
enabledID
=
env
->
GetFieldID
(
cls
,
"enabled"
,
"Z"
);
DASSERT
(
AwtComponent
::
enabledID
);
CHECK_NULL
(
AwtComponent
::
enabledID
);
AwtComponent
::
parentID
=
env
->
GetFieldID
(
cls
,
"parent"
,
"Ljava/awt/Container;"
);
AwtComponent
::
parentID
=
env
->
GetFieldID
(
cls
,
"parent"
,
"Ljava/awt/Container;"
);
DASSERT
(
AwtComponent
::
parentID
);
CHECK_NULL
(
AwtComponent
::
parentID
);
AwtComponent
::
graphicsConfigID
=
AwtComponent
::
graphicsConfigID
=
env
->
GetFieldID
(
cls
,
"graphicsConfig"
,
"Ljava/awt/GraphicsConfiguration;"
);
env
->
GetFieldID
(
cls
,
"graphicsConfig"
,
"Ljava/awt/GraphicsConfiguration;"
);
DASSERT
(
AwtComponent
::
graphicsConfigID
);
CHECK_NULL
(
AwtComponent
::
graphicsConfigID
);
AwtComponent
::
focusableID
=
env
->
GetFieldID
(
cls
,
"focusable"
,
"Z"
);
AwtComponent
::
focusableID
=
env
->
GetFieldID
(
cls
,
"focusable"
,
"Z"
);
DASSERT
(
AwtComponent
::
focusableID
);
CHECK_NULL
(
AwtComponent
::
focusableID
);
AwtComponent
::
appContextID
=
env
->
GetFieldID
(
cls
,
"appContext"
,
AwtComponent
::
appContextID
=
env
->
GetFieldID
(
cls
,
"appContext"
,
"Lsun/awt/AppContext;"
);
"Lsun/awt/AppContext;"
);
DASSERT
(
AwtComponent
::
appContextID
);
CHECK_NULL
(
AwtComponent
::
appContextID
);
AwtComponent
::
peerGCID
=
env
->
GetFieldID
(
peerCls
,
"winGraphicsConfig"
,
AwtComponent
::
peerGCID
=
env
->
GetFieldID
(
peerCls
,
"winGraphicsConfig"
,
"Lsun/awt/Win32GraphicsConfig;"
);
"Lsun/awt/Win32GraphicsConfig;"
);
DASSERT
(
AwtComponent
::
peerGCID
);
CHECK_NULL
(
AwtComponent
::
peerGCID
);
AwtComponent
::
hwndID
=
env
->
GetFieldID
(
peerCls
,
"hwnd"
,
"J"
);
AwtComponent
::
hwndID
=
env
->
GetFieldID
(
peerCls
,
"hwnd"
,
"J"
);
DASSERT
(
AwtComponent
::
hwndID
);
CHECK_NULL
(
AwtComponent
::
hwndID
);
AwtComponent
::
cursorID
=
env
->
GetFieldID
(
cls
,
"cursor"
,
"Ljava/awt/Cursor;"
);
AwtComponent
::
cursorID
=
env
->
GetFieldID
(
cls
,
"cursor"
,
"Ljava/awt/Cursor;"
);
DASSERT
(
AwtComponent
::
cursorID
);
CHECK_NULL
(
AwtComponent
::
cursorID
);
/* method ids */
/* method ids */
AwtComponent
::
getFontMID
=
AwtComponent
::
getFontMID
=
env
->
GetMethodID
(
cls
,
"getFont_NoClientCode"
,
"()Ljava/awt/Font;"
);
env
->
GetMethodID
(
cls
,
"getFont_NoClientCode"
,
"()Ljava/awt/Font;"
);
DASSERT
(
AwtComponent
::
getFontMID
);
CHECK_NULL
(
AwtComponent
::
getFontMID
);
AwtComponent
::
getToolkitMID
=
AwtComponent
::
getToolkitMID
=
env
->
GetMethodID
(
cls
,
"getToolkitImpl"
,
"()Ljava/awt/Toolkit;"
);
env
->
GetMethodID
(
cls
,
"getToolkitImpl"
,
"()Ljava/awt/Toolkit;"
);
DASSERT
(
AwtComponent
::
getToolkitMID
);
CHECK_NULL
(
AwtComponent
::
getToolkitMID
);
AwtComponent
::
isEnabledMID
=
env
->
GetMethodID
(
cls
,
"isEnabledImpl"
,
"()Z"
);
AwtComponent
::
isEnabledMID
=
env
->
GetMethodID
(
cls
,
"isEnabledImpl"
,
"()Z"
);
DASSERT
(
AwtComponent
::
isEnabledMID
);
CHECK_NULL
(
AwtComponent
::
isEnabledMID
);
AwtComponent
::
getLocationOnScreenMID
=
AwtComponent
::
getLocationOnScreenMID
=
env
->
GetMethodID
(
cls
,
"getLocationOnScreen_NoTreeLock"
,
"()Ljava/awt/Point;"
);
env
->
GetMethodID
(
cls
,
"getLocationOnScreen_NoTreeLock"
,
"()Ljava/awt/Point;"
);
DASSERT
(
AwtComponent
::
getLocationOnScreenMID
);
CHECK_NULL
(
AwtComponent
::
getLocationOnScreenMID
);
AwtComponent
::
replaceSurfaceDataMID
=
AwtComponent
::
replaceSurfaceDataMID
=
env
->
GetMethodID
(
peerCls
,
"replaceSurfaceData"
,
"()V"
);
env
->
GetMethodID
(
peerCls
,
"replaceSurfaceData"
,
"()V"
);
DASSERT
(
AwtComponent
::
replaceSurfaceDataMID
);
CHECK_NULL
(
AwtComponent
::
replaceSurfaceDataMID
);
AwtComponent
::
replaceSurfaceDataLaterMID
=
AwtComponent
::
replaceSurfaceDataLaterMID
=
env
->
GetMethodID
(
peerCls
,
"replaceSurfaceDataLater"
,
"()V"
);
env
->
GetMethodID
(
peerCls
,
"replaceSurfaceDataLater"
,
"()V"
);
AwtComponent
::
disposeLaterMID
=
env
->
GetMethodID
(
peerCls
,
"disposeLater"
,
"()V"
);
DASSERT
(
AwtComponent
::
xID
);
DASSERT
(
AwtComponent
::
yID
);
DASSERT
(
AwtComponent
::
heightID
);
DASSERT
(
AwtComponent
::
widthID
);
DASSERT
(
AwtComponent
::
visibleID
);
DASSERT
(
AwtComponent
::
backgroundID
);
DASSERT
(
AwtComponent
::
foregroundID
);
DASSERT
(
AwtComponent
::
enabledID
);
DASSERT
(
AwtComponent
::
parentID
);
DASSERT
(
AwtComponent
::
hwndID
);
DASSERT
(
AwtComponent
::
getFontMID
);
DASSERT
(
AwtComponent
::
getToolkitMID
);
DASSERT
(
AwtComponent
::
isEnabledMID
);
DASSERT
(
AwtComponent
::
getLocationOnScreenMID
);
DASSERT
(
AwtComponent
::
replaceSurfaceDataMID
);
DASSERT
(
AwtComponent
::
replaceSurfaceDataLaterMID
);
DASSERT
(
AwtComponent
::
replaceSurfaceDataLaterMID
);
DASSERT
(
AwtComponent
::
dispose
LaterMID
);
CHECK_NULL
(
AwtComponent
::
replaceSurfaceData
LaterMID
);
AwtComponent
::
disposeLaterMID
=
env
->
GetMethodID
(
peerCls
,
"disposeLater"
,
"()V"
);
DASSERT
(
AwtComponent
::
disposeLaterMID
);
CHECK_NULL
(
AwtComponent
::
disposeLaterMID
);
CATCH_BAD_ALLOC
;
CATCH_BAD_ALLOC
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录