Commit 24eee97d authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Add a driver entry point for UpdateLayeredWindow.

parent ddf41276
......@@ -22,6 +22,7 @@
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/debug.h"
......@@ -122,6 +123,7 @@ static const USER_DRIVER *load_driver(void)
GET_USER_FUNC(SetWindowText);
GET_USER_FUNC(ShowWindow);
GET_USER_FUNC(SysCommand);
GET_USER_FUNC(UpdateLayeredWindow);
GET_USER_FUNC(WindowMessage);
GET_USER_FUNC(WindowPosChanging);
GET_USER_FUNC(WindowPosChanged);
......@@ -413,6 +415,12 @@ static LRESULT CDECL nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam
return -1;
}
static BOOL CDECL nulldrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
const RECT *window_rect )
{
return TRUE;
}
static LRESULT CDECL nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
return 0;
......@@ -489,6 +497,7 @@ static USER_DRIVER null_driver =
nulldrv_SetWindowText,
nulldrv_ShowWindow,
nulldrv_SysCommand,
nulldrv_UpdateLayeredWindow,
nulldrv_WindowMessage,
nulldrv_WindowPosChanging,
nulldrv_WindowPosChanged
......@@ -757,6 +766,12 @@ static LRESULT CDECL loaderdrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lpar
return load_driver()->pSysCommand( hwnd, wparam, lparam );
}
static BOOL CDECL loaderdrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
const RECT *window_rect )
{
return load_driver()->pUpdateLayeredWindow( hwnd, info, window_rect );
}
static LRESULT CDECL loaderdrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
{
return load_driver()->pWindowMessage( hwnd, msg, wparam, lparam );
......@@ -837,6 +852,7 @@ static USER_DRIVER lazy_load_driver =
loaderdrv_SetWindowText,
loaderdrv_ShowWindow,
loaderdrv_SysCommand,
loaderdrv_UpdateLayeredWindow,
loaderdrv_WindowMessage,
loaderdrv_WindowPosChanging,
loaderdrv_WindowPosChanged
......
......@@ -36,6 +36,7 @@
#define NONAMELESSSTRUCT
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "user_private.h"
......
......@@ -27,6 +27,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "win.h"
#include "user_private.h"
......
......@@ -70,6 +70,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winerror.h"
#include "win.h"
......
......@@ -111,6 +111,7 @@ typedef struct tagUSER_DRIVER {
void (CDECL *pSetWindowText)(HWND,LPCWSTR);
UINT (CDECL *pShowWindow)(HWND,INT,RECT*,UINT);
LRESULT (CDECL *pSysCommand)(HWND,WPARAM,LPARAM);
BOOL (CDECL *pUpdateLayeredWindow)(HWND,const UPDATELAYEREDWINDOWINFO *,const RECT *);
LRESULT (CDECL *pWindowMessage)(HWND,UINT,WPARAM,LPARAM);
void (CDECL *pWindowPosChanging)(HWND,HWND,UINT,const RECT *,const RECT *,RECT *,struct window_surface**);
void (CDECL *pWindowPosChanged)(HWND,HWND,UINT,const RECT *,const RECT *,const RECT *,const RECT *,struct window_surface*);
......
......@@ -3648,7 +3648,6 @@ BOOL WINAPI UpdateLayeredWindowIndirect( HWND hwnd, const UPDATELAYEREDWINDOWINF
DWORD flags = SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW;
RECT window_rect, client_rect;
SIZE offset;
BYTE alpha = 0xff;
if (!info ||
info->cbSize != sizeof(*info) ||
......@@ -3693,39 +3692,10 @@ BOOL WINAPI UpdateLayeredWindowIndirect( HWND hwnd, const UPDATELAYEREDWINDOWINF
TRACE( "window %p win %s client %s\n", hwnd,
wine_dbgstr_rect(&window_rect), wine_dbgstr_rect(&client_rect) );
set_window_pos( hwnd, 0, flags, &window_rect, &client_rect, NULL );
if (info->hdcSrc)
{
HDC hdc = GetWindowDC( hwnd );
if (hdc)
{
int x = 0, y = 0;
RECT rect;
GetWindowRect( hwnd, &rect );
OffsetRect( &rect, -rect.left, -rect.top);
if (info->pptSrc)
{
x = info->pptSrc->x;
y = info->pptSrc->y;
}
if (!USER_Driver->pUpdateLayeredWindow( hwnd, info, &window_rect )) return FALSE;
if (!info->prcDirty || (info->prcDirty && IntersectRect(&rect, &rect, info->prcDirty)))
{
TRACE( "copying window %p pos %d,%d\n", hwnd, x, y );
BitBlt( hdc, rect.left, rect.top, rect.right, rect.bottom,
info->hdcSrc, rect.left + x, rect.top + y, SRCCOPY );
}
ReleaseDC( hwnd, hdc );
}
}
if (info->pblend && !(info->dwFlags & ULW_OPAQUE)) alpha = info->pblend->SourceConstantAlpha;
TRACE( "setting window %p alpha %u\n", hwnd, alpha );
USER_Driver->pSetLayeredWindowAttributes( hwnd, info->crKey, alpha,
info->dwFlags & (LWA_ALPHA | LWA_COLORKEY) );
set_window_pos( hwnd, 0, flags, &window_rect, &client_rect, NULL );
return TRUE;
}
......
......@@ -28,6 +28,7 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "controls.h"
#include "win.h"
#include "user_private.h"
......
......@@ -2324,6 +2324,49 @@ void CDECL X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alph
}
/*****************************************************************************
* UpdateLayeredWindow (X11DRV.@)
*/
BOOL CDECL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
const RECT *window_rect )
{
BYTE alpha = 0xff;
if (info->hdcSrc)
{
HDC hdc = GetWindowDC( hwnd );
if (hdc)
{
int x = 0, y = 0;
RECT rect;
GetWindowRect( hwnd, &rect );
OffsetRect( &rect, -rect.left, -rect.top);
if (info->pptSrc)
{
x = info->pptSrc->x;
y = info->pptSrc->y;
}
if (!info->prcDirty || (info->prcDirty && IntersectRect(&rect, &rect, info->prcDirty)))
{
TRACE( "copying window %p pos %d,%d\n", hwnd, x, y );
BitBlt( hdc, rect.left, rect.top, rect.right, rect.bottom,
info->hdcSrc, rect.left + x, rect.top + y, SRCCOPY );
}
ReleaseDC( hwnd, hdc );
}
}
if (info->pblend && !(info->dwFlags & ULW_OPAQUE)) alpha = info->pblend->SourceConstantAlpha;
TRACE( "setting window %p alpha %u\n", hwnd, alpha );
X11DRV_SetLayeredWindowAttributes( hwnd, info->crKey, alpha,
info->dwFlags & (LWA_ALPHA | LWA_COLORKEY) );
return TRUE;
}
/**********************************************************************
* X11DRV_WindowMessage (X11DRV.@)
*/
......
......@@ -51,6 +51,7 @@
@ cdecl SetWindowText(long wstr) X11DRV_SetWindowText
@ cdecl ShowWindow(long long ptr long) X11DRV_ShowWindow
@ cdecl SysCommand(long long long) X11DRV_SysCommand
@ cdecl UpdateLayeredWindow(long ptr ptr) X11DRV_UpdateLayeredWindow
@ cdecl WindowMessage(long long long long) X11DRV_WindowMessage
@ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) X11DRV_WindowPosChanging
@ cdecl WindowPosChanged(long long long ptr ptr ptr ptr ptr) X11DRV_WindowPosChanged
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment