sane.ds: Implement stub support for ICAP_PIXELFLAVOR.
This commit is contained in:
parent
4b794bee9a
commit
9bb24b8f7e
|
@ -126,7 +126,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_COMPRESSION };
|
||||
ICAP_XFERMECH, ICAP_PIXELTYPE, ICAP_COMPRESSION, ICAP_PIXELFLAVOR };
|
||||
|
||||
pCapability->hContainer = GlobalAlloc (0, FIELD_OFFSET( TW_ARRAY, ItemList[sizeof(supported_caps)] ));
|
||||
pCapability->ConType = TWON_ARRAY;
|
||||
|
@ -345,6 +345,50 @@ static TW_UINT16 SANE_ICAPCompression (pTW_CAPABILITY pCapability, TW_UINT16 act
|
|||
return twCC;
|
||||
}
|
||||
|
||||
/* ICAP_PIXELFLAVOR */
|
||||
static TW_UINT16 SANE_ICAPPixelFlavor (pTW_CAPABILITY pCapability, TW_UINT16 action)
|
||||
{
|
||||
static const TW_UINT32 possible_values[] = { TWPF_CHOCOLATE, TWPF_VANILLA };
|
||||
TW_UINT32 val;
|
||||
TW_UINT16 twCC = TWCC_BADCAP;
|
||||
|
||||
TRACE("ICAP_PIXELFLAVOR\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 = msg_get_enum(pCapability, possible_values, sizeof(possible_values) / sizeof(possible_values[0]),
|
||||
TWTY_UINT16, TWPF_CHOCOLATE, TWPF_CHOCOLATE);
|
||||
break;
|
||||
|
||||
case MSG_SET:
|
||||
twCC = msg_set(pCapability, &val);
|
||||
if (twCC == TWCC_SUCCESS)
|
||||
{
|
||||
FIXME("Stub: PIXELFLAVOR set to %d, but ignored\n", val);
|
||||
}
|
||||
break;
|
||||
|
||||
case MSG_GETDEFAULT:
|
||||
twCC = set_onevalue(pCapability, TWTY_UINT16, TWPF_CHOCOLATE);
|
||||
break;
|
||||
|
||||
case MSG_RESET:
|
||||
/* .. fall through intentional .. */
|
||||
|
||||
case MSG_GETCURRENT:
|
||||
twCC = set_onevalue(pCapability, TWTY_UINT16, TWPF_CHOCOLATE);
|
||||
break;
|
||||
}
|
||||
return twCC;
|
||||
}
|
||||
|
||||
|
||||
TW_UINT16 SANE_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action)
|
||||
{
|
||||
TW_UINT16 twCC = TWCC_CAPUNSUPPORTED;
|
||||
|
@ -376,6 +420,10 @@ TW_UINT16 SANE_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action)
|
|||
twCC = SANE_ICAPXferMech (pCapability, action);
|
||||
break;
|
||||
|
||||
case ICAP_PIXELFLAVOR:
|
||||
twCC = SANE_ICAPPixelFlavor (pCapability, action);
|
||||
break;
|
||||
|
||||
case ICAP_COMPRESSION:
|
||||
twCC = SANE_ICAPCompression(pCapability, action);
|
||||
break;
|
||||
|
|
|
@ -333,8 +333,10 @@ static void test_single_source(TW_IDENTITY *appid, TW_IDENTITY *source)
|
|||
ok(capabilities[ICAP_PHYSICALHEIGHT], "ICAP_PHYSICALHEIGHT not supported\n");
|
||||
todo_wine
|
||||
ok(capabilities[ICAP_PHYSICALWIDTH], "ICAP_PHYSICALWIDTH not supported\n");
|
||||
todo_wine
|
||||
ok(capabilities[ICAP_PIXELFLAVOR], "ICAP_PIXELFLAVOR not supported\n");
|
||||
if (capabilities[ICAP_PIXELFLAVOR])
|
||||
test_onevalue_cap(appid, source, ICAP_PIXELFLAVOR, TWTY_UINT16,
|
||||
TWQC_GET | TWQC_SET | TWQC_GETDEFAULT | TWQC_GETCURRENT | TWQC_RESET);
|
||||
|
||||
/* For Twain 1.6:
|
||||
Sources that supply image information must support DG_CONTROL / DAT_CAPABILITY /
|
||||
|
|
Loading…
Reference in New Issue