Get rid of the WIN_SetRectangles export from user32.

This commit is contained in:
Alexandre Julliard 2004-09-09 00:30:29 +00:00
parent 17c775f13c
commit 92acc58af6
8 changed files with 101 additions and 56 deletions

View File

@ -3,7 +3,7 @@ TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = ttydrv.dll
IMPORTS = user32 gdi32 kernel32
IMPORTS = user32 gdi32 kernel32 ntdll
EXTRALIBS = @CURSESLIBS@
C_SRCS = \

View File

@ -25,6 +25,7 @@
#include "winpos.h"
#include "wownt32.h"
#include "wine/wingdi16.h"
#include "wine/server.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
@ -36,18 +37,66 @@ WINE_DEFAULT_DEBUG_CHANNEL(ttydrv);
#define SWP_AGG_STATUSFLAGS \
(SWP_AGG_NOPOSCHANGE | SWP_FRAMECHANGED | SWP_HIDEWINDOW | SWP_SHOWWINDOW)
/***********************************************************************
* set_window_rectangles
*
* Set the window and client rectangles.
*/
static void set_window_rectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient )
{
WND *win = WIN_GetPtr( hwnd );
BOOL ret;
if (!win) return;
if (win == WND_OTHER_PROCESS)
{
if (IsWindow( hwnd )) ERR( "cannot set rectangles of other process window %p\n", hwnd );
return;
}
SERVER_START_REQ( set_window_rectangles )
{
req->handle = hwnd;
req->window.left = rectWindow->left;
req->window.top = rectWindow->top;
req->window.right = rectWindow->right;
req->window.bottom = rectWindow->bottom;
req->client.left = rectClient->left;
req->client.top = rectClient->top;
req->client.right = rectClient->right;
req->client.bottom = rectClient->bottom;
ret = !wine_server_call( req );
}
SERVER_END_REQ;
if (ret)
{
win->rectWindow = *rectWindow;
win->rectClient = *rectClient;
TRACE( "win %p window (%ld,%ld)-(%ld,%ld) client (%ld,%ld)-(%ld,%ld)\n", hwnd,
rectWindow->left, rectWindow->top, rectWindow->right, rectWindow->bottom,
rectClient->left, rectClient->top, rectClient->right, rectClient->bottom );
}
WIN_ReleasePtr( win );
}
/**********************************************************************
* CreateWindow (TTYDRV.@)
*/
BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
{
BOOL ret;
RECT rect;
HWND hwndLinkAfter;
CBT_CREATEWNDA cbtc;
WND *wndPtr = WIN_GetPtr( hwnd );
TRACE("(%p)\n", hwnd);
/* initialize the dimensions before sending WM_GETMINMAXINFO */
SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy );
set_window_rectangles( hwnd, &rect, &rect );
if (!wndPtr->parent) /* desktop window */
{
wndPtr->pDriverData = root_window;
@ -602,7 +651,7 @@ BOOL TTYDRV_SetWindowPos( WINDOWPOS *winpos )
/* FIXME: actually do something with WVR_VALIDRECTS */
WIN_SetRectangles( winpos->hwnd, &newWindowRect, &newClientRect );
set_window_rectangles( winpos->hwnd, &newWindowRect, &newClientRect );
if( winpos->flags & SWP_SHOWWINDOW )
WIN_SetStyle( winpos->hwnd, wndPtr->dwStyle | WS_VISIBLE );

View File

@ -739,7 +739,6 @@
@ cdecl WIN_ReleaseWndPtr(ptr)
@ cdecl WIN_RestoreWndsLock(long)
@ cdecl WIN_SetExStyle(long long)
@ cdecl WIN_SetRectangles(long ptr ptr)
@ cdecl WIN_SetStyle(long long)
@ cdecl WIN_SuspendWndsLock()
@ cdecl WIN_UnlinkWindow(long)

View File

@ -41,6 +41,7 @@
#include "wine/debug.h"
#include "x11drv.h"
#include "wine/server.h"
#include "win.h"
#include "winpos.h"
#include "mwm.h"
@ -739,6 +740,49 @@ void X11DRV_register_window( Display *display, HWND hwnd, struct x11drv_win_data
}
/***********************************************************************
* X11DRV_set_window_rectangles
*
* Set the window and client rectangles.
*/
void X11DRV_set_window_rectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient )
{
WND *win = WIN_GetPtr( hwnd );
BOOL ret;
if (!win) return;
if (win == WND_OTHER_PROCESS)
{
if (IsWindow( hwnd )) ERR( "cannot set rectangles of other process window %p\n", hwnd );
return;
}
SERVER_START_REQ( set_window_rectangles )
{
req->handle = hwnd;
req->window.left = rectWindow->left;
req->window.top = rectWindow->top;
req->window.right = rectWindow->right;
req->window.bottom = rectWindow->bottom;
req->client.left = rectClient->left;
req->client.top = rectClient->top;
req->client.right = rectClient->right;
req->client.bottom = rectClient->bottom;
ret = !wine_server_call( req );
}
SERVER_END_REQ;
if (ret)
{
win->rectWindow = *rectWindow;
win->rectClient = *rectClient;
TRACE( "win %p window (%ld,%ld)-(%ld,%ld) client (%ld,%ld)-(%ld,%ld)\n", hwnd,
rectWindow->left, rectWindow->top, rectWindow->right, rectWindow->bottom,
rectClient->left, rectClient->top, rectClient->right, rectClient->bottom );
}
WIN_ReleasePtr( win );
}
/**********************************************************************
* create_desktop
*/
@ -997,7 +1041,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
/* initialize the dimensions before sending WM_GETMINMAXINFO */
SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy );
WIN_SetRectangles( hwnd, &rect, &rect );
X11DRV_set_window_rectangles( hwnd, &rect, &rect );
if (!wndPtr->parent)
{
@ -1038,7 +1082,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
if (!(wndPtr = WIN_GetPtr( hwnd ))) return FALSE;
SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy );
WIN_SetRectangles( hwnd, &rect, &rect );
X11DRV_set_window_rectangles( hwnd, &rect, &rect );
X11DRV_sync_whole_window_position( display, wndPtr, 0 );
}
WIN_ReleasePtr( wndPtr );
@ -1066,7 +1110,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
if (!(wndPtr = WIN_GetPtr(hwnd))) return FALSE;
if (rect.left > rect.right || rect.top > rect.bottom) rect = wndPtr->rectWindow;
WIN_SetRectangles( hwnd, &wndPtr->rectWindow, &rect );
X11DRV_set_window_rectangles( hwnd, &wndPtr->rectWindow, &rect );
X11DRV_sync_client_window_position( display, wndPtr );
X11DRV_register_window( display, hwnd, data );

View File

@ -967,7 +967,7 @@ BOOL X11DRV_SetWindowPos( WINDOWPOS *winpos )
/* FIXME: actually do something with WVR_VALIDRECTS */
WIN_SetRectangles( winpos->hwnd, &newWindowRect, &newClientRect );
X11DRV_set_window_rectangles( winpos->hwnd, &newWindowRect, &newClientRect );
if (get_whole_window(wndPtr)) /* don't do anything if X window not created yet */
{
@ -1579,7 +1579,7 @@ void X11DRV_handle_desktop_resize( unsigned int width, unsigned int height )
screen_height = height;
TRACE("desktop %p change to (%dx%d)\n", hwnd, width, height);
SetRect( &rect, 0, 0, width, height );
WIN_SetRectangles( hwnd, &rect, &rect );
X11DRV_set_window_rectangles( hwnd, &rect, &rect );
SendMessageTimeoutW( HWND_BROADCAST, WM_DISPLAYCHANGE, screen_depth,
MAKELPARAM( width, height ), SMTO_ABORTIFHUNG, 2000, NULL );
}

View File

@ -559,6 +559,7 @@ extern Window X11DRV_create_desktop( XVisualInfo *desktop_vi, const char *geomet
extern void X11DRV_sync_window_style( Display *display, WND *win );
extern int X11DRV_sync_whole_window_position( Display *display, WND *win, int zorder );
extern int X11DRV_sync_client_window_position( Display *display, WND *win );
extern void X11DRV_set_window_rectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient );
extern void X11DRV_set_wm_hints( Display *display, WND *win );
extern void X11DRV_handle_desktop_resize(unsigned int width, unsigned int height);

View File

@ -105,7 +105,6 @@ extern void WIN_UnlinkWindow( HWND hwnd );
extern HWND WIN_SetOwner( HWND hwnd, HWND owner );
extern LONG WIN_SetStyle( HWND hwnd, LONG style );
extern LONG WIN_SetExStyle( HWND hwnd, LONG style );
extern void WIN_SetRectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient );
extern BOOL WIN_GetRectangles( HWND hwnd, RECT *rectWindow, RECT *rectClient );
extern LRESULT WIN_DestroyWindow( HWND hwnd );
extern void WIN_DestroyThreadWindows( HWND hwnd );

View File

@ -539,49 +539,6 @@ LONG WIN_SetExStyle( HWND hwnd, LONG style )
}
/***********************************************************************
* WIN_SetRectangles
*
* Set the window and client rectangles.
*/
void WIN_SetRectangles( HWND hwnd, const RECT *rectWindow, const RECT *rectClient )
{
WND *win = WIN_GetPtr( hwnd );
BOOL ret;
if (!win) return;
if (win == WND_OTHER_PROCESS)
{
if (IsWindow( hwnd )) ERR( "cannot set rectangles of other process window %p\n", hwnd );
return;
}
SERVER_START_REQ( set_window_rectangles )
{
req->handle = hwnd;
req->window.left = rectWindow->left;
req->window.top = rectWindow->top;
req->window.right = rectWindow->right;
req->window.bottom = rectWindow->bottom;
req->client.left = rectClient->left;
req->client.top = rectClient->top;
req->client.right = rectClient->right;
req->client.bottom = rectClient->bottom;
ret = !wine_server_call( req );
}
SERVER_END_REQ;
if (ret)
{
win->rectWindow = *rectWindow;
win->rectClient = *rectClient;
TRACE( "win %p window (%ld,%ld)-(%ld,%ld) client (%ld,%ld)-(%ld,%ld)\n", hwnd,
rectWindow->left, rectWindow->top, rectWindow->right, rectWindow->bottom,
rectClient->left, rectClient->top, rectClient->right, rectClient->bottom );
}
WIN_ReleasePtr( win );
}
/***********************************************************************
* WIN_GetRectangles
*
@ -731,7 +688,6 @@ BOOL WIN_CreateDesktopWindow(void)
{
HWND hwndDesktop;
CREATESTRUCTA cs;
RECT rect;
TRACE("Creating desktop window\n");
@ -765,9 +721,6 @@ BOOL WIN_CreateDesktopWindow(void)
cs.lpszName = NULL;
cs.lpszClass = DESKTOP_CLASS_ATOM;
SetRect( &rect, 0, 0, cs.cx, cs.cy );
WIN_SetRectangles( hwndDesktop, &rect, &rect );
SERVER_START_REQ( set_window_info )
{
req->handle = hwndDesktop;