1993-09-04 12:09:32 +02:00
|
|
|
/*
|
|
|
|
* Window painting functions
|
|
|
|
*
|
1995-03-02 18:44:29 +01:00
|
|
|
* Copyright 1993, 1994, 1995 Alexandre Julliard
|
1999-03-28 11:37:57 +02:00
|
|
|
* 1999 Alex Korobka
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* 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
|
1993-09-04 12:09:32 +02:00
|
|
|
*/
|
|
|
|
|
2003-11-26 23:29:30 +01:00
|
|
|
#include "config.h"
|
|
|
|
#include "wine/port.h"
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2001-01-26 21:43:40 +01:00
|
|
|
#include <string.h>
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "windef.h"
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "winbase.h"
|
2000-02-10 20:03:02 +01:00
|
|
|
#include "wingdi.h"
|
|
|
|
#include "wine/winuser16.h"
|
2002-10-18 06:05:49 +02:00
|
|
|
#include "wownt32.h"
|
2000-08-14 16:41:19 +02:00
|
|
|
#include "wine/unicode.h"
|
2001-07-19 02:39:09 +02:00
|
|
|
#include "wine/server.h"
|
2001-01-15 21:12:55 +01:00
|
|
|
#include "user.h"
|
1993-09-04 12:09:32 +02:00
|
|
|
#include "win.h"
|
2002-12-04 00:34:52 +01:00
|
|
|
#include "message.h"
|
Release 960606
Wed Jun 5 20:13:54 1996 Alexandre Julliard <julliard@lrc.epfl.ch>
* [controls/button.c] [controls/listbox.c]
Fixed wParam of WM_DRAWITEM message.
* [if1632/Makefile.in] [loader/builtin.c]
Remove WPROCS32 DLL, as the relay code can call Wine routines
directly.
* [loader/module.c] [loader/ne_image.c]
Fixed initial stack layout for self-loading modules.
* [tools/build.c]
Fixed data segment building for Win16 modules.
* [windows/defdlg.c]
Implemented Win32 versions of DefDlgProc().
* [windows/dialog.c]
Merged Win16 and Win32 dialog code.
Added support for control extra data in dialog item template.
* [windows/win.c]
Unified Win16 and Win32 versions of CreateWindow().
Implemented Win32 version of GetWindowLong().
* [windows/winproc.c]
Changed the implementation of window procedures, so that 16-bit
winprocs are valid segmented pointers.
Sun Jun 2 16:39:46 1996 Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>
* [misc/registry.c]
Fixed another bug in the w95 loader. Quietened some debug output.
Sun Jun 2 10:00:22 1996 Ulrich Schmid <uschmid@mail.hh.provi.de>
* [windows/winproc.c]
Bug fix: WM_PARENTNOTIFY: don't fall through to WM_SETTEXT.
Sat Jun 1 12:37:22 1996 Tristan Tarrant <tst@sthinc.demon.co.uk>
* [resources/TODO] [resources/sysres_It.rc]
Updated font dialog box.
Thu May 30 21:05:19 1996 Albrecht Kleine <kleine@ak.sax.de>
* [include/commdlg.h] [misc/commdlg.c]
ChooseFont() and ChooseColor():
Bugfixes and added more support for some CF_* and CC_* flags:
dialog templates and font size control.
Bugfix in structure definition of CHOOSECOLOR definition.
* [ipc/dde_proc.c] [windows/event.c]
Replaced SendMessage with SendMessage16 and added inclusion of
dde_proc.h for error-free compilation of ipc module.
Thu May 30 19:00:00 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu>
* [windows/scroll.c]
Made ScrollDC to save/restore current clipping region.
* [misc/clipboard.c] [windows/event.c]
Implemented most of the previously missing features (not tested),
improved text pasting from/to X.
* [if1632/user.spec] [if1632/gdi.spec] [objects/dc.c]
[objects/gdiobj.c] [objects/clipping.c] [windows/dce.c]
[windows/winpos.c] [windows/painting.c]
Updated DCE code, implemented dynamic invalidation of owned DCs.
This fixes a lot of problems with scrolling in WinWord. Not
sure about the effect on -desktop.
Wed May 29 23:35:44 1996 Jukka Iivonen <iivonen@cc.helsinki.fi>
* [win32/time.c] [if1632/kernel32.spec]
Added SetSystemTime and SetTimeZoneInformation.
* [if1632/kernel32.spec]
Added lstrcat, lstrcatA, lstrcmp, lstrcmpA, lstrcpy, lstrlen.
* [include/windows.h]
Added SYSTEM_POWER_STATUS structure and prototypes for
GetSystemPowerStatus, SetSystemPowerState, SetSystemTime.
* [include/kernel32.h]
Added a prototype for SetTimeZoneInformation.
* [win32/environment.c] [if1632/kernel32.spec]
Added GetSystemPowerStatus and SetSystemPowerState stubs.
1996-06-06 20:38:27 +02:00
|
|
|
#include "dce.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1993-09-04 12:09:32 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(win);
|
|
|
|
WINE_DECLARE_DEBUG_CHANNEL(nonclient);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
2002-10-18 06:05:49 +02:00
|
|
|
HPALETTE (WINAPI *pfnGDISelectPalette)(HDC hdc, HPALETTE hpal, WORD bkgnd ) = NULL;
|
|
|
|
UINT (WINAPI *pfnGDIRealizePalette)(HDC hdc) = NULL;
|
1999-03-28 11:37:57 +02:00
|
|
|
|
2001-12-17 22:37:53 +01:00
|
|
|
|
2000-08-04 06:18:04 +02:00
|
|
|
/***********************************************************************
|
2002-10-18 06:05:49 +02:00
|
|
|
* SelectPalette (Not a Windows API)
|
2000-08-04 06:18:04 +02:00
|
|
|
*/
|
2002-10-18 06:05:49 +02:00
|
|
|
HPALETTE WINAPI SelectPalette( HDC hDC, HPALETTE hPal, BOOL bForceBackground )
|
2000-08-04 06:18:04 +02:00
|
|
|
{
|
2000-09-16 22:57:39 +02:00
|
|
|
WORD wBkgPalette = 1;
|
|
|
|
|
2000-10-29 02:22:15 +01:00
|
|
|
if (!bForceBackground && (hPal != GetStockObject(DEFAULT_PALETTE)))
|
2000-09-16 22:57:39 +02:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
2002-10-18 06:05:49 +02:00
|
|
|
return pfnGDISelectPalette( hDC, hPal, wBkgPalette);
|
2000-08-04 06:18:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
2002-10-18 06:05:49 +02:00
|
|
|
* UserRealizePalette (USER32.@)
|
2000-08-04 06:18:04 +02:00
|
|
|
*/
|
2002-10-18 06:05:49 +02:00
|
|
|
UINT WINAPI UserRealizePalette( HDC hDC )
|
2000-08-04 06:18:04 +02:00
|
|
|
{
|
2002-10-18 06:05:49 +02:00
|
|
|
UINT realized = pfnGDIRealizePalette( hDC );
|
2000-09-16 22:57:39 +02:00
|
|
|
|
|
|
|
/* do not send anything if no colors were changed */
|
2002-10-18 06:05:49 +02:00
|
|
|
if (realized && IsDCCurrentPalette16( HDC_16(hDC) ))
|
2000-09-16 22:57:39 +02:00
|
|
|
{
|
|
|
|
/* send palette change notification */
|
|
|
|
HWND hWnd = WindowFromDC( hDC );
|
2003-10-31 05:18:55 +01:00
|
|
|
if (hWnd) SendMessageTimeoutW( HWND_BROADCAST, WM_PALETTECHANGED, (WPARAM)hWnd, 0,
|
|
|
|
SMTO_ABORTIFHUNG, 2000, NULL );
|
2000-09-16 22:57:39 +02:00
|
|
|
}
|
|
|
|
return realized;
|
|
|
|
}
|