Sort out event struct types in nsGUIEvent.h

RESOLVED FIXED in mozilla20

Status

()

RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: masayuki, Assigned: masayuki)

Tracking

Trunk
mozilla20
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

Looks like some struct types defined in nsGUIEvent.h isn't being used. We can remove it.

And I think that for safety, we should change them to typed enum.
Created attachment 683038 [details] [diff] [review]
part.1 Remove unused event struct type
Attachment #683038 - Flags: review?(roc)
Created attachment 683041 [details] [diff] [review]
part.2 Make event struct type named enumeration

This change enables build time check if the struct type is used for other purpose.

NS_POPUP_EVENT will be removed by next patch.

I'm not sure why there are the SVG event types.
Attachment #683041 - Flags: review?(roc)
Attachment #683041 - Flags: review?(bugs)
Created attachment 683042 [details] [diff] [review]
part.3 Remove NS_POPUP_EVENT
Attachment #683042 - Flags: review?(roc)
Attachment #683042 - Flags: review?(bugs)

Comment 4

6 years ago
Comment on attachment 683041 [details] [diff] [review]
part.2 Make event struct type named enumeration

I would keep nsEventStructType in nsGUIEvent.h since that is where (almost)
all the event structs are.
That fixed, r=me
Attachment #683041 - Flags: review?(bugs) → review+
(In reply to Olli Pettay [:smaug] from comment #4)
> I would keep nsEventStructType in nsGUIEvent.h since that is where (almost)
> all the event structs are.
> That fixed, r=me

Hmm, nsEvent.h is included by nsGUIEvent.h. If some *.h files need nsEventStructType for arguments or members, including nsEvent.h is better since nsGUIEvent.h includes a lot of *.h files for implementing the all event structs.

Roc, how do you think about that?
# If we make nsGUIEvent.cpp, we don't need the separated header files though.
Comment on attachment 683041 [details] [diff] [review]
part.2 Make event struct type named enumeration

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

What Olli said.
Attachment #683041 - Flags: review?(roc) → review+

Comment 7

6 years ago
Comment on attachment 683042 [details] [diff] [review]
part.3 Remove NS_POPUP_EVENT

I wonder when NS_POPUP_EVENT was still used, and for what.
Must be something really ancient, since even 1.8.0 doesn't seem to use it.
Attachment #683042 - Flags: review?(bugs) → review+
Okay, I'll move the enum to nsGUIEvent.h and land them tomorrow. Thank you roc and smaug!
I meant it's after the merging.
You need to log in before you can comment on or make changes to this bug.