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
4b794bee
Commit
4b794bee
authored
Feb 13, 2009
by
Jeremy White
Committed by
Alexandre Julliard
Feb 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane.ds: Get resolution from sane, instead of hard coding -1.
parent
9f32c0d9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
2 deletions
+61
-2
Makefile.in
dlls/sane.ds/Makefile.in
+1
-0
ds_image.c
dlls/sane.ds/ds_image.c
+5
-2
options.c
dlls/sane.ds/options.c
+49
-0
sane_i.h
dlls/sane.ds/sane_i.h
+6
-0
No files found.
dlls/sane.ds/Makefile.in
View file @
4b794bee
...
...
@@ -10,6 +10,7 @@ C_SRCS = \
capability.c
\
ds_ctrl.c
\
ds_image.c
\
options.c
\
sane_main.c
\
ui.c
...
...
dlls/sane.ds/ds_image.c
View file @
4b794bee
...
...
@@ -86,6 +86,7 @@ TW_UINT16 SANE_ImageInfoGet (pTW_IDENTITY pOrigin,
TW_UINT16
twRC
=
TWRC_SUCCESS
;
pTW_IMAGEINFO
pImageInfo
=
(
pTW_IMAGEINFO
)
pData
;
SANE_Status
status
;
SANE_Int
resolution
;
TRACE
(
"DG_IMAGE/DAT_IMAGEINFO/MSG_GET
\n
"
);
...
...
@@ -111,9 +112,11 @@ TW_UINT16 SANE_ImageInfoGet (pTW_IDENTITY pOrigin,
activeDS
.
sane_param_valid
=
TRUE
;
}
pImageInfo
->
XResolution
.
Whole
=
-
1
;
if
(
sane_option_get_int
(
activeDS
.
deviceHandle
,
"resolution"
,
&
resolution
)
==
SANE_STATUS_GOOD
)
pImageInfo
->
XResolution
.
Whole
=
pImageInfo
->
YResolution
.
Whole
=
resolution
;
else
pImageInfo
->
XResolution
.
Whole
=
pImageInfo
->
YResolution
.
Whole
=
-
1
;
pImageInfo
->
XResolution
.
Frac
=
0
;
pImageInfo
->
YResolution
.
Whole
=
-
1
;
pImageInfo
->
YResolution
.
Frac
=
0
;
pImageInfo
->
ImageWidth
=
activeDS
.
sane_param
.
pixels_per_line
;
pImageInfo
->
ImageLength
=
activeDS
.
sane_param
.
lines
;
...
...
dlls/sane.ds/options.c
0 → 100644
View file @
4b794bee
/*
* Copyright 2009 Jeremy White <jwhite@codeweavers.com> for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include "twain.h"
#include "sane_i.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
twain
);
#ifdef SONAME_LIBSANE
SANE_Status
sane_option_get_int
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Int
*
val
)
{
SANE_Status
rc
;
SANE_Int
optcount
;
const
SANE_Option_Descriptor
*
opt
;
int
i
;
rc
=
psane_control_option
(
h
,
0
,
SANE_ACTION_GET_VALUE
,
&
optcount
,
NULL
);
if
(
rc
!=
SANE_STATUS_GOOD
)
return
rc
;
for
(
i
=
1
;
i
<
optcount
;
i
++
)
{
opt
=
psane_get_option_descriptor
(
h
,
i
);
if
(
opt
&&
(
opt
->
name
&&
strcmp
(
opt
->
name
,
option_name
)
==
0
)
&&
opt
->
type
==
SANE_TYPE_INT
)
return
psane_control_option
(
h
,
i
,
SANE_ACTION_GET_VALUE
,
val
,
NULL
);
}
return
SANE_STATUS_EOF
;
}
#endif
dlls/sane.ds/sane_i.h
View file @
4b794bee
...
...
@@ -211,4 +211,10 @@ TW_UINT16 SANE_RGBResponseSet
BOOL
DoScannerUI
(
void
);
HWND
ScanningDialogBox
(
HWND
dialog
,
LONG
progress
);
/* Option functions */
#ifdef SONAME_LIBSANE
SANE_Status
sane_option_get_int
(
SANE_Handle
h
,
const
char
*
option_name
,
SANE_Int
*
val
);
#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