Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1fe2a12b
Commit
1fe2a12b
authored
Oct 27, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane.ds: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
64d54282
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
53 deletions
+21
-53
Makefile.in
dlls/sane.ds/Makefile.in
+0
-2
capability.c
dlls/sane.ds/capability.c
+0
-2
ds_ctrl.c
dlls/sane.ds/ds_ctrl.c
+0
-5
ds_image.c
dlls/sane.ds/ds_image.c
+0
-2
options.c
dlls/sane.ds/options.c
+4
-10
sane_i.h
dlls/sane.ds/sane_i.h
+0
-4
sane_main.c
dlls/sane.ds/sane_main.c
+1
-5
ui.c
dlls/sane.ds/ui.c
+16
-23
No files found.
dlls/sane.ds/Makefile.in
View file @
1fe2a12b
...
...
@@ -4,8 +4,6 @@ IMPORTS = comctl32 user32 gdi32
EXTRALIBS
=
$(SANE_LIBS)
EXTRAINCL
=
$(SANE_CFLAGS)
EXTRADLLFLAGS
=
-mcygwin
C_SRCS
=
\
capability.c
\
ds_ctrl.c
\
...
...
dlls/sane.ds/capability.c
View file @
1fe2a12b
...
...
@@ -16,8 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <math.h>
...
...
dlls/sane.ds/ds_ctrl.c
View file @
1fe2a12b
...
...
@@ -16,11 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <stdlib.h>
#include "sane_i.h"
#include "wine/debug.h"
...
...
dlls/sane.ds/ds_image.c
View file @
1fe2a12b
...
...
@@ -17,8 +17,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include "sane_i.h"
...
...
dlls/sane.ds/options.c
View file @
1fe2a12b
...
...
@@ -16,15 +16,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "sane_i.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
twain
);
...
...
@@ -143,14 +140,11 @@ TW_UINT16 sane_option_probe_mode(TW_UINT16 *current, TW_UINT32 *choices, int *co
*
count
=
0
;
if
(
opt
.
constraint_type
==
CONSTRAINT_STRING_LIST
)
{
for
(
p
=
opt
.
constraint
.
strings
;
*
p
;
p
+=
strlenW
(
p
)
+
1
)
for
(
p
=
opt
.
constraint
.
strings
;
*
p
;
p
+=
l
strlenW
(
p
)
+
1
)
{
static
const
WCHAR
lineartW
[]
=
{
'L'
,
'i'
,
'n'
,
'e'
,
'a'
,
'r'
,
't'
,
0
};
static
const
WCHAR
colorW
[]
=
{
'C'
,
'o'
,
'l'
,
'o'
,
'r'
,
0
};
static
const
WCHAR
grayW
[]
=
{
'G'
,
'r'
,
'a'
,
'y'
,
0
};
if
(
!
strcmpW
(
p
,
lineartW
))
choices
[(
*
count
)
++
]
=
TWPT_BW
;
else
if
(
!
strcmpW
(
p
,
colorW
))
choices
[(
*
count
)
++
]
=
TWPT_RGB
;
else
if
(
!
strncmpW
(
p
,
grayW
,
4
))
choices
[(
*
count
)
++
]
=
TWPT_GRAY
;
if
(
!
wcscmp
(
p
,
L"Lineart"
))
choices
[(
*
count
)
++
]
=
TWPT_BW
;
else
if
(
!
wcscmp
(
p
,
L"Color"
))
choices
[(
*
count
)
++
]
=
TWPT_RGB
;
else
if
(
!
wcsncmp
(
p
,
L"Gray"
,
4
))
choices
[(
*
count
)
++
]
=
TWPT_GRAY
;
}
}
return
rc
;
...
...
dlls/sane.ds/sane_i.h
View file @
1fe2a12b
...
...
@@ -19,10 +19,6 @@
#ifndef _TWAIN32_H
#define _TWAIN32_H
#ifndef __WINE_CONFIG_H
# error You must include config.h first
#endif
#include <stdarg.h>
#include "windef.h"
...
...
dlls/sane.ds/sane_main.c
View file @
1fe2a12b
...
...
@@ -18,9 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include <stdio.h>
...
...
@@ -64,8 +61,7 @@ static TW_UINT16 SANE_OpenDS( pTW_IDENTITY pOrigin, pTW_IDENTITY self)
if
(
SANE_dsmentry
==
NULL
)
{
static
const
WCHAR
twain32W
[]
=
{
't'
,
'w'
,
'a'
,
'i'
,
'n'
,
'_'
,
'3'
,
'2'
,
0
};
HMODULE
moddsm
=
GetModuleHandleW
(
twain32W
);
HMODULE
moddsm
=
GetModuleHandleW
(
L"twain_32"
);
if
(
moddsm
)
SANE_dsmentry
=
(
void
*
)
GetProcAddress
(
moddsm
,
"DSM_Entry"
);
...
...
dlls/sane.ds/ui.c
View file @
1fe2a12b
...
...
@@ -18,8 +18,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
...
...
@@ -33,7 +31,6 @@
#include "prsht.h"
#include "wine/debug.h"
#include "resource.h"
#include "wine/unicode.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
twain
);
...
...
@@ -60,7 +57,7 @@ static int create_leading_static(HDC hdc, const WCHAR *text,
base
=
GetDialogBaseUnits
();
len
=
strlenW
(
text
)
*
sizeof
(
WCHAR
);
len
=
l
strlenW
(
text
)
*
sizeof
(
WCHAR
);
len
+=
sizeof
(
DLGITEMTEMPLATE
);
len
+=
4
*
sizeof
(
WORD
);
...
...
@@ -78,8 +75,8 @@ static int create_leading_static(HDC hdc, const WCHAR *text,
ptr
=
(
WORD
*
)(
tpl
+
1
);
*
ptr
++
=
0xffff
;
*
ptr
++
=
0x0082
;
strcpyW
(
ptr
,
text
);
ptr
+=
strlenW
(
ptr
)
+
1
;
l
strcpyW
(
ptr
,
text
);
ptr
+=
l
strlenW
(
ptr
)
+
1
;
*
ptr
=
0
;
*
template_out
=
tpl
;
...
...
@@ -99,7 +96,7 @@ static int create_trailing_edit(HDC hdc, LPDLGITEMTEMPLATEW* template_out, int i
base
=
GetDialogBaseUnits
();
len
=
strlenW
(
text
)
*
sizeof
(
WCHAR
);
len
=
l
strlenW
(
text
)
*
sizeof
(
WCHAR
);
len
+=
sizeof
(
DLGITEMTEMPLATE
);
len
+=
4
*
sizeof
(
WORD
);
...
...
@@ -121,8 +118,8 @@ static int create_trailing_edit(HDC hdc, LPDLGITEMTEMPLATEW* template_out, int i
ptr
=
(
WORD
*
)(
tpl
+
1
);
*
ptr
++
=
0xffff
;
*
ptr
++
=
0x0081
;
strcpyW
(
ptr
,
text
);
ptr
+=
strlenW
(
ptr
)
+
1
;
l
strcpyW
(
ptr
,
text
);
ptr
+=
l
strlenW
(
ptr
)
+
1
;
*
ptr
=
0
;
*
template_out
=
tpl
;
...
...
@@ -165,9 +162,8 @@ static int create_item(HDC hdc, const struct option_descriptor *opt,
case
TYPE_INT
:
{
int
i
;
static
const
WCHAR
fmtW
[]
=
{
'%'
,
'i'
,
0
};
sane_option_get_value
(
id
-
ID_BASE
,
&
i
);
s
printfW
(
buffer
,
fmtW
,
i
);
s
wprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"%i"
,
i
);
switch
(
opt
->
constraint_type
)
{
...
...
@@ -193,12 +189,11 @@ static int create_item(HDC hdc, const struct option_descriptor *opt,
}
case
TYPE_FIXED
:
{
static
const
WCHAR
fmtW
[]
=
{
'%'
,
'f'
,
0
};
int
*
i
=
HeapAlloc
(
GetProcessHeap
(),
0
,
opt
->
size
*
sizeof
(
int
));
sane_option_get_value
(
id
-
ID_BASE
,
i
);
s
printfW
(
buffer
,
fmtW
,
*
i
/
65536
.
0
);
s
wprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"%f"
,
*
i
/
65536
.
0
);
HeapFree
(
GetProcessHeap
(),
0
,
i
);
switch
(
opt
->
constraint_type
)
...
...
@@ -253,7 +248,7 @@ static int create_item(HDC hdc, const struct option_descriptor *opt,
}
local_len
+=
sizeof
(
DLGITEMTEMPLATE
);
if
(
title
)
local_len
+=
strlenW
(
title
)
*
sizeof
(
WCHAR
);
if
(
title
)
local_len
+=
l
strlenW
(
title
)
*
sizeof
(
WCHAR
);
local_len
+=
4
*
sizeof
(
WORD
);
if
(
lead_static
)
...
...
@@ -299,8 +294,8 @@ static int create_item(HDC hdc, const struct option_descriptor *opt,
*
ptr
++
=
class
;
if
(
title
)
{
strcpyW
(
ptr
,
title
);
ptr
+=
strlenW
(
ptr
);
l
strcpyW
(
ptr
,
title
);
ptr
+=
l
strlenW
(
ptr
);
}
*
ptr
++
=
0
;
*
ptr
=
0
;
...
...
@@ -513,8 +508,8 @@ BOOL DoScannerUI(void)
if
(
opt
.
type
==
TYPE_GROUP
)
{
LPWSTR
title
=
HeapAlloc
(
GetProcessHeap
(),
0
,(
strlenW
(
opt
.
title
)
+
1
)
*
sizeof
(
WCHAR
));
strcpyW
(
title
,
opt
.
title
);
LPWSTR
title
=
HeapAlloc
(
GetProcessHeap
(),
0
,(
l
strlenW
(
opt
.
title
)
+
1
)
*
sizeof
(
WCHAR
));
l
strcpyW
(
title
,
opt
.
title
);
psp
[
page_count
].
pszTitle
=
title
;
}
...
...
@@ -575,7 +570,6 @@ static void UpdateRelevantEdit(HWND hwnd, const struct option_descriptor *opt, i
{
case
TYPE_INT
:
{
static
const
WCHAR
formatW
[]
=
{
'%'
,
'i'
,
0
};
INT
si
;
if
(
opt
->
constraint
.
range
.
quant
)
...
...
@@ -583,12 +577,11 @@ static void UpdateRelevantEdit(HWND hwnd, const struct option_descriptor *opt, i
else
si
=
position
;
len
=
s
printfW
(
buffer
,
formatW
,
si
);
len
=
s
wprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"%i"
,
si
);
break
;
}
case
TYPE_FIXED
:
{
static
const
WCHAR
formatW
[]
=
{
'%'
,
'f'
,
0
};
double
dd
;
if
(
opt
->
constraint
.
range
.
quant
)
...
...
@@ -596,7 +589,7 @@ static void UpdateRelevantEdit(HWND hwnd, const struct option_descriptor *opt, i
else
dd
=
position
*
0
.
01
;
len
=
s
printfW
(
buffer
,
formatW
,
dd
);
len
=
s
wprintf
(
buffer
,
ARRAY_SIZE
(
buffer
),
L"%f"
,
dd
);
break
;
}
default:
...
...
@@ -679,7 +672,7 @@ static INT_PTR InitializeDialog(HWND hwnd)
CHAR
buffer
[
255
];
WCHAR
*
p
;
for
(
p
=
opt
.
constraint
.
strings
;
*
p
;
p
+=
strlenW
(
p
)
+
1
)
for
(
p
=
opt
.
constraint
.
strings
;
*
p
;
p
+=
l
strlenW
(
p
)
+
1
)
SendMessageW
(
control
,
CB_ADDSTRING
,
0
,
(
LPARAM
)
p
);
sane_option_get_value
(
i
,
buffer
);
SendMessageA
(
control
,
CB_SELECTSTRING
,
0
,(
LPARAM
)
buffer
);
...
...
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