Bug 542047 - Forward nsDOMScrollAreaEvent. r=smaug

This commit is contained in:
Joe Drew 2010-01-27 15:55:57 -05:00
parent 93d6ce34da
commit a1955073ea
2 changed files with 48 additions and 0 deletions

View File

@ -35,6 +35,11 @@
*
* ***** END LICENSE BLOCK ***** */
#ifdef MOZ_IPC
#include "base/basictypes.h"
#include "IPC/IPCMessageUtils.h"
#endif
#include "nsDOMScrollAreaEvent.h"
#include "nsGUIEvent.h"
#include "nsClientRect.h"
@ -106,6 +111,44 @@ nsDOMScrollAreaEvent::InitScrollAreaEvent(const nsAString &aEventType,
return NS_OK;
}
#ifdef MOZ_IPC
void
nsDOMScrollAreaEvent::Serialize(IPC::Message* aMsg,
PRBool aSerializeInterfaceType)
{
if (aSerializeInterfaceType) {
IPC::WriteParam(aMsg, NS_LITERAL_STRING("scrollareaevent"));
}
nsDOMEvent::Serialize(aMsg, PR_FALSE);
float val;
mClientArea.GetLeft(&val);
IPC::WriteParam(aMsg, val);
mClientArea.GetTop(&val);
IPC::WriteParam(aMsg, val);
mClientArea.GetWidth(&val);
IPC::WriteParam(aMsg, val);
mClientArea.GetHeight(&val);
IPC::WriteParam(aMsg, val);
}
PRBool
nsDOMScrollAreaEvent::Deserialize(const IPC::Message* aMsg, void** aIter)
{
NS_ENSURE_TRUE(nsDOMEvent::Deserialize(aMsg, aIter), PR_FALSE);
float x, y, width, height;
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &x), PR_FALSE);
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &y), PR_FALSE);
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &width), PR_FALSE);
NS_ENSURE_TRUE(IPC::ReadParam(aMsg, aIter, &height), PR_FALSE);
mClientArea.SetRect(x, y, width, height);
return PR_TRUE;
}
#endif
nsresult
NS_NewDOMScrollAreaEvent(nsIDOMEvent **aInstancePtrResult,
nsPresContext *aPresContext,

View File

@ -58,6 +58,11 @@ public:
NS_FORWARD_TO_NSDOMUIEVENT
#ifdef MOZ_IPC
virtual void Serialize(IPC::Message* aMsg, PRBool aSerializeInterfaceType);
virtual PRBool Deserialize(const IPC::Message* aMsg, void** aIter);
#endif
protected:
nsClientRect mClientArea;
};