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
5ac00719
Commit
5ac00719
authored
Dec 11, 2003
by
Richard Cohen
Committed by
Alexandre Julliard
Dec 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fix obsolete comments about windowsx, commdlg.
- Increase filename length to MAX_PATH. - Set the windows extent before playing the metafile. - Don't hardcode logpixels to 96.
parent
e45d29cd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
view.c
programs/view/view.c
+10
-16
No files found.
programs/view/view.c
View file @
5ac00719
...
...
@@ -17,16 +17,8 @@
*/
#include <windows.h>
#include "resource.h"
/*
#include <windowsx.h>
Wine doesn't have windowsx.h, so we use this
*/
#define GET_WM_COMMAND_ID(wp,lp) LOWORD(wp)
/* Wine seems to need this */
#include <commdlg.h>
#include "resource.h"
#include "globals.h"
#include <stdio.h>
...
...
@@ -34,8 +26,6 @@
BOOL
FileIsPlaceable
(
LPCSTR
szFileName
);
HMETAFILE
GetPlaceableMetaFile
(
HWND
hwnd
,
LPCSTR
szFileName
);
#define FN_LENGTH 80
HMETAFILE
hmf
;
int
deltax
=
0
,
deltay
=
0
;
int
width
=
0
,
height
=
0
;
...
...
@@ -69,11 +59,12 @@ LRESULT CALLBACK WndProc(HWND hwnd,
PAINTSTRUCT
ps
;
BeginPaint
(
hwnd
,
&
ps
);
SetMapMode
(
ps
.
hdc
,
MM_ANISOTROPIC
);
/* Set the window extent to a sane value in case the metafile doesn't */
SetWindowExtEx
(
ps
.
hdc
,
width
,
height
,
NULL
);
SetViewportExtEx
(
ps
.
hdc
,
width
,
height
,
NULL
);
SetViewportOrgEx
(
ps
.
hdc
,
deltax
,
deltay
,
NULL
);
if
(
hmf
)
PlayMetaFile
(
ps
.
hdc
,
hmf
);
EndPaint
(
hwnd
,
&
ps
);
}
break
;
...
...
@@ -86,8 +77,8 @@ LRESULT CALLBACK WndProc(HWND hwnd,
case
IDM_OPEN
:
{
char
filename
[
FN_LENG
TH
];
if
(
FileOpen
(
hwnd
,
filename
,
FN_LENGTH
))
{
char
filename
[
MAX_PA
TH
];
if
(
FileOpen
(
hwnd
,
filename
,
sizeof
(
filename
)
))
{
isAldus
=
FileIsPlaceable
(
filename
);
if
(
isAldus
)
{
hmf
=
GetPlaceableMetaFile
(
hwnd
,
filename
);
...
...
@@ -178,6 +169,7 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName )
HFILE
fh
;
HMETAFILE
hmf
;
WORD
checksum
,
*
p
;
HDC
hdc
;
int
i
;
if
(
(
fh
=
_lopen
(
szFileName
,
OF_READ
)
)
==
HFILE_ERROR
)
return
0
;
...
...
@@ -218,8 +210,10 @@ HMETAFILE GetPlaceableMetaFile( HWND hwnd, LPCSTR szFileName )
height
=
APMHeader
.
bbox
.
Bottom
-
APMHeader
.
bbox
.
Top
;
/* printf("Ok! width %d height %d inch %d\n", width, height, APMHeader.inch); */
width
=
width
*
96
/
APMHeader
.
inch
;
height
=
height
*
96
/
APMHeader
.
inch
;
hdc
=
GetDC
(
hwnd
);
width
=
width
*
GetDeviceCaps
(
hdc
,
LOGPIXELSX
)
/
APMHeader
.
inch
;
height
=
height
*
GetDeviceCaps
(
hdc
,
LOGPIXELSY
)
/
APMHeader
.
inch
;
ReleaseDC
(
hwnd
,
hdc
);
deltax
=
0
;
deltay
=
0
;
...
...
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