Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
f75b5ebb
Commit
f75b5ebb
authored
16 years ago
by
Jeremy White
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
sane.ds: Added support for ICAP_UNITS.
parent
982482e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dlls/sane.ds/capability.c
+48
-1
48 additions, 1 deletion
dlls/sane.ds/capability.c
dlls/twain_32/tests/dsm.c
+6
-1
6 additions, 1 deletion
dlls/twain_32/tests/dsm.c
with
54 additions
and
2 deletions
dlls/sane.ds/capability.c
+
48
−
1
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
;
...
...
This diff is collapsed.
Click to expand it.
dlls/twain_32/tests/dsm.c
+
6
−
1
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
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment