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
5a0129c0
Commit
5a0129c0
authored
Apr 11, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Apr 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Move the duplex list to a standard list.
parent
e6e42c86
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
31 deletions
+44
-31
driver.c
dlls/wineps.drv/driver.c
+17
-8
ppd.c
dlls/wineps.drv/ppd.c
+21
-19
ps.c
dlls/wineps.drv/ps.c
+2
-1
psdrv.h
dlls/wineps.drv/psdrv.h
+4
-3
No files found.
dlls/wineps.drv/driver.c
View file @
5a0129c0
...
...
@@ -195,7 +195,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
WPARAM
wParam
,
LPARAM
lParam
)
{
PSDRV_DLGINFO
*
di
;
int
i
,
Cursel
=
0
;
int
i
,
Cursel
;
PAGESIZE
*
ps
;
DUPLEX
*
duplex
;
...
...
@@ -204,7 +204,7 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
di
=
(
PSDRV_DLGINFO
*
)((
PROPSHEETPAGEA
*
)
lParam
)
->
lParam
;
SetWindowLongPtrW
(
hwnd
,
DWLP_USER
,
(
LONG_PTR
)
di
);
i
=
0
;
i
=
Cursel
=
0
;
LIST_FOR_EACH_ENTRY
(
ps
,
&
di
->
pi
->
ppd
->
PageSizes
,
PAGESIZE
,
entry
)
{
SendDlgItemMessageA
(
hwnd
,
IDD_PAPERS
,
LB_INSERTSTRING
,
i
,
(
LPARAM
)
ps
->
FullName
);
...
...
@@ -219,16 +219,21 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
DMORIENT_PORTRAIT
?
IDD_ORIENT_PORTRAIT
:
IDD_ORIENT_LANDSCAPE
);
if
(
!
di
->
pi
->
ppd
->
Duplexes
)
{
if
(
list_empty
(
&
di
->
pi
->
ppd
->
Duplexes
))
{
ShowWindow
(
GetDlgItem
(
hwnd
,
IDD_DUPLEX
),
SW_HIDE
);
ShowWindow
(
GetDlgItem
(
hwnd
,
IDD_DUPLEX_NAME
),
SW_HIDE
);
}
else
{
Cursel
=
0
;
for
(
duplex
=
di
->
pi
->
ppd
->
Duplexes
,
i
=
0
;
duplex
;
duplex
=
duplex
->
next
,
i
++
)
{
}
else
{
i
=
Cursel
=
0
;
LIST_FOR_EACH_ENTRY
(
duplex
,
&
di
->
pi
->
ppd
->
Duplexes
,
DUPLEX
,
entry
)
{
SendDlgItemMessageA
(
hwnd
,
IDD_DUPLEX
,
CB_INSERTSTRING
,
i
,
(
LPARAM
)(
duplex
->
FullName
?
duplex
->
FullName
:
duplex
->
Name
));
if
(
di
->
pi
->
Devmode
->
dmPublic
.
dmDuplex
==
duplex
->
WinDuplex
)
Cursel
=
i
;
i
++
;
}
SendDlgItemMessageA
(
hwnd
,
IDD_DUPLEX
,
CB_SETCURSEL
,
Cursel
,
0
);
}
...
...
@@ -261,8 +266,12 @@ static INT_PTR CALLBACK PSDRV_PaperDlgProc(HWND hwnd, UINT msg,
case
IDD_DUPLEX
:
if
(
HIWORD
(
wParam
)
==
CBN_SELCHANGE
)
{
Cursel
=
SendDlgItemMessageA
(
hwnd
,
LOWORD
(
wParam
),
CB_GETCURSEL
,
0
,
0
);
for
(
i
=
0
,
duplex
=
di
->
pi
->
ppd
->
Duplexes
;
i
<
Cursel
;
i
++
,
duplex
=
duplex
->
next
)
;
i
=
0
;
LIST_FOR_EACH_ENTRY
(
duplex
,
&
di
->
pi
->
ppd
->
Duplexes
,
DUPLEX
,
entry
)
{
if
(
i
>=
Cursel
)
break
;
i
++
;
}
TRACE
(
"Setting duplex to item %d Winduplex = %d
\n
"
,
Cursel
,
duplex
->
WinDuplex
);
di
->
dlgdm
->
dmPublic
.
dmDuplex
=
duplex
->
WinDuplex
;
SendMessageW
(
GetParent
(
hwnd
),
PSM_CHANGED
,
0
,
0
);
...
...
dlls/wineps.drv/ppd.c
View file @
5a0129c0
...
...
@@ -632,6 +632,7 @@ PPD *PSDRV_ParsePPD(char *fname)
list_init
(
&
ppd
->
PageSizes
);
list_init
(
&
ppd
->
Constraints
);
list_init
(
&
ppd
->
InputSlots
);
list_init
(
&
ppd
->
Duplexes
);
/*
* The Windows PostScript drivers create the following "virtual bin" for
...
...
@@ -869,27 +870,24 @@ PPD *PSDRV_ParsePPD(char *fname)
TRACE
(
"*TTRasterizer = %d
\n
"
,
ppd
->
TTRasterizer
);
}
else
if
(
!
strcmp
(
"*Duplex"
,
tuple
.
key
))
{
DUPLEX
**
duplex
;
for
(
duplex
=
&
ppd
->
Duplexes
;
*
duplex
;
duplex
=
&
(
*
duplex
)
->
next
)
;
*
duplex
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
**
duplex
));
(
*
duplex
)
->
Name
=
tuple
.
option
;
(
*
duplex
)
->
FullName
=
tuple
.
opttrans
;
(
*
duplex
)
->
InvocationString
=
tuple
.
value
;
(
*
duplex
)
->
next
=
NULL
;
else
if
(
!
strcmp
(
"*Duplex"
,
tuple
.
key
))
{
DUPLEX
*
duplex
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
duplex
)
);
duplex
->
Name
=
tuple
.
option
;
duplex
->
FullName
=
tuple
.
opttrans
;
duplex
->
InvocationString
=
tuple
.
value
;
if
(
!
strcasecmp
(
"None"
,
tuple
.
option
)
||
!
strcasecmp
(
"False"
,
tuple
.
option
)
||
!
strcasecmp
(
"Simplex"
,
tuple
.
option
))
(
*
duplex
)
->
WinDuplex
=
DMDUP_SIMPLEX
;
duplex
->
WinDuplex
=
DMDUP_SIMPLEX
;
else
if
(
!
strcasecmp
(
"DuplexNoTumble"
,
tuple
.
option
))
(
*
duplex
)
->
WinDuplex
=
DMDUP_VERTICAL
;
duplex
->
WinDuplex
=
DMDUP_VERTICAL
;
else
if
(
!
strcasecmp
(
"DuplexTumble"
,
tuple
.
option
))
(
*
duplex
)
->
WinDuplex
=
DMDUP_HORIZONTAL
;
duplex
->
WinDuplex
=
DMDUP_HORIZONTAL
;
else
if
(
!
strcasecmp
(
"Notcapable"
,
tuple
.
option
))
(
*
duplex
)
->
WinDuplex
=
0
;
duplex
->
WinDuplex
=
0
;
else
{
FIXME
(
"Unknown option %s for *Duplex defaulting to simplex
\n
"
,
tuple
.
option
);
(
*
duplex
)
->
WinDuplex
=
DMDUP_SIMPLEX
;
duplex
->
WinDuplex
=
DMDUP_SIMPLEX
;
}
tuple
.
option
=
tuple
.
opttrans
=
tuple
.
value
=
NULL
;
}
...
...
@@ -945,10 +943,13 @@ PPD *PSDRV_ParsePPD(char *fname)
}
ppd
->
DefaultDuplex
=
NULL
;
if
(
default_duplex
)
{
if
(
default_duplex
)
{
DUPLEX
*
duplex
;
for
(
duplex
=
ppd
->
Duplexes
;
duplex
;
duplex
=
duplex
->
next
)
{
if
(
!
strcmp
(
duplex
->
Name
,
default_duplex
))
{
LIST_FOR_EACH_ENTRY
(
duplex
,
&
ppd
->
Duplexes
,
DUPLEX
,
entry
)
{
if
(
!
strcmp
(
duplex
->
Name
,
default_duplex
))
{
ppd
->
DefaultDuplex
=
duplex
;
TRACE
(
"DefaultDuplex: %s
\n
"
,
duplex
->
Name
);
break
;
...
...
@@ -956,8 +957,9 @@ PPD *PSDRV_ParsePPD(char *fname)
}
HeapFree
(
PSDRV_Heap
,
0
,
default_duplex
);
}
if
(
!
ppd
->
DefaultDuplex
)
{
ppd
->
DefaultDuplex
=
ppd
->
Duplexes
;
if
(
!
ppd
->
DefaultDuplex
)
{
ppd
->
DefaultDuplex
=
LIST_ENTRY
(
list_head
(
&
ppd
->
Duplexes
),
DUPLEX
,
entry
);
TRACE
(
"Setting DefaultDuplex to first in list
\n
"
);
}
...
...
dlls/wineps.drv/ps.c
View file @
5a0129c0
...
...
@@ -372,7 +372,8 @@ INT PSDRV_WriteHeader( PHYSDEV dev, LPCWSTR title )
win_duplex
=
physDev
->
Devmode
->
dmPublic
.
dmFields
&
DM_DUPLEX
?
physDev
->
Devmode
->
dmPublic
.
dmDuplex
:
0
;
for
(
duplex
=
physDev
->
pi
->
ppd
->
Duplexes
;
duplex
;
duplex
=
duplex
->
next
)
{
LIST_FOR_EACH_ENTRY
(
duplex
,
&
physDev
->
pi
->
ppd
->
Duplexes
,
DUPLEX
,
entry
)
{
if
(
duplex
->
WinDuplex
==
win_duplex
)
{
if
(
duplex
->
InvocationString
)
{
PSDRV_WriteFeature
(
dev
,
"*Duplex"
,
duplex
->
Name
,
...
...
dlls/wineps.drv/psdrv.h
View file @
5a0129c0
...
...
@@ -189,12 +189,13 @@ typedef struct
typedef
enum
_RASTERIZEROPTION
{
RO_None
,
RO_Accept68K
,
RO_Type42
,
RO_TrueImage
}
RASTERIZEROPTION
;
typedef
struct
_tagDUPLEX
{
typedef
struct
{
struct
list
entry
;
char
*
Name
;
char
*
FullName
;
char
*
InvocationString
;
WORD
WinDuplex
;
/* eg DMDUP_SIMPLEX */
struct
_tagDUPLEX
*
next
;
}
DUPLEX
;
/* Many Mac OS X based ppd files don't include a *ColorDevice line, so
...
...
@@ -223,7 +224,7 @@ typedef struct {
struct
list
Constraints
;
struct
list
InputSlots
;
RASTERIZEROPTION
TTRasterizer
;
DUPLEX
*
Duplexes
;
struct
list
Duplexes
;
DUPLEX
*
DefaultDuplex
;
}
PPD
;
...
...
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