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
f9bfbe2e
Commit
f9bfbe2e
authored
Oct 16, 2006
by
Kirill K. Smirnov
Committed by
Alexandre Julliard
Oct 18, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhelp: Improved metafile support.
parent
e852f195
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
25 deletions
+58
-25
hlpfile.c
programs/winhelp/hlpfile.c
+9
-13
hlpfile.h
programs/winhelp/hlpfile.h
+1
-5
winhelp.c
programs/winhelp/winhelp.c
+47
-7
winhelp.h
programs/winhelp/winhelp.h
+1
-0
No files found.
programs/winhelp/hlpfile.c
View file @
f9bfbe2e
...
...
@@ -654,16 +654,17 @@ static BOOL HLPFILE_LoadMetaFile(BYTE* beg, BYTE pack, HLPFILE_PARAGRAPH* pa
unsigned
long
size
,
csize
;
unsigned
long
off
,
hsoff
;
BYTE
*
bits
;
METAFILEPICT
mfp
;
LPMETAFILEPICT
lp
mfp
;
WINE_TRACE
(
"Loading metafile
\n
"
);
ptr
=
beg
+
2
;
/* for type and pack */
mfp
.
mm
=
fetch_ushort
(
&
ptr
);
/* mapping mode */
lpmfp
=
&
paragraph
->
u
.
gfx
.
u
.
mfp
;
lpmfp
->
mm
=
fetch_ushort
(
&
ptr
);
/* mapping mode */
mfp
.
xExt
=
GET_USHORT
(
ptr
,
0
);
mfp
.
yExt
=
GET_USHORT
(
ptr
,
2
);
lpmfp
->
xExt
=
GET_USHORT
(
ptr
,
0
);
lpmfp
->
yExt
=
GET_USHORT
(
ptr
,
2
);
ptr
+=
4
;
size
=
fetch_ulong
(
&
ptr
);
/* decompressed size */
...
...
@@ -674,25 +675,20 @@ static BOOL HLPFILE_LoadMetaFile(BYTE* beg, BYTE pack, HLPFILE_PARAGRAPH* pa
ptr
+=
8
;
WINE_TRACE
(
"sz=%lu csz=%lu (%d,%d) offs=%lu/%u,%lu
\n
"
,
size
,
csize
,
mfp
.
xExt
,
mfp
.
yExt
,
off
,
ptr
-
beg
,
hsoff
);
size
,
csize
,
lpmfp
->
xExt
,
lpmfp
->
yExt
,
off
,
ptr
-
beg
,
hsoff
);
bits
=
HLPFILE_DecompressGfx
(
beg
+
off
,
csize
,
size
,
pack
);
if
(
!
bits
)
return
FALSE
;
paragraph
->
cookie
=
para_metafile
;
mfp
.
hMF
=
NULL
;
lpmfp
->
hMF
=
SetMetaFileBitsEx
(
size
,
bits
)
;
paragraph
->
u
.
gfx
.
u
.
mf
.
hMetaFile
=
SetMetaFileBitsEx
(
size
,
bits
);
if
(
!
paragraph
->
u
.
gfx
.
u
.
mf
.
hMetaFile
)
if
(
!
lpmfp
->
hMF
)
WINE_FIXME
(
"Couldn't load metafile
\n
"
);
if
(
bits
!=
beg
+
off
)
HeapFree
(
GetProcessHeap
(),
0
,
bits
);
paragraph
->
u
.
gfx
.
u
.
mf
.
mfSize
.
cx
=
mfp
.
xExt
;
paragraph
->
u
.
gfx
.
u
.
mf
.
mfSize
.
cy
=
mfp
.
yExt
;
return
TRUE
;
}
...
...
@@ -1930,7 +1926,7 @@ static void HLPFILE_DeleteParagraph(HLPFILE_PARAGRAPH* paragraph)
next
=
paragraph
->
next
;
if
(
paragraph
->
cookie
==
para_metafile
)
DeleteMetaFile
(
paragraph
->
u
.
gfx
.
u
.
mf
.
hMetaFile
);
DeleteMetaFile
(
paragraph
->
u
.
gfx
.
u
.
mf
p
.
hMF
);
HLPFILE_FreeLink
(
paragraph
->
link
);
...
...
programs/winhelp/hlpfile.h
View file @
f9bfbe2e
...
...
@@ -69,11 +69,7 @@ typedef struct tagHlpFileParagraph
{
HBITMAP
hBitmap
;
}
bmp
;
struct
{
HMETAFILE
hMetaFile
;
SIZE
mfSize
;
}
mf
;
METAFILEPICT
mfp
;
}
u
;
}
gfx
;
/* for bitmaps and metafiles */
}
u
;
...
...
programs/winhelp/winhelp.c
View file @
f9bfbe2e
...
...
@@ -1051,11 +1051,35 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
break
;
case
hlp_line_part_metafile
:
{
POINT
pt
;
HDC
hMemDC
;
HBITMAP
hBitmap
;
SIZE
sz
;
RECT
rc
;
SetViewportOrgEx
(
hDc
,
part
->
rect
.
left
,
part
->
rect
.
top
-
scroll_pos
,
&
pt
);
PlayMetaFile
(
hDc
,
part
->
u
.
metafile
.
hMetaFile
);
SetViewportOrgEx
(
hDc
,
pt
.
x
,
pt
.
y
,
NULL
);
sz
.
cx
=
part
->
rect
.
right
-
part
->
rect
.
left
;
sz
.
cy
=
part
->
rect
.
bottom
-
part
->
rect
.
top
;
hMemDC
=
CreateCompatibleDC
(
hDc
);
hBitmap
=
CreateCompatibleBitmap
(
hDc
,
sz
.
cx
,
sz
.
cy
);
SelectObject
(
hMemDC
,
hBitmap
);
SelectObject
(
hMemDC
,
win
->
hBrush
);
rc
.
left
=
0
;
rc
.
top
=
0
;
rc
.
right
=
sz
.
cx
;
rc
.
bottom
=
sz
.
cy
;
FillRect
(
hMemDC
,
&
rc
,
win
->
hBrush
);
SetMapMode
(
hMemDC
,
part
->
u
.
metafile
.
mm
);
SetWindowExtEx
(
hMemDC
,
sz
.
cx
,
sz
.
cy
,
0
);
SetViewportExtEx
(
hMemDC
,
sz
.
cx
,
sz
.
cy
,
0
);
SetWindowOrgEx
(
hMemDC
,
0
,
0
,
0
);
SetViewportOrgEx
(
hMemDC
,
0
,
0
,
0
);
PlayMetaFile
(
hMemDC
,
part
->
u
.
metafile
.
hMetaFile
);
SetMapMode
(
hMemDC
,
MM_TEXT
);
SetWindowOrgEx
(
hMemDC
,
0
,
0
,
0
);
SetViewportOrgEx
(
hMemDC
,
0
,
0
,
0
);
BitBlt
(
hDc
,
part
->
rect
.
left
,
part
->
rect
.
top
-
scroll_pos
,
sz
.
cx
,
sz
.
cy
,
hMemDC
,
0
,
0
,
SRCCOPY
);
DeleteDC
(
hMemDC
);
DeleteObject
(
hBitmap
);
}
break
;
}
...
...
@@ -1578,8 +1602,23 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
gfxSize
.
cx
=
dibs
.
dsBm
.
bmWidth
;
gfxSize
.
cy
=
dibs
.
dsBm
.
bmHeight
;
}
else
gfxSize
=
p
->
u
.
gfx
.
u
.
mf
.
mfSize
;
else
{
LPMETAFILEPICT
lpmfp
=
&
p
->
u
.
gfx
.
u
.
mfp
;
if
(
lpmfp
->
mm
==
MM_ANISOTROPIC
||
lpmfp
->
mm
==
MM_ISOTROPIC
)
{
gfxSize
.
cx
=
MulDiv
(
lpmfp
->
xExt
,
GetDeviceCaps
(
hDc
,
HORZRES
),
100
*
GetDeviceCaps
(
hDc
,
HORZSIZE
));
gfxSize
.
cy
=
MulDiv
(
lpmfp
->
yExt
,
GetDeviceCaps
(
hDc
,
VERTRES
),
100
*
GetDeviceCaps
(
hDc
,
VERTSIZE
));
}
else
{
gfxSize
.
cx
=
lpmfp
->
xExt
;
gfxSize
.
cy
=
lpmfp
->
yExt
;
}
}
free_width
=
rect
.
right
-
((
part
&&
*
line
)
?
(
*
line
)
->
rect
.
right
:
rect
.
left
)
-
space
.
cx
;
if
(
free_width
<=
0
)
{
...
...
@@ -1601,7 +1640,8 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
else
{
ref_part
->
cookie
=
hlp_line_part_metafile
;
ref_part
->
u
.
metafile
.
hMetaFile
=
p
->
u
.
gfx
.
u
.
mf
.
hMetaFile
;
ref_part
->
u
.
metafile
.
hMetaFile
=
p
->
u
.
gfx
.
u
.
mfp
.
hMF
;
ref_part
->
u
.
metafile
.
mm
=
p
->
u
.
gfx
.
u
.
mfp
.
mm
;
}
}
break
;
...
...
programs/winhelp/winhelp.h
View file @
f9bfbe2e
...
...
@@ -62,6 +62,7 @@ typedef struct tagHelpLinePart
struct
{
HMETAFILE
hMetaFile
;
INT
mm
;
}
metafile
;
}
u
;
HLPFILE_LINK
*
link
;
...
...
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