Module: wine Branch: master Commit: 585da9296d7559784c5a72474be4c9eb58ebc1c9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=585da9296d7559784c5a72474b...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Apr 17 16:07:06 2008 +0200
winex11: Moved the ExposeEvent handler to event.c.
Use consistent naming for all event handlers.
---
dlls/winex11.drv/event.c | 85 ++++++++++++++++++++++++++++++++++++-------- dlls/winex11.drv/winpos.c | 51 --------------------------- dlls/winex11.drv/x11drv.h | 1 - 3 files changed, 69 insertions(+), 68 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 377e8f4..fc126c2 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -51,6 +51,7 @@ #include "shlobj.h" /* DROPFILES */ #include "shellapi.h"
+#include "wine/server.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(event); @@ -72,10 +73,11 @@ extern BOOL ximInComposeMode; #define DndURL 128 /* KDE drag&drop */
/* Event handlers */ -static void EVENT_FocusIn( HWND hwnd, XEvent *event ); -static void EVENT_FocusOut( HWND hwnd, XEvent *event ); -static void EVENT_PropertyNotify( HWND hwnd, XEvent *event ); -static void EVENT_ClientMessage( HWND hwnd, XEvent *event ); +static void X11DRV_FocusIn( HWND hwnd, XEvent *event ); +static void X11DRV_FocusOut( HWND hwnd, XEvent *event ); +static void X11DRV_Expose( HWND hwnd, XEvent *event ); +static void X11DRV_PropertyNotify( HWND hwnd, XEvent *event ); +static void X11DRV_ClientMessage( HWND hwnd, XEvent *event );
struct event_handler { @@ -95,8 +97,8 @@ static struct event_handler handlers[MAX_EVENT_HANDLERS] = { MotionNotify, X11DRV_MotionNotify }, { EnterNotify, X11DRV_EnterNotify }, /* LeaveNotify */ - { FocusIn, EVENT_FocusIn }, - { FocusOut, EVENT_FocusOut }, + { FocusIn, X11DRV_FocusIn }, + { FocusOut, X11DRV_FocusOut }, { KeymapNotify, X11DRV_KeymapNotify }, { Expose, X11DRV_Expose }, /* GraphicsExpose */ @@ -114,12 +116,12 @@ static struct event_handler handlers[MAX_EVENT_HANDLERS] = /* ResizeRequest */ /* CirculateNotify */ /* CirculateRequest */ - { PropertyNotify, EVENT_PropertyNotify }, + { PropertyNotify, X11DRV_PropertyNotify }, { SelectionClear, X11DRV_SelectionClear }, { SelectionRequest, X11DRV_SelectionRequest }, /* SelectionNotify */ /* ColormapNotify */ - { ClientMessage, EVENT_ClientMessage }, + { ClientMessage, X11DRV_ClientMessage }, { MappingNotify, X11DRV_MappingNotify }, };
@@ -568,9 +570,9 @@ static const char * const focus_details[] = };
/********************************************************************** - * EVENT_FocusIn + * X11DRV_FocusIn */ -static void EVENT_FocusIn( HWND hwnd, XEvent *xev ) +static void X11DRV_FocusIn( HWND hwnd, XEvent *xev ) { XFocusChangeEvent *event = &xev->xfocus; XIC xic; @@ -602,11 +604,11 @@ static void EVENT_FocusIn( HWND hwnd, XEvent *xev )
/********************************************************************** - * EVENT_FocusOut + * X11DRV_FocusOut * * Note: only top-level windows get FocusOut events. */ -static void EVENT_FocusOut( HWND hwnd, XEvent *xev ) +static void X11DRV_FocusOut( HWND hwnd, XEvent *xev ) { XFocusChangeEvent *event = &xev->xfocus; HWND hwnd_tmp; @@ -659,6 +661,57 @@ static void EVENT_FocusOut( HWND hwnd, XEvent *xev )
/*********************************************************************** + * X11DRV_Expose + */ +static void X11DRV_Expose( HWND hwnd, XEvent *xev ) +{ + XExposeEvent *event = &xev->xexpose; + RECT rect; + struct x11drv_win_data *data; + int flags = RDW_INVALIDATE | RDW_ERASE; + + TRACE( "win %p (%lx) %d,%d %dx%d\n", + hwnd, event->window, event->x, event->y, event->width, event->height ); + + if (!(data = X11DRV_get_win_data( hwnd ))) return; + + if (event->window == data->whole_window) + { + rect.left = data->whole_rect.left + event->x; + rect.top = data->whole_rect.top + event->y; + flags |= RDW_FRAME; + } + else + { + rect.left = data->client_rect.left + event->x; + rect.top = data->client_rect.top + event->y; + } + rect.right = rect.left + event->width; + rect.bottom = rect.top + event->height; + + if (event->window != root_window) + { + SERVER_START_REQ( update_window_zorder ) + { + req->window = hwnd; + req->rect.left = rect.left; + req->rect.top = rect.top; + req->rect.right = rect.right; + req->rect.bottom = rect.bottom; + wine_server_call( req ); + } + SERVER_END_REQ; + + /* make position relative to client area instead of parent */ + OffsetRect( &rect, -data->client_rect.left, -data->client_rect.top ); + flags |= RDW_ALLCHILDREN; + } + + RedrawWindow( hwnd, &rect, 0, flags ); +} + + +/*********************************************************************** * get_window_wm_state */ int get_window_wm_state( Display *display, struct x11drv_win_data *data ) @@ -755,9 +808,9 @@ static void handle_wm_state_notify( struct x11drv_win_data *data, XPropertyEvent
/*********************************************************************** - * EVENT_PropertyNotify + * X11DRV_PropertyNotify */ -static void EVENT_PropertyNotify( HWND hwnd, XEvent *xev ) +static void X11DRV_PropertyNotify( HWND hwnd, XEvent *xev ) { XPropertyEvent *event = &xev->xproperty; struct x11drv_win_data *data; @@ -1130,9 +1183,9 @@ static const struct client_message_handler client_messages[] =
/********************************************************************** - * EVENT_ClientMessage + * X11DRV_ClientMessage */ -static void EVENT_ClientMessage( HWND hwnd, XEvent *xev ) +static void X11DRV_ClientMessage( HWND hwnd, XEvent *xev ) { XClientMessageEvent *event = &xev->xclient; unsigned int i; diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c index f6b75d6..8c904ad 100644 --- a/dlls/winex11.drv/winpos.c +++ b/dlls/winex11.drv/winpos.c @@ -61,57 +61,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv); static const char managed_prop[] = "__wine_x11_managed";
/*********************************************************************** - * X11DRV_Expose - */ -void X11DRV_Expose( HWND hwnd, XEvent *xev ) -{ - XExposeEvent *event = &xev->xexpose; - RECT rect; - struct x11drv_win_data *data; - int flags = RDW_INVALIDATE | RDW_ERASE; - - TRACE( "win %p (%lx) %d,%d %dx%d\n", - hwnd, event->window, event->x, event->y, event->width, event->height ); - - if (!(data = X11DRV_get_win_data( hwnd ))) return; - - if (event->window == data->whole_window) - { - rect.left = data->whole_rect.left + event->x; - rect.top = data->whole_rect.top + event->y; - flags |= RDW_FRAME; - } - else - { - rect.left = data->client_rect.left + event->x; - rect.top = data->client_rect.top + event->y; - } - rect.right = rect.left + event->width; - rect.bottom = rect.top + event->height; - - if (event->window != root_window) - { - SERVER_START_REQ( update_window_zorder ) - { - req->window = hwnd; - req->rect.left = rect.left; - req->rect.top = rect.top; - req->rect.right = rect.right; - req->rect.bottom = rect.bottom; - wine_server_call( req ); - } - SERVER_END_REQ; - - /* make position relative to client area instead of parent */ - OffsetRect( &rect, -data->client_rect.left, -data->client_rect.top ); - flags |= RDW_ALLCHILDREN; - } - - RedrawWindow( hwnd, &rect, 0, flags ); -} - - -/*********************************************************************** * update_net_wm_states */ static void update_net_wm_states( Display *display, struct x11drv_win_data *data ) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index e682f07..b040e05 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -641,7 +641,6 @@ extern void X11DRV_MotionNotify( HWND hwnd, XEvent *event ); extern void X11DRV_EnterNotify( HWND hwnd, XEvent *event ); extern void X11DRV_KeyEvent( HWND hwnd, XEvent *event ); extern void X11DRV_KeymapNotify( HWND hwnd, XEvent *event ); -extern void X11DRV_Expose( HWND hwnd, XEvent *event ); extern void X11DRV_DestroyNotify( HWND hwnd, XEvent *event ); extern void X11DRV_MapNotify( HWND hwnd, XEvent *event ); extern void X11DRV_ConfigureNotify( HWND hwnd, XEvent *event );