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
0ccb9fea
Commit
0ccb9fea
authored
Oct 18, 2002
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store the original GDI palette functions in pfnSelectPalette and
pfnRealizePalette so that USER doesn't have to import them.
parent
034e4df6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
21 deletions
+37
-21
user16.c
dlls/user/user16.c
+16
-0
user_main.c
dlls/user/user_main.c
+7
-2
user.h
include/user.h
+2
-0
palette.c
objects/palette.c
+2
-2
painting.c
windows/painting.c
+10
-17
No files found.
dlls/user/user16.c
View file @
0ccb9fea
...
...
@@ -133,6 +133,22 @@ UINT16 WINAPI GlobalGetAtomName16(ATOM nAtom, LPSTR lpBuffer, INT16 nSize)
}
/***********************************************************************
* SelectPalette (USER.282)
*/
HPALETTE16
WINAPI
SelectPalette16
(
HDC16
hdc
,
HPALETTE16
hpal
,
BOOL16
bForceBackground
)
{
return
HPALETTE_16
(
SelectPalette
(
HDC_32
(
hdc
),
HPALETTE_32
(
hpal
),
bForceBackground
));
}
/***********************************************************************
* RealizePalette (USER.283)
*/
UINT16
WINAPI
RealizePalette16
(
HDC16
hdc
)
{
return
UserRealizePalette
(
HDC_32
(
hdc
)
);
}
/***********************************************************************
* LoadImage (USER.389)
*
*/
...
...
dlls/user/user_main.c
View file @
0ccb9fea
...
...
@@ -48,6 +48,9 @@ WINE_LOOK TWEAK_WineLook = WIN31_LOOK;
WORD
USER_HeapSel
=
0
;
/* USER heap selector */
extern
HPALETTE
(
WINAPI
*
pfnGDISelectPalette
)(
HDC
hdc
,
HPALETTE
hpal
,
WORD
bkgnd
);
extern
UINT
(
WINAPI
*
pfnGDIRealizePalette
)(
HDC
hdc
);
static
HMODULE
graphics_driver
;
static
DWORD
exiting_thread_id
;
...
...
@@ -168,9 +171,11 @@ static void palette_init(void)
ERR
(
"cannot get GDI32 handle
\n
"
);
return
;
}
if
((
ptr
=
(
void
**
)
GetProcAddress
(
module
,
"pfnSelectPalette"
)))
*
ptr
=
SelectPalette16
;
if
((
ptr
=
(
void
**
)
GetProcAddress
(
module
,
"pfnSelectPalette"
)))
pfnGDISelectPalette
=
InterlockedExchangePointer
(
ptr
,
SelectPalette
);
else
ERR
(
"cannot find pfnSelectPalette in GDI32
\n
"
);
if
((
ptr
=
(
void
**
)
GetProcAddress
(
module
,
"pfnRealizePalette"
)))
*
ptr
=
UserRealizePalette
;
if
((
ptr
=
(
void
**
)
GetProcAddress
(
module
,
"pfnRealizePalette"
)))
pfnGDIRealizePalette
=
InterlockedExchangePointer
(
ptr
,
UserRealizePalette
);
else
ERR
(
"cannot find pfnRealizePalette in GDI32
\n
"
);
}
...
...
include/user.h
View file @
0ccb9fea
...
...
@@ -140,6 +140,8 @@ extern HBRUSH CACHE_GetPattern55AABrush(void);
/* syscolor.c */
extern
HPEN
SYSCOLOR_GetPen
(
INT
index
);
extern
HPALETTE
WINAPI
SelectPalette
(
HDC
hDC
,
HPALETTE
hPal
,
BOOL
bForceBackground
);
extern
DWORD
USER16_AlertableWait
;
/* HANDLE16 <-> HANDLE conversions */
...
...
objects/palette.c
View file @
0ccb9fea
...
...
@@ -53,8 +53,8 @@ static const struct gdi_obj_funcs palette_funcs =
/* Pointers to USER implementation of SelectPalette/RealizePalette */
/* they will be patched by USER on startup */
HPALETTE
(
WINAPI
*
pfnSelectPalette
)(
HDC
hdc
,
HPALETTE
hpal
,
WORD
bkgnd
)
=
NULL
;
UINT
(
WINAPI
*
pfnRealizePalette
)(
HDC
hdc
)
=
NULL
;
HPALETTE
(
WINAPI
*
pfnSelectPalette
)(
HDC
hdc
,
HPALETTE
hpal
,
WORD
bkgnd
)
=
GDISelectPalette
;
UINT
(
WINAPI
*
pfnRealizePalette
)(
HDC
hdc
)
=
GDIRealizePalette
;
static
UINT
SystemPaletteUse
=
SYSPAL_STATIC
;
/* currently not considered */
...
...
windows/painting.c
View file @
0ccb9fea
...
...
@@ -23,6 +23,7 @@
#include "windef.h"
#include "wingdi.h"
#include "wine/winuser16.h"
#include "wownt32.h"
#include "wine/unicode.h"
#include "wine/server.h"
#include "gdi.h"
...
...
@@ -56,6 +57,8 @@ WINE_DECLARE_DEBUG_CHANNEL(nonclient);
/* Last COLOR id */
#define COLOR_MAX COLOR_GRADIENTINACTIVECAPTION
HPALETTE
(
WINAPI
*
pfnGDISelectPalette
)(
HDC
hdc
,
HPALETTE
hpal
,
WORD
bkgnd
)
=
NULL
;
UINT
(
WINAPI
*
pfnGDIRealizePalette
)(
HDC
hdc
)
=
NULL
;
/* ### start build ### */
extern
WORD
CALLBACK
PAINTING_CallTo16_word_wlwww
(
DRAWSTATEPROC16
,
WORD
,
LONG
,
WORD
,
WORD
,
WORD
);
...
...
@@ -1434,10 +1437,9 @@ BOOL16 WINAPI DrawState16( HDC16 hdc, HBRUSH16 hbr, DRAWSTATEPROC16 func, LPARAM
/***********************************************************************
* SelectPalette (
USER.282
)
* SelectPalette (
Not a Windows API
)
*/
HPALETTE16
WINAPI
SelectPalette16
(
HDC16
hDC
,
HPALETTE16
hPal
,
BOOL16
bForceBackground
)
HPALETTE
WINAPI
SelectPalette
(
HDC
hDC
,
HPALETTE
hPal
,
BOOL
bForceBackground
)
{
WORD
wBkgPalette
=
1
;
...
...
@@ -1451,19 +1453,19 @@ HPALETTE16 WINAPI SelectPalette16( HDC16 hDC, HPALETTE16 hPal,
if
(
hForeground
==
hwnd
||
IsChild
(
hForeground
,
hwnd
))
wBkgPalette
=
0
;
}
}
return
GDISelectPalette16
(
hDC
,
hPal
,
wBkgPalette
);
return
pfnGDISelectPalette
(
hDC
,
hPal
,
wBkgPalette
);
}
/***********************************************************************
*
RealizePalette (USER.283
)
*
UserRealizePalette (USER32.@
)
*/
UINT
16
WINAPI
RealizePalette16
(
HDC16
hDC
)
UINT
WINAPI
UserRealizePalette
(
HDC
hDC
)
{
UINT
16
realized
=
GDIRealizePalette16
(
hDC
);
UINT
realized
=
pfnGDIRealizePalette
(
hDC
);
/* do not send anything if no colors were changed */
if
(
realized
&&
IsDCCurrentPalette16
(
hDC
))
if
(
realized
&&
IsDCCurrentPalette16
(
HDC_16
(
hDC
)
))
{
/* send palette change notification */
HWND
hWnd
=
WindowFromDC
(
hDC
);
...
...
@@ -1471,12 +1473,3 @@ UINT16 WINAPI RealizePalette16( HDC16 hDC )
}
return
realized
;
}
/***********************************************************************
* UserRealizePalette (USER32.@)
*/
UINT
WINAPI
UserRealizePalette
(
HDC
hDC
)
{
return
RealizePalette16
(
hDC
);
}
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