Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
33efe959
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看板
提交
33efe959
编写于
3月 22, 2013
作者:
D
denis
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7123476: DesktopOpenTests:When enter the file path and click the open button,it crash
Reviewed-by: art, anthony
上级
6a4cda21
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
208 addition
and
78 deletion
+208
-78
make/sun/xawt/FILES_c_unix.gmk
make/sun/xawt/FILES_c_unix.gmk
+2
-1
makefiles/CompileNativeLibraries.gmk
makefiles/CompileNativeLibraries.gmk
+2
-1
src/solaris/native/sun/awt/gtk2_interface.c
src/solaris/native/sun/awt/gtk2_interface.c
+34
-1
src/solaris/native/sun/awt/gtk2_interface.h
src/solaris/native/sun/awt/gtk2_interface.h
+15
-1
src/solaris/native/sun/xawt/awt_Desktop.c
src/solaris/native/sun/xawt/awt_Desktop.c
+29
-74
src/solaris/native/sun/xawt/gnome_interface.c
src/solaris/native/sun/xawt/gnome_interface.c
+87
-0
src/solaris/native/sun/xawt/gnome_interface.h
src/solaris/native/sun/xawt/gnome_interface.h
+39
-0
未找到文件。
make/sun/xawt/FILES_c_unix.gmk
浏览文件 @
33efe959
#
#
# Copyright (c) 2002, 201
0
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 201
3
, 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
...
@@ -76,6 +76,7 @@ FILES_c = \
...
@@ -76,6 +76,7 @@ FILES_c = \
debug_trace.c \
debug_trace.c \
debug_util.c \
debug_util.c \
awt_Plugin.c \
awt_Plugin.c \
gnome_interface.c \
gtk2_interface.c \
gtk2_interface.c \
swing_GTKEngine.c \
swing_GTKEngine.c \
swing_GTKStyle.c \
swing_GTKStyle.c \
...
...
makefiles/CompileNativeLibraries.gmk
浏览文件 @
33efe959
#
#
# Copyright (c) 2011, 201
2
, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 201
3
, 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
...
@@ -843,6 +843,7 @@ LIBAWT_XAWT_FILES:=\
...
@@ -843,6 +843,7 @@ LIBAWT_XAWT_FILES:=\
debug_trace.c \
debug_trace.c \
debug_util.c \
debug_util.c \
awt_Plugin.c \
awt_Plugin.c \
gnome_interface.c \
gtk2_interface.c \
gtk2_interface.c \
swing_GTKEngine.c \
swing_GTKEngine.c \
swing_GTKStyle.c \
swing_GTKStyle.c \
...
...
src/solaris/native/sun/awt/gtk2_interface.c
浏览文件 @
33efe959
/*
/*
* Copyright (c) 2005, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
3
, 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
...
@@ -437,6 +437,39 @@ gboolean gtk2_check_version()
...
@@ -437,6 +437,39 @@ gboolean gtk2_check_version()
}
}
}
}
/**
* Functions for awt_Desktop.c
*/
gboolean
gtk2_show_uri_load
()
{
gboolean
success
=
FALSE
;
dlerror
();
const
char
*
gtk_version
=
fp_gtk_check_version
(
2
,
14
,
0
);
if
(
gtk_version
!=
NULL
)
{
// The gtk_show_uri is available from GTK+ 2.14
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"The version of GTK is %s. "
"The gtk_show_uri function is supported "
"since GTK+ 2.14.
\n
"
,
gtk_version
);
#endif
/* INTERNAL_BUILD */
}
else
{
// Loading symbols only if the GTK version is 2.14 and higher
fp_gtk_show_uri
=
dl_symbol
(
"gtk_show_uri"
);
const
char
*
dlsym_error
=
dlerror
();
if
(
dlsym_error
)
{
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"Cannot load symbol: %s
\n
"
,
dlsym_error
);
#endif
/* INTERNAL_BUILD */
}
else
if
(
fp_gtk_show_uri
==
NULL
)
{
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"dlsym(gtk_show_uri) returned NULL
\n
"
);
#endif
/* INTERNAL_BUILD */
}
else
{
success
=
TRUE
;
}
}
return
success
;
}
/**
/**
* Functions for sun_awt_X11_GtkFileDialogPeer.c
* Functions for sun_awt_X11_GtkFileDialogPeer.c
*/
*/
...
...
src/solaris/native/sun/awt/gtk2_interface.h
浏览文件 @
33efe959
/*
/*
* Copyright (c) 2005, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
3
, 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
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
#define GTK_STOCK_CANCEL "gtk-cancel"
#define GTK_STOCK_CANCEL "gtk-cancel"
#define GTK_STOCK_SAVE "gtk-save"
#define GTK_STOCK_SAVE "gtk-save"
#define GTK_STOCK_OPEN "gtk-open"
#define GTK_STOCK_OPEN "gtk-open"
#define GDK_CURRENT_TIME 0L
typedef
enum
_WidgetType
typedef
enum
_WidgetType
{
{
...
@@ -280,6 +281,7 @@ struct _GSList
...
@@ -280,6 +281,7 @@ struct _GSList
typedef
void
GdkColormap
;
typedef
void
GdkColormap
;
typedef
void
GdkDrawable
;
typedef
void
GdkDrawable
;
typedef
void
GdkGC
;
typedef
void
GdkGC
;
typedef
void
GdkScreen
;
typedef
void
GdkPixbuf
;
typedef
void
GdkPixbuf
;
typedef
void
GdkPixmap
;
typedef
void
GdkPixmap
;
typedef
void
GdkWindow
;
typedef
void
GdkWindow
;
...
@@ -663,6 +665,15 @@ gchar* (*fp_gtk_check_version)(guint required_major, guint required_minor,
...
@@ -663,6 +665,15 @@ gchar* (*fp_gtk_check_version)(guint required_major, guint required_minor,
*/
*/
gboolean
gtk2_load
();
gboolean
gtk2_load
();
/*
* Loads fp_gtk_show_uri function pointer. This initialization is
* separated because the function is required only
* for java.awt.Desktop API. The function relies on initialization in
* gtk2_load, so it must be invoked only after a successful gtk2_load
* invocation
*/
gboolean
gtk2_show_uri_load
();
/*
/*
* Unload the gtk2 library. If the library is already unloaded this method has
* Unload the gtk2 library. If the library is already unloaded this method has
* no effect and returns success.
* no effect and returns success.
...
@@ -795,4 +806,7 @@ void (*fp_gdk_threads_init)(void);
...
@@ -795,4 +806,7 @@ void (*fp_gdk_threads_init)(void);
void
(
*
fp_gdk_threads_enter
)(
void
);
void
(
*
fp_gdk_threads_enter
)(
void
);
void
(
*
fp_gdk_threads_leave
)(
void
);
void
(
*
fp_gdk_threads_leave
)(
void
);
gboolean
(
*
fp_gtk_show_uri
)(
GdkScreen
*
screen
,
const
gchar
*
uri
,
guint32
timestamp
,
GError
**
error
);
#endif
/* !_GTK2_INTERFACE_H */
#endif
/* !_GTK2_INTERFACE_H */
src/solaris/native/sun/xawt/awt_Desktop.c
浏览文件 @
33efe959
/*
/*
* Copyright (c) 2005, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
3
, 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
...
@@ -23,71 +23,11 @@
...
@@ -23,71 +23,11 @@
* questions.
* questions.
*/
*/
#include <jni.h>
#include "gtk2_interface.h"
#include <jvm_md.h>
#include "gnome_interface.h"
#include <dlfcn.h>
typedef
int
gboolean
;
static
gboolean
gtk_has_been_loaded
=
FALSE
;
static
gboolean
gnome_has_been_loaded
=
FALSE
;
typedef
gboolean
(
GNOME_URL_SHOW_TYPE
)(
const
char
*
,
void
**
);
typedef
gboolean
(
GNOME_VFS_INIT_TYPE
)(
void
);
GNOME_URL_SHOW_TYPE
*
gnome_url_show
;
GNOME_VFS_INIT_TYPE
*
gnome_vfs_init
;
int
init
(){
void
*
vfs_handle
;
void
*
gnome_handle
;
const
char
*
errmsg
;
vfs_handle
=
dlopen
(
VERSIONED_JNI_LIB_NAME
(
"gnomevfs-2"
,
"0"
),
RTLD_LAZY
);
if
(
vfs_handle
==
NULL
)
{
vfs_handle
=
dlopen
(
JNI_LIB_NAME
(
"gnomevfs-2"
),
RTLD_LAZY
);
if
(
vfs_handle
==
NULL
)
{
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"can not load libgnomevfs-2.so
\n
"
);
#endif
return
0
;
}
}
dlerror
();
/* Clear errors */
gnome_vfs_init
=
(
GNOME_VFS_INIT_TYPE
*
)
dlsym
(
vfs_handle
,
"gnome_vfs_init"
);
if
(
gnome_vfs_init
==
NULL
){
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"dlsym( gnome_vfs_init) returned NULL
\n
"
);
#endif
return
0
;
}
if
((
errmsg
=
dlerror
())
!=
NULL
)
{
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"can not find symbol gnome_vfs_init %s
\n
"
,
errmsg
);
#endif
return
0
;
}
// call gonme_vfs_init()
(
*
gnome_vfs_init
)();
gnome_handle
=
dlopen
(
VERSIONED_JNI_LIB_NAME
(
"gnome-2"
,
"0"
),
RTLD_LAZY
);
if
(
gnome_handle
==
NULL
)
{
gnome_handle
=
dlopen
(
JNI_LIB_NAME
(
"gnome-2"
),
RTLD_LAZY
);
if
(
gnome_handle
==
NULL
)
{
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"can not load libgnome-2.so
\n
"
);
#endif
return
0
;
}
}
dlerror
();
/* Clear errors */
gnome_url_show
=
(
GNOME_URL_SHOW_TYPE
*
)
dlsym
(
gnome_handle
,
"gnome_url_show"
);
if
((
errmsg
=
dlerror
())
!=
NULL
)
{
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"can not find symble gnome_url_show
\n
"
);
#endif
return
0
;
}
return
1
;
}
/*
/*
* Class: sun_awt_X11_XDesktopPeer
* Class: sun_awt_X11_XDesktopPeer
...
@@ -97,8 +37,20 @@ int init(){
...
@@ -97,8 +37,20 @@ int init(){
JNIEXPORT
jboolean
JNICALL
Java_sun_awt_X11_XDesktopPeer_init
JNIEXPORT
jboolean
JNICALL
Java_sun_awt_X11_XDesktopPeer_init
(
JNIEnv
*
env
,
jclass
cls
)
(
JNIEnv
*
env
,
jclass
cls
)
{
{
int
init_ok
=
init
();
return
init_ok
?
JNI_TRUE
:
JNI_FALSE
;
if
(
gtk_has_been_loaded
||
gnome_has_been_loaded
)
{
return
JNI_TRUE
;
}
if
(
gtk2_load
()
&&
gtk2_show_uri_load
())
{
gtk_has_been_loaded
=
TRUE
;
return
JNI_TRUE
;
}
else
if
(
gnome_load
())
{
gnome_has_been_loaded
=
TRUE
;
return
JNI_TRUE
;
}
return
JNI_FALSE
;
}
}
/*
/*
...
@@ -109,16 +61,19 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XDesktopPeer_init
...
@@ -109,16 +61,19 @@ JNIEXPORT jboolean JNICALL Java_sun_awt_X11_XDesktopPeer_init
JNIEXPORT
jboolean
JNICALL
Java_sun_awt_X11_XDesktopPeer_gnome_1url_1show
JNIEXPORT
jboolean
JNICALL
Java_sun_awt_X11_XDesktopPeer_gnome_1url_1show
(
JNIEnv
*
env
,
jobject
obj
,
jbyteArray
url_j
)
(
JNIEnv
*
env
,
jobject
obj
,
jbyteArray
url_j
)
{
{
gboolean
success
;
gboolean
success
=
FALSE
;
const
char
*
url_c
;
const
g
char
*
url_c
;
if
(
gnome_url_show
==
NULL
)
{
url_c
=
(
char
*
)(
*
env
)
->
GetByteArrayElements
(
env
,
url_j
,
NULL
);
return
JNI_FALSE
;
if
(
gtk_has_been_loaded
)
{
fp_gdk_threads_enter
();
success
=
fp_gtk_show_uri
(
NULL
,
url_c
,
GDK_CURRENT_TIME
,
NULL
);
fp_gdk_threads_leave
();
}
else
if
(
gnome_has_been_loaded
)
{
success
=
(
*
gnome_url_show
)(
url_c
,
NULL
);
}
}
url_c
=
(
char
*
)(
*
env
)
->
GetByteArrayElements
(
env
,
url_j
,
NULL
);
// call gnome_url_show(const char* , GError**)
success
=
(
*
gnome_url_show
)(
url_c
,
NULL
);
(
*
env
)
->
ReleaseByteArrayElements
(
env
,
url_j
,
(
signed
char
*
)
url_c
,
0
);
(
*
env
)
->
ReleaseByteArrayElements
(
env
,
url_j
,
(
signed
char
*
)
url_c
,
0
);
return
success
?
JNI_TRUE
:
JNI_FALSE
;
return
success
?
JNI_TRUE
:
JNI_FALSE
;
...
...
src/solaris/native/sun/xawt/gnome_interface.c
0 → 100644
浏览文件 @
33efe959
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "gnome_interface.h"
GNOME_URL_SHOW_TYPE
*
gnome_url_show
=
NULL
;
gboolean
gnome_load
()
{
void
*
vfs_handle
;
void
*
gnome_handle
;
const
char
*
errmsg
;
GNOME_VFS_INIT_TYPE
*
gnome_vfs_init
;
// trying to open the gnomevfs. VERSIONED_JNI_LIB_NAME
// macros formats the library name in a system specific manner
// see jdk/src/solaris/javavm/export/jvm_md.h for more details
vfs_handle
=
dlopen
(
VERSIONED_JNI_LIB_NAME
(
"gnomevfs-2"
,
"0"
),
RTLD_LAZY
);
if
(
vfs_handle
==
NULL
)
{
// if we cannot load the library using a version assumed by JNI
// we are trying to load the library without a version suffix
vfs_handle
=
dlopen
(
JNI_LIB_NAME
(
"gnomevfs-2"
),
RTLD_LAZY
);
if
(
vfs_handle
==
NULL
)
{
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"can not load libgnomevfs-2.so
\n
"
);
#endif
return
FALSE
;
}
}
dlerror
();
/* Clear errors */
gnome_vfs_init
=
(
GNOME_VFS_INIT_TYPE
*
)
dlsym
(
vfs_handle
,
"gnome_vfs_init"
);
if
(
gnome_vfs_init
==
NULL
){
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"dlsym( gnome_vfs_init) returned NULL
\n
"
);
#endif
return
FALSE
;
}
if
((
errmsg
=
dlerror
())
!=
NULL
)
{
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"can not find symbol gnome_vfs_init %s
\n
"
,
errmsg
);
#endif
return
FALSE
;
}
// call gonme_vfs_init()
(
*
gnome_vfs_init
)();
gnome_handle
=
dlopen
(
VERSIONED_JNI_LIB_NAME
(
"gnome-2"
,
"0"
),
RTLD_LAZY
);
if
(
gnome_handle
==
NULL
)
{
gnome_handle
=
dlopen
(
JNI_LIB_NAME
(
"gnome-2"
),
RTLD_LAZY
);
if
(
gnome_handle
==
NULL
)
{
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"can not load libgnome-2.so
\n
"
);
#endif
return
FALSE
;
}
}
dlerror
();
/* Clear errors */
gnome_url_show
=
(
GNOME_URL_SHOW_TYPE
*
)
dlsym
(
gnome_handle
,
"gnome_url_show"
);
if
((
errmsg
=
dlerror
())
!=
NULL
)
{
#ifdef INTERNAL_BUILD
fprintf
(
stderr
,
"can not find symble gnome_url_show
\n
"
);
#endif
return
FALSE
;
}
return
TRUE
;
}
src/solaris/native/sun/xawt/gnome_interface.h
0 → 100644
浏览文件 @
33efe959
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef _GNOME_INTERFACE_H
#define _GNOME_INTERFACE_H
#include "gtk2_interface.h"
#include <dlfcn.h>
#include <jvm_md.h>
#include <jni.h>
typedef
gboolean
(
GNOME_URL_SHOW_TYPE
)(
const
char
*
,
void
**
);
typedef
gboolean
(
GNOME_VFS_INIT_TYPE
)(
void
);
extern
GNOME_URL_SHOW_TYPE
*
gnome_url_show
;
gboolean
gnome_load
();
#endif
/* !_GNOME_INTERFACE_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录