Bug 920425 part.1 Create widget/EventClassList.h r=roc
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 18 Oct 2013 15:10:20 +0900
changeset 151297 8ee916cacd478cc3969410dc80e6e6982a6f79dd
parent 151296 8b64180059f9d6c67354aadb8359d90ba1df78ec
child 151298 f20b704a6727d82d35cc75d17f35c8dc4a3a7450
push id25484
push userryanvm@gmail.com
push dateFri, 18 Oct 2013 19:14:25 +0000
treeherdermozilla-central@3daff401c7ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs920425
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 920425 part.1 Create widget/EventClassList.h r=roc
widget/EventClassList.h
widget/EventForwards.h
widget/moz.build
new file mode 100644
--- /dev/null
+++ b/widget/EventClassList.h
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/**
+ * This header file lists up all event classes and related structs.
+ * Define NS_EVENT_CLASS(aPrefix, aName) and NS_ROOT_EVENT_CLASS(aPrefix, aName)
+ * before including this.
+ * If an event name is WidgetInputEvent, aPrefix is "Widget" and aName is
+ * "InputEvent".  NS_ROOT_EVENT_CLASS() is only used for WidgetEvent for
+ * allowing special handling for it.  If you don't need such special handling,
+ * you can define it as:
+ * #define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
+ */
+
+// BasicEvents.h
+NS_ROOT_EVENT_CLASS(Widget, Event)
+NS_EVENT_CLASS(Widget, GUIEvent)
+NS_EVENT_CLASS(Widget, InputEvent)
+NS_EVENT_CLASS(Internal, UIEvent)
+
+// TextEvents.h
+NS_EVENT_CLASS(Widget, KeyboardEvent)
+NS_EVENT_CLASS(Widget, TextEvent)
+NS_EVENT_CLASS(Widget, CompositionEvent)
+NS_EVENT_CLASS(Widget, QueryContentEvent)
+NS_EVENT_CLASS(Widget, SelectionEvent)
+
+// MouseEvents.h
+NS_EVENT_CLASS(Widget, MouseEventBase)
+NS_EVENT_CLASS(Widget, MouseEvent)
+NS_EVENT_CLASS(Widget, DragEvent)
+NS_EVENT_CLASS(Widget, MouseScrollEvent)
+NS_EVENT_CLASS(Widget, WheelEvent)
+
+// TouchEvents.h
+NS_EVENT_CLASS(Widget, GestureNotifyEvent)
+NS_EVENT_CLASS(Widget, SimpleGestureEvent)
+NS_EVENT_CLASS(Widget, TouchEvent)
+
+// ContentEvents.h
+NS_EVENT_CLASS(Internal, ScriptErrorEvent)
+NS_EVENT_CLASS(Internal, ScrollPortEvent)
+NS_EVENT_CLASS(Internal, ScrollAreaEvent)
+NS_EVENT_CLASS(Internal, FormEvent)
+NS_EVENT_CLASS(Internal, ClipboardEvent)
+NS_EVENT_CLASS(Internal, FocusEvent)
+NS_EVENT_CLASS(Internal, TransitionEvent)
+NS_EVENT_CLASS(Internal, AnimationEvent)
+
+// MiscEvents.h
+NS_EVENT_CLASS(Widget, CommandEvent)
+NS_EVENT_CLASS(Widget, ContentCommandEvent)
+NS_EVENT_CLASS(Widget, PluginEvent)
+
+// MutationEvent.h (content/events/public)
+NS_EVENT_CLASS(Internal, MutationEvent)
--- a/widget/EventForwards.h
+++ b/widget/EventForwards.h
@@ -44,62 +44,31 @@ enum KeyNameIndex
 #undef NS_DEFINE_KEYNAME
 
 } // namespace mozilla
 
 /**
  * All header files should include this header instead of *Events.h.
  */
 
-// BasicEvents.h
 namespace mozilla {
-struct EventFlags;
+
+#define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName;
+#define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
 
-class WidgetEvent;
-class WidgetGUIEvent;
-class WidgetInputEvent;
-class InternalUIEvent;
+#include "mozilla/EventClassList.h"
+
+#undef NS_EVENT_CLASS
+#undef NS_ROOT_EVENT_CLASS
+
+// BasicEvents.h
+struct EventFlags;
 
 // TextEvents.h
 struct AlternativeCharCode;
 struct TextRangeStyle;
 struct TextRange;
 
 typedef TextRange* TextRangeArray;
 
-class WidgetKeyboardEvent;
-class WidgetTextEvent;
-class WidgetCompositionEvent;
-class WidgetQueryContentEvent;
-class WidgetSelectionEvent;
-
-// MouseEvents.h
-class WidgetMouseEventBase;
-class WidgetMouseEvent;
-class WidgetDragEvent;
-class WidgetMouseScrollEvent;
-class WidgetWheelEvent;
-
-// TouchEvents.h
-class WidgetGestureNotifyEvent;
-class WidgetSimpleGestureEvent;
-class WidgetTouchEvent;
-
-// ContentEvents.h
-class InternalScriptErrorEvent;
-class InternalScrollPortEvent;
-class InternalScrollAreaEvent;
-class InternalFormEvent;
-class InternalClipboardEvent;
-class InternalFocusEvent;
-class InternalTransitionEvent;
-class InternalAnimationEvent;
-
-// MiscEvents.h
-class WidgetCommandEvent;
-class WidgetContentCommandEvent;
-class WidgetPluginEvent;
-
-// MutationEvent.h (content/events/public)
-class InternalMutationEvent;
 } // namespace mozilla
 
 #endif // mozilla_EventForwards_h__
--- a/widget/moz.build
+++ b/widget/moz.build
@@ -107,16 +107,17 @@ EXPORTS += [
     'nsIWidgetListener.h',
     'nsWidgetInitData.h',
     'nsWidgetsCID.h',
 ]
 
 EXPORTS.mozilla += [
     'BasicEvents.h',
     'ContentEvents.h',
+    'EventClassList.h',
     'EventForwards.h',
     'LookAndFeel.h',
     'MiscEvents.h',
     'MouseEvents.h',
     'TextEvents.h',
     'TouchEvents.h',
     'WidgetUtils.h',
 ]