Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Münchhalfen
wine
Commits
56ef1fec
Commit
56ef1fec
authored
20 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Moved palette functions to user_main.c and removed
windows/painting.c.
parent
cd2b2bd9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dlls/user/Makefile.in
+0
-1
0 additions, 1 deletion
dlls/user/Makefile.in
dlls/user/user_main.c
+48
-3
48 additions, 3 deletions
dlls/user/user_main.c
include/user.h
+0
-2
0 additions, 2 deletions
include/user.h
windows/painting.c
+0
-84
0 additions, 84 deletions
windows/painting.c
with
48 additions
and
90 deletions
dlls/user/Makefile.in
+
0
−
1
View file @
56ef1fec
...
...
@@ -29,7 +29,6 @@ C_SRCS = \
$(
TOPOBJDIR
)
/windows/msgbox.c
\
$(
TOPOBJDIR
)
/windows/multimon.c
\
$(
TOPOBJDIR
)
/windows/nonclient.c
\
$(
TOPOBJDIR
)
/windows/painting.c
\
$(
TOPOBJDIR
)
/windows/queue.c
\
$(
TOPOBJDIR
)
/windows/rect.c
\
$(
TOPOBJDIR
)
/windows/scroll.c
\
...
...
This diff is collapsed.
Click to expand it.
dlls/user/user_main.c
+
48
−
3
View file @
56ef1fec
...
...
@@ -42,8 +42,9 @@ USER_DRIVER USER_Driver;
WORD
USER_HeapSel
=
0
;
/* USER heap selector */
HMODULE
user32_module
=
0
;
extern
HPALETTE
(
WINAPI
*
pfnGDISelectPalette
)(
HDC
hdc
,
HPALETTE
hpal
,
WORD
bkgnd
);
extern
UINT
(
WINAPI
*
pfnGDIRealizePalette
)(
HDC
hdc
);
static
HPALETTE
(
WINAPI
*
pfnGDISelectPalette
)(
HDC
hdc
,
HPALETTE
hpal
,
WORD
bkgnd
);
static
UINT
(
WINAPI
*
pfnGDIRealizePalette
)(
HDC
hdc
);
static
HPALETTE
hPrimaryPalette
;
static
HMODULE
graphics_driver
;
static
DWORD
exiting_thread_id
;
...
...
@@ -135,6 +136,50 @@ static BOOL load_driver(void)
}
/***********************************************************************
* UserSelectPalette (Not a Windows API)
*/
static
HPALETTE
WINAPI
UserSelectPalette
(
HDC
hDC
,
HPALETTE
hPal
,
BOOL
bForceBackground
)
{
WORD
wBkgPalette
=
1
;
if
(
!
bForceBackground
&&
(
hPal
!=
GetStockObject
(
DEFAULT_PALETTE
)))
{
HWND
hwnd
=
WindowFromDC
(
hDC
);
if
(
hwnd
)
{
HWND
hForeground
=
GetForegroundWindow
();
/* set primary palette if it's related to current active */
if
(
hForeground
==
hwnd
||
IsChild
(
hForeground
,
hwnd
))
{
wBkgPalette
=
0
;
hPrimaryPalette
=
hPal
;
}
}
}
return
pfnGDISelectPalette
(
hDC
,
hPal
,
wBkgPalette
);
}
/***********************************************************************
* UserRealizePalette (USER32.@)
*/
UINT
WINAPI
UserRealizePalette
(
HDC
hDC
)
{
UINT
realized
=
pfnGDIRealizePalette
(
hDC
);
/* do not send anything if no colors were changed */
if
(
realized
&&
GetCurrentObject
(
hDC
,
OBJ_PAL
)
==
hPrimaryPalette
)
{
/* send palette change notification */
HWND
hWnd
=
WindowFromDC
(
hDC
);
if
(
hWnd
)
SendMessageTimeoutW
(
HWND_BROADCAST
,
WM_PALETTECHANGED
,
(
WPARAM
)
hWnd
,
0
,
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
}
return
realized
;
}
/***********************************************************************
* palette_init
*
...
...
@@ -150,7 +195,7 @@ static void palette_init(void)
return
;
}
if
((
ptr
=
(
void
**
)
GetProcAddress
(
module
,
"pfnSelectPalette"
)))
pfnGDISelectPalette
=
InterlockedExchangePointer
(
ptr
,
SelectPalette
);
pfnGDISelectPalette
=
InterlockedExchangePointer
(
ptr
,
User
SelectPalette
);
else
ERR
(
"cannot find pfnSelectPalette in GDI32
\n
"
);
if
((
ptr
=
(
void
**
)
GetProcAddress
(
module
,
"pfnRealizePalette"
)))
pfnGDIRealizePalette
=
InterlockedExchangePointer
(
ptr
,
UserRealizePalette
);
...
...
This diff is collapsed.
Click to expand it.
include/user.h
+
0
−
2
View file @
56ef1fec
...
...
@@ -156,8 +156,6 @@ extern INT SYSMETRICS_Set( INT index, INT value );
extern
void
SYSPARAMS_GetDoubleClickSize
(
INT
*
width
,
INT
*
height
);
extern
INT
SYSPARAMS_GetMouseButtonSwap
(
void
);
extern
HPALETTE
WINAPI
SelectPalette
(
HDC
hDC
,
HPALETTE
hPal
,
BOOL
bForceBackground
);
extern
BOOL
CLIPBOARD_ReleaseOwner
(
void
);
extern
DWORD
USER16_AlertableWait
;
...
...
This diff is collapsed.
Click to expand it.
windows/painting.c
deleted
100644 → 0
+
0
−
84
View file @
cd2b2bd9
/*
* Window painting functions
*
* Copyright 1993, 1994, 1995 Alexandre Julliard
* 1999 Alex Korobka
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
"config.h"
#include
"wine/port.h"
#include
<stdarg.h>
#include
<string.h>
#include
"windef.h"
#include
"winbase.h"
#include
"wingdi.h"
#include
"wine/winuser16.h"
#include
"wownt32.h"
#include
"wine/unicode.h"
#include
"wine/server.h"
#include
"user.h"
#include
"win.h"
#include
"message.h"
#include
"dce.h"
#include
"wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
win
);
WINE_DECLARE_DEBUG_CHANNEL
(
nonclient
);
HPALETTE
(
WINAPI
*
pfnGDISelectPalette
)(
HDC
hdc
,
HPALETTE
hpal
,
WORD
bkgnd
)
=
NULL
;
UINT
(
WINAPI
*
pfnGDIRealizePalette
)(
HDC
hdc
)
=
NULL
;
/***********************************************************************
* SelectPalette (Not a Windows API)
*/
HPALETTE
WINAPI
SelectPalette
(
HDC
hDC
,
HPALETTE
hPal
,
BOOL
bForceBackground
)
{
WORD
wBkgPalette
=
1
;
if
(
!
bForceBackground
&&
(
hPal
!=
GetStockObject
(
DEFAULT_PALETTE
)))
{
HWND
hwnd
=
WindowFromDC
(
hDC
);
if
(
hwnd
)
{
HWND
hForeground
=
GetForegroundWindow
();
/* set primary palette if it's related to current active */
if
(
hForeground
==
hwnd
||
IsChild
(
hForeground
,
hwnd
))
wBkgPalette
=
0
;
}
}
return
pfnGDISelectPalette
(
hDC
,
hPal
,
wBkgPalette
);
}
/***********************************************************************
* UserRealizePalette (USER32.@)
*/
UINT
WINAPI
UserRealizePalette
(
HDC
hDC
)
{
UINT
realized
=
pfnGDIRealizePalette
(
hDC
);
/* do not send anything if no colors were changed */
if
(
realized
&&
IsDCCurrentPalette16
(
HDC_16
(
hDC
)
))
{
/* send palette change notification */
HWND
hWnd
=
WindowFromDC
(
hDC
);
if
(
hWnd
)
SendMessageTimeoutW
(
HWND_BROADCAST
,
WM_PALETTECHANGED
,
(
WPARAM
)
hWnd
,
0
,
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
}
return
realized
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment