From dc02d2f159e91ad31fa36fecfc0e212d29bc04e2 Mon Sep 17 00:00:00 2001 From: "davidm%netscape.com" Date: Wed, 16 Dec 1998 22:05:04 +0000 Subject: [PATCH] Add mac code to get NSPR event queue for dispatching of link click events git-svn-id: svn://10.0.0.236/trunk@16534 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 14 ++++++++++++-- mozilla/webshell/src/nsWebShell.cpp | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index b884842baf1..03cf6dde7c3 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -100,6 +100,10 @@ void nsWebShell_SetUnixEventQueue(PLEventQueue* aEventQueue) gWebShell_UnixEventQueue = aEventQueue; } #endif +#if XP_MAC +// This has all the same problems as the above +extern "C" PLEventQueue* GetMacPLEventQueue(); +#endif //---------------------------------------------------------------------- @@ -1542,7 +1546,7 @@ OnLinkClickEvent::OnLinkClickEvent(nsWebShell* aHandler, NS_IF_ADDREF(mContent); mVerb = aVerb; -#ifdef XP_PC +#ifdef XP_PC PL_InitEvent(this, nsnull, (PLHandleEventProc) ::HandlePLEvent, (PLDestroyEventProc) ::DestroyPLEvent); @@ -1558,7 +1562,13 @@ OnLinkClickEvent::OnLinkClickEvent(nsWebShell* aHandler, PL_PostEvent(gWebShell_UnixEventQueue, this); #endif - +#ifdef XP_MAC + PL_InitEvent(this, nsnull, + (PLHandleEventProc) ::HandlePLEvent, + (PLDestroyEventProc) ::DestroyPLEvent); + PLEventQueue* eventQueue = GetMacPLEventQueue(); + PL_PostEvent(eventQueue, this); +#endif } OnLinkClickEvent::~OnLinkClickEvent() diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index b884842baf1..03cf6dde7c3 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -100,6 +100,10 @@ void nsWebShell_SetUnixEventQueue(PLEventQueue* aEventQueue) gWebShell_UnixEventQueue = aEventQueue; } #endif +#if XP_MAC +// This has all the same problems as the above +extern "C" PLEventQueue* GetMacPLEventQueue(); +#endif //---------------------------------------------------------------------- @@ -1542,7 +1546,7 @@ OnLinkClickEvent::OnLinkClickEvent(nsWebShell* aHandler, NS_IF_ADDREF(mContent); mVerb = aVerb; -#ifdef XP_PC +#ifdef XP_PC PL_InitEvent(this, nsnull, (PLHandleEventProc) ::HandlePLEvent, (PLDestroyEventProc) ::DestroyPLEvent); @@ -1558,7 +1562,13 @@ OnLinkClickEvent::OnLinkClickEvent(nsWebShell* aHandler, PL_PostEvent(gWebShell_UnixEventQueue, this); #endif - +#ifdef XP_MAC + PL_InitEvent(this, nsnull, + (PLHandleEventProc) ::HandlePLEvent, + (PLDestroyEventProc) ::DestroyPLEvent); + PLEventQueue* eventQueue = GetMacPLEventQueue(); + PL_PostEvent(eventQueue, this); +#endif } OnLinkClickEvent::~OnLinkClickEvent()