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
f75b5ebb
Commit
f75b5ebb
authored
Feb 25, 2009
by
Jeremy White
Committed by
Alexandre Julliard
Feb 26, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane.ds: Added support for ICAP_UNITS.
parent
982482e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
2 deletions
+54
-2
capability.c
dlls/sane.ds/capability.c
+48
-1
dsm.c
dlls/twain_32/tests/dsm.c
+6
-1
No files found.
dlls/sane.ds/capability.c
View file @
f75b5ebb
...
...
@@ -154,7 +154,7 @@ static TW_UINT16 TWAIN_GetSupportedCaps(pTW_CAPABILITY pCapability)
{
TW_ARRAY
*
a
;
static
const
UINT16
supported_caps
[]
=
{
CAP_SUPPORTEDCAPS
,
CAP_XFERCOUNT
,
CAP_UICONTROLLABLE
,
ICAP_XFERMECH
,
ICAP_PIXELTYPE
,
ICAP_BITDEPTH
,
ICAP_COMPRESSION
,
ICAP_PIXELFLAVOR
,
ICAP_XFERMECH
,
ICAP_PIXELTYPE
,
ICAP_
UNITS
,
ICAP_
BITDEPTH
,
ICAP_COMPRESSION
,
ICAP_PIXELFLAVOR
,
ICAP_XRESOLUTION
,
ICAP_YRESOLUTION
};
pCapability
->
hContainer
=
GlobalAlloc
(
0
,
FIELD_OFFSET
(
TW_ARRAY
,
ItemList
[
sizeof
(
supported_caps
)]
));
...
...
@@ -311,6 +311,49 @@ static TW_UINT16 SANE_ICAPPixelType (pTW_CAPABILITY pCapability, TW_UINT16 actio
return
twCC
;
}
/* ICAP_UNITS */
static
TW_UINT16
SANE_ICAPUnits
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
{
TW_UINT32
val
;
TW_UINT16
twCC
=
TWCC_BADCAP
;
TRACE
(
"ICAP_UNITS
\n
"
);
switch
(
action
)
{
case
MSG_QUERYSUPPORT
:
twCC
=
set_onevalue
(
pCapability
,
TWTY_INT32
,
TWQC_GET
|
TWQC_SET
|
TWQC_GETDEFAULT
|
TWQC_GETCURRENT
|
TWQC_RESET
);
break
;
case
MSG_GET
:
twCC
=
set_onevalue
(
pCapability
,
TWTY_UINT16
,
TWUN_INCHES
);
break
;
case
MSG_SET
:
twCC
=
msg_set
(
pCapability
,
&
val
);
if
(
twCC
==
TWCC_SUCCESS
)
{
if
(
val
!=
TWUN_INCHES
)
{
ERR
(
"Sane supports only SANE_UNIT_DPI
\n
"
);
twCC
=
TWCC_BADVALUE
;
}
}
break
;
case
MSG_GETDEFAULT
:
case
MSG_RESET
:
/* .. fall through intentional .. */
case
MSG_GETCURRENT
:
twCC
=
set_onevalue
(
pCapability
,
TWTY_UINT16
,
TWUN_INCHES
);
break
;
}
return
twCC
;
}
/* ICAP_BITDEPTH */
static
TW_UINT16
SANE_ICAPBitDepth
(
pTW_CAPABILITY
pCapability
,
TW_UINT16
action
)
{
...
...
@@ -581,6 +624,10 @@ TW_UINT16 SANE_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action)
twCC
=
SANE_ICAPPixelType
(
pCapability
,
action
);
break
;
case
ICAP_UNITS
:
twCC
=
SANE_ICAPUnits
(
pCapability
,
action
);
break
;
case
ICAP_BITDEPTH
:
twCC
=
SANE_ICAPBitDepth
(
pCapability
,
action
);
break
;
...
...
dlls/twain_32/tests/dsm.c
View file @
f75b5ebb
...
...
@@ -109,6 +109,9 @@ static void check_get(TW_CAPABILITY *pCapability, TW_INT32 actual_support,
TW_ONEVALUE
*
onev
=
(
TW_ONEVALUE
*
)
p
;
ok
(
onev
->
Item
==
orig_value
||
!
(
actual_support
&
TWQC_GETCURRENT
),
"MSG_GET of 0x%x returned 0x%x, expecting 0x%x
\n
"
,
pCapability
->
Cap
,
onev
->
Item
,
orig_value
);
trace
(
"MSG_GET of 0x%x returned val 0x%x, type %d
\n
"
,
pCapability
->
Cap
,
onev
->
Item
,
onev
->
ItemType
);
if
(
suggested_set_value
)
*
suggested_set_value
=
onev
->
Item
;
}
else
if
(
pCapability
->
ConType
==
TWON_ENUMERATION
)
{
...
...
@@ -473,8 +476,10 @@ static void test_single_source(TW_IDENTITY *appid, TW_IDENTITY *source)
if
(
capabilities
[
ICAP_PIXELTYPE
])
test_onevalue_cap
(
appid
,
source
,
ICAP_PIXELTYPE
,
TWTY_UINT16
,
TWQC_GET
|
TWQC_SET
|
TWQC_GETDEFAULT
|
TWQC_GETCURRENT
|
TWQC_RESET
);
todo_wine
ok
(
capabilities
[
ICAP_UNITS
],
"ICAP_UNITS not supported
\n
"
);
if
(
capabilities
[
ICAP_UNITS
])
test_onevalue_cap
(
appid
,
source
,
ICAP_UNITS
,
TWTY_UINT16
,
TWQC_GET
|
TWQC_SET
|
TWQC_GETDEFAULT
|
TWQC_GETCURRENT
|
TWQC_RESET
);
ok
(
capabilities
[
ICAP_XFERMECH
],
"ICAP_XFERMECH not supported
\n
"
);
if
(
capabilities
[
ICAP_XFERMECH
])
test_onevalue_cap
(
appid
,
source
,
ICAP_XFERMECH
,
TWTY_UINT16
,
...
...
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