Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
83890cdc
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
83890cdc
编写于
12月 15, 2016
作者:
A
alitvinov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8165543: Better window framing
Reviewed-by: serb
上级
64f4e28d
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
166 addition
and
124 deletion
+166
-124
src/windows/native/sun/windows/awt.h
src/windows/native/sun/windows/awt.h
+30
-18
src/windows/native/sun/windows/awt_Button.cpp
src/windows/native/sun/windows/awt_Button.cpp
+1
-9
src/windows/native/sun/windows/awt_Canvas.cpp
src/windows/native/sun/windows/awt_Canvas.cpp
+4
-7
src/windows/native/sun/windows/awt_Checkbox.cpp
src/windows/native/sun/windows/awt_Checkbox.cpp
+5
-6
src/windows/native/sun/windows/awt_Choice.cpp
src/windows/native/sun/windows/awt_Choice.cpp
+4
-9
src/windows/native/sun/windows/awt_Component.cpp
src/windows/native/sun/windows/awt_Component.cpp
+45
-24
src/windows/native/sun/windows/awt_Component.h
src/windows/native/sun/windows/awt_Component.h
+1
-0
src/windows/native/sun/windows/awt_Dialog.cpp
src/windows/native/sun/windows/awt_Dialog.cpp
+2
-3
src/windows/native/sun/windows/awt_Frame.cpp
src/windows/native/sun/windows/awt_Frame.cpp
+3
-7
src/windows/native/sun/windows/awt_Label.cpp
src/windows/native/sun/windows/awt_Label.cpp
+1
-4
src/windows/native/sun/windows/awt_List.cpp
src/windows/native/sun/windows/awt_List.cpp
+1
-8
src/windows/native/sun/windows/awt_ScrollPane.cpp
src/windows/native/sun/windows/awt_ScrollPane.cpp
+2
-4
src/windows/native/sun/windows/awt_Scrollbar.cpp
src/windows/native/sun/windows/awt_Scrollbar.cpp
+64
-14
src/windows/native/sun/windows/awt_Scrollbar.h
src/windows/native/sun/windows/awt_Scrollbar.h
+2
-0
src/windows/native/sun/windows/awt_TextArea.cpp
src/windows/native/sun/windows/awt_TextArea.cpp
+0
-3
src/windows/native/sun/windows/awt_TextComponent.cpp
src/windows/native/sun/windows/awt_TextComponent.cpp
+1
-2
src/windows/native/sun/windows/awt_TextField.cpp
src/windows/native/sun/windows/awt_TextField.cpp
+0
-3
src/windows/native/sun/windows/awt_Window.cpp
src/windows/native/sun/windows/awt_Window.cpp
+0
-3
未找到文件。
src/windows/native/sun/windows/awt.h
浏览文件 @
83890cdc
...
...
@@ -57,15 +57,6 @@ typedef AwtObject* PDATA;
} \
}
#define JNI_CHECK_PEER_GOTO(peer, where) { \
JNI_CHECK_NULL_GOTO(peer, "peer", where); \
pData = JNI_GET_PDATA(peer); \
if (pData == NULL) { \
THROW_NULL_PDATA_IF_NOT_DESTROYED(peer); \
goto where; \
} \
}
#define JNI_CHECK_NULL_RETURN(obj, msg) { \
if (obj == NULL) { \
env->ExceptionClear(); \
...
...
@@ -74,15 +65,6 @@ typedef AwtObject* PDATA;
} \
}
#define JNI_CHECK_PEER_RETURN(peer) { \
JNI_CHECK_NULL_RETURN(peer, "peer"); \
pData = JNI_GET_PDATA(peer); \
if (pData == NULL) { \
THROW_NULL_PDATA_IF_NOT_DESTROYED(peer); \
return; \
} \
}
#define JNI_CHECK_PEER_CREATION_RETURN(peer) { \
if (peer == NULL ) { \
return; \
...
...
@@ -109,6 +91,33 @@ typedef AwtObject* PDATA;
} \
}
/**
* This macros must be used under SyncCall or on the Toolkit thread.
*/
#define JNI_CHECK_PEER_GOTO(peer, where) { \
JNI_CHECK_NULL_GOTO(peer, "peer", where); \
pData = JNI_GET_PDATA(peer); \
if (pData == NULL) { \
THROW_NULL_PDATA_IF_NOT_DESTROYED(peer); \
goto where; \
} \
}
/**
* This macros must be used under SyncCall or on the Toolkit thread.
*/
#define JNI_CHECK_PEER_RETURN(peer) { \
JNI_CHECK_NULL_RETURN(peer, "peer"); \
pData = JNI_GET_PDATA(peer); \
if (pData == NULL) { \
THROW_NULL_PDATA_IF_NOT_DESTROYED(peer); \
return; \
} \
}
/**
* This macros must be used under SyncCall or on the Toolkit thread.
*/
#define JNI_CHECK_PEER_RETURN_NULL(peer) { \
JNI_CHECK_NULL_RETURN_NULL(peer, "peer"); \
pData = JNI_GET_PDATA(peer); \
...
...
@@ -118,6 +127,9 @@ typedef AwtObject* PDATA;
} \
}
/**
* This macros must be used under SyncCall or on the Toolkit thread.
*/
#define JNI_CHECK_PEER_RETURN_VAL(peer, val) { \
JNI_CHECK_NULL_RETURN_VAL(peer, "peer", val); \
pData = JNI_GET_PDATA(peer); \
...
...
src/windows/native/sun/windows/awt_Button.cpp
浏览文件 @
83890cdc
...
...
@@ -65,6 +65,7 @@ LPCTSTR AwtButton::GetClassName() {
/* Create a new AwtButton object and window. */
AwtButton
*
AwtButton
::
Create
(
jobject
self
,
jobject
parent
)
{
DASSERT
(
AwtToolkit
::
IsMainThread
());
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
/* the result */
...
...
@@ -88,7 +89,6 @@ AwtButton* AwtButton::Create(jobject self, jobject parent)
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
awtParent
=
(
AwtCanvas
*
)
pData
;
JNI_CHECK_NULL_GOTO
(
awtParent
,
"awtParent"
,
done
);
target
=
env
->
GetObjectField
(
self
,
AwtObject
::
targetID
);
JNI_CHECK_NULL_GOTO
(
target
,
"target"
,
done
);
...
...
@@ -374,9 +374,6 @@ Java_sun_awt_windows_WButtonPeer_setLabel(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
self
);
SetLabelStruct
*
sls
=
new
SetLabelStruct
;
sls
->
button
=
env
->
NewGlobalRef
(
self
);
sls
->
label
=
(
label
!=
NULL
)
?
(
jstring
)
env
->
NewGlobalRef
(
label
)
:
NULL
;
...
...
@@ -398,14 +395,9 @@ Java_sun_awt_windows_WButtonPeer_create(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
parent
);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtButton
::
Create
);
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_Canvas.cpp
浏览文件 @
83890cdc
...
...
@@ -59,6 +59,7 @@ LPCTSTR AwtCanvas::GetClassName() {
*/
AwtCanvas
*
AwtCanvas
::
Create
(
jobject
self
,
jobject
hParent
)
{
DASSERT
(
AwtToolkit
::
IsMainThread
());
TRY
;
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
...
...
@@ -74,12 +75,11 @@ AwtCanvas* AwtCanvas::Create(jobject self, jobject hParent)
return
NULL
;
}
PDATA
pData
;
AwtComponent
*
parent
;
JNI_CHECK_NULL_GOTO
(
hParent
,
"null hParent"
,
done
);
parent
=
(
AwtComponent
*
)
JNI_GET_PDATA
(
hParent
);
JNI_CHECK_NULL_GOTO
(
parent
,
"null parent"
,
done
);
JNI_CHECK_PEER_GOTO
(
hParent
,
done
);
parent
=
(
AwtCanvas
*
)
pData
;
target
=
env
->
GetObjectField
(
self
,
AwtObject
::
targetID
);
JNI_CHECK_NULL_GOTO
(
target
,
"null target"
,
done
);
...
...
@@ -236,12 +236,9 @@ Java_sun_awt_windows_WCanvasPeer_create(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
parent
);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtCanvas
::
Create
);
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_Checkbox.cpp
浏览文件 @
83890cdc
...
...
@@ -70,6 +70,7 @@ LPCTSTR AwtCheckbox::GetClassName() {
AwtCheckbox
*
AwtCheckbox
::
Create
(
jobject
peer
,
jobject
parent
)
{
DASSERT
(
AwtToolkit
::
IsMainThread
());
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
jstring
label
=
NULL
;
...
...
@@ -81,11 +82,10 @@ AwtCheckbox* AwtCheckbox::Create(jobject peer, jobject parent)
return
NULL
;
}
PDATA
pData
;
AwtComponent
*
awtParent
;
JNI_CHECK_NULL_GOTO
(
parent
,
"null parent"
,
done
);
awtParent
=
(
AwtComponent
*
)
JNI_GET_PDATA
(
parent
);
JNI_CHECK_NULL_GOTO
(
awtParent
,
"null awtParent"
,
done
);
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
awtParent
=
(
AwtCanvas
*
)
pData
;
target
=
env
->
GetObjectField
(
peer
,
AwtObject
::
targetID
);
JNI_CHECK_NULL_GOTO
(
target
,
"null target"
,
done
);
...
...
@@ -667,11 +667,10 @@ Java_sun_awt_windows_WCheckboxPeer_create(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
parent
);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtCheckbox
::
Create
);
PDATA
pData
;
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
#ifdef DEBUG
...
...
src/windows/native/sun/windows/awt_Choice.cpp
浏览文件 @
83890cdc
...
...
@@ -104,7 +104,7 @@ void AwtChoice::Dispose() {
}
AwtChoice
*
AwtChoice
::
Create
(
jobject
peer
,
jobject
parent
)
{
DASSERT
(
AwtToolkit
::
IsMainThread
());
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
jobject
target
=
NULL
;
...
...
@@ -115,12 +115,10 @@ AwtChoice* AwtChoice::Create(jobject peer, jobject parent) {
if
(
env
->
EnsureLocalCapacity
(
1
)
<
0
)
{
return
NULL
;
}
PDATA
pData
;
AwtCanvas
*
awtParent
;
JNI_CHECK_NULL_GOTO
(
parent
,
"null parent"
,
done
);
awtParent
=
(
AwtCanvas
*
)
JNI_GET_PDATA
(
parent
);
JNI_CHECK_NULL_GOTO
(
awtParent
,
"null awtParent"
,
done
);
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
awtParent
=
(
AwtCanvas
*
)
pData
;
target
=
env
->
GetObjectField
(
peer
,
AwtObject
::
targetID
);
JNI_CHECK_NULL_GOTO
(
target
,
"null target"
,
done
);
...
...
@@ -829,12 +827,9 @@ Java_sun_awt_windows_WChoicePeer_create(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
parent
);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtChoice
::
Create
);
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_Component.cpp
浏览文件 @
83890cdc
...
...
@@ -150,6 +150,11 @@ struct SetFocusStruct {
jobject
component
;
jboolean
doSetFocus
;
};
// Struct for _SetParent function
struct
SetParentStruct
{
jobject
component
;
jobject
parentComp
;
};
/************************************************************************/
//////////////////////////////////////////////////////////////////////////
...
...
@@ -261,9 +266,6 @@ AwtComponent::~AwtComponent()
{
DASSERT
(
AwtToolkit
::
IsMainThread
());
/* Disconnect all links. */
UnlinkObjects
();
/*
* All the messages for this component are processed, native
* resources are freed, and Java object is not connected to
...
...
@@ -275,6 +277,8 @@ AwtComponent::~AwtComponent()
void
AwtComponent
::
Dispose
()
{
DASSERT
(
AwtToolkit
::
IsMainThread
());
// NOTE: in case the component/toplevel was focused, Java should
// have already taken care of proper transferring it or clearing.
...
...
@@ -293,8 +297,10 @@ void AwtComponent::Dispose()
/* Release global ref to input method */
SetInputMethod
(
NULL
,
TRUE
);
if
(
m_childList
!=
NULL
)
if
(
m_childList
!=
NULL
)
{
delete
m_childList
;
m_childList
=
NULL
;
}
DestroyDropTarget
();
ReleaseDragCapture
(
0
);
...
...
@@ -317,6 +323,9 @@ void AwtComponent::Dispose()
m_brushBackground
=
NULL
;
}
/* Disconnect all links. */
UnlinkObjects
();
if
(
m_bPauseDestroy
)
{
// AwtComponent::WmNcDestroy could be released now
m_bPauseDestroy
=
FALSE
;
...
...
@@ -6123,21 +6132,36 @@ ret:
return
result
;
}
void
AwtComponent
::
SetParent
(
void
*
param
)
{
void
AwtComponent
::
_SetParent
(
void
*
param
)
{
if
(
AwtToolkit
::
IsMainThread
())
{
AwtComponent
**
comps
=
(
AwtComponent
**
)
param
;
if
((
comps
[
0
]
!=
NULL
)
&&
(
comps
[
1
]
!=
NULL
))
{
HWND
selfWnd
=
comps
[
0
]
->
GetHWnd
();
HWND
parentWnd
=
comps
[
1
]
->
GetHWnd
();
if
(
::
IsWindow
(
selfWnd
)
&&
::
IsWindow
(
parentWnd
))
{
// Shouldn't trigger native focus change
// (only the proxy may be the native focus owner).
::
SetParent
(
selfWnd
,
parentWnd
);
}
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
SetParentStruct
*
data
=
(
SetParentStruct
*
)
param
;
jobject
self
=
data
->
component
;
jobject
parent
=
data
->
parentComp
;
AwtComponent
*
awtComponent
=
NULL
;
AwtComponent
*
awtParent
=
NULL
;
PDATA
pData
;
JNI_CHECK_PEER_GOTO
(
self
,
ret
);
awtComponent
=
(
AwtComponent
*
)
pData
;
JNI_CHECK_PEER_GOTO
(
parent
,
ret
);
awtParent
=
(
AwtComponent
*
)
pData
;
HWND
selfWnd
=
awtComponent
->
GetHWnd
();
HWND
parentWnd
=
awtParent
->
GetHWnd
();
if
(
::
IsWindow
(
selfWnd
)
&&
::
IsWindow
(
parentWnd
))
{
// Shouldn't trigger native focus change
// (only the proxy may be the native focus owner).
::
SetParent
(
selfWnd
,
parentWnd
);
}
delete
[]
comps
;
ret:
env
->
DeleteGlobalRef
(
self
);
env
->
DeleteGlobalRef
(
parent
);
delete
data
;
}
else
{
AwtToolkit
::
GetInstance
().
InvokeFunction
(
AwtComponent
::
SetParent
,
param
);
AwtToolkit
::
GetInstance
().
InvokeFunction
(
AwtComponent
::
_
SetParent
,
param
);
}
}
...
...
@@ -6964,15 +6988,12 @@ JNIEXPORT void JNICALL
Java_sun_awt_windows_WComponentPeer_pSetParent
(
JNIEnv
*
env
,
jobject
self
,
jobject
parent
)
{
TRY
;
typedef
AwtComponent
*
PComponent
;
AwtComponent
**
comps
=
new
PComponent
[
2
];
AwtComponent
*
comp
=
(
AwtComponent
*
)
JNI_GET_PDATA
(
self
);
AwtComponent
*
parentComp
=
(
AwtComponent
*
)
JNI_GET_PDATA
(
parent
);
comps
[
0
]
=
comp
;
comps
[
1
]
=
parentComp
;
SetParentStruct
*
data
=
new
SetParentStruct
;
data
->
component
=
env
->
NewGlobalRef
(
self
);
data
->
parentComp
=
env
->
NewGlobalRef
(
parent
);
AwtToolkit
::
GetInstance
().
SyncCall
(
AwtComponent
::
SetParent
,
comps
);
//
comps is
deleted in SetParent
AwtToolkit
::
GetInstance
().
SyncCall
(
AwtComponent
::
_SetParent
,
data
);
//
global refs and data are
deleted in SetParent
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_Component.h
浏览文件 @
83890cdc
...
...
@@ -665,6 +665,7 @@ public:
static
void
_RemoveNativeDropTarget
(
void
*
param
);
static
jintArray
_CreatePrintedPixels
(
void
*
param
);
static
jboolean
_NativeHandlesWheelScrolling
(
void
*
param
);
static
void
_SetParent
(
void
*
param
);
static
void
_SetRectangularShape
(
void
*
param
);
static
void
_SetZOrder
(
void
*
param
);
...
...
src/windows/native/sun/windows/awt_Dialog.cpp
浏览文件 @
83890cdc
...
...
@@ -112,12 +112,13 @@ AwtDialog* AwtDialog::Create(jobject peer, jobject parent)
PDATA
pData
;
AwtWindow
*
awtParent
=
NULL
;
HWND
hwndParent
=
NULL
;
target
=
env
->
GetObjectField
(
peer
,
AwtObject
::
targetID
);
JNI_CHECK_NULL_GOTO
(
target
,
"null target"
,
done
);
if
(
parent
!=
NULL
)
{
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
awtParent
=
(
AwtWindow
*
)
(
JNI_GET_PDATA
(
parent
))
;
awtParent
=
(
AwtWindow
*
)
pData
;
hwndParent
=
awtParent
->
GetHWnd
();
}
else
{
// There is no way to prevent a parentless dialog from showing on
...
...
@@ -784,11 +785,9 @@ Java_sun_awt_windows_WDialogPeer_createAwtDialog(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtDialog
::
Create
);
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_Frame.cpp
浏览文件 @
83890cdc
...
...
@@ -1578,12 +1578,12 @@ void AwtFrame::_NotifyModalBlocked(void *param)
PDATA
pData
;
pData
=
JNI_GET_PDATA
(
peer
);
JNI_CHECK_PEER_GOTO
(
peer
,
ret
);
AwtFrame
*
f
=
(
AwtFrame
*
)
pData
;
// dialog here may be NULL, for example, if the blocker is a native dialog
// however, we need to install/unistall modal hooks anyway
pData
=
JNI_GET_PDATA
(
blockerPeer
);
JNI_CHECK_PEER_GOTO
(
blockerPeer
,
ret
);
AwtDialog
*
d
=
(
AwtDialog
*
)
pData
;
if
((
f
!=
NULL
)
&&
::
IsWindow
(
f
->
GetHWnd
()))
...
...
@@ -1635,7 +1635,7 @@ void AwtFrame::_NotifyModalBlocked(void *param)
}
}
}
ret:
env
->
DeleteGlobalRef
(
self
);
env
->
DeleteGlobalRef
(
peer
);
env
->
DeleteGlobalRef
(
blockerPeer
);
...
...
@@ -1807,8 +1807,6 @@ Java_sun_awt_windows_WFramePeer_createAwtFrame(JNIEnv *env, jobject self,
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtFrame
::
Create
);
PDATA
pData
;
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
@@ -1922,8 +1920,6 @@ Java_sun_awt_windows_WEmbeddedFramePeer_create(JNIEnv *env, jobject self,
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtFrame
::
Create
);
PDATA
pData
;
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_Label.cpp
浏览文件 @
83890cdc
...
...
@@ -80,7 +80,7 @@ AwtLabel* AwtLabel::Create(jobject labelPeer, jobject parent)
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
awtParent
=
(
AwtCanvas
*
)
pData
;
JNI_CHECK_NULL_GOTO
(
awtParent
,
"awtParent"
,
done
);
target
=
env
->
GetObjectField
(
labelPeer
,
AwtObject
::
targetID
);
JNI_CHECK_NULL_GOTO
(
target
,
"target"
,
done
);
...
...
@@ -392,12 +392,9 @@ Java_sun_awt_windows_WLabelPeer_create(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
parent
);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtLabel
::
Create
);
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_List.cpp
浏览文件 @
83890cdc
...
...
@@ -89,10 +89,9 @@ AwtList* AwtList::Create(jobject peer, jobject parent)
PDATA
pData
;
AwtCanvas
*
awtParent
;
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
awtParent
=
(
AwtCanvas
*
)
pData
;
JNI_CHECK_NULL_GOTO
(
awtParent
,
"null awtParent"
,
done
);
/* target is Hjava_awt_List * */
target
=
env
->
GetObjectField
(
peer
,
AwtObject
::
targetID
);
...
...
@@ -928,9 +927,6 @@ Java_sun_awt_windows_WListPeer_deselect(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
self
);
SelectElementStruct
*
ses
=
new
SelectElementStruct
;
ses
->
list
=
env
->
NewGlobalRef
(
self
);
ses
->
index
=
pos
;
...
...
@@ -994,11 +990,8 @@ Java_sun_awt_windows_WListPeer_create(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
parent
);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtList
::
Create
);
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_ScrollPane.cpp
浏览文件 @
83890cdc
...
...
@@ -96,10 +96,9 @@ AwtScrollPane* AwtScrollPane::Create(jobject self, jobject parent)
PDATA
pData
;
AwtComponent
*
awtParent
;
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
awtParent
=
(
AwtComponent
*
)
pData
;
JNI_CHECK_NULL_GOTO
(
awtParent
,
"null awtParent"
,
done
);
target
=
env
->
GetObjectField
(
self
,
AwtObject
::
targetID
);
JNI_CHECK_NULL_GOTO
(
target
,
"null target"
,
done
);
...
...
@@ -679,11 +678,10 @@ Java_sun_awt_windows_WScrollPanePeer_create(JNIEnv *env, jobject self,
DTRACE_PRINTLN2
(
"%x: WScrollPanePeer.create(%x)"
,
self
,
parent
);
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
parent
);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtScrollPane
::
Create
);
PDATA
pData
;
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
((
AwtScrollPane
*
)
pData
)
->
VerifyState
();
...
...
src/windows/native/sun/windows/awt_Scrollbar.cpp
浏览文件 @
83890cdc
...
...
@@ -38,7 +38,11 @@ struct SetValuesStruct {
jint
value
;
jint
visible
;
jint
min
,
max
;
};
// struct for _SetLineIncrement()/_SetPageIncrement() methods
struct
SetIncrementStruct
{
jobject
scrollbar
;
jint
increment
;
};
/************************************************************************
* AwtScrollbar fields
...
...
@@ -108,10 +112,9 @@ AwtScrollbar::Create(jobject peer, jobject parent)
PDATA
pData
;
AwtCanvas
*
awtParent
;
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
awtParent
=
(
AwtCanvas
*
)
pData
;
JNI_CHECK_NULL_GOTO
(
awtParent
,
"null awtParent"
,
done
);
target
=
env
->
GetObjectField
(
peer
,
AwtObject
::
targetID
);
JNI_CHECK_NULL_GOTO
(
target
,
"null target"
,
done
);
...
...
@@ -471,6 +474,52 @@ ret:
delete
svs
;
}
void
AwtScrollbar
::
_SetLineIncrement
(
void
*
param
)
{
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
SetIncrementStruct
*
sis
=
(
SetIncrementStruct
*
)
param
;
jobject
self
=
sis
->
scrollbar
;
jint
increment
=
sis
->
increment
;
AwtScrollbar
*
sb
=
NULL
;
PDATA
pData
;
JNI_CHECK_PEER_GOTO
(
self
,
ret
);
sb
=
(
AwtScrollbar
*
)
pData
;
if
(
::
IsWindow
(
sb
->
GetHWnd
()))
{
sb
->
SetLineIncrement
(
increment
);
}
ret:
env
->
DeleteGlobalRef
(
self
);
delete
sis
;
}
void
AwtScrollbar
::
_SetPageIncrement
(
void
*
param
)
{
JNIEnv
*
env
=
(
JNIEnv
*
)
JNU_GetEnv
(
jvm
,
JNI_VERSION_1_2
);
SetIncrementStruct
*
sis
=
(
SetIncrementStruct
*
)
param
;
jobject
self
=
sis
->
scrollbar
;
jint
increment
=
sis
->
increment
;
AwtScrollbar
*
sb
=
NULL
;
PDATA
pData
;
JNI_CHECK_PEER_GOTO
(
self
,
ret
);
sb
=
(
AwtScrollbar
*
)
pData
;
if
(
::
IsWindow
(
sb
->
GetHWnd
()))
{
sb
->
SetPageIncrement
(
increment
);
}
ret:
env
->
DeleteGlobalRef
(
self
);
delete
sis
;
}
/************************************************************************
* Scrollbar native methods
*/
...
...
@@ -546,10 +595,12 @@ Java_sun_awt_windows_WScrollbarPeer_setLineIncrement(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
self
);
AwtScrollbar
*
c
=
(
AwtScrollbar
*
)
pData
;
c
->
SetLineIncrement
(
increment
);
SetIncrementStruct
*
sis
=
new
SetIncrementStruct
;
sis
->
scrollbar
=
env
->
NewGlobalRef
(
self
);
sis
->
increment
=
increment
;
AwtToolkit
::
GetInstance
().
SyncCall
(
AwtScrollbar
::
_SetLineIncrement
,
sis
);
// global ref and svs are deleted in _SetValues
CATCH_BAD_ALLOC
;
}
...
...
@@ -565,10 +616,12 @@ Java_sun_awt_windows_WScrollbarPeer_setPageIncrement(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
self
);
AwtScrollbar
*
c
=
(
AwtScrollbar
*
)
pData
;
c
->
SetPageIncrement
(
increment
);
SetIncrementStruct
*
sis
=
new
SetIncrementStruct
;
sis
->
scrollbar
=
env
->
NewGlobalRef
(
self
);
sis
->
increment
=
increment
;
AwtToolkit
::
GetInstance
().
SyncCall
(
AwtScrollbar
::
_SetPageIncrement
,
sis
);
// global ref and svs are deleted in _SetValues
CATCH_BAD_ALLOC
;
}
...
...
@@ -584,12 +637,9 @@ Java_sun_awt_windows_WScrollbarPeer_create(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
parent
);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtScrollbar
::
Create
);
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_Scrollbar.h
浏览文件 @
83890cdc
...
...
@@ -77,6 +77,8 @@ public:
INLINE
virtual
BOOL
IsScrollbar
()
{
return
TRUE
;
}
static
void
_SetLineIncrement
(
void
*
param
);
static
void
_SetPageIncrement
(
void
*
param
);
// invoked on Toolkit thread
static
void
_SetValues
(
void
*
param
);
...
...
src/windows/native/sun/windows/awt_TextArea.cpp
浏览文件 @
83890cdc
...
...
@@ -543,12 +543,9 @@ Java_sun_awt_windows_WTextAreaPeer_create(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
parent
);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtTextArea
::
Create
);
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_TextComponent.cpp
浏览文件 @
83890cdc
...
...
@@ -95,10 +95,9 @@ AwtTextComponent* AwtTextComponent::Create(jobject peer, jobject parent, BOOL is
PDATA
pData
;
AwtCanvas
*
awtParent
;
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
JNI_CHECK_PEER_GOTO
(
parent
,
done
);
awtParent
=
(
AwtCanvas
*
)
pData
;
JNI_CHECK_NULL_GOTO
(
awtParent
,
"null awtParent"
,
done
);
target
=
env
->
GetObjectField
(
peer
,
AwtObject
::
targetID
);
JNI_CHECK_NULL_GOTO
(
target
,
"null target"
,
done
);
...
...
src/windows/native/sun/windows/awt_TextField.cpp
浏览文件 @
83890cdc
...
...
@@ -301,12 +301,9 @@ Java_sun_awt_windows_WTextFieldPeer_create(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
JNI_CHECK_PEER_RETURN
(
parent
);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtTextField
::
Create
);
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
src/windows/native/sun/windows/awt_Window.cpp
浏览文件 @
83890cdc
...
...
@@ -3246,12 +3246,9 @@ Java_sun_awt_windows_WWindowPeer_createAwtWindow(JNIEnv *env, jobject self,
{
TRY
;
PDATA
pData
;
// JNI_CHECK_PEER_RETURN(parent);
AwtToolkit
::
CreateComponent
(
self
,
parent
,
(
AwtToolkit
::
ComponentFactory
)
AwtWindow
::
Create
);
JNI_CHECK_PEER_CREATION_RETURN
(
self
);
CATCH_BAD_ALLOC
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录