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
782ea74a
Commit
782ea74a
authored
Mar 10, 2009
by
Jeremy White
Committed by
Alexandre Julliard
Mar 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane.ds: Move a few static functions so they can be shared.
parent
689a49b5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
52 deletions
+51
-52
capability.c
dlls/sane.ds/capability.c
+0
-52
options.c
dlls/sane.ds/options.c
+49
-0
sane_i.h
dlls/sane.ds/sane_i.h
+2
-0
No files found.
dlls/sane.ds/capability.c
View file @
782ea74a
...
@@ -315,33 +315,6 @@ static BOOL sane_mode_to_pixeltype(SANE_String_Const mode, TW_UINT16 *pixeltype)
...
@@ -315,33 +315,6 @@ static BOOL sane_mode_to_pixeltype(SANE_String_Const mode, TW_UINT16 *pixeltype)
return
TRUE
;
return
TRUE
;
}
}
static
TW_UINT16
sane_status_to_twcc
(
SANE_Status
rc
)
{
switch
(
rc
)
{
case
SANE_STATUS_GOOD
:
return
TWCC_SUCCESS
;
case
SANE_STATUS_UNSUPPORTED
:
return
TWCC_CAPUNSUPPORTED
;
case
SANE_STATUS_JAMMED
:
return
TWCC_PAPERJAM
;
case
SANE_STATUS_NO_MEM
:
return
TWCC_LOWMEMORY
;
case
SANE_STATUS_ACCESS_DENIED
:
return
TWCC_DENIED
;
case
SANE_STATUS_IO_ERROR
:
case
SANE_STATUS_NO_DOCS
:
case
SANE_STATUS_COVER_OPEN
:
case
SANE_STATUS_EOF
:
case
SANE_STATUS_INVAL
:
case
SANE_STATUS_CANCELLED
:
case
SANE_STATUS_DEVICE_BUSY
:
default:
return
TWCC_BUMMER
;
}
}
#endif
#endif
/* ICAP_PIXELTYPE */
/* ICAP_PIXELTYPE */
...
@@ -696,31 +669,6 @@ static TW_UINT16 SANE_ICAPResolution (pTW_CAPABILITY pCapability, TW_UINT16 acti
...
@@ -696,31 +669,6 @@ static TW_UINT16 SANE_ICAPResolution (pTW_CAPABILITY pCapability, TW_UINT16 acti
return
twCC
;
return
twCC
;
}
}
#ifdef SONAME_LIBSANE
static
void
convert_double_fix32
(
double
d
,
TW_FIX32
*
fix32
)
{
TW_INT32
value
=
(
TW_INT32
)
(
d
*
65536
.
0
+
0
.
5
);
fix32
->
Whole
=
value
>>
16
;
fix32
->
Frac
=
value
&
0x0000ffffL
;
}
static
BOOL
convert_sane_res_to_twain
(
double
sane_res
,
SANE_Unit
unit
,
TW_FIX32
*
twain_res
,
TW_UINT16
twtype
)
{
double
d
;
if
(
unit
!=
SANE_UNIT_MM
)
return
FALSE
;
if
(
twtype
!=
TWUN_INCHES
)
return
FALSE
;
d
=
(
sane_res
/
10
.
0
)
/
2
.
54
;
convert_double_fix32
((
sane_res
/
10
.
0
)
/
2
.
54
,
twain_res
);
return
TRUE
;
}
#endif
/* ICAP_PHYSICALHEIGHT, ICAP_PHYSICALWIDTH */
/* ICAP_PHYSICALHEIGHT, ICAP_PHYSICALWIDTH */
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
)
{
{
...
...
dlls/sane.ds/options.c
View file @
782ea74a
...
@@ -218,4 +218,53 @@ SANE_Status sane_option_probe_scan_area(SANE_Handle h, const char *option_name,
...
@@ -218,4 +218,53 @@ SANE_Status sane_option_probe_scan_area(SANE_Handle h, const char *option_name,
return
rc
;
return
rc
;
}
}
TW_UINT16
sane_status_to_twcc
(
SANE_Status
rc
)
{
switch
(
rc
)
{
case
SANE_STATUS_GOOD
:
return
TWCC_SUCCESS
;
case
SANE_STATUS_UNSUPPORTED
:
return
TWCC_CAPUNSUPPORTED
;
case
SANE_STATUS_JAMMED
:
return
TWCC_PAPERJAM
;
case
SANE_STATUS_NO_MEM
:
return
TWCC_LOWMEMORY
;
case
SANE_STATUS_ACCESS_DENIED
:
return
TWCC_DENIED
;
case
SANE_STATUS_IO_ERROR
:
case
SANE_STATUS_NO_DOCS
:
case
SANE_STATUS_COVER_OPEN
:
case
SANE_STATUS_EOF
:
case
SANE_STATUS_INVAL
:
case
SANE_STATUS_CANCELLED
:
case
SANE_STATUS_DEVICE_BUSY
:
default:
return
TWCC_BUMMER
;
}
}
static
void
convert_double_fix32
(
double
d
,
TW_FIX32
*
fix32
)
{
TW_INT32
value
=
(
TW_INT32
)
(
d
*
65536
.
0
+
0
.
5
);
fix32
->
Whole
=
value
>>
16
;
fix32
->
Frac
=
value
&
0x0000ffffL
;
}
BOOL
convert_sane_res_to_twain
(
double
sane_res
,
SANE_Unit
unit
,
TW_FIX32
*
twain_res
,
TW_UINT16
twtype
)
{
double
d
;
if
(
unit
!=
SANE_UNIT_MM
)
return
FALSE
;
if
(
twtype
!=
TWUN_INCHES
)
return
FALSE
;
d
=
(
sane_res
/
10
.
0
)
/
2
.
54
;
convert_double_fix32
((
sane_res
/
10
.
0
)
/
2
.
54
,
twain_res
);
return
TRUE
;
}
#endif
#endif
dlls/sane.ds/sane_i.h
View file @
782ea74a
...
@@ -234,6 +234,8 @@ SANE_Status sane_option_probe_scan_area(SANE_Handle h, const char *option_name,
...
@@ -234,6 +234,8 @@ SANE_Status sane_option_probe_scan_area(SANE_Handle h, const char *option_name,
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
);
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
);
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
);
TW_UINT16
sane_status_to_twcc
(
SANE_Status
rc
);
BOOL
convert_sane_res_to_twain
(
double
sane_res
,
SANE_Unit
unit
,
TW_FIX32
*
twain_res
,
TW_UINT16
twtype
);
#endif
#endif
...
...
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