зеркало из https://github.com/mozilla/pjs.git
Remove nsIEventHandler, part of the XPCOM plugin API. b=499329 sr=sicking
This commit is contained in:
Родитель
9ce1e16b85
Коммит
05514e36df
|
@ -73,7 +73,6 @@ XPIDLSRCS = \
|
|||
nsIPluginInstanceOwner.idl \
|
||||
nsIPlugin.idl \
|
||||
nsIHTTPHeaderListener.idl \
|
||||
nsIEventHandler.idl \
|
||||
nsIWindowlessPlugInstPeer.idl \
|
||||
nsIPluginTag.idl \
|
||||
nsIPluginTagInfo.idl \
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nspluginroot.idl"
|
||||
|
||||
%{C++
|
||||
#include "nsplugindefs.h"
|
||||
%}
|
||||
|
||||
[uuid(a447ddf0-1a99-11d2-815f-006008119d7a)]
|
||||
interface nsIEventHandler : nsISupports
|
||||
{
|
||||
/**
|
||||
* Handles an event. An nsIEventHandler can also get registered with with
|
||||
* nsIPluginManager2::RegisterWindow and will be called whenever an event
|
||||
* comes in for that window.
|
||||
*
|
||||
* Note that for Unix and Mac the nsPluginEvent structure is different
|
||||
* from the old NPEvent structure -- it's no longer the native event
|
||||
* record, but is instead a struct. This was done for future extensibility,
|
||||
* and so that the Mac could receive the window argument too. For Windows
|
||||
* and OS2, it's always been a struct, so there's no change for them.
|
||||
*
|
||||
* (Corresponds to NPP_HandleEvent.)
|
||||
*
|
||||
* @param aEvent - the event to be handled
|
||||
* @param aHandled - set to PR_TRUE if event was handled
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
void handleEvent(in nsPluginEventPtr aEvent, out boolean aHandled);
|
||||
};
|
|
@ -38,7 +38,6 @@
|
|||
#include "nsIPluginManager.idl"
|
||||
|
||||
interface nsIPlugin;
|
||||
interface nsIEventHandler;
|
||||
|
||||
native nsPluginPlatformWindowRef(nsPluginPlatformWindowRef);
|
||||
|
||||
|
@ -46,7 +45,7 @@ native nsPluginPlatformWindowRef(nsPluginPlatformWindowRef);
|
|||
* Plugin Manager 2 Interface
|
||||
* These extensions to nsIPluginManager are only available in Communicator 5.0.
|
||||
*/
|
||||
[uuid(d2962dc0-4eb6-11d2-8164-006008119d7a)]
|
||||
[uuid(C7706E95-2FD6-4701-992D-FA9D7787667B)]
|
||||
interface nsIPluginManager2 : nsIPluginManager
|
||||
{
|
||||
/**
|
||||
|
@ -98,53 +97,4 @@ interface nsIPluginManager2 : nsIPluginManager
|
|||
* Which proxy/SOCKS to use is determined by the plugin.
|
||||
*/
|
||||
void findProxyForURL(in string aURL, out string aResult);
|
||||
|
||||
/**
|
||||
* Registers a top-level window with the browser. Events received by that
|
||||
* window will be dispatched to the event handler specified.
|
||||
*
|
||||
* @param aHandler - the event handler for the window
|
||||
* @param aWindow - the platform window reference
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
void registerWindow(in nsIEventHandler aHandler, in nsPluginPlatformWindowRef aWindow);
|
||||
|
||||
/**
|
||||
* Unregisters a top-level window with the browser. The handler and window pair
|
||||
* should be the same as that specified to RegisterWindow.
|
||||
*
|
||||
* @param aHandler - the event handler for the window
|
||||
* @param aWindow - the platform window reference
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
void unregisterWindow(in nsIEventHandler aHandler, in nsPluginPlatformWindowRef aWindow);
|
||||
|
||||
/**
|
||||
* Allocates a new menu ID (for the Mac).
|
||||
*
|
||||
* @param aHandler - the event handler for the window
|
||||
* @param aIsSubmenu - whether this is a sub-menu ID or not
|
||||
* @param aResult - the resulting menu ID
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
void allocateMenuID(in nsIEventHandler aHandler, in boolean aIsSubmenu, out short aResult);
|
||||
|
||||
/**
|
||||
* Deallocates a menu ID (for the Mac).
|
||||
*
|
||||
* @param aHandler - the event handler for the window
|
||||
* @param aMenuID - the menu ID
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
void deallocateMenuID(in nsIEventHandler aHandler, in short aMenuID);
|
||||
|
||||
/**
|
||||
* Indicates whether this event handler has allocated the given menu ID.
|
||||
*
|
||||
* @param aHandler - the event handler for the window
|
||||
* @param aMenuID - the menu ID
|
||||
* @param aResult - returns PR_TRUE if the menu ID is allocated
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
void hasAllocatedMenuID(in nsIEventHandler aHandler, in short aMenuID, out boolean aResult);
|
||||
};
|
||||
|
|
|
@ -395,7 +395,6 @@ enum nsPluginReason {
|
|||
|
||||
// Classes that must be implemented by the plugin DLL:
|
||||
class nsIPlugin; // plugin class (MIME-type handler)
|
||||
class nsIEventHandler; // event handler interface
|
||||
class nsIPluginInstance; // plugin instance
|
||||
|
||||
// Classes that are implemented by the browser:
|
||||
|
|
|
@ -3018,31 +3018,6 @@ NS_IMETHODIMP nsPluginHostImpl::FindProxyForURL(const char* url, char* *result)
|
|||
return res;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginHostImpl::RegisterWindow(nsIEventHandler* handler, nsPluginPlatformWindowRef window)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginHostImpl::UnregisterWindow(nsIEventHandler* handler, nsPluginPlatformWindowRef window)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginHostImpl::AllocateMenuID(nsIEventHandler* handler, PRBool isSubmenu, PRInt16 *result)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginHostImpl::DeallocateMenuID(nsIEventHandler* handler, PRInt16 menuID)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginHostImpl::HasAllocatedMenuID(nsIEventHandler* handler, PRInt16 menuID, PRBool *result)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginHostImpl::CreateInstance(nsISupports *aOuter,
|
||||
REFNSIID aIID,
|
||||
void **aResult)
|
||||
|
|
|
@ -390,7 +390,6 @@ nsIEntropyCollector
|
|||
nsIEnumerator
|
||||
nsIErrorService
|
||||
nsIEvaluateStringProxy
|
||||
nsIEventHandler
|
||||
nsIEventQueue
|
||||
nsIEventQueueService
|
||||
nsIException
|
||||
|
|
|
@ -724,30 +724,9 @@ typedef struct vtable_nsIPluginManager2
|
|||
VFTDELTA_DECL(NotifyStatusChange)
|
||||
nsresult (*VFTCALL FindProxyForURL)(void *pvThis, const char *aURL, char **aResult);
|
||||
VFTDELTA_DECL(FindProxyForURL)
|
||||
nsresult (*VFTCALL RegisterWindow)(void *pvThis, nsIEventHandler *aHandler, nsPluginPlatformWindowRef aWindow);
|
||||
VFTDELTA_DECL(RegisterWindow)
|
||||
nsresult (*VFTCALL UnregisterWindow)(void *pvThis, nsIEventHandler *aHandler, nsPluginPlatformWindowRef aWindow);
|
||||
VFTDELTA_DECL(UnregisterWindow)
|
||||
nsresult (*VFTCALL AllocateMenuID)(void *pvThis, nsIEventHandler *aHandler, PRBool aIsSubmenu, PRInt16 *aResult);
|
||||
VFTDELTA_DECL(AllocateMenuID)
|
||||
nsresult (*VFTCALL DeallocateMenuID)(void *pvThis, nsIEventHandler *aHandler, PRInt16 aMenuID);
|
||||
VFTDELTA_DECL(DeallocateMenuID)
|
||||
nsresult (*VFTCALL HasAllocatedMenuID)(void *pvThis, nsIEventHandler *aHandler, PRInt16 aMenuID, PRBool *aResult);
|
||||
VFTDELTA_DECL(HasAllocatedMenuID)
|
||||
} VFTnsIPluginManager2;
|
||||
|
||||
|
||||
/**
|
||||
* nsIEventHandler
|
||||
*/
|
||||
typedef struct vtable_nsIEventHandler
|
||||
{
|
||||
VFTnsISupports base;
|
||||
nsresult (*VFTCALL HandleEvent)(void *pvThis, nsPluginEvent * aEvent, PRBool *aHandled);
|
||||
VFTDELTA_DECL(HandleEvent)
|
||||
} VFTnsIEventHandler;
|
||||
|
||||
|
||||
/**
|
||||
* nsIJVMThreadManager
|
||||
*/
|
||||
|
|
|
@ -90,7 +90,6 @@
|
|||
#include "nsplugindefs.h"
|
||||
#include "nsIPlugin.h"
|
||||
#include "nsIPluginManager.h"
|
||||
#include "nsIEventHandler.h"
|
||||
#include "nsIPluginManager2.h"
|
||||
#include "nsIPluginStreamInfo.h"
|
||||
#include "nsIPluginStreamListener.h"
|
||||
|
@ -3012,56 +3011,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
|
||||
// UP: nsIEventHandler
|
||||
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
|
||||
|
||||
/**
|
||||
* nsIEventHandler
|
||||
*/
|
||||
class UpEventHandler : public nsIEventHandler, public UpSupportsBase
|
||||
{
|
||||
public:
|
||||
UP_IMPL_NSISUPPORTS();
|
||||
|
||||
/**
|
||||
* Handles an event. An nsIEventHandler can also get registered with with
|
||||
* nsIPluginManager2::RegisterWindow and will be called whenever an event
|
||||
* comes in for that window.
|
||||
*
|
||||
* Note that for Unix and Mac the nsPluginEvent structure is different
|
||||
* from the old NPEvent structure -- it's no longer the native event
|
||||
* record, but is instead a struct. This was done for future extensibility,
|
||||
* and so that the Mac could receive the window argument too. For Windows
|
||||
* and OS2, it's always been a struct, so there's no change for them.
|
||||
*
|
||||
* (Corresponds to NPP_HandleEvent.)
|
||||
*
|
||||
* @param aEvent - the event to be handled
|
||||
* @param aHandled - set to PR_TRUE if event was handled
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
/* void handleEvent (in nsPluginEventPtr aEvent, out boolean aHandled); */
|
||||
NS_IMETHOD HandleEvent(nsPluginEvent *aEvent, PRBool *aHandled)
|
||||
{
|
||||
UP_ENTER_RC();
|
||||
rc = VFTCALL2((VFTnsIEventHandler*)mpvVFTable, HandleEvent, mpvThis, aEvent, aHandled);
|
||||
if (NS_SUCCEEDED(rc) && VALID_PTR(aHandled))
|
||||
dprintf(("%s: *aHandled=%d", pszFunction, *aHandled));
|
||||
UP_LEAVE_INT(rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/** Constructor */
|
||||
UpEventHandler(void *pvThis) :
|
||||
UpSupportsBase(pvThis, (nsIEventHandler*)this, kEventHandlerIID)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
|
||||
// UP: nsIRunnable
|
||||
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
|
||||
|
@ -6480,157 +6429,6 @@ nsresult VFTCALL downIPM2FindProxyForURL(void *pvThis, const char *aURL, char **
|
|||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a top-level window with the browser. Events received by that
|
||||
* window will be dispatched to the event handler specified.
|
||||
*
|
||||
* @param aHandler - the event handler for the window
|
||||
* @param aWindow - the platform window reference
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
/* void registerWindow (in nsIEventHandler aHandler, in nsPluginPlatformWindowRef aWindow); */
|
||||
nsresult VFTCALL downIPM2RegisterWindow(void *pvThis, nsIEventHandler *aHandler, nsPluginPlatformWindowRef aWindow)
|
||||
{
|
||||
DOWN_ENTER_RC(pvThis, nsIPluginManager2);
|
||||
dprintf(("%s: Incomplete!!!", pszFunction));
|
||||
dprintf(("%s: aHandler=%p aWindow=%x", pszFunction, aHandler, aWindow));
|
||||
|
||||
nsIEventHandler * pupHandler = aHandler;
|
||||
rc = upCreateWrapper((void**)&pupHandler, kEventHandlerIID, NS_OK);
|
||||
if (NS_SUCCEEDED(rc))
|
||||
{
|
||||
//@todo wrap window handle somehow...
|
||||
DebugInt3();
|
||||
nsPluginPlatformWindowRef os2Window = aWindow;
|
||||
if (NS_SUCCEEDED(rc))
|
||||
{
|
||||
rc = pMozI->RegisterWindow(pupHandler, os2Window);
|
||||
}
|
||||
else
|
||||
dprintf(("%s: failed to create window handle wrapper for %x!!!", pszFunction, aWindow));
|
||||
}
|
||||
else
|
||||
dprintf(("%s: failed to create up wrapper for nsIEventHandler %x!!!", pszFunction, aHandler));
|
||||
DOWN_LEAVE_INT(pvThis, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters a top-level window with the browser. The handler and window pair
|
||||
* should be the same as that specified to RegisterWindow.
|
||||
*
|
||||
* @param aHandler - the event handler for the window
|
||||
* @param aWindow - the platform window reference
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
/* void unregisterWindow (in nsIEventHandler aHandler, in nsPluginPlatformWindowRef aWindow); */
|
||||
nsresult VFTCALL downIPM2UnregisterWindow(void *pvThis, nsIEventHandler *aHandler, nsPluginPlatformWindowRef aWindow)
|
||||
{
|
||||
DOWN_ENTER_RC(pvThis, nsIPluginManager2);
|
||||
dprintf(("%s: Incomplete!!!", pszFunction));
|
||||
dprintf(("%s: aHandler=%p aWindow=%x", pszFunction, aHandler, aWindow));
|
||||
|
||||
nsIEventHandler * pupHandler = aHandler;
|
||||
rc = upCreateWrapper((void**)&pupHandler, kEventHandlerIID, NS_OK);
|
||||
if (NS_SUCCEEDED(rc))
|
||||
{
|
||||
//@todo wrap window handle somehow...
|
||||
DebugInt3();
|
||||
nsPluginPlatformWindowRef os2Window = aWindow;
|
||||
if (NS_SUCCEEDED(rc))
|
||||
{
|
||||
rc = pMozI->UnregisterWindow(pupHandler, os2Window);
|
||||
}
|
||||
else
|
||||
dprintf(("%s: failed to create window handle wrapper for %x!!!", pszFunction, aWindow));
|
||||
}
|
||||
else
|
||||
dprintf(("%s: failed to create up wrapper for nsIEventHandler %x!!!", pszFunction, aHandler));
|
||||
DOWN_LEAVE_INT(pvThis, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocates a new menu ID (for the Mac).
|
||||
*
|
||||
* @param aHandler - the event handler for the window
|
||||
* @param aIsSubmenu - whether this is a sub-menu ID or not
|
||||
* @param aResult - the resulting menu ID
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
/* void allocateMenuID (in nsIEventHandler aHandler, in boolean aIsSubmenu, out short aResult); */
|
||||
nsresult VFTCALL downIPM2AllocateMenuID(void *pvThis, nsIEventHandler *aHandler, PRBool aIsSubmenu, PRInt16 *aResult)
|
||||
{
|
||||
DOWN_ENTER_RC(pvThis, nsIPluginManager2);
|
||||
dprintf(("%s: Incomplete!!!", pszFunction));
|
||||
dprintf(("%s: aHandler=%p aIsSubmenu=%d aResult=%p", pszFunction, aHandler, aIsSubmenu, aResult));
|
||||
|
||||
nsIEventHandler * pupHandler = aHandler;
|
||||
rc = upCreateWrapper((void**)&pupHandler, kEventHandlerIID, NS_OK);
|
||||
if (NS_SUCCEEDED(rc))
|
||||
{
|
||||
rc = pMozI->AllocateMenuID(pupHandler, aIsSubmenu, aResult);
|
||||
if (NS_SUCCEEDED(rc) && VALID_PTR(aResult))
|
||||
dprintf(("%s: *aResult=%d (0x%x)", pszFunction, *aResult, *aResult));
|
||||
}
|
||||
else
|
||||
dprintf(("%s: failed to create up wrapper for nsIEventHandler %x !!!", pszFunction, aHandler));
|
||||
DOWN_LEAVE_INT(pvThis, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deallocates a menu ID (for the Mac).
|
||||
*
|
||||
* @param aHandler - the event handler for the window
|
||||
* @param aMenuID - the menu ID
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
/* void deallocateMenuID (in nsIEventHandler aHandler, in short aMenuID); */
|
||||
nsresult VFTCALL downIPM2DeallocateMenuID(void *pvThis, nsIEventHandler *aHandler, PRInt16 aMenuID)
|
||||
{
|
||||
DOWN_ENTER_RC(pvThis, nsIPluginManager2);
|
||||
dprintf(("%s: aHandler=%p aMenuID=%d", pszFunction, aHandler, aMenuID));
|
||||
|
||||
nsIEventHandler * pupHandler = aHandler;
|
||||
rc = upCreateWrapper((void**)&pupHandler, kEventHandlerIID, NS_OK);
|
||||
if (NS_SUCCEEDED(rc))
|
||||
rc = pMozI->DeallocateMenuID(pupHandler, aMenuID);
|
||||
else
|
||||
dprintf(("%s: failed to create up wrapper for nsIEventHandler %x !!!", pszFunction, aHandler));
|
||||
DOWN_LEAVE_INT(pvThis, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this event handler has allocated the given menu ID.
|
||||
*
|
||||
* @param aHandler - the event handler for the window
|
||||
* @param aMenuID - the menu ID
|
||||
* @param aResult - returns PR_TRUE if the menu ID is allocated
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
/* void hasAllocatedMenuID (in nsIEventHandler aHandler, in short aMenuID, out boolean aResult); */
|
||||
nsresult VFTCALL downIPM2HasAllocatedMenuID(void *pvThis, nsIEventHandler *aHandler, PRInt16 aMenuID, PRBool *aResult)
|
||||
{
|
||||
DOWN_ENTER_RC(pvThis, nsIPluginManager2);
|
||||
dprintf(("%s: aHandler=%p aMenuID=%d aResult=%p", pszFunction, aHandler, aMenuID, aResult));
|
||||
|
||||
nsIEventHandler * pupHandler = aHandler;
|
||||
rc = upCreateWrapper((void**)&pupHandler, kEventHandlerIID, NS_OK);
|
||||
if (NS_SUCCEEDED(rc))
|
||||
{
|
||||
rc = pMozI->HasAllocatedMenuID(pupHandler, aMenuID, aResult);
|
||||
if (NS_SUCCEEDED(rc) && VALID_PTR(aResult))
|
||||
dprintf(("%s: *aResult=%d", pszFunction, *aResult));
|
||||
}
|
||||
else
|
||||
dprintf(("%s: failed to create up wrapper for nsIEventHandler %x !!!", pszFunction, aHandler));
|
||||
DOWN_LEAVE_INT(pvThis, rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
MAKE_SAFE_VFT(VFTnsIPluginManager2, downVFTnsIPluginManager2)
|
||||
{
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче