Commit 550cac96 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winemac: Use the new NotifyIcon user driver interface.

parent 22bfdbeb
......@@ -424,9 +424,3 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
macdrv_module = instance;
return process_attach();
}
int CDECL wine_notify_icon(DWORD msg, NOTIFYICONDATAW *data)
{
struct notify_icon_params params = { .msg = msg, .data = data };
return MACDRV_CALL(notify_icon, &params);
}
......@@ -269,6 +269,8 @@ static const struct user_driver_funcs macdrv_funcs =
.pBeep = macdrv_Beep,
.pChangeDisplaySettings = macdrv_ChangeDisplaySettings,
.pClipCursor = macdrv_ClipCursor,
.pNotifyIcon = macdrv_NotifyIcon,
.pCleanupIcons = macdrv_CleanupIcons,
.pClipboardWindowProc = macdrv_ClipboardWindowProc,
.pDesktopWindowProc = macdrv_DesktopWindowProc,
.pDestroyCursorIcon = macdrv_DestroyCursorIcon,
......
......@@ -134,6 +134,8 @@ extern BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device
extern BOOL macdrv_GetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp);
extern BOOL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp);
extern BOOL macdrv_ClipCursor(const RECT *clip, BOOL reset);
extern LRESULT macdrv_NotifyIcon(HWND hwnd, UINT msg, NOTIFYICONDATAW *data);
extern void macdrv_CleanupIcons(HWND hwnd);
extern LRESULT macdrv_DesktopWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
extern void macdrv_DestroyWindow(HWND hwnd);
extern void macdrv_SetDesktopWindow(HWND hwnd);
......@@ -281,7 +283,6 @@ extern NTSTATUS macdrv_dnd_get_formats(void *arg);
extern NTSTATUS macdrv_dnd_have_format(void *arg);
extern NTSTATUS macdrv_dnd_release(void *arg);
extern NTSTATUS macdrv_dnd_retain(void *arg);
extern NTSTATUS macdrv_notify_icon(void *arg);
extern NTSTATUS macdrv_client_func(enum macdrv_client_funcs func, const void *params,
ULONG size);
......
......@@ -623,7 +623,6 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
macdrv_dnd_release,
macdrv_dnd_retain,
macdrv_init,
macdrv_notify_icon,
macdrv_quit_result,
};
......@@ -661,61 +660,6 @@ static NTSTATUS wow64_init(void *arg)
return macdrv_init(&params);
}
static NTSTATUS wow64_notify_icon(void *arg)
{
struct
{
DWORD msg;
ULONG data;
} *params32 = arg;
struct
{
DWORD cbSize;
ULONG hWnd;
UINT uID;
UINT uFlags;
UINT uCallbackMessage;
ULONG hIcon;
WCHAR szTip[128];
DWORD dwState;
DWORD dwStateMask;
WCHAR szInfo[256];
UINT uTimeout;
WCHAR szInfoTitle[64];
DWORD dwInfoFlags;
GUID guidItem;
ULONG hBalloonIcon;
} *data32 = UlongToPtr(params32->data);
struct notify_icon_params params;
NOTIFYICONDATAW data;
params.msg = params32->msg;
params.data = &data;
data.cbSize = sizeof(data);
data.hWnd = UlongToHandle(data32->hWnd);
data.uID = data32->uID;
data.uFlags = data32->uFlags;
data.uCallbackMessage = data32->uCallbackMessage;
data.hIcon = UlongToHandle(data32->hIcon);
if (data.uFlags & NIF_TIP)
wcscpy(data.szTip, data32->szTip);
data.dwState = data32->dwState;
data.dwStateMask = data32->dwStateMask;
if (data.uFlags & NIF_INFO)
{
wcscpy(data.szInfoTitle, data32->szInfoTitle);
wcscpy(data.szInfo, data32->szInfo);
data.uTimeout = data32->uTimeout;
data.dwInfoFlags = data32->dwInfoFlags;
}
data.guidItem = data32->guidItem;
data.hBalloonIcon = UlongToHandle(data32->hBalloonIcon);
return macdrv_notify_icon(&params);
}
const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
{
wow64_dnd_get_data,
......@@ -724,7 +668,6 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
macdrv_dnd_release,
macdrv_dnd_retain,
wow64_init,
wow64_notify_icon,
macdrv_quit_result,
};
......
......@@ -59,12 +59,11 @@ static struct list icon_list = LIST_INIT(icon_list);
static BOOL delete_icon(struct tray_icon *icon);
/***********************************************************************
* cleanup_icons
*
* Delete all systray icons owned by a given window.
* CleanupIcons (MACDRV.@)
*/
static void cleanup_icons(HWND hwnd)
void macdrv_CleanupIcons(HWND hwnd)
{
struct tray_icon *icon, *next;
......@@ -245,18 +244,14 @@ static BOOL delete_icon(struct tray_icon *icon)
/***********************************************************************
* wine_notify_icon (MACDRV.@)
*
* Driver-side implementation of Shell_NotifyIcon.
* NotifyIcon (MACDRV.@)
*/
NTSTATUS macdrv_notify_icon(void *arg)
LRESULT macdrv_NotifyIcon(HWND hwnd, UINT msg, NOTIFYICONDATAW *data)
{
struct notify_icon_params *params = arg;
NOTIFYICONDATAW *data = params->data;
BOOL ret = FALSE;
struct tray_icon *icon;
switch (params->msg)
switch (msg)
{
case NIM_ADD:
ret = add_icon(data);
......@@ -267,9 +262,6 @@ NTSTATUS macdrv_notify_icon(void *arg)
case NIM_MODIFY:
if ((icon = get_icon(data->hWnd, data->uID))) ret = modify_icon(icon, data);
break;
case 0xdead: /* Wine extension: owner window has died */
cleanup_icons(data->hWnd);
break;
case NIM_SETVERSION:
if ((icon = get_icon(data->hWnd, data->uID)))
{
......@@ -278,8 +270,8 @@ NTSTATUS macdrv_notify_icon(void *arg)
}
break;
default:
FIXME("unhandled tray message: %u\n", params->msg);
break;
ERR("Unexpected NotifyIconProc call\n");
return -1;
}
return ret;
}
......
......@@ -27,7 +27,6 @@ enum macdrv_funcs
unix_dnd_release,
unix_dnd_retain,
unix_init,
unix_notify_icon,
unix_quit_result,
unix_funcs_count
};
......@@ -70,13 +69,6 @@ struct init_params
struct localized_string *strings;
};
/* macdrv_notify_icon params */
struct notify_icon_params
{
unsigned int msg;
struct _NOTIFYICONDATAW *data;
};
/* macdrv_quit_result params */
struct quit_result_params
{
......
# System tray
@ cdecl wine_notify_icon(long ptr)
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