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
28206822
Commit
28206822
authored
May 07, 2008
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Implement EMFDRV_SelectPalette.
parent
51c28a14
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
1 deletion
+57
-1
enhmetafiledrv.h
dlls/gdi32/enhmfdrv/enhmetafiledrv.h
+1
-0
init.c
dlls/gdi32/enhmfdrv/init.c
+1
-1
objects.c
dlls/gdi32/enhmfdrv/objects.c
+55
-0
No files found.
dlls/gdi32/enhmfdrv/enhmetafiledrv.h
View file @
28206822
...
...
@@ -122,6 +122,7 @@ extern HBRUSH EMFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle ) DECLSPEC_HIDDEN
extern
BOOL
EMFDRV_SelectClipPath
(
PHYSDEV
dev
,
INT
iMode
)
DECLSPEC_HIDDEN
;
extern
HFONT
EMFDRV_SelectFont
(
PHYSDEV
dev
,
HFONT
handle
,
HANDLE
gdiFont
)
DECLSPEC_HIDDEN
;
extern
HPEN
EMFDRV_SelectPen
(
PHYSDEV
dev
,
HPEN
handle
)
DECLSPEC_HIDDEN
;
extern
HPALETTE
EMFDRV_SelectPalette
(
PHYSDEV
dev
,
HPALETTE
hPal
,
BOOL
force
)
DECLSPEC_HIDDEN
;
extern
INT
EMFDRV_SetArcDirection
(
PHYSDEV
dev
,
INT
arcDirection
)
DECLSPEC_HIDDEN
;
extern
COLORREF
EMFDRV_SetBkColor
(
PHYSDEV
dev
,
COLORREF
color
)
DECLSPEC_HIDDEN
;
extern
INT
EMFDRV_SetBkMode
(
PHYSDEV
dev
,
INT
mode
)
DECLSPEC_HIDDEN
;
...
...
dlls/gdi32/enhmfdrv/init.c
View file @
28206822
...
...
@@ -114,7 +114,7 @@ static const DC_FUNCTIONS EMFDRV_Funcs =
EMFDRV_SelectBrush
,
/* pSelectBrush */
EMFDRV_SelectClipPath
,
/* pSelectClipPath */
EMFDRV_SelectFont
,
/* pSelectFont */
NULL
,
/* pSelectPalette */
EMFDRV_SelectPalette
,
/* pSelectPalette */
EMFDRV_SelectPen
,
/* pSelectPen */
EMFDRV_SetArcDirection
,
/* pSetArcDirection */
NULL
,
/* pSetBitmapBits */
...
...
dlls/gdi32/enhmfdrv/objects.c
View file @
28206822
...
...
@@ -465,6 +465,61 @@ HPEN EMFDRV_SelectPen(PHYSDEV dev, HPEN hPen )
/******************************************************************
* EMFDRV_CreatePalette
*/
static
DWORD
EMFDRV_CreatePalette
(
PHYSDEV
dev
,
HPALETTE
hPal
)
{
WORD
i
;
struct
{
EMRCREATEPALETTE
hdr
;
PALETTEENTRY
entry
[
255
];
}
pal
;
memset
(
&
pal
,
0
,
sizeof
(
pal
)
);
if
(
!
GetObjectW
(
hPal
,
sizeof
(
pal
.
hdr
.
lgpl
)
+
sizeof
(
pal
.
entry
),
&
pal
.
hdr
.
lgpl
))
return
0
;
for
(
i
=
0
;
i
<
pal
.
hdr
.
lgpl
.
palNumEntries
;
i
++
)
pal
.
hdr
.
lgpl
.
palPalEntry
[
i
].
peFlags
=
0
;
pal
.
hdr
.
emr
.
iType
=
EMR_CREATEPALETTE
;
pal
.
hdr
.
emr
.
nSize
=
sizeof
(
pal
.
hdr
)
+
pal
.
hdr
.
lgpl
.
palNumEntries
*
sizeof
(
PALETTEENTRY
);
pal
.
hdr
.
ihPal
=
EMFDRV_AddHandle
(
dev
,
hPal
);
if
(
!
EMFDRV_WriteRecord
(
dev
,
&
pal
.
hdr
.
emr
))
pal
.
hdr
.
ihPal
=
0
;
return
pal
.
hdr
.
ihPal
;
}
/******************************************************************
* EMFDRV_SelectPalette
*/
HPALETTE
EMFDRV_SelectPalette
(
PHYSDEV
dev
,
HPALETTE
hPal
,
BOOL
force
)
{
EMFDRV_PDEVICE
*
physDev
=
(
EMFDRV_PDEVICE
*
)
dev
;
EMRSELECTPALETTE
emr
;
DWORD
index
;
if
(
hPal
==
GetStockObject
(
DEFAULT_PALETTE
))
index
=
DEFAULT_PALETTE
|
0x80000000
;
goto
found
;
if
((
index
=
EMFDRV_FindObject
(
dev
,
hPal
))
!=
0
)
goto
found
;
if
(
!
(
index
=
EMFDRV_CreatePalette
(
dev
,
hPal
)))
return
0
;
GDI_hdc_using_object
(
hPal
,
physDev
->
hdc
);
found:
emr
.
emr
.
iType
=
EMR_SELECTPALETTE
;
emr
.
emr
.
nSize
=
sizeof
(
emr
);
emr
.
ihPal
=
index
;
return
EMFDRV_WriteRecord
(
dev
,
&
emr
.
emr
)
?
hPal
:
0
;
}
/******************************************************************
* EMFDRV_GdiComment
*/
BOOL
EMFDRV_GdiComment
(
PHYSDEV
dev
,
UINT
bytes
,
CONST
BYTE
*
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