Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
cf5bad0e
Commit
cf5bad0e
authored
Oct 25, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
configure: Disable sane.ds if the Unix library is missing.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
80a30625
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
101 additions
and
312 deletions
+101
-312
configure
configure
+14
-31
configure.ac
configure.ac
+3
-3
Makefile.in
dlls/sane.ds/Makefile.in
+1
-0
capability.c
dlls/sane.ds/capability.c
+5
-29
ds_ctrl.c
dlls/sane.ds/ds_ctrl.c
+6
-24
ds_image.c
dlls/sane.ds/ds_image.c
+28
-52
options.c
dlls/sane.ds/options.c
+12
-14
sane_i.h
dlls/sane.ds/sane_i.h
+4
-28
sane_main.c
dlls/sane.ds/sane_main.c
+7
-96
ui.c
dlls/sane.ds/ui.c
+21
-32
config.h.in
include/config.h.in
+0
-3
No files found.
configure
View file @
cf5bad0e
...
@@ -13313,14 +13313,14 @@ ac_save_CPPFLAGS=$CPPFLAGS
...
@@ -13313,14 +13313,14 @@ ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS
=
"
$CPPFLAGS
$SANE_CFLAGS
"
CPPFLAGS
=
"
$CPPFLAGS
$SANE_CFLAGS
"
ac_fn_c_check_header_mongrel
"
$LINENO
"
"sane/sane.h"
"ac_cv_header_sane_sane_h"
"
$ac_includes_default
"
ac_fn_c_check_header_mongrel
"
$LINENO
"
"sane/sane.h"
"ac_cv_header_sane_sane_h"
"
$ac_includes_default
"
if
test
"x
$ac_cv_header_sane_sane_h
"
=
xyes
;
then
:
if
test
"x
$ac_cv_header_sane_sane_h
"
=
xyes
;
then
:
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for -lsane"
>
&5
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for
sane_init in
-lsane"
>
&5
$as_echo_n
"checking for -lsane... "
>
&6
;
}
$as_echo_n
"checking for
sane_init in
-lsane... "
>
&6
;
}
if
${
ac_cv_lib_s
oname_sane
+
:
}
false
;
then
:
if
${
ac_cv_lib_s
ane_sane_init
+
:
}
false
;
then
:
$as_echo_n
"(cached) "
>
&6
$as_echo_n
"(cached) "
>
&6
else
else
ac_check_
soname
_save_LIBS
=
$LIBS
ac_check_
lib
_save_LIBS
=
$LIBS
LIBS
=
"-lsane
$SANE_LIBS
$LIBS
"
LIBS
=
"-lsane
$SANE_LIBS
$LIBS
"
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
cat
confdefs.h -
<<
_ACEOF
>conftest.
$ac_ext
/* end confdefs.h. */
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
/* Override any GCC internal prototype to avoid an error.
...
@@ -13339,37 +13339,20 @@ return sane_init ();
...
@@ -13339,37 +13339,20 @@ return sane_init ();
}
}
_ACEOF
_ACEOF
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
if
ac_fn_c_try_link
"
$LINENO
"
;
then
:
case
"
$LIBEXT
"
in
ac_cv_lib_sane_sane_init
=
yes
dll
)
ac_cv_lib_soname_sane
=
`
$ac_cv_path_LDD
conftest.exe |
grep
"sane"
|
sed
-e
"s/dll.*/dll/"
';2,$d'
`
;;
dylib
)
ac_cv_lib_soname_sane
=
`
$OTOOL
-L
conftest
$ac_exeext
|
grep
"libsane
\\
.[0-9A-Za-z.]*dylib"
|
sed
-e
"s/^.*
\/\(
libsane
\.
[0-9A-Za-z.]*dylib
\)
.*
$/
\1
/"
';2,$d'
`
;;
*
)
ac_cv_lib_soname_sane
=
`
$READELF
-d
conftest
$ac_exeext
|
grep
"NEEDED.*libsane
\\
.
$LIBEXT
"
|
sed
-e
"s/^.*
\\
[
\\
(libsane
\\
.
$LIBEXT
[^ ]*
\\
)
\\
].*
$/
\1
/"
';2,$d'
`
if
${
ac_cv_lib_soname_sane
:+false
}
:
;
then
:
ac_cv_lib_soname_sane
=
`
$LDD
conftest
$ac_exeext
|
grep
"libsane
\\
.
$LIBEXT
"
|
sed
-e
"s/^.*
\(
libsane
\.
$LIBEXT
[^ ]*
\)
.*
$/
\1
/"
';2,$d'
`
fi
;;
esac
else
else
ac_cv_lib_s
oname_sane
=
ac_cv_lib_s
ane_sane_init
=
no
fi
fi
rm
-f
core conftest.err conftest.
$ac_objext
\
rm
-f
core conftest.err conftest.
$ac_objext
\
conftest
$ac_exeext
conftest.
$ac_ext
conftest
$ac_exeext
conftest.
$ac_ext
LIBS
=
$ac_check_soname
_save_LIBS
LIBS
=
$ac_check_lib
_save_LIBS
fi
fi
if
${
ac_cv_lib_soname_sane
:+false
}
:
;
then
:
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_sane_sane_init
"
>
&5
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result: not found"
>
&5
$as_echo
"
$ac_cv_lib_sane_sane_init
"
>
&6
;
}
$as_echo
"not found"
>
&6
;
}
if
test
"x
$ac_cv_lib_sane_sane_init
"
=
xyes
;
then
:
SANE_CFLAGS
=
""
:
else
{
$as_echo
"
$as_me
:
${
as_lineno
-
$LINENO
}
: result:
$ac_cv_lib_soname_sane
"
>
&5
$as_echo
"
$ac_cv_lib_soname_sane
"
>
&6
;
}
cat
>>
confdefs.h
<<
_ACEOF
#define SONAME_LIBSANE "
$ac_cv_lib_soname_sane
"
_ACEOF
fi
fi
else
SANE_CFLAGS
=
""
fi
fi
...
@@ -13383,7 +13366,7 @@ if test "x$ac_cv_lib_soname_sane" = "x"; then :
...
@@ -13383,7 +13366,7 @@ if test "x$ac_cv_lib_soname_sane" = "x"; then :
*
)
as_fn_error
$?
"libsane
${
notice_platform
}
development files not found, scanners won't be supported.
*
)
as_fn_error
$?
"libsane
${
notice_platform
}
development files not found, scanners won't be supported.
This is an error since --with-sane was requested."
"
$LINENO
"
5
;;
This is an error since --with-sane was requested."
"
$LINENO
"
5
;;
esac
esac
enable_sane_ds
=
${
enable_sane_ds
:-
no
}
fi
fi
if
test
"x
$with_usb
"
!=
"xno"
if
test
"x
$with_usb
"
!=
"xno"
...
...
configure.ac
View file @
cf5bad0e
...
@@ -1347,11 +1347,11 @@ if test "x$with_sane" != "xno"
...
@@ -1347,11 +1347,11 @@ if test "x$with_sane" != "xno"
then
then
WINE_PACKAGE_FLAGS(SANE,[sane-backends],,[`${SANE_CONFIG:-sane-config} --cflags 2>/dev/null`],[`${SANE_CONFIG:-sane-config} --ldflags 2>/dev/null`],
WINE_PACKAGE_FLAGS(SANE,[sane-backends],,[`${SANE_CONFIG:-sane-config} --cflags 2>/dev/null`],[`${SANE_CONFIG:-sane-config} --ldflags 2>/dev/null`],
[AC_CHECK_HEADER(sane/sane.h,
[AC_CHECK_HEADER(sane/sane.h,
[WINE_CHECK_SONAME(sane,sane_init,,[SANE_CFLAGS=""],[$SANE_LIBS])],
[AC_CHECK_LIB(sane,sane_init,[:],,[$SANE_LIBS])])])
[SANE_CFLAGS=""])])
fi
fi
WINE_NOTICE_WITH(sane,[test "x$ac_cv_lib_soname_sane" = "x"],
WINE_NOTICE_WITH(sane,[test "x$ac_cv_lib_soname_sane" = "x"],
[libsane ${notice_platform}development files not found, scanners won't be supported.])
[libsane ${notice_platform}development files not found, scanners won't be supported.],
[enable_sane_ds])
dnl **** Check for libusb ****
dnl **** Check for libusb ****
if test "x$with_usb" != "xno"
if test "x$with_usb" != "xno"
...
...
dlls/sane.ds/Makefile.in
View file @
cf5bad0e
MODULE
=
sane.ds
MODULE
=
sane.ds
IMPORTS
=
comctl32 user32 gdi32
IMPORTS
=
comctl32 user32 gdi32
EXTRALIBS
=
$(SANE_LIBS)
EXTRAINCL
=
$(SANE_CFLAGS)
EXTRAINCL
=
$(SANE_CFLAGS)
EXTRADLLFLAGS
=
-mcygwin
EXTRADLLFLAGS
=
-mcygwin
...
...
dlls/sane.ds/capability.c
View file @
cf5bad0e
...
@@ -129,7 +129,6 @@ static TW_UINT16 msg_get_enum(pTW_CAPABILITY pCapability, const TW_UINT32 *value
...
@@ -129,7 +129,6 @@ static TW_UINT16 msg_get_enum(pTW_CAPABILITY pCapability, const TW_UINT32 *value
return
TWCC_SUCCESS
;
return
TWCC_SUCCESS
;
}
}
#ifdef SONAME_LIBSANE
static
TW_UINT16
msg_get_range
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
type
,
static
TW_UINT16
msg_get_range
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
type
,
TW_UINT32
minval
,
TW_UINT32
maxval
,
TW_UINT32
step
,
TW_UINT32
def
,
TW_UINT32
current
)
TW_UINT32
minval
,
TW_UINT32
maxval
,
TW_UINT32
step
,
TW_UINT32
def
,
TW_UINT32
current
)
{
{
...
@@ -155,7 +154,6 @@ static TW_UINT16 msg_get_range(pTW_CAPABILITY pCapability, TW_UINT16 type,
...
@@ -155,7 +154,6 @@ static TW_UINT16 msg_get_range(pTW_CAPABILITY pCapability, TW_UINT16 type,
GlobalUnlock
(
pCapability
->
hContainer
);
GlobalUnlock
(
pCapability
->
hContainer
);
return
TWCC_SUCCESS
;
return
TWCC_SUCCESS
;
}
}
#endif
static
TW_UINT16
TWAIN_GetSupportedCaps
(
pTW_CAPABILITY
pCapability
)
static
TW_UINT16
TWAIN_GetSupportedCaps
(
pTW_CAPABILITY
pCapability
)
{
{
...
@@ -273,7 +271,6 @@ static TW_UINT16 SANE_CAPXferCount (pTW_CAPABILITY pCapability, TW_UINT16 action
...
@@ -273,7 +271,6 @@ static TW_UINT16 SANE_CAPXferCount (pTW_CAPABILITY pCapability, TW_UINT16 action
return
twCC
;
return
twCC
;
}
}
#ifdef SONAME_LIBSANE
static
BOOL
pixeltype_to_sane_mode
(
TW_UINT16
pixeltype
,
SANE_String
mode
,
int
len
)
static
BOOL
pixeltype_to_sane_mode
(
TW_UINT16
pixeltype
,
SANE_String
mode
,
int
len
)
{
{
SANE_String_Const
m
=
NULL
;
SANE_String_Const
m
=
NULL
;
...
@@ -309,13 +306,11 @@ static BOOL sane_mode_to_pixeltype(SANE_String_Const mode, TW_UINT16 *pixeltype)
...
@@ -309,13 +306,11 @@ static BOOL sane_mode_to_pixeltype(SANE_String_Const mode, TW_UINT16 *pixeltype)
return
TRUE
;
return
TRUE
;
}
}
#endif
/* ICAP_PIXELTYPE */
/* ICAP_PIXELTYPE */
static
TW_UINT16
SANE_ICAPPixelType
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
static
TW_UINT16
SANE_ICAPPixelType
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
{
{
TW_UINT16
twCC
=
TWCC_BADCAP
;
TW_UINT16
twCC
=
TWCC_BADCAP
;
#ifdef SONAME_LIBSANE
TW_UINT32
possible_values
[
3
];
TW_UINT32
possible_values
[
3
];
int
possible_value_count
;
int
possible_value_count
;
TW_UINT32
val
;
TW_UINT32
val
;
...
@@ -382,7 +377,7 @@ static TW_UINT16 SANE_ICAPPixelType (pTW_CAPABILITY pCapability, TW_UINT16 actio
...
@@ -382,7 +377,7 @@ static TW_UINT16 SANE_ICAPPixelType (pTW_CAPABILITY pCapability, TW_UINT16 actio
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
return
sane_status_to_twcc
(
rc
);
return
sane_status_to_twcc
(
rc
);
if
(
status
&
SANE_INFO_RELOAD_PARAMS
)
if
(
status
&
SANE_INFO_RELOAD_PARAMS
)
p
sane_get_parameters
(
activeDS
.
deviceHandle
,
&
activeDS
.
sane_param
);
sane_get_parameters
(
activeDS
.
deviceHandle
,
&
activeDS
.
sane_param
);
}
}
break
;
break
;
...
@@ -406,7 +401,7 @@ static TW_UINT16 SANE_ICAPPixelType (pTW_CAPABILITY pCapability, TW_UINT16 actio
...
@@ -406,7 +401,7 @@ static TW_UINT16 SANE_ICAPPixelType (pTW_CAPABILITY pCapability, TW_UINT16 actio
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
return
sane_status_to_twcc
(
rc
);
return
sane_status_to_twcc
(
rc
);
if
(
status
&
SANE_INFO_RELOAD_PARAMS
)
if
(
status
&
SANE_INFO_RELOAD_PARAMS
)
p
sane_get_parameters
(
activeDS
.
deviceHandle
,
&
activeDS
.
sane_param
);
sane_get_parameters
(
activeDS
.
deviceHandle
,
&
activeDS
.
sane_param
);
/* .. fall through intentional .. */
/* .. fall through intentional .. */
...
@@ -416,7 +411,6 @@ static TW_UINT16 SANE_ICAPPixelType (pTW_CAPABILITY pCapability, TW_UINT16 actio
...
@@ -416,7 +411,6 @@ static TW_UINT16 SANE_ICAPPixelType (pTW_CAPABILITY pCapability, TW_UINT16 actio
break
;
break
;
}
}
#endif
return
twCC
;
return
twCC
;
}
}
...
@@ -467,7 +461,6 @@ static TW_UINT16 SANE_ICAPUnits (pTW_CAPABILITY pCapability, TW_UINT16 action)
...
@@ -467,7 +461,6 @@ static TW_UINT16 SANE_ICAPUnits (pTW_CAPABILITY pCapability, TW_UINT16 action)
static
TW_UINT16
SANE_ICAPBitDepth
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
static
TW_UINT16
SANE_ICAPBitDepth
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
{
{
TW_UINT16
twCC
=
TWCC_BADCAP
;
TW_UINT16
twCC
=
TWCC_BADCAP
;
#ifdef SONAME_LIBSANE
TW_UINT32
possible_values
[
1
];
TW_UINT32
possible_values
[
1
];
TRACE
(
"ICAP_BITDEPTH
\n
"
);
TRACE
(
"ICAP_BITDEPTH
\n
"
);
...
@@ -494,7 +487,6 @@ static TW_UINT16 SANE_ICAPBitDepth(pTW_CAPABILITY pCapability, TW_UINT16 action)
...
@@ -494,7 +487,6 @@ static TW_UINT16 SANE_ICAPBitDepth(pTW_CAPABILITY pCapability, TW_UINT16 action)
twCC
=
set_onevalue
(
pCapability
,
TWTY_UINT16
,
activeDS
.
sane_param
.
depth
);
twCC
=
set_onevalue
(
pCapability
,
TWTY_UINT16
,
activeDS
.
sane_param
.
depth
);
break
;
break
;
}
}
#endif
return
twCC
;
return
twCC
;
}
}
...
@@ -565,7 +557,6 @@ static TW_UINT16 SANE_ICAPCompression (pTW_CAPABILITY pCapability, TW_UINT16 act
...
@@ -565,7 +557,6 @@ static TW_UINT16 SANE_ICAPCompression (pTW_CAPABILITY pCapability, TW_UINT16 act
static
TW_UINT16
SANE_ICAPResolution
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
,
TW_UINT16
cap
)
static
TW_UINT16
SANE_ICAPResolution
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
,
TW_UINT16
cap
)
{
{
TW_UINT16
twCC
=
TWCC_BADCAP
;
TW_UINT16
twCC
=
TWCC_BADCAP
;
#ifdef SONAME_LIBSANE
TW_UINT32
val
;
TW_UINT32
val
;
SANE_Int
current_resolution
;
SANE_Int
current_resolution
;
TW_FIX32
*
default_res
;
TW_FIX32
*
default_res
;
...
@@ -659,7 +650,6 @@ static TW_UINT16 SANE_ICAPResolution (pTW_CAPABILITY pCapability, TW_UINT16 acti
...
@@ -659,7 +650,6 @@ static TW_UINT16 SANE_ICAPResolution (pTW_CAPABILITY pCapability, TW_UINT16 acti
twCC
=
set_onevalue
(
pCapability
,
TWTY_FIX32
,
current_resolution
);
twCC
=
set_onevalue
(
pCapability
,
TWTY_FIX32
,
current_resolution
);
break
;
break
;
}
}
#endif
return
twCC
;
return
twCC
;
}
}
...
@@ -667,7 +657,6 @@ static TW_UINT16 SANE_ICAPResolution (pTW_CAPABILITY pCapability, TW_UINT16 acti
...
@@ -667,7 +657,6 @@ static TW_UINT16 SANE_ICAPResolution (pTW_CAPABILITY pCapability, TW_UINT16 acti
static
TW_UINT16
SANE_ICAPPhysical
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
,
TW_UINT16
cap
)
static
TW_UINT16
SANE_ICAPPhysical
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
,
TW_UINT16
cap
)
{
{
TW_UINT16
twCC
=
TWCC_BADCAP
;
TW_UINT16
twCC
=
TWCC_BADCAP
;
#ifdef SONAME_LIBSANE
TW_FIX32
res
;
TW_FIX32
res
;
char
option_name
[
64
];
char
option_name
[
64
];
SANE_Fixed
lower
,
upper
;
SANE_Fixed
lower
,
upper
;
...
@@ -708,7 +697,6 @@ static TW_UINT16 SANE_ICAPPhysical (pTW_CAPABILITY pCapability, TW_UINT16 action
...
@@ -708,7 +697,6 @@ static TW_UINT16 SANE_ICAPPhysical (pTW_CAPABILITY pCapability, TW_UINT16 action
twCC
=
set_onevalue
(
pCapability
,
TWTY_FIX32
,
res
.
Whole
|
(
res
.
Frac
<<
16
));
twCC
=
set_onevalue
(
pCapability
,
TWTY_FIX32
,
res
.
Whole
|
(
res
.
Frac
<<
16
));
break
;
break
;
}
}
#endif
return
twCC
;
return
twCC
;
}
}
...
@@ -716,7 +704,6 @@ static TW_UINT16 SANE_ICAPPhysical (pTW_CAPABILITY pCapability, TW_UINT16 action
...
@@ -716,7 +704,6 @@ static TW_UINT16 SANE_ICAPPhysical (pTW_CAPABILITY pCapability, TW_UINT16 action
static
TW_UINT16
SANE_ICAPPixelFlavor
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
static
TW_UINT16
SANE_ICAPPixelFlavor
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
{
{
TW_UINT16
twCC
=
TWCC_BADCAP
;
TW_UINT16
twCC
=
TWCC_BADCAP
;
#ifdef SONAME_LIBSANE
static
const
TW_UINT32
possible_values
[]
=
{
TWPF_CHOCOLATE
,
TWPF_VANILLA
};
static
const
TW_UINT32
possible_values
[]
=
{
TWPF_CHOCOLATE
,
TWPF_VANILLA
};
TW_UINT32
val
;
TW_UINT32
val
;
TW_UINT32
flavor
=
activeDS
.
sane_param
.
depth
==
1
?
TWPF_VANILLA
:
TWPF_CHOCOLATE
;
TW_UINT32
flavor
=
activeDS
.
sane_param
.
depth
==
1
?
TWPF_VANILLA
:
TWPF_CHOCOLATE
;
...
@@ -754,11 +741,9 @@ static TW_UINT16 SANE_ICAPPixelFlavor (pTW_CAPABILITY pCapability, TW_UINT16 act
...
@@ -754,11 +741,9 @@ static TW_UINT16 SANE_ICAPPixelFlavor (pTW_CAPABILITY pCapability, TW_UINT16 act
twCC
=
set_onevalue
(
pCapability
,
TWTY_UINT16
,
flavor
);
twCC
=
set_onevalue
(
pCapability
,
TWTY_UINT16
,
flavor
);
break
;
break
;
}
}
#endif
return
twCC
;
return
twCC
;
}
}
#ifdef SONAME_LIBSANE
static
TW_UINT16
get_width_height
(
double
*
width
,
double
*
height
,
BOOL
max
)
static
TW_UINT16
get_width_height
(
double
*
width
,
double
*
height
,
BOOL
max
)
{
{
SANE_Status
status
;
SANE_Status
status
;
...
@@ -911,13 +896,11 @@ static TW_UINT16 get_current_paper_size(const supported_size_t *s, int n)
...
@@ -911,13 +896,11 @@ static TW_UINT16 get_current_paper_size(const supported_size_t *s, int n)
return
TWSS_NONE
;
return
TWSS_NONE
;
}
}
#endif
/* ICAP_SUPPORTEDSIZES */
/* ICAP_SUPPORTEDSIZES */
static
TW_UINT16
SANE_ICAPSupportedSizes
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
static
TW_UINT16
SANE_ICAPSupportedSizes
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
{
{
TW_UINT16
twCC
=
TWCC_BADCAP
;
TW_UINT16
twCC
=
TWCC_BADCAP
;
#ifdef SONAME_LIBSANE
static
TW_UINT32
possible_values
[
ARRAY_SIZE
(
supported_sizes
)];
static
TW_UINT32
possible_values
[
ARRAY_SIZE
(
supported_sizes
)];
unsigned
int
i
;
unsigned
int
i
;
...
@@ -975,7 +958,6 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16
...
@@ -975,7 +958,6 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16
break
;
break
;
}
}
#endif
return
twCC
;
return
twCC
;
}
}
...
@@ -983,7 +965,6 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16
...
@@ -983,7 +965,6 @@ static TW_UINT16 SANE_ICAPSupportedSizes (pTW_CAPABILITY pCapability, TW_UINT16
static
TW_UINT16
SANE_CAPAutofeed
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
static
TW_UINT16
SANE_CAPAutofeed
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
{
{
TW_UINT16
twCC
=
TWCC_BADCAP
;
TW_UINT16
twCC
=
TWCC_BADCAP
;
#ifdef SONAME_LIBSANE
TW_UINT32
val
;
TW_UINT32
val
;
SANE_Bool
autofeed
;
SANE_Bool
autofeed
;
SANE_Status
status
;
SANE_Status
status
;
...
@@ -1016,7 +997,7 @@ static TW_UINT16 SANE_CAPAutofeed (pTW_CAPABILITY pCapability, TW_UINT16 action)
...
@@ -1016,7 +997,7 @@ static TW_UINT16 SANE_CAPAutofeed (pTW_CAPABILITY pCapability, TW_UINT16 action)
status
=
sane_option_set_bool
(
activeDS
.
deviceHandle
,
"batch-scan"
,
autofeed
,
NULL
);
status
=
sane_option_set_bool
(
activeDS
.
deviceHandle
,
"batch-scan"
,
autofeed
,
NULL
);
if
(
status
!=
SANE_STATUS_GOOD
)
if
(
status
!=
SANE_STATUS_GOOD
)
{
{
ERR
(
"Error %s: Could not set batch-scan to %d
\n
"
,
p
sane_strstatus
(
status
),
autofeed
);
ERR
(
"Error %s: Could not set batch-scan to %d
\n
"
,
sane_strstatus
(
status
),
autofeed
);
return
sane_status_to_twcc
(
status
);
return
sane_status_to_twcc
(
status
);
}
}
}
}
...
@@ -1031,7 +1012,7 @@ static TW_UINT16 SANE_CAPAutofeed (pTW_CAPABILITY pCapability, TW_UINT16 action)
...
@@ -1031,7 +1012,7 @@ static TW_UINT16 SANE_CAPAutofeed (pTW_CAPABILITY pCapability, TW_UINT16 action)
status
=
sane_option_set_bool
(
activeDS
.
deviceHandle
,
"batch-scan"
,
autofeed
,
NULL
);
status
=
sane_option_set_bool
(
activeDS
.
deviceHandle
,
"batch-scan"
,
autofeed
,
NULL
);
if
(
status
!=
SANE_STATUS_GOOD
)
if
(
status
!=
SANE_STATUS_GOOD
)
{
{
ERR
(
"Error %s: Could not reset batch-scan to SANE_TRUE
\n
"
,
p
sane_strstatus
(
status
));
ERR
(
"Error %s: Could not reset batch-scan to SANE_TRUE
\n
"
,
sane_strstatus
(
status
));
return
sane_status_to_twcc
(
status
);
return
sane_status_to_twcc
(
status
);
}
}
/* .. fall through intentional .. */
/* .. fall through intentional .. */
...
@@ -1040,7 +1021,6 @@ static TW_UINT16 SANE_CAPAutofeed (pTW_CAPABILITY pCapability, TW_UINT16 action)
...
@@ -1040,7 +1021,6 @@ static TW_UINT16 SANE_CAPAutofeed (pTW_CAPABILITY pCapability, TW_UINT16 action)
twCC
=
set_onevalue
(
pCapability
,
TWTY_BOOL
,
autofeed
);
twCC
=
set_onevalue
(
pCapability
,
TWTY_BOOL
,
autofeed
);
break
;
break
;
}
}
#endif
return
twCC
;
return
twCC
;
}
}
...
@@ -1048,7 +1028,6 @@ static TW_UINT16 SANE_CAPAutofeed (pTW_CAPABILITY pCapability, TW_UINT16 action)
...
@@ -1048,7 +1028,6 @@ static TW_UINT16 SANE_CAPAutofeed (pTW_CAPABILITY pCapability, TW_UINT16 action)
static
TW_UINT16
SANE_CAPFeederEnabled
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
static
TW_UINT16
SANE_CAPFeederEnabled
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
{
{
TW_UINT16
twCC
=
TWCC_BADCAP
;
TW_UINT16
twCC
=
TWCC_BADCAP
;
#ifdef SONAME_LIBSANE
TW_UINT32
val
;
TW_UINT32
val
;
TW_BOOL
enabled
;
TW_BOOL
enabled
;
SANE_Status
status
;
SANE_Status
status
;
...
@@ -1088,7 +1067,7 @@ static TW_UINT16 SANE_CAPFeederEnabled (pTW_CAPABILITY pCapability, TW_UINT16 ac
...
@@ -1088,7 +1067,7 @@ static TW_UINT16 SANE_CAPFeederEnabled (pTW_CAPABILITY pCapability, TW_UINT16 ac
}
}
if
(
status
!=
SANE_STATUS_GOOD
)
if
(
status
!=
SANE_STATUS_GOOD
)
{
{
ERR
(
"Error %s: Could not set source to either ADF or Auto
\n
"
,
p
sane_strstatus
(
status
));
ERR
(
"Error %s: Could not set source to either ADF or Auto
\n
"
,
sane_strstatus
(
status
));
return
sane_status_to_twcc
(
status
);
return
sane_status_to_twcc
(
status
);
}
}
}
}
...
@@ -1108,7 +1087,6 @@ static TW_UINT16 SANE_CAPFeederEnabled (pTW_CAPABILITY pCapability, TW_UINT16 ac
...
@@ -1108,7 +1087,6 @@ static TW_UINT16 SANE_CAPFeederEnabled (pTW_CAPABILITY pCapability, TW_UINT16 ac
twCC
=
set_onevalue
(
pCapability
,
TWTY_BOOL
,
enabled
);
twCC
=
set_onevalue
(
pCapability
,
TWTY_BOOL
,
enabled
);
break
;
break
;
}
}
#endif
return
twCC
;
return
twCC
;
}
}
...
@@ -1210,7 +1188,6 @@ TW_UINT16 SANE_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action)
...
@@ -1210,7 +1188,6 @@ TW_UINT16 SANE_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action)
return
twCC
;
return
twCC
;
}
}
#ifdef SONAME_LIBSANE
TW_UINT16
SANE_SaneSetDefaults
(
void
)
TW_UINT16
SANE_SaneSetDefaults
(
void
)
{
{
TW_CAPABILITY
cap
;
TW_CAPABILITY
cap
;
...
@@ -1238,4 +1215,3 @@ TW_UINT16 SANE_SaneSetDefaults (void)
...
@@ -1238,4 +1215,3 @@ TW_UINT16 SANE_SaneSetDefaults (void)
return
TWCC_SUCCESS
;
return
TWCC_SUCCESS
;
}
}
#endif
dlls/sane.ds/ds_ctrl.c
View file @
cf5bad0e
...
@@ -199,9 +199,6 @@ TW_UINT16 SANE_ProcessEvent (pTW_IDENTITY pOrigin,
...
@@ -199,9 +199,6 @@ TW_UINT16 SANE_ProcessEvent (pTW_IDENTITY pOrigin,
TW_UINT16
SANE_PendingXfersEndXfer
(
pTW_IDENTITY
pOrigin
,
TW_UINT16
SANE_PendingXfersEndXfer
(
pTW_IDENTITY
pOrigin
,
TW_MEMREF
pData
)
TW_MEMREF
pData
)
{
{
#ifndef SONAME_LIBSANE
return
TWRC_FAILURE
;
#else
TW_UINT16
twRC
=
TWRC_SUCCESS
;
TW_UINT16
twRC
=
TWRC_SUCCESS
;
pTW_PENDINGXFERS
pPendingXfers
=
(
pTW_PENDINGXFERS
)
pData
;
pTW_PENDINGXFERS
pPendingXfers
=
(
pTW_PENDINGXFERS
)
pData
;
SANE_Status
status
;
SANE_Status
status
;
...
@@ -219,10 +216,10 @@ TW_UINT16 SANE_PendingXfersEndXfer (pTW_IDENTITY pOrigin,
...
@@ -219,10 +216,10 @@ TW_UINT16 SANE_PendingXfersEndXfer (pTW_IDENTITY pOrigin,
activeDS
.
currentState
=
6
;
activeDS
.
currentState
=
6
;
if
(
!
activeDS
.
sane_started
)
if
(
!
activeDS
.
sane_started
)
{
{
status
=
p
sane_start
(
activeDS
.
deviceHandle
);
status
=
sane_start
(
activeDS
.
deviceHandle
);
if
(
status
!=
SANE_STATUS_GOOD
)
if
(
status
!=
SANE_STATUS_GOOD
)
{
{
TRACE
(
"PENDINGXFERS/MSG_ENDXFER sane_start returns %s
\n
"
,
p
sane_strstatus
(
status
));
TRACE
(
"PENDINGXFERS/MSG_ENDXFER sane_start returns %s
\n
"
,
sane_strstatus
(
status
));
pPendingXfers
->
Count
=
0
;
pPendingXfers
->
Count
=
0
;
activeDS
.
currentState
=
5
;
activeDS
.
currentState
=
5
;
/* Notify the application that it can close the data source */
/* Notify the application that it can close the data source */
...
@@ -236,16 +233,12 @@ TW_UINT16 SANE_PendingXfersEndXfer (pTW_IDENTITY pOrigin,
...
@@ -236,16 +233,12 @@ TW_UINT16 SANE_PendingXfersEndXfer (pTW_IDENTITY pOrigin,
}
}
return
twRC
;
return
twRC
;
#endif
}
}
/* DG_CONTROL/DAT_PENDINGXFERS/MSG_GET */
/* DG_CONTROL/DAT_PENDINGXFERS/MSG_GET */
TW_UINT16
SANE_PendingXfersGet
(
pTW_IDENTITY
pOrigin
,
TW_UINT16
SANE_PendingXfersGet
(
pTW_IDENTITY
pOrigin
,
TW_MEMREF
pData
)
TW_MEMREF
pData
)
{
{
#ifndef SONAME_LIBSANE
return
TWRC_FAILURE
;
#else
TW_UINT16
twRC
=
TWRC_SUCCESS
;
TW_UINT16
twRC
=
TWRC_SUCCESS
;
pTW_PENDINGXFERS
pPendingXfers
=
(
pTW_PENDINGXFERS
)
pData
;
pTW_PENDINGXFERS
pPendingXfers
=
(
pTW_PENDINGXFERS
)
pData
;
SANE_Status
status
;
SANE_Status
status
;
...
@@ -262,10 +255,10 @@ TW_UINT16 SANE_PendingXfersGet (pTW_IDENTITY pOrigin,
...
@@ -262,10 +255,10 @@ TW_UINT16 SANE_PendingXfersGet (pTW_IDENTITY pOrigin,
pPendingXfers
->
Count
=
-
1
;
pPendingXfers
->
Count
=
-
1
;
if
(
!
activeDS
.
sane_started
)
if
(
!
activeDS
.
sane_started
)
{
{
status
=
p
sane_start
(
activeDS
.
deviceHandle
);
status
=
sane_start
(
activeDS
.
deviceHandle
);
if
(
status
!=
SANE_STATUS_GOOD
)
if
(
status
!=
SANE_STATUS_GOOD
)
{
{
TRACE
(
"PENDINGXFERS/MSG_GET sane_start returns %s
\n
"
,
p
sane_strstatus
(
status
));
TRACE
(
"PENDINGXFERS/MSG_GET sane_start returns %s
\n
"
,
sane_strstatus
(
status
));
pPendingXfers
->
Count
=
0
;
pPendingXfers
->
Count
=
0
;
}
}
else
else
...
@@ -276,16 +269,12 @@ TW_UINT16 SANE_PendingXfersGet (pTW_IDENTITY pOrigin,
...
@@ -276,16 +269,12 @@ TW_UINT16 SANE_PendingXfersGet (pTW_IDENTITY pOrigin,
}
}
return
twRC
;
return
twRC
;
#endif
}
}
/* DG_CONTROL/DAT_PENDINGXFERS/MSG_RESET */
/* DG_CONTROL/DAT_PENDINGXFERS/MSG_RESET */
TW_UINT16
SANE_PendingXfersReset
(
pTW_IDENTITY
pOrigin
,
TW_UINT16
SANE_PendingXfersReset
(
pTW_IDENTITY
pOrigin
,
TW_MEMREF
pData
)
TW_MEMREF
pData
)
{
{
#ifndef SONAME_LIBSANE
return
TWRC_FAILURE
;
#else
TW_UINT16
twRC
=
TWRC_SUCCESS
;
TW_UINT16
twRC
=
TWRC_SUCCESS
;
pTW_PENDINGXFERS
pPendingXfers
=
(
pTW_PENDINGXFERS
)
pData
;
pTW_PENDINGXFERS
pPendingXfers
=
(
pTW_PENDINGXFERS
)
pData
;
...
@@ -305,22 +294,18 @@ TW_UINT16 SANE_PendingXfersReset (pTW_IDENTITY pOrigin,
...
@@ -305,22 +294,18 @@ TW_UINT16 SANE_PendingXfersReset (pTW_IDENTITY pOrigin,
if
(
activeDS
.
sane_started
)
if
(
activeDS
.
sane_started
)
{
{
p
sane_cancel
(
activeDS
.
deviceHandle
);
sane_cancel
(
activeDS
.
deviceHandle
);
activeDS
.
sane_started
=
FALSE
;
activeDS
.
sane_started
=
FALSE
;
}
}
}
}
return
twRC
;
return
twRC
;
#endif
}
}
/* DG_CONTROL/DAT_SETUPMEMXFER/MSG_GET */
/* DG_CONTROL/DAT_SETUPMEMXFER/MSG_GET */
TW_UINT16
SANE_SetupMemXferGet
(
pTW_IDENTITY
pOrigin
,
TW_UINT16
SANE_SetupMemXferGet
(
pTW_IDENTITY
pOrigin
,
TW_MEMREF
pData
)
TW_MEMREF
pData
)
{
{
#ifndef SONAME_LIBSANE
return
TWRC_FAILURE
;
#else
pTW_SETUPMEMXFER
pSetupMemXfer
=
(
pTW_SETUPMEMXFER
)
pData
;
pTW_SETUPMEMXFER
pSetupMemXfer
=
(
pTW_SETUPMEMXFER
)
pData
;
TRACE
(
"DG_CONTROL/DAT_SETUPMEMXFER/MSG_GET
\n
"
);
TRACE
(
"DG_CONTROL/DAT_SETUPMEMXFER/MSG_GET
\n
"
);
...
@@ -339,7 +324,6 @@ TW_UINT16 SANE_SetupMemXferGet (pTW_IDENTITY pOrigin,
...
@@ -339,7 +324,6 @@ TW_UINT16 SANE_SetupMemXferGet (pTW_IDENTITY pOrigin,
}
}
return
TWRC_SUCCESS
;
return
TWRC_SUCCESS
;
#endif
}
}
/* DG_CONTROL/DAT_STATUS/MSG_GET */
/* DG_CONTROL/DAT_STATUS/MSG_GET */
...
@@ -406,13 +390,11 @@ TW_UINT16 SANE_EnableDSUserInterface (pTW_IDENTITY pOrigin,
...
@@ -406,13 +390,11 @@ TW_UINT16 SANE_EnableDSUserInterface (pTW_IDENTITY pOrigin,
{
{
SANE_Notify
(
MSG_CLOSEDSREQ
);
SANE_Notify
(
MSG_CLOSEDSREQ
);
}
}
#ifdef SONAME_LIBSANE
else
else
{
{
p
sane_get_parameters
(
activeDS
.
deviceHandle
,
&
activeDS
.
sane_param
);
sane_get_parameters
(
activeDS
.
deviceHandle
,
&
activeDS
.
sane_param
);
activeDS
.
sane_param_valid
=
TRUE
;
activeDS
.
sane_param_valid
=
TRUE
;
}
}
#endif
}
}
else
else
{
{
...
...
dlls/sane.ds/ds_image.c
View file @
cf5bad0e
This diff is collapsed.
Click to expand it.
dlls/sane.ds/options.c
View file @
cf5bad0e
...
@@ -22,7 +22,6 @@
...
@@ -22,7 +22,6 @@
#include "sane_i.h"
#include "sane_i.h"
#include "wine/debug.h"
#include "wine/debug.h"
#ifdef SONAME_LIBSANE
static
SANE_Status
sane_find_option
(
SANE_Handle
h
,
const
char
*
option_name
,
static
SANE_Status
sane_find_option
(
SANE_Handle
h
,
const
char
*
option_name
,
const
SANE_Option_Descriptor
**
opt_p
,
int
*
optno
,
SANE_Value_Type
type
)
const
SANE_Option_Descriptor
**
opt_p
,
int
*
optno
,
SANE_Value_Type
type
)
{
{
...
@@ -34,17 +33,17 @@ static SANE_Status sane_find_option(SANE_Handle h, const char *option_name,
...
@@ -34,17 +33,17 @@ static SANE_Status sane_find_option(SANE_Handle h, const char *option_name,
/* Debian, in 32_net_backend_standard_fix.dpatch,
/* Debian, in 32_net_backend_standard_fix.dpatch,
* forces a frontend (that's us) to reload options
* forces a frontend (that's us) to reload options
* manually by invoking get_option_descriptor. */
* manually by invoking get_option_descriptor. */
opt
=
p
sane_get_option_descriptor
(
h
,
0
);
opt
=
sane_get_option_descriptor
(
h
,
0
);
if
(
!
opt
)
if
(
!
opt
)
return
SANE_STATUS_EOF
;
return
SANE_STATUS_EOF
;
rc
=
p
sane_control_option
(
h
,
0
,
SANE_ACTION_GET_VALUE
,
&
optcount
,
NULL
);
rc
=
sane_control_option
(
h
,
0
,
SANE_ACTION_GET_VALUE
,
&
optcount
,
NULL
);
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
return
rc
;
return
rc
;
for
(
i
=
1
;
i
<
optcount
;
i
++
)
for
(
i
=
1
;
i
<
optcount
;
i
++
)
{
{
opt
=
p
sane_get_option_descriptor
(
h
,
i
);
opt
=
sane_get_option_descriptor
(
h
,
i
);
if
(
opt
&&
(
opt
->
name
&&
strcmp
(
opt
->
name
,
option_name
)
==
0
)
&&
if
(
opt
&&
(
opt
->
name
&&
strcmp
(
opt
->
name
,
option_name
)
==
0
)
&&
opt
->
type
==
type
)
opt
->
type
==
type
)
{
{
...
@@ -66,7 +65,7 @@ SANE_Status sane_option_get_int(SANE_Handle h, const char *option_name, SANE_Int
...
@@ -66,7 +65,7 @@ SANE_Status sane_option_get_int(SANE_Handle h, const char *option_name, SANE_Int
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
return
rc
;
return
rc
;
return
p
sane_control_option
(
h
,
optno
,
SANE_ACTION_GET_VALUE
,
val
,
NULL
);
return
sane_control_option
(
h
,
optno
,
SANE_ACTION_GET_VALUE
,
val
,
NULL
);
}
}
SANE_Status
sane_option_set_int
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Int
val
,
SANE_Int
*
status
)
SANE_Status
sane_option_set_int
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Int
val
,
SANE_Int
*
status
)
...
@@ -79,7 +78,7 @@ SANE_Status sane_option_set_int(SANE_Handle h, const char *option_name, SANE_Int
...
@@ -79,7 +78,7 @@ SANE_Status sane_option_set_int(SANE_Handle h, const char *option_name, SANE_Int
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
return
rc
;
return
rc
;
return
p
sane_control_option
(
h
,
optno
,
SANE_ACTION_SET_VALUE
,
(
void
*
)
&
val
,
status
);
return
sane_control_option
(
h
,
optno
,
SANE_ACTION_SET_VALUE
,
(
void
*
)
&
val
,
status
);
}
}
SANE_Status
sane_option_get_bool
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Bool
*
val
,
SANE_Int
*
status
)
SANE_Status
sane_option_get_bool
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Bool
*
val
,
SANE_Int
*
status
)
...
@@ -92,7 +91,7 @@ SANE_Status sane_option_get_bool(SANE_Handle h, const char *option_name, SANE_Bo
...
@@ -92,7 +91,7 @@ SANE_Status sane_option_get_bool(SANE_Handle h, const char *option_name, SANE_Bo
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
return
rc
;
return
rc
;
return
p
sane_control_option
(
h
,
optno
,
SANE_ACTION_GET_VALUE
,
(
void
*
)
val
,
status
);
return
sane_control_option
(
h
,
optno
,
SANE_ACTION_GET_VALUE
,
(
void
*
)
val
,
status
);
}
}
SANE_Status
sane_option_set_bool
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Bool
val
,
SANE_Int
*
status
)
SANE_Status
sane_option_set_bool
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Bool
val
,
SANE_Int
*
status
)
...
@@ -105,7 +104,7 @@ SANE_Status sane_option_set_bool(SANE_Handle h, const char *option_name, SANE_Bo
...
@@ -105,7 +104,7 @@ SANE_Status sane_option_set_bool(SANE_Handle h, const char *option_name, SANE_Bo
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
return
rc
;
return
rc
;
return
p
sane_control_option
(
h
,
optno
,
SANE_ACTION_SET_VALUE
,
(
void
*
)
&
val
,
status
);
return
sane_control_option
(
h
,
optno
,
SANE_ACTION_SET_VALUE
,
(
void
*
)
&
val
,
status
);
}
}
SANE_Status
sane_option_set_fixed
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Fixed
val
,
SANE_Int
*
status
)
SANE_Status
sane_option_set_fixed
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Fixed
val
,
SANE_Int
*
status
)
...
@@ -118,7 +117,7 @@ SANE_Status sane_option_set_fixed(SANE_Handle h, const char *option_name, SANE_F
...
@@ -118,7 +117,7 @@ SANE_Status sane_option_set_fixed(SANE_Handle h, const char *option_name, SANE_F
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
return
rc
;
return
rc
;
return
p
sane_control_option
(
h
,
optno
,
SANE_ACTION_SET_VALUE
,
(
void
*
)
&
val
,
status
);
return
sane_control_option
(
h
,
optno
,
SANE_ACTION_SET_VALUE
,
(
void
*
)
&
val
,
status
);
}
}
SANE_Status
sane_option_get_str
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_String
val
,
size_t
len
,
SANE_Int
*
status
)
SANE_Status
sane_option_get_str
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_String
val
,
size_t
len
,
SANE_Int
*
status
)
...
@@ -132,7 +131,7 @@ SANE_Status sane_option_get_str(SANE_Handle h, const char *option_name, SANE_Str
...
@@ -132,7 +131,7 @@ SANE_Status sane_option_get_str(SANE_Handle h, const char *option_name, SANE_Str
return
rc
;
return
rc
;
if
(
opt
->
size
<
len
)
if
(
opt
->
size
<
len
)
return
p
sane_control_option
(
h
,
optno
,
SANE_ACTION_GET_VALUE
,
(
void
*
)
val
,
status
);
return
sane_control_option
(
h
,
optno
,
SANE_ACTION_GET_VALUE
,
(
void
*
)
val
,
status
);
else
else
return
SANE_STATUS_NO_MEM
;
return
SANE_STATUS_NO_MEM
;
}
}
...
@@ -148,7 +147,7 @@ SANE_Status sane_option_set_str(SANE_Handle h, const char *option_name, SANE_Str
...
@@ -148,7 +147,7 @@ SANE_Status sane_option_set_str(SANE_Handle h, const char *option_name, SANE_Str
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
return
rc
;
return
rc
;
return
p
sane_control_option
(
h
,
optno
,
SANE_ACTION_SET_VALUE
,
(
void
*
)
val
,
status
);
return
sane_control_option
(
h
,
optno
,
SANE_ACTION_SET_VALUE
,
(
void
*
)
val
,
status
);
}
}
SANE_Status
sane_option_probe_resolution
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Int
*
minval
,
SANE_Int
*
maxval
,
SANE_Int
*
quant
)
SANE_Status
sane_option_probe_resolution
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Int
*
minval
,
SANE_Int
*
maxval
,
SANE_Int
*
quant
)
...
@@ -184,7 +183,7 @@ SANE_Status sane_option_probe_mode(SANE_Handle h, SANE_String_Const **choices, c
...
@@ -184,7 +183,7 @@ SANE_Status sane_option_probe_mode(SANE_Handle h, SANE_String_Const **choices, c
*
choices
=
(
SANE_String_Const
*
)
opt
->
constraint
.
string_list
;
*
choices
=
(
SANE_String_Const
*
)
opt
->
constraint
.
string_list
;
if
(
opt
->
size
<
current_size
)
if
(
opt
->
size
<
current_size
)
return
p
sane_control_option
(
h
,
optno
,
SANE_ACTION_GET_VALUE
,
current
,
NULL
);
return
sane_control_option
(
h
,
optno
,
SANE_ACTION_GET_VALUE
,
current
,
NULL
);
else
else
return
SANE_STATUS_NO_MEM
;
return
SANE_STATUS_NO_MEM
;
...
@@ -211,7 +210,7 @@ SANE_Status sane_option_probe_scan_area(SANE_Handle h, const char *option_name,
...
@@ -211,7 +210,7 @@ SANE_Status sane_option_probe_scan_area(SANE_Handle h, const char *option_name,
*
quant
=
opt
->
constraint
.
range
->
quant
;
*
quant
=
opt
->
constraint
.
range
->
quant
;
if
(
val
)
if
(
val
)
rc
=
p
sane_control_option
(
h
,
optno
,
SANE_ACTION_GET_VALUE
,
val
,
NULL
);
rc
=
sane_control_option
(
h
,
optno
,
SANE_ACTION_GET_VALUE
,
val
,
NULL
);
return
rc
;
return
rc
;
}
}
...
@@ -261,4 +260,3 @@ BOOL convert_sane_res_to_twain(double sane_res, SANE_Unit unit, TW_FIX32 *twain_
...
@@ -261,4 +260,3 @@ BOOL convert_sane_res_to_twain(double sane_res, SANE_Unit unit, TW_FIX32 *twain_
return
TRUE
;
return
TRUE
;
}
}
#endif
dlls/sane.ds/sane_i.h
View file @
cf5bad0e
...
@@ -25,35 +25,14 @@
...
@@ -25,35 +25,14 @@
#include <stdarg.h>
#include <stdarg.h>
#ifdef SONAME_LIBSANE
#include <sane/sane.h>
# include <sane/sane.h>
#include <sane/saneopts.h>
# include <sane/saneopts.h>
#endif
#include "windef.h"
#include "windef.h"
#include "winbase.h"
#include "winbase.h"
#include "winuser.h"
#include "winuser.h"
#include "twain.h"
#include "twain.h"
#ifdef SONAME_LIBSANE
#define MAKE_FUNCPTR(f) extern typeof(f) * p##f DECLSPEC_HIDDEN;
MAKE_FUNCPTR
(
sane_init
)
MAKE_FUNCPTR
(
sane_exit
)
MAKE_FUNCPTR
(
sane_get_devices
)
MAKE_FUNCPTR
(
sane_open
)
MAKE_FUNCPTR
(
sane_close
)
MAKE_FUNCPTR
(
sane_get_option_descriptor
)
MAKE_FUNCPTR
(
sane_control_option
)
MAKE_FUNCPTR
(
sane_get_parameters
)
MAKE_FUNCPTR
(
sane_start
)
MAKE_FUNCPTR
(
sane_read
)
MAKE_FUNCPTR
(
sane_cancel
)
MAKE_FUNCPTR
(
sane_set_io_mode
)
MAKE_FUNCPTR
(
sane_get_select_fd
)
MAKE_FUNCPTR
(
sane_strstatus
)
#undef MAKE_FUNCPTR
#endif
extern
HINSTANCE
SANE_instance
DECLSPEC_HIDDEN
;
extern
HINSTANCE
SANE_instance
DECLSPEC_HIDDEN
;
#define TWCC_CHECKSTATUS (TWCC_CUSTOMBASE + 1)
#define TWCC_CHECKSTATUS (TWCC_CUSTOMBASE + 1)
...
@@ -68,14 +47,14 @@ struct tagActiveDS
...
@@ -68,14 +47,14 @@ struct tagActiveDS
TW_IDENTITY
appIdentity
;
/* identity of the app */
TW_IDENTITY
appIdentity
;
/* identity of the app */
HWND
hwndOwner
;
/* window handle of the app */
HWND
hwndOwner
;
/* window handle of the app */
HWND
progressWnd
;
/* window handle of the scanning window */
HWND
progressWnd
;
/* window handle of the scanning window */
#ifdef SONAME_LIBSANE
SANE_Handle
deviceHandle
;
/* device handle */
SANE_Handle
deviceHandle
;
/* device handle */
SANE_Parameters
sane_param
;
/* parameters about the image
SANE_Parameters
sane_param
;
/* parameters about the image
transferred */
transferred */
BOOL
sane_param_valid
;
/* true if valid sane_param*/
BOOL
sane_param_valid
;
/* true if valid sane_param*/
BOOL
sane_started
;
/* If sane_start has been called */
BOOL
sane_started
;
/* If sane_start has been called */
INT
deviceIndex
;
/* index of the current device */
INT
deviceIndex
;
/* index of the current device */
#endif
/* Capabilities */
/* Capabilities */
TW_UINT16
capXferMech
;
/* ICAP_XFERMECH */
TW_UINT16
capXferMech
;
/* ICAP_XFERMECH */
BOOL
PixelTypeSet
;
BOOL
PixelTypeSet
;
...
@@ -227,7 +206,6 @@ BOOL DoScannerUI(void) DECLSPEC_HIDDEN;
...
@@ -227,7 +206,6 @@ BOOL DoScannerUI(void) DECLSPEC_HIDDEN;
HWND
ScanningDialogBox
(
HWND
dialog
,
LONG
progress
)
DECLSPEC_HIDDEN
;
HWND
ScanningDialogBox
(
HWND
dialog
,
LONG
progress
)
DECLSPEC_HIDDEN
;
/* Option functions */
/* Option functions */
#ifdef SONAME_LIBSANE
SANE_Status
sane_option_get_int
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Int
*
val
)
DECLSPEC_HIDDEN
;
SANE_Status
sane_option_get_int
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Int
*
val
)
DECLSPEC_HIDDEN
;
SANE_Status
sane_option_set_int
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Int
val
,
SANE_Int
*
status
)
DECLSPEC_HIDDEN
;
SANE_Status
sane_option_set_int
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Int
val
,
SANE_Int
*
status
)
DECLSPEC_HIDDEN
;
SANE_Status
sane_option_get_str
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_String
val
,
size_t
len
,
SANE_Int
*
status
)
DECLSPEC_HIDDEN
;
SANE_Status
sane_option_get_str
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_String
val
,
size_t
len
,
SANE_Int
*
status
)
DECLSPEC_HIDDEN
;
...
@@ -241,7 +219,5 @@ SANE_Status sane_option_set_bool(SANE_Handle h, const char *option_name, SANE_Bo
...
@@ -241,7 +219,5 @@ SANE_Status sane_option_set_bool(SANE_Handle h, const char *option_name, SANE_Bo
SANE_Status
sane_option_set_fixed
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Fixed
val
,
SANE_Int
*
status
)
DECLSPEC_HIDDEN
;
SANE_Status
sane_option_set_fixed
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Fixed
val
,
SANE_Int
*
status
)
DECLSPEC_HIDDEN
;
TW_UINT16
sane_status_to_twcc
(
SANE_Status
rc
)
DECLSPEC_HIDDEN
;
TW_UINT16
sane_status_to_twcc
(
SANE_Status
rc
)
DECLSPEC_HIDDEN
;
BOOL
convert_sane_res_to_twain
(
double
sane_res
,
SANE_Unit
unit
,
TW_FIX32
*
twain_res
,
TW_UINT16
twtype
)
DECLSPEC_HIDDEN
;
BOOL
convert_sane_res_to_twain
(
double
sane_res
,
SANE_Unit
unit
,
TW_FIX32
*
twain_res
,
TW_UINT16
twtype
)
DECLSPEC_HIDDEN
;
#endif
#endif
#endif
dlls/sane.ds/sane_main.c
View file @
cf5bad0e
...
@@ -32,72 +32,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(twain);
...
@@ -32,72 +32,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(twain);
struct
tagActiveDS
activeDS
;
struct
tagActiveDS
activeDS
;
DSMENTRYPROC
SANE_dsmentry
;
DSMENTRYPROC
SANE_dsmentry
;
#ifdef SONAME_LIBSANE
#define MAKE_FUNCPTR(f) typeof(f) * p##f;
MAKE_FUNCPTR
(
sane_init
)
MAKE_FUNCPTR
(
sane_exit
)
MAKE_FUNCPTR
(
sane_get_devices
)
MAKE_FUNCPTR
(
sane_open
)
MAKE_FUNCPTR
(
sane_close
)
MAKE_FUNCPTR
(
sane_get_option_descriptor
)
MAKE_FUNCPTR
(
sane_control_option
)
MAKE_FUNCPTR
(
sane_get_parameters
)
MAKE_FUNCPTR
(
sane_start
)
MAKE_FUNCPTR
(
sane_read
)
MAKE_FUNCPTR
(
sane_cancel
)
MAKE_FUNCPTR
(
sane_set_io_mode
)
MAKE_FUNCPTR
(
sane_get_select_fd
)
MAKE_FUNCPTR
(
sane_strstatus
)
#undef MAKE_FUNCPTR
HINSTANCE
SANE_instance
;
HINSTANCE
SANE_instance
;
static
void
*
libsane_handle
;
static
void
close_libsane
(
void
*
h
)
{
if
(
h
)
dlclose
(
h
);
}
static
void
*
open_libsane
(
void
)
{
void
*
h
;
h
=
dlopen
(
SONAME_LIBSANE
,
RTLD_GLOBAL
|
RTLD_NOW
);
if
(
!
h
)
{
WARN
(
"failed to load %s; %s
\n
"
,
SONAME_LIBSANE
,
dlerror
());
return
NULL
;
}
#define LOAD_FUNCPTR(f) \
if((p##f = dlsym(h, #f)) == NULL) { \
close_libsane(h); \
ERR("Could not dlsym %s\n", #f); \
return NULL; \
}
LOAD_FUNCPTR
(
sane_init
)
LOAD_FUNCPTR
(
sane_exit
)
LOAD_FUNCPTR
(
sane_get_devices
)
LOAD_FUNCPTR
(
sane_open
)
LOAD_FUNCPTR
(
sane_close
)
LOAD_FUNCPTR
(
sane_get_option_descriptor
)
LOAD_FUNCPTR
(
sane_control_option
)
LOAD_FUNCPTR
(
sane_get_parameters
)
LOAD_FUNCPTR
(
sane_start
)
LOAD_FUNCPTR
(
sane_read
)
LOAD_FUNCPTR
(
sane_cancel
)
LOAD_FUNCPTR
(
sane_set_io_mode
)
LOAD_FUNCPTR
(
sane_get_select_fd
)
LOAD_FUNCPTR
(
sane_strstatus
)
#undef LOAD_FUNCPTR
return
h
;
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
BOOL
WINAPI
DllMain
(
HINSTANCE
hinstDLL
,
DWORD
fdwReason
,
LPVOID
lpvReserved
)
{
{
TRACE
(
"%p,%x,%p
\n
"
,
hinstDLL
,
fdwReason
,
lpvReserved
);
TRACE
(
"%p,%x,%p
\n
"
,
hinstDLL
,
fdwReason
,
lpvReserved
);
...
@@ -107,11 +43,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
...
@@ -107,11 +43,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
case
DLL_PROCESS_ATTACH
:
{
case
DLL_PROCESS_ATTACH
:
{
SANE_Int
version_code
;
SANE_Int
version_code
;
libsane_handle
=
open_libsane
();
sane_init
(
&
version_code
,
NULL
);
if
(
!
libsane_handle
)
return
FALSE
;
psane_init
(
&
version_code
,
NULL
);
SANE_instance
=
hinstDLL
;
SANE_instance
=
hinstDLL
;
DisableThreadLibraryCalls
(
hinstDLL
);
DisableThreadLibraryCalls
(
hinstDLL
);
break
;
break
;
...
@@ -119,8 +51,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
...
@@ -119,8 +51,7 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
case
DLL_PROCESS_DETACH
:
case
DLL_PROCESS_DETACH
:
if
(
lpvReserved
)
break
;
if
(
lpvReserved
)
break
;
TRACE
(
"calling sane_exit()
\n
"
);
TRACE
(
"calling sane_exit()
\n
"
);
psane_exit
();
sane_exit
();
close_libsane
(
libsane_handle
);
break
;
break
;
}
}
...
@@ -129,9 +60,6 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
...
@@ -129,9 +60,6 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
static
TW_UINT16
SANE_GetIdentity
(
pTW_IDENTITY
,
pTW_IDENTITY
);
static
TW_UINT16
SANE_GetIdentity
(
pTW_IDENTITY
,
pTW_IDENTITY
);
static
TW_UINT16
SANE_OpenDS
(
pTW_IDENTITY
,
pTW_IDENTITY
);
static
TW_UINT16
SANE_OpenDS
(
pTW_IDENTITY
,
pTW_IDENTITY
);
#endif
/* SONAME_LIBSANE */
static
TW_UINT16
SANE_SetEntryPoint
(
pTW_IDENTITY
pOrigin
,
TW_MEMREF
pData
);
static
TW_UINT16
SANE_SetEntryPoint
(
pTW_IDENTITY
pOrigin
,
TW_MEMREF
pData
);
static
TW_UINT16
SANE_SourceControlHandler
(
static
TW_UINT16
SANE_SourceControlHandler
(
...
@@ -148,28 +76,13 @@ static TW_UINT16 SANE_SourceControlHandler (
...
@@ -148,28 +76,13 @@ static TW_UINT16 SANE_SourceControlHandler (
switch
(
MSG
)
switch
(
MSG
)
{
{
case
MSG_CLOSEDS
:
case
MSG_CLOSEDS
:
#ifdef SONAME_LIBSANE
sane_close
(
activeDS
.
deviceHandle
);
psane_close
(
activeDS
.
deviceHandle
);
#else
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_CAPUNSUPPORTED
;
#endif
break
;
break
;
case
MSG_OPENDS
:
case
MSG_OPENDS
:
#ifdef SONAME_LIBSANE
twRC
=
SANE_OpenDS
(
pOrigin
,
(
pTW_IDENTITY
)
pData
);
twRC
=
SANE_OpenDS
(
pOrigin
,
(
pTW_IDENTITY
)
pData
);
#else
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_CAPUNSUPPORTED
;
#endif
break
;
break
;
case
MSG_GET
:
case
MSG_GET
:
#ifdef SONAME_LIBSANE
twRC
=
SANE_GetIdentity
(
pOrigin
,
(
pTW_IDENTITY
)
pData
);
twRC
=
SANE_GetIdentity
(
pOrigin
,
(
pTW_IDENTITY
)
pData
);
#else
twRC
=
TWRC_FAILURE
;
activeDS
.
twCC
=
TWCC_CAPUNSUPPORTED
;
#endif
break
;
break
;
}
}
break
;
break
;
...
@@ -427,7 +340,6 @@ TW_UINT16 SANE_SetEntryPoint (pTW_IDENTITY pOrigin, TW_MEMREF pData)
...
@@ -427,7 +340,6 @@ TW_UINT16 SANE_SetEntryPoint (pTW_IDENTITY pOrigin, TW_MEMREF pData)
return
TWRC_SUCCESS
;
return
TWRC_SUCCESS
;
}
}
#ifdef SONAME_LIBSANE
/* Sane returns device names that are longer than the 32 bytes allowed
/* Sane returns device names that are longer than the 32 bytes allowed
by TWAIN. However, it colon separates them, and the last bit is
by TWAIN. However, it colon separates them, and the last bit is
the most interesting. So we use the last bit, and add a signature
the most interesting. So we use the last bit, and add a signature
...
@@ -466,7 +378,7 @@ static void
...
@@ -466,7 +378,7 @@ static void
detect_sane_devices
(
void
)
{
detect_sane_devices
(
void
)
{
if
(
sane_devlist
&&
sane_devlist
[
0
])
return
;
if
(
sane_devlist
&&
sane_devlist
[
0
])
return
;
TRACE
(
"detecting sane...
\n
"
);
TRACE
(
"detecting sane...
\n
"
);
if
(
p
sane_get_devices
(
&
sane_devlist
,
SANE_FALSE
)
!=
SANE_STATUS_GOOD
)
if
(
sane_get_devices
(
&
sane_devlist
,
SANE_FALSE
)
!=
SANE_STATUS_GOOD
)
return
;
return
;
}
}
...
@@ -538,7 +450,7 @@ static TW_UINT16 SANE_OpenDS( pTW_IDENTITY pOrigin, pTW_IDENTITY self) {
...
@@ -538,7 +450,7 @@ static TW_UINT16 SANE_OpenDS( pTW_IDENTITY pOrigin, pTW_IDENTITY self) {
WARN
(
"Scanner not found.
\n
"
);
WARN
(
"Scanner not found.
\n
"
);
return
TWRC_FAILURE
;
return
TWRC_FAILURE
;
}
}
status
=
p
sane_open
(
sane_devlist
[
i
]
->
name
,
&
activeDS
.
deviceHandle
);
status
=
sane_open
(
sane_devlist
[
i
]
->
name
,
&
activeDS
.
deviceHandle
);
if
(
status
==
SANE_STATUS_GOOD
)
{
if
(
status
==
SANE_STATUS_GOOD
)
{
activeDS
.
twCC
=
SANE_SaneSetDefaults
();
activeDS
.
twCC
=
SANE_SaneSetDefaults
();
if
(
activeDS
.
twCC
==
TWCC_SUCCESS
)
{
if
(
activeDS
.
twCC
==
TWCC_SUCCESS
)
{
...
@@ -548,10 +460,9 @@ static TW_UINT16 SANE_OpenDS( pTW_IDENTITY pOrigin, pTW_IDENTITY self) {
...
@@ -548,10 +460,9 @@ static TW_UINT16 SANE_OpenDS( pTW_IDENTITY pOrigin, pTW_IDENTITY self) {
return
TWRC_SUCCESS
;
return
TWRC_SUCCESS
;
}
}
else
else
p
sane_close
(
activeDS
.
deviceHandle
);
sane_close
(
activeDS
.
deviceHandle
);
}
}
else
else
ERR
(
"sane_open(%s): %s
\n
"
,
sane_devlist
[
i
]
->
name
,
p
sane_strstatus
(
status
));
ERR
(
"sane_open(%s): %s
\n
"
,
sane_devlist
[
i
]
->
name
,
sane_strstatus
(
status
));
return
TWRC_FAILURE
;
return
TWRC_FAILURE
;
}
}
#endif
dlls/sane.ds/ui.c
View file @
cf5bad0e
...
@@ -35,8 +35,6 @@
...
@@ -35,8 +35,6 @@
#include "resource.h"
#include "resource.h"
#include "wine/unicode.h"
#include "wine/unicode.h"
#ifdef SONAME_LIBSANE
WINE_DEFAULT_DEBUG_CHANNEL
(
twain
);
WINE_DEFAULT_DEBUG_CHANNEL
(
twain
);
#define ID_BASE 0x100
#define ID_BASE 0x100
...
@@ -173,7 +171,7 @@ static int create_item(HDC hdc, const SANE_Option_Descriptor *opt,
...
@@ -173,7 +171,7 @@ static int create_item(HDC hdc, const SANE_Option_Descriptor *opt,
{
{
SANE_Int
i
;
SANE_Int
i
;
p
sane_control_option
(
activeDS
.
deviceHandle
,
id
-
ID_BASE
,
sane_control_option
(
activeDS
.
deviceHandle
,
id
-
ID_BASE
,
SANE_ACTION_GET_VALUE
,
&
i
,
NULL
);
SANE_ACTION_GET_VALUE
,
&
i
,
NULL
);
sprintf
(
buffer
,
"%i"
,
i
);
sprintf
(
buffer
,
"%i"
,
i
);
...
@@ -209,7 +207,7 @@ static int create_item(HDC hdc, const SANE_Option_Descriptor *opt,
...
@@ -209,7 +207,7 @@ static int create_item(HDC hdc, const SANE_Option_Descriptor *opt,
i
=
HeapAlloc
(
GetProcessHeap
(),
0
,
opt
->
size
*
sizeof
(
SANE_Word
));
i
=
HeapAlloc
(
GetProcessHeap
(),
0
,
opt
->
size
*
sizeof
(
SANE_Word
));
p
sane_control_option
(
activeDS
.
deviceHandle
,
id
-
ID_BASE
,
sane_control_option
(
activeDS
.
deviceHandle
,
id
-
ID_BASE
,
SANE_ACTION_GET_VALUE
,
i
,
NULL
);
SANE_ACTION_GET_VALUE
,
i
,
NULL
);
dd
=
SANE_UNFIX
(
*
i
);
dd
=
SANE_UNFIX
(
*
i
);
...
@@ -253,7 +251,7 @@ static int create_item(HDC hdc, const SANE_Option_Descriptor *opt,
...
@@ -253,7 +251,7 @@ static int create_item(HDC hdc, const SANE_Option_Descriptor *opt,
}
}
leading_len
+=
create_leading_static
(
hdc
,
opt
->
title
,
&
lead_static
,
y
,
leading_len
+=
create_leading_static
(
hdc
,
opt
->
title
,
&
lead_static
,
y
,
id
+
ID_STATIC_BASE
);
id
+
ID_STATIC_BASE
);
p
sane_control_option
(
activeDS
.
deviceHandle
,
id
-
ID_BASE
,
sane_control_option
(
activeDS
.
deviceHandle
,
id
-
ID_BASE
,
SANE_ACTION_GET_VALUE
,
buffer
,
NULL
);
SANE_ACTION_GET_VALUE
,
buffer
,
NULL
);
title
=
buffer
;
title
=
buffer
;
...
@@ -391,7 +389,7 @@ static LPDLGTEMPLATEW create_options_page(HDC hdc, int *from_index,
...
@@ -391,7 +389,7 @@ static LPDLGTEMPLATEW create_options_page(HDC hdc, int *from_index,
int
count
;
int
count
;
int
hold_for_group
=
0
;
int
hold_for_group
=
0
;
opt
=
p
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
i
);
opt
=
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
i
);
if
(
!
opt
)
if
(
!
opt
)
continue
;
continue
;
if
(
opt
->
type
==
SANE_TYPE_GROUP
&&
split_tabs
)
if
(
opt
->
type
==
SANE_TYPE_GROUP
&&
split_tabs
)
...
@@ -529,7 +527,7 @@ BOOL DoScannerUI(void)
...
@@ -529,7 +527,7 @@ BOOL DoScannerUI(void)
hdc
=
GetDC
(
0
);
hdc
=
GetDC
(
0
);
memset
(
psp
,
0
,
sizeof
(
psp
));
memset
(
psp
,
0
,
sizeof
(
psp
));
rc
=
p
sane_control_option
(
activeDS
.
deviceHandle
,
0
,
SANE_ACTION_GET_VALUE
,
rc
=
sane_control_option
(
activeDS
.
deviceHandle
,
0
,
SANE_ACTION_GET_VALUE
,
&
optcount
,
NULL
);
&
optcount
,
NULL
);
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
{
{
...
@@ -542,7 +540,7 @@ BOOL DoScannerUI(void)
...
@@ -542,7 +540,7 @@ BOOL DoScannerUI(void)
const
SANE_Option_Descriptor
*
opt
;
const
SANE_Option_Descriptor
*
opt
;
psp
[
page_count
].
u
.
pResource
=
create_options_page
(
hdc
,
&
index
,
psp
[
page_count
].
u
.
pResource
=
create_options_page
(
hdc
,
&
index
,
optcount
,
TRUE
);
optcount
,
TRUE
);
opt
=
p
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
index
);
opt
=
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
index
);
if
(
opt
->
type
==
SANE_TYPE_GROUP
)
if
(
opt
->
type
==
SANE_TYPE_GROUP
)
{
{
...
@@ -661,7 +659,7 @@ static BOOL UpdateSaneScrollOption(
...
@@ -661,7 +659,7 @@ static BOOL UpdateSaneScrollOption(
else
else
si
=
position
;
si
=
position
;
rc
=
p
sane_control_option
(
activeDS
.
deviceHandle
,
index
,
rc
=
sane_control_option
(
activeDS
.
deviceHandle
,
index
,
SANE_ACTION_SET_VALUE
,
&
si
,
&
result
);
SANE_ACTION_SET_VALUE
,
&
si
,
&
result
);
}
}
...
@@ -681,7 +679,7 @@ static BOOL UpdateSaneScrollOption(
...
@@ -681,7 +679,7 @@ static BOOL UpdateSaneScrollOption(
*
sf
=
SANE_FIX
(
dd
);
*
sf
=
SANE_FIX
(
dd
);
rc
=
p
sane_control_option
(
activeDS
.
deviceHandle
,
index
,
rc
=
sane_control_option
(
activeDS
.
deviceHandle
,
index
,
SANE_ACTION_SET_VALUE
,
sf
,
&
result
);
SANE_ACTION_SET_VALUE
,
sf
,
&
result
);
HeapFree
(
GetProcessHeap
(),
0
,
sf
);
HeapFree
(
GetProcessHeap
(),
0
,
sf
);
...
@@ -704,7 +702,7 @@ static BOOL UpdateSaneBoolOption(int index, BOOL position)
...
@@ -704,7 +702,7 @@ static BOOL UpdateSaneBoolOption(int index, BOOL position)
si
=
position
;
si
=
position
;
rc
=
p
sane_control_option
(
activeDS
.
deviceHandle
,
index
,
rc
=
sane_control_option
(
activeDS
.
deviceHandle
,
index
,
SANE_ACTION_SET_VALUE
,
&
si
,
&
result
);
SANE_ACTION_SET_VALUE
,
&
si
,
&
result
);
if
(
rc
==
SANE_STATUS_GOOD
)
if
(
rc
==
SANE_STATUS_GOOD
)
...
@@ -721,7 +719,7 @@ static BOOL UpdateSaneIntOption(int index, SANE_Int value)
...
@@ -721,7 +719,7 @@ static BOOL UpdateSaneIntOption(int index, SANE_Int value)
SANE_Status
rc
=
SANE_STATUS_GOOD
;
SANE_Status
rc
=
SANE_STATUS_GOOD
;
SANE_Int
result
=
0
;
SANE_Int
result
=
0
;
rc
=
p
sane_control_option
(
activeDS
.
deviceHandle
,
index
,
rc
=
sane_control_option
(
activeDS
.
deviceHandle
,
index
,
SANE_ACTION_SET_VALUE
,
&
value
,
&
result
);
SANE_ACTION_SET_VALUE
,
&
value
,
&
result
);
if
(
rc
==
SANE_STATUS_GOOD
)
if
(
rc
==
SANE_STATUS_GOOD
)
...
@@ -738,7 +736,7 @@ static BOOL UpdateSaneStringOption(int index, SANE_String value)
...
@@ -738,7 +736,7 @@ static BOOL UpdateSaneStringOption(int index, SANE_String value)
SANE_Status
rc
=
SANE_STATUS_GOOD
;
SANE_Status
rc
=
SANE_STATUS_GOOD
;
SANE_Int
result
=
0
;
SANE_Int
result
=
0
;
rc
=
p
sane_control_option
(
activeDS
.
deviceHandle
,
index
,
rc
=
sane_control_option
(
activeDS
.
deviceHandle
,
index
,
SANE_ACTION_SET_VALUE
,
value
,
&
result
);
SANE_ACTION_SET_VALUE
,
value
,
&
result
);
if
(
rc
==
SANE_STATUS_GOOD
)
if
(
rc
==
SANE_STATUS_GOOD
)
...
@@ -757,7 +755,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
...
@@ -757,7 +755,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
HWND
control
;
HWND
control
;
int
i
;
int
i
;
rc
=
p
sane_control_option
(
activeDS
.
deviceHandle
,
0
,
SANE_ACTION_GET_VALUE
,
rc
=
sane_control_option
(
activeDS
.
deviceHandle
,
0
,
SANE_ACTION_GET_VALUE
,
&
optcount
,
NULL
);
&
optcount
,
NULL
);
if
(
rc
!=
SANE_STATUS_GOOD
)
if
(
rc
!=
SANE_STATUS_GOOD
)
{
{
...
@@ -774,7 +772,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
...
@@ -774,7 +772,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
if
(
!
control
)
if
(
!
control
)
continue
;
continue
;
opt
=
p
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
i
);
opt
=
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
i
);
TRACE
(
"%i %s %i %i
\n
"
,
i
,
opt
->
title
,
opt
->
type
,
opt
->
constraint_type
);
TRACE
(
"%i %s %i %i
\n
"
,
i
,
opt
->
title
,
opt
->
type
,
opt
->
constraint_type
);
...
@@ -796,13 +794,13 @@ static INT_PTR InitializeDialog(HWND hwnd)
...
@@ -796,13 +794,13 @@ static INT_PTR InitializeDialog(HWND hwnd)
(
LPARAM
)
opt
->
constraint
.
string_list
[
j
]);
(
LPARAM
)
opt
->
constraint
.
string_list
[
j
]);
j
++
;
j
++
;
}
}
p
sane_control_option
(
activeDS
.
deviceHandle
,
i
,
SANE_ACTION_GET_VALUE
,
buffer
,
NULL
);
sane_control_option
(
activeDS
.
deviceHandle
,
i
,
SANE_ACTION_GET_VALUE
,
buffer
,
NULL
);
SendMessageA
(
control
,
CB_SELECTSTRING
,
0
,(
LPARAM
)
buffer
);
SendMessageA
(
control
,
CB_SELECTSTRING
,
0
,(
LPARAM
)
buffer
);
}
}
else
if
(
opt
->
type
==
SANE_TYPE_BOOL
)
else
if
(
opt
->
type
==
SANE_TYPE_BOOL
)
{
{
SANE_Bool
b
;
SANE_Bool
b
;
p
sane_control_option
(
activeDS
.
deviceHandle
,
i
,
sane_control_option
(
activeDS
.
deviceHandle
,
i
,
SANE_ACTION_GET_VALUE
,
&
b
,
NULL
);
SANE_ACTION_GET_VALUE
,
&
b
,
NULL
);
if
(
b
)
if
(
b
)
SendMessageA
(
control
,
BM_SETCHECK
,
BST_CHECKED
,
0
);
SendMessageA
(
control
,
BM_SETCHECK
,
BST_CHECKED
,
0
);
...
@@ -819,7 +817,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
...
@@ -819,7 +817,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
sprintf
(
buffer
,
"%d"
,
opt
->
constraint
.
word_list
[
j
]);
sprintf
(
buffer
,
"%d"
,
opt
->
constraint
.
word_list
[
j
]);
SendMessageA
(
control
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
buffer
);
SendMessageA
(
control
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
buffer
);
}
}
p
sane_control_option
(
activeDS
.
deviceHandle
,
i
,
SANE_ACTION_GET_VALUE
,
&
val
,
NULL
);
sane_control_option
(
activeDS
.
deviceHandle
,
i
,
SANE_ACTION_GET_VALUE
,
&
val
,
NULL
);
sprintf
(
buffer
,
"%d"
,
val
);
sprintf
(
buffer
,
"%d"
,
val
);
SendMessageA
(
control
,
CB_SELECTSTRING
,
0
,(
LPARAM
)
buffer
);
SendMessageA
(
control
,
CB_SELECTSTRING
,
0
,(
LPARAM
)
buffer
);
}
}
...
@@ -840,7 +838,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
...
@@ -840,7 +838,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
SendMessageA
(
control
,
SBM_SETRANGE
,
min
,
max
);
SendMessageA
(
control
,
SBM_SETRANGE
,
min
,
max
);
p
sane_control_option
(
activeDS
.
deviceHandle
,
i
,
sane_control_option
(
activeDS
.
deviceHandle
,
i
,
SANE_ACTION_GET_VALUE
,
&
si
,
NULL
);
SANE_ACTION_GET_VALUE
,
&
si
,
NULL
);
if
(
opt
->
constraint
.
range
->
quant
)
if
(
opt
->
constraint
.
range
->
quant
)
si
=
si
/
opt
->
constraint
.
range
->
quant
;
si
=
si
/
opt
->
constraint
.
range
->
quant
;
...
@@ -876,7 +874,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
...
@@ -876,7 +874,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
sf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
opt
->
size
*
sizeof
(
SANE_Word
));
sf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
opt
->
size
*
sizeof
(
SANE_Word
));
p
sane_control_option
(
activeDS
.
deviceHandle
,
i
,
sane_control_option
(
activeDS
.
deviceHandle
,
i
,
SANE_ACTION_GET_VALUE
,
sf
,
NULL
);
SANE_ACTION_GET_VALUE
,
sf
,
NULL
);
dd
=
SANE_UNFIX
(
*
sf
);
dd
=
SANE_UNFIX
(
*
sf
);
...
@@ -912,7 +910,7 @@ static INT_PTR ProcessScroll(HWND hwnd, WPARAM wParam, LPARAM lParam)
...
@@ -912,7 +910,7 @@ static INT_PTR ProcessScroll(HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
index
<
0
)
if
(
index
<
0
)
return
FALSE
;
return
FALSE
;
opt
=
p
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
index
);
opt
=
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
index
);
if
(
!
opt
)
if
(
!
opt
)
return
FALSE
;
return
FALSE
;
...
@@ -967,7 +965,7 @@ static void ButtonClicked(HWND hwnd, INT id, HWND control)
...
@@ -967,7 +965,7 @@ static void ButtonClicked(HWND hwnd, INT id, HWND control)
if
(
index
<
0
)
if
(
index
<
0
)
return
;
return
;
opt
=
p
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
index
);
opt
=
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
index
);
if
(
!
opt
)
if
(
!
opt
)
return
;
return
;
...
@@ -992,7 +990,7 @@ static void ComboChanged(HWND hwnd, INT id, HWND control)
...
@@ -992,7 +990,7 @@ static void ComboChanged(HWND hwnd, INT id, HWND control)
if
(
index
<
0
)
if
(
index
<
0
)
return
;
return
;
opt
=
p
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
index
);
opt
=
sane_get_option_descriptor
(
activeDS
.
deviceHandle
,
index
);
if
(
!
opt
)
if
(
!
opt
)
return
;
return
;
...
@@ -1094,12 +1092,3 @@ HWND ScanningDialogBox(HWND dialog, LONG progress)
...
@@ -1094,12 +1092,3 @@ HWND ScanningDialogBox(HWND dialog, LONG progress)
return
dialog
;
return
dialog
;
}
}
#else
/* SONAME_LIBSANE */
BOOL
DoScannerUI
(
void
)
{
return
FALSE
;
}
#endif
/* SONAME_LIBSANE */
include/config.h.in
View file @
cf5bad0e
...
@@ -937,9 +937,6 @@
...
@@ -937,9 +937,6 @@
/* Define to the soname of the libOSMesa library. */
/* Define to the soname of the libOSMesa library. */
#undef SONAME_LIBOSMESA
#undef SONAME_LIBOSMESA
/* Define to the soname of the libsane library. */
#undef SONAME_LIBSANE
/* Define to the soname of the libSDL2 library. */
/* Define to the soname of the libSDL2 library. */
#undef SONAME_LIBSDL2
#undef SONAME_LIBSDL2
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment