Commit fc5ce145 authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid most references to the internals of the WND structure by passing

around an x11drv_win_data pointer instead.
parent b819f4cd
......@@ -78,7 +78,6 @@
#include "winbase.h"
#include "winreg.h"
#include "wine/wingdi16.h"
#include "win.h"
#include "x11drv.h"
#include "wine/debug.h"
#include "wine/unicode.h"
......
......@@ -1051,18 +1051,19 @@ static void EVENT_DropFromOffiX( HWND hWnd, XClientMessageEvent *event )
} u;
int x, y;
BOOL bAccept;
Window w_aux_root, w_aux_child;
Window win, w_aux_root, w_aux_child;
WND* pWnd;
HWND hScope = hWnd;
pWnd = WIN_FindWndPtr(hWnd);
win = X11DRV_get_whole_window(hWnd);
wine_tsx11_lock();
XQueryPointer( event->display, get_whole_window(pWnd), &w_aux_root, &w_aux_child,
XQueryPointer( event->display, win, &w_aux_root, &w_aux_child,
&x, &y, (int *) &u.pt_aux.x, (int *) &u.pt_aux.y,
(unsigned int*)&aux_long);
wine_tsx11_unlock();
pWnd = WIN_FindWndPtr(hWnd);
/* find out drop point and drop window */
if( x < 0 || y < 0 ||
x > (pWnd->rectWindow.right - pWnd->rectWindow.left) ||
......
......@@ -32,6 +32,7 @@
#include "winbase.h"
#include "wine/winuser16.h"
#include "win.h"
#include "x11drv.h"
#include "wine/debug.h"
......@@ -69,19 +70,15 @@ static BYTE *pKeyStateTable;
*/
static void get_coords( HWND *hwnd, Window window, int x, int y, POINT *pt )
{
struct x11drv_win_data *data;
WND *win;
struct x11drv_win_data *data = X11DRV_get_win_data( *hwnd );
if (!(win = WIN_GetPtr( *hwnd )) || win == WND_OTHER_PROCESS) return;
data = win->pDriverData;
if (!data) return;
if (window == data->whole_window)
{
x -= data->client_rect.left;
y -= data->client_rect.top;
}
WIN_ReleasePtr( win );
pt->x = x;
pt->y = y;
if (*hwnd != GetDesktopWindow())
......
......@@ -31,7 +31,6 @@
#include "winuser.h"
#include "x11drv.h"
#include "win.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(scroll);
......
......@@ -40,7 +40,8 @@ typedef int Status;
#include "windef.h"
#include "winbase.h"
#include "win.h"
#include "wingdi.h"
#include "winuser.h"
#include "ddrawi.h"
#include "thread.h"
......@@ -508,9 +509,11 @@ extern int X11DRV_ProcessTabletEvent(HWND hwnd, XEvent *event);
/* x11drv private window data */
struct x11drv_win_data
{
HWND hwnd; /* hwnd that this private data belongs to */
Window whole_window; /* X window for the complete window */
Window client_window; /* X window for the client area */
Window icon_window; /* X window for the icon */
RECT window_rect; /* USER window rectangle relative to parent */
RECT whole_rect; /* X window rectangle for the whole window relative to parent */
RECT client_rect; /* client area relative to whole window */
XIC xic; /* X input context */
......@@ -518,28 +521,16 @@ struct x11drv_win_data
HBITMAP hWMIconMask;
};
typedef struct x11drv_win_data X11DRV_WND_DATA;
extern struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd );
extern Window X11DRV_get_client_window( HWND hwnd );
extern Window X11DRV_get_whole_window( HWND hwnd );
extern BOOL X11DRV_is_window_rect_mapped( const RECT *rect );
extern XIC X11DRV_get_ic( HWND hwnd );
inline static Window get_client_window( WND *wnd )
{
struct x11drv_win_data *data = wnd->pDriverData;
return data->client_window;
}
inline static Window get_whole_window( WND *wnd )
{
struct x11drv_win_data *data = wnd->pDriverData;
return data->whole_window;
}
inline static BOOL is_window_top_level( WND *win )
inline static BOOL is_window_top_level( HWND hwnd )
{
return (root_window == DefaultRootWindow(gdi_display) && win->parent == GetDesktopWindow());
return (root_window == DefaultRootWindow(gdi_display) &&
GetAncestor( hwnd, GA_PARENT ) == GetDesktopWindow());
}
extern void X11DRV_SetFocus( HWND hwnd );
......@@ -550,17 +541,19 @@ typedef int (*x11drv_error_callback)( Display *display, XErrorEvent *event, void
extern void X11DRV_expect_error( Display *display, x11drv_error_callback callback, void *arg );
extern int X11DRV_check_error(void);
extern void X11DRV_register_window( Display *display, HWND hwnd, struct x11drv_win_data *data );
extern void X11DRV_set_iconic_state( WND *win );
extern void X11DRV_window_to_X_rect( WND *win, RECT *rect );
extern void X11DRV_X_to_window_rect( WND *win, RECT *rect );
extern void X11DRV_set_iconic_state( HWND hwnd );
extern void X11DRV_window_to_X_rect( HWND hwnd, RECT *rect );
extern void X11DRV_X_to_window_rect( HWND hwnd, RECT *rect );
extern void X11DRV_create_desktop_thread(void);
extern Window X11DRV_create_desktop( XVisualInfo *desktop_vi, const char *geometry );
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_sync_window_style( Display *display, struct x11drv_win_data *data );
extern int X11DRV_sync_whole_window_position( Display *display, struct x11drv_win_data *data,
int zorder );
extern int X11DRV_sync_client_window_position( Display *display, struct x11drv_win_data *data,
const RECT *new_client_rect );
extern BOOL X11DRV_set_window_pos( HWND hwnd, HWND insert_after, const RECT *rectWindow,
const RECT *rectClient, UINT swp_flags, UINT wvr_flags );
extern void X11DRV_set_wm_hints( Display *display, WND *win );
extern void X11DRV_set_wm_hints( Display *display, struct x11drv_win_data *data );
extern void X11DRV_handle_desktop_resize(unsigned int width, unsigned int height);
extern void X11DRV_Settings_AddDepthModes(void);
......
......@@ -59,7 +59,6 @@
#include "wine/winbase16.h"
#include "winreg.h"
#include "win.h"
#include "x11drv.h"
#include "xvidmode.h"
#include "xrandr.h"
......
......@@ -35,7 +35,6 @@
#include "controls.h"
#include "nonclient.h"
#include "winpos.h"
#include "dce.h"
#include "message.h"
#include "wine/unicode.h"
#include "wine/winuser16.h"
......@@ -201,7 +200,6 @@ static void DEFWND_SetRedraw( HWND hwnd, WPARAM wParam )
if( !bVisible )
{
WIN_SetStyle( hwnd, wndPtr->dwStyle | WS_VISIBLE );
DCE_InvalidateDCE( hwnd, &wndPtr->rectWindow );
}
}
else if( bVisible )
......@@ -210,7 +208,6 @@ static void DEFWND_SetRedraw( HWND hwnd, WPARAM wParam )
else wParam = RDW_ALLCHILDREN | RDW_VALIDATE;
RedrawWindow( hwnd, NULL, 0, wParam );
DCE_InvalidateDCE( hwnd, &wndPtr->rectWindow );
WIN_SetStyle( hwnd, wndPtr->dwStyle & ~WS_VISIBLE );
}
WIN_ReleaseWndPtr( wndPtr );
......
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