Closed Bug 832159 Opened 11 years ago Closed 11 years ago

Move internal part of InputData (nsEvent conversion) out from the header

Categories

(Core :: Widget, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: romaxa, Assigned: romaxa)

Details

Attachments

(1 file, 1 obsolete file)

I'm trying to reuse as much as possible from existing gecko code for embedding API.
and one thing required in order to make generic C++ embedding interface is ability to convert platform toolkit events into gecko events (InputData events)

basically I want to be able to use InputData outside of internal build and outside of XPCOM context (embed parent context), but in order to do that I need to move some functionality like 
MultiTouchInput(const nsTouchEvent& aTouchEvent)
MultiTouchInput(const nsMouseEvent& aMouseEvent)

into internal InputData.cpp file, so I can include header. for InputEvent intialization outside of Internal context...

I tried to initialize nsEvent's nsTouchEvents directly but as soon I create nsDOMTouchEvent outside of XPCOM context assert on garbage collector...
Also I need default constructors in order to be able to IPC these events through IPDL.
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #703758 - Flags: feedback?(bugzilla)
( Not garbage collector, but cycle collector, I guess.
nsEvent has strong refs to event targets, which are cycle collectable objects, so it should not
be uses off-main-thread. )
What is the reason for adding ctors that take no parameters?
See Comment #1
IPDL generated code has initialization with default ctor...
see for example this commit where default ctor's were added to nsEvent
http://hg.mozilla.org/mozilla-central/rev/fb5ad0e555fd
Comment on attachment 703758 [details] [diff] [review]
Allow to use InputData.h outside of Internal build

Review of attachment 703758 [details] [diff] [review]:
-----------------------------------------------------------------

Ok, I see. This code is actually smaug's baby though, so we should see what he says.

Also, is this patch formatted correctly? The review tool doesn't seem to be parsing InputData.cpp as a different file.
Attachment #703758 - Flags: feedback?(bugzilla)
Attachment #703758 - Flags: feedback?(bugs)
Attachment #703758 - Flags: feedback+
Formatted patch, change 2 space indent
Attachment #703758 - Attachment is obsolete: true
Attachment #703758 - Flags: feedback?(bugs)
Attachment #704359 - Flags: review?(bugs)
Comment on attachment 704359 [details] [diff] [review]
Allow to use InputData.h outside of Internal build, and push throug IPDL

Don't have comments of a method in two places. I'd prefer keeping them in .h
I'm talking about the comment just before MultiTouchInput::MultiTouchInput(const nsMouseEvent& aMouseEvent)
Attachment #704359 - Flags: review?(bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/ffa079b50b20
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: