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
31a4a58f
Commit
31a4a58f
authored
Sep 11, 2017
by
Vincent Povirk
Committed by
Alexandre Julliard
Sep 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane.ds: Add support for word list options.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
72e5f1af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
ui.c
dlls/sane.ds/ui.c
+37
-0
No files found.
dlls/sane.ds/ui.c
View file @
31a4a58f
...
...
@@ -716,6 +716,23 @@ static BOOL UpdateSaneBoolOption(int index, BOOL position)
return
FALSE
;
}
static
BOOL
UpdateSaneIntOption
(
int
index
,
SANE_Int
value
)
{
SANE_Status
rc
=
SANE_STATUS_GOOD
;
SANE_Int
result
=
0
;
rc
=
psane_control_option
(
activeDS
.
deviceHandle
,
index
,
SANE_ACTION_SET_VALUE
,
&
value
,
&
result
);
if
(
rc
==
SANE_STATUS_GOOD
)
{
if
(
result
&
SANE_INFO_RELOAD_OPTIONS
||
result
&
SANE_INFO_RELOAD_PARAMS
||
result
&
SANE_INFO_INEXACT
)
return
TRUE
;
}
return
FALSE
;
}
static
BOOL
UpdateSaneStringOption
(
int
index
,
SANE_String
value
)
{
SANE_Status
rc
=
SANE_STATUS_GOOD
;
...
...
@@ -791,6 +808,21 @@ static INT_PTR InitializeDialog(HWND hwnd)
SendMessageA
(
control
,
BM_SETCHECK
,
BST_CHECKED
,
0
);
}
else
if
(
opt
->
type
==
SANE_TYPE_INT
&&
opt
->
constraint_type
==
SANE_CONSTRAINT_WORD_LIST
)
{
int
j
,
count
=
opt
->
constraint
.
word_list
[
0
];
CHAR
buffer
[
16
];
SANE_Int
val
;
for
(
j
=
1
;
j
<=
count
;
j
++
)
{
sprintf
(
buffer
,
"%d"
,
opt
->
constraint
.
word_list
[
j
]);
SendMessageA
(
control
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
buffer
);
}
psane_control_option
(
activeDS
.
deviceHandle
,
i
,
SANE_ACTION_GET_VALUE
,
&
val
,
NULL
);
sprintf
(
buffer
,
"%d"
,
val
);
SendMessageA
(
control
,
CB_SELECTSTRING
,
0
,(
LPARAM
)
buffer
);
}
else
if
(
opt
->
constraint_type
==
SANE_CONSTRAINT_RANGE
)
{
if
(
opt
->
type
==
SANE_TYPE_INT
)
...
...
@@ -977,6 +1009,11 @@ static void ComboChanged(HWND hwnd, INT id, HWND control)
if
(
UpdateSaneStringOption
(
index
,
value
))
InitializeDialog
(
hwnd
);
}
else
if
(
opt
->
type
==
SANE_TYPE_INT
)
{
if
(
UpdateSaneIntOption
(
index
,
atoi
(
value
)))
InitializeDialog
(
hwnd
);
}
}
...
...
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