From 6758db9a0cc59033761be57ec23f394dabc20f58 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 17 Jan 2005 20:27:11 +0000 Subject: [PATCH] Get rid of nonclient.h and of the corresponding exported functions in user32.spec. --- dlls/user/controls.h | 12 ++++++++++++ dlls/user/menu.c | 1 - dlls/user/user32.spec | 3 --- dlls/x11drv/winpos.c | 20 +++++++++++--------- include/nonclient.h | 38 -------------------------------------- windows/defwnd.c | 1 - windows/mdi.c | 1 - windows/nonclient.c | 3 +-- windows/winpos.c | 1 - 9 files changed, 24 insertions(+), 56 deletions(-) delete mode 100644 include/nonclient.h diff --git a/dlls/user/controls.h b/dlls/user/controls.h index a2ac8b684c5..6a529384a6a 100644 --- a/dlls/user/controls.h +++ b/dlls/user/controls.h @@ -68,6 +68,18 @@ extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd, BOOL suppress_draw ); extern UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget ); +/* nonclient area */ +extern LONG NC_HandleNCPaint( HWND hwnd , HRGN clip); +extern LONG NC_HandleNCActivate( HWND hwnd, WPARAM wParam ); +extern LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ); +extern LONG NC_HandleNCHitTest( HWND hwnd, POINT pt ); +extern LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ); +extern LONG NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam); +extern LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ); +extern LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ); +extern BOOL NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ); +extern void NC_GetSysPopupPos( HWND hwnd, RECT* rect ); + /* scrollbar */ extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior ); extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt ); diff --git a/dlls/user/menu.c b/dlls/user/menu.c index d628b9ed5f4..0da3a014fa0 100644 --- a/dlls/user/menu.c +++ b/dlls/user/menu.c @@ -43,7 +43,6 @@ #include "wine/unicode.h" #include "win.h" #include "controls.h" -#include "nonclient.h" #include "user_private.h" #include "wine/debug.h" diff --git a/dlls/user/user32.spec b/dlls/user/user32.spec index 4624a84745f..851ae766332 100644 --- a/dlls/user/user32.spec +++ b/dlls/user/user32.spec @@ -727,9 +727,6 @@ # @ cdecl DCE_InvalidateDCE(long ptr) @ cdecl HOOK_CallHooks(long long long long long) -@ cdecl NC_GetInsideRect(long ptr) -@ cdecl NC_HandleNCHitTest(long long long) -@ cdecl NC_HandleSetCursor(long long long) @ cdecl USER_Unlock() @ cdecl WINPOS_ActivateOtherWindow(long) @ cdecl WINPOS_GetMinMaxInfo(long ptr ptr ptr ptr) diff --git a/dlls/x11drv/winpos.c b/dlls/x11drv/winpos.c index ad3dedff106..7a0af6d1797 100644 --- a/dlls/x11drv/winpos.c +++ b/dlls/x11drv/winpos.c @@ -41,7 +41,6 @@ #include "win.h" #include "winpos.h" #include "dce.h" -#include "nonclient.h" #include "wine/server.h" #include "wine/debug.h" @@ -1581,16 +1580,19 @@ static LONG start_size_move( HWND hwnd, WPARAM wParam, POINT *capturePoint, LONG if ((wParam & 0xfff0) == SC_MOVE) { /* Move pointer at the center of the caption */ - RECT rect; - NC_GetInsideRect( hwnd, &rect ); + RECT rect = rectWindow; + /* Note: to be exactly centered we should take the different types + * of border into account, but it shouldn't make more that a few pixels + * of difference so let's not bother with that */ + rect.top += GetSystemMetrics(SM_CYBORDER); if (style & WS_SYSMENU) rect.left += GetSystemMetrics(SM_CXSIZE) + 1; if (style & WS_MINIMIZEBOX) rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; if (style & WS_MAXIMIZEBOX) rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; - pt.x = rectWindow.left + (rect.right - rect.left) / 2; - pt.y = rectWindow.top + rect.top + GetSystemMetrics(SM_CYSIZE)/2; + pt.x = (rect.right + rect.left) / 2; + pt.y = rect.top + GetSystemMetrics(SM_CYSIZE)/2; hittest = HTCAPTION; *capturePoint = pt; } @@ -1604,9 +1606,9 @@ static LONG start_size_move( HWND hwnd, WPARAM wParam, POINT *capturePoint, LONG switch(msg.message) { case WM_MOUSEMOVE: - hittest = NC_HandleNCHitTest( hwnd, msg.pt ); - if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT)) - hittest = 0; + pt = msg.pt; + hittest = SendMessageW( hwnd, WM_NCHITTEST, 0, MAKELONG( pt.x, pt.y ) ); + if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT)) hittest = 0; break; case WM_LBUTTONUP: @@ -1643,7 +1645,7 @@ static LONG start_size_move( HWND hwnd, WPARAM wParam, POINT *capturePoint, LONG *capturePoint = pt; } SetCursorPos( pt.x, pt.y ); - NC_HandleSetCursor( hwnd, (WPARAM)hwnd, MAKELONG( hittest, WM_MOUSEMOVE )); + SendMessageW( hwnd, WM_SETCURSOR, (WPARAM)hwnd, MAKELONG( hittest, WM_MOUSEMOVE )); return hittest; } diff --git a/include/nonclient.h b/include/nonclient.h deleted file mode 100644 index 21ded3ea626..00000000000 --- a/include/nonclient.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Window non-client functions definitions - * - * Copyright 1995 Alexandre Julliard - * - * 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 - */ - -#ifndef __WINE_NONCLIENT_H -#define __WINE_NONCLIENT_H - -#include - -extern LONG NC_HandleNCPaint( HWND hwnd , HRGN clip); -extern LONG NC_HandleNCActivate( HWND hwnd, WPARAM wParam ); -extern LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ); -extern LONG NC_HandleNCHitTest( HWND hwnd, POINT pt ); -extern LONG NC_HandleNCLButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ); -extern LONG NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam); -extern LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ); -extern LONG NC_HandleSetCursor( HWND hwnd, WPARAM wParam, LPARAM lParam ); -extern BOOL NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down ); -extern void NC_GetSysPopupPos( HWND hwnd, RECT* rect ); -extern void NC_GetInsideRect( HWND hwnd, RECT *rect ); - -#endif /* __WINE_NONCLIENT_H */ diff --git a/windows/defwnd.c b/windows/defwnd.c index 1ef4f293911..a6e23af401f 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -33,7 +33,6 @@ #include "win.h" #include "user_private.h" #include "controls.h" -#include "nonclient.h" #include "winpos.h" #include "message.h" #include "wine/unicode.h" diff --git a/windows/mdi.c b/windows/mdi.c index 8f140e0a857..bf5aefc653a 100644 --- a/windows/mdi.c +++ b/windows/mdi.c @@ -94,7 +94,6 @@ #include "wine/winuser16.h" #include "wine/unicode.h" #include "win.h" -#include "nonclient.h" #include "controls.h" #include "message.h" #include "user_private.h" diff --git a/windows/nonclient.c b/windows/nonclient.c index c05b72e8cf9..434c5ac015b 100644 --- a/windows/nonclient.c +++ b/windows/nonclient.c @@ -33,7 +33,6 @@ #include "controls.h" #include "cursoricon.h" #include "winpos.h" -#include "nonclient.h" #include "shellapi.h" #include "wine/debug.h" @@ -427,7 +426,7 @@ LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) * but without the borders (if any). * The rectangle is in window coordinates (for drawing with GetWindowDC()). */ -void NC_GetInsideRect( HWND hwnd, RECT *rect ) +static void NC_GetInsideRect( HWND hwnd, RECT *rect ) { WND * wndPtr = WIN_FindWndPtr( hwnd ); diff --git a/windows/winpos.c b/windows/winpos.c index 937bc9ed75c..5373e90b8b9 100644 --- a/windows/winpos.c +++ b/windows/winpos.c @@ -37,7 +37,6 @@ #include "win.h" #include "message.h" #include "winpos.h" -#include "nonclient.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(win);