Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
9d72a242
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看板
提交
9d72a242
编写于
3月 08, 2017
作者:
P
psadhukhan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8058316: lookupDefaultPrintService returns null on Solaris 11
Reviewed-by: prr, jdv
上级
2e3ff1bd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
63 addition
and
1 deletion
+63
-1
make/mapfiles/libawt/mapfile-mawt-vers
make/mapfiles/libawt/mapfile-mawt-vers
+1
-0
make/mapfiles/libawt_headless/mapfile-vers
make/mapfiles/libawt_headless/mapfile-vers
+1
-0
make/mapfiles/libawt_xawt/mapfile-vers
make/mapfiles/libawt_xawt/mapfile-vers
+1
-0
src/solaris/classes/sun/print/CUPSPrinter.java
src/solaris/classes/sun/print/CUPSPrinter.java
+11
-1
src/solaris/native/sun/awt/CUPSfuncs.c
src/solaris/native/sun/awt/CUPSfuncs.c
+49
-0
未找到文件。
make/mapfiles/libawt/mapfile-mawt-vers
浏览文件 @
9d72a242
...
...
@@ -201,6 +201,7 @@ SUNWprivate_1.1 {
Java_sun_print_CUPSPrinter_initIDs;
Java_sun_print_CUPSPrinter_getCupsServer;
Java_sun_print_CUPSPrinter_getCupsPort;
Java_sun_print_CUPSPrinter_getCupsDefaultPrinter;
Java_sun_print_CUPSPrinter_canConnect;
Java_sun_print_CUPSPrinter_getMedia;
Java_sun_print_CUPSPrinter_getPageSizes;
...
...
make/mapfiles/libawt_headless/mapfile-vers
浏览文件 @
9d72a242
...
...
@@ -73,6 +73,7 @@ SUNWprivate_1.1 {
Java_sun_print_CUPSPrinter_initIDs;
Java_sun_print_CUPSPrinter_getCupsServer;
Java_sun_print_CUPSPrinter_getCupsPort;
Java_sun_print_CUPSPrinter_getCupsDefaultPrinter;
Java_sun_print_CUPSPrinter_canConnect;
Java_sun_print_CUPSPrinter_getMedia;
Java_sun_print_CUPSPrinter_getPageSizes;
...
...
make/mapfiles/libawt_xawt/mapfile-vers
浏览文件 @
9d72a242
...
...
@@ -439,6 +439,7 @@ SUNWprivate_1.1 {
Java_sun_print_CUPSPrinter_initIDs;
Java_sun_print_CUPSPrinter_getCupsServer;
Java_sun_print_CUPSPrinter_getCupsPort;
Java_sun_print_CUPSPrinter_getCupsDefaultPrinter;
Java_sun_print_CUPSPrinter_canConnect;
Java_sun_print_CUPSPrinter_getMedia;
Java_sun_print_CUPSPrinter_getPageSizes;
...
...
src/solaris/classes/sun/print/CUPSPrinter.java
浏览文件 @
9d72a242
...
...
@@ -51,6 +51,7 @@ public class CUPSPrinter {
private
boolean
initialized
;
private
static
native
String
getCupsServer
();
private
static
native
int
getCupsPort
();
private
static
native
String
getCupsDefaultPrinter
();
private
static
native
boolean
canConnect
(
String
server
,
int
port
);
private
static
native
boolean
initIDs
();
// These functions need to be synchronized as
...
...
@@ -250,6 +251,15 @@ public class CUPSPrinter {
* Returns 2 values - index 0 is printer name, index 1 is the uri.
*/
static
String
[]
getDefaultPrinter
()
{
// Try to get user/lpoptions-defined printer name from CUPS
// if not user-set, then go for server default destination
String
printerInfo
[]
=
new
String
[
2
];
printerInfo
[
0
]
=
getCupsDefaultPrinter
();
if
(
printerInfo
[
0
]
!=
null
)
{
printerInfo
[
1
]
=
null
;
return
printerInfo
.
clone
();
}
try
{
URL
url
=
new
URL
(
"http"
,
getServer
(),
getPort
(),
""
);
final
HttpURLConnection
urlConnection
=
...
...
@@ -285,7 +295,7 @@ public class CUPSPrinter {
attCl
))
{
HashMap
defaultMap
=
null
;
String
[]
printerInfo
=
new
String
[
2
];
InputStream
is
=
urlConnection
.
getInputStream
();
HashMap
[]
responseMap
=
IPPPrintService
.
readIPPResponse
(
is
);
...
...
src/solaris/native/sun/awt/CUPSfuncs.c
浏览文件 @
9d72a242
...
...
@@ -43,6 +43,10 @@ typedef int (*fn_ippPort)(void);
typedef
http_t
*
(
*
fn_httpConnect
)(
const
char
*
,
int
);
typedef
void
(
*
fn_httpClose
)(
http_t
*
);
typedef
char
*
(
*
fn_cupsGetPPD
)(
const
char
*
);
typedef
cups_dest_t
*
(
*
fn_cupsGetDest
)(
const
char
*
name
,
const
char
*
instance
,
int
num_dests
,
cups_dest_t
*
dests
);
typedef
int
(
*
fn_cupsGetDests
)(
cups_dest_t
**
dests
);
typedef
void
(
*
fn_cupsFreeDests
)(
int
num_dests
,
cups_dest_t
*
dests
);
typedef
ppd_file_t
*
(
*
fn_ppdOpenFile
)(
const
char
*
);
typedef
void
(
*
fn_ppdClose
)(
ppd_file_t
*
);
typedef
ppd_option_t
*
(
*
fn_ppdFindOption
)(
ppd_file_t
*
,
const
char
*
);
...
...
@@ -53,6 +57,9 @@ fn_ippPort j2d_ippPort;
fn_httpConnect
j2d_httpConnect
;
fn_httpClose
j2d_httpClose
;
fn_cupsGetPPD
j2d_cupsGetPPD
;
fn_cupsGetDest
j2d_cupsGetDest
;
fn_cupsGetDests
j2d_cupsGetDests
;
fn_cupsFreeDests
j2d_cupsFreeDests
;
fn_ppdOpenFile
j2d_ppdOpenFile
;
fn_ppdClose
j2d_ppdClose
;
fn_ppdFindOption
j2d_ppdFindOption
;
...
...
@@ -106,6 +113,24 @@ Java_sun_print_CUPSPrinter_initIDs(JNIEnv *env,
return
JNI_FALSE
;
}
j2d_cupsGetDest
=
(
fn_cupsGetDest
)
dlsym
(
handle
,
"cupsGetDest"
);
if
(
j2d_cupsGetDest
==
NULL
)
{
dlclose
(
handle
);
return
JNI_FALSE
;
}
j2d_cupsGetDests
=
(
fn_cupsGetDests
)
dlsym
(
handle
,
"cupsGetDests"
);
if
(
j2d_cupsGetDests
==
NULL
)
{
dlclose
(
handle
);
return
JNI_FALSE
;
}
j2d_cupsFreeDests
=
(
fn_cupsFreeDests
)
dlsym
(
handle
,
"cupsFreeDests"
);
if
(
j2d_cupsFreeDests
==
NULL
)
{
dlclose
(
handle
);
return
JNI_FALSE
;
}
j2d_ppdOpenFile
=
(
fn_ppdOpenFile
)
dlsym
(
handle
,
"ppdOpenFile"
);
if
(
j2d_ppdOpenFile
==
NULL
)
{
dlclose
(
handle
);
...
...
@@ -169,6 +194,30 @@ Java_sun_print_CUPSPrinter_getCupsPort(JNIEnv *env,
}
/*
* Gets CUPS default printer name.
*
*/
JNIEXPORT
jstring
JNICALL
Java_sun_print_CUPSPrinter_getCupsDefaultPrinter
(
JNIEnv
*
env
,
jobject
printObj
)
{
jstring
cDefPrinter
=
NULL
;
cups_dest_t
*
dests
;
char
*
defaultPrinter
=
NULL
;
int
num_dests
=
j2d_cupsGetDests
(
&
dests
);
int
i
=
0
;
cups_dest_t
*
dest
=
j2d_cupsGetDest
(
NULL
,
NULL
,
num_dests
,
dests
);
if
(
dest
!=
NULL
)
{
defaultPrinter
=
dest
->
name
;
if
(
defaultPrinter
!=
NULL
)
{
cDefPrinter
=
JNU_NewStringPlatform
(
env
,
defaultPrinter
);
}
}
j2d_cupsFreeDests
(
num_dests
,
dests
);
return
cDefPrinter
;
}
/*
* Checks if connection can be made to the server.
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录