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
56ef1fec
Commit
56ef1fec
authored
Dec 08, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved palette functions to user_main.c and removed
windows/painting.c.
parent
cd2b2bd9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
90 deletions
+48
-90
Makefile.in
dlls/user/Makefile.in
+0
-1
user_main.c
dlls/user/user_main.c
+48
-3
user.h
include/user.h
+0
-2
painting.c
windows/painting.c
+0
-84
No files found.
dlls/user/Makefile.in
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
\
...
...
dlls/user/user_main.c
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
;
...
...
@@ -136,6 +137,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
*
* Patch the function pointers in GDI for SelectPalette and RealizePalette
...
...
@@ -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
);
...
...
include/user.h
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
;
...
...
windows/painting.c
deleted
100644 → 0
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
;
}
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