Line data Source code
1 : /* THIS FILE IS AUTOGENERATED FROM MouseEvent.webidl BY Codegen.py - DO NOT EDIT */
2 :
3 : #ifndef mozilla_dom_MouseEventBinding_h
4 : #define mozilla_dom_MouseEventBinding_h
5 :
6 : #include "UIEventBinding.h"
7 : #include "js/RootingAPI.h"
8 : #include "jspubtd.h"
9 : #include "mozilla/ErrorResult.h"
10 : #include "mozilla/dom/BindingDeclarations.h"
11 : #include "mozilla/dom/EventTarget.h"
12 : #include "mozilla/dom/Nullable.h"
13 : #include "nsGlobalWindow.h"
14 :
15 : class nsGlobalWindow;
16 :
17 : namespace mozilla {
18 : namespace dom {
19 :
20 : class EventTarget;
21 : class MouseEvent;
22 : struct MouseEventAtoms;
23 : struct MouseEventInitAtoms;
24 : struct NativePropertyHooks;
25 : class ProtoAndIfaceCache;
26 :
27 : } // namespace dom
28 : } // namespace mozilla
29 :
30 : namespace mozilla {
31 : namespace dom {
32 :
33 0 : struct MouseEventInit : public EventModifierInit
34 : {
35 : MOZ_INIT_OUTSIDE_CTOR int16_t mButton;
36 : MOZ_INIT_OUTSIDE_CTOR uint16_t mButtons;
37 : MOZ_INIT_OUTSIDE_CTOR int32_t mClientX;
38 : MOZ_INIT_OUTSIDE_CTOR int32_t mClientY;
39 : MOZ_INIT_OUTSIDE_CTOR int32_t mMovementX;
40 : MOZ_INIT_OUTSIDE_CTOR int32_t mMovementY;
41 : MOZ_INIT_OUTSIDE_CTOR RefPtr<mozilla::dom::EventTarget> mRelatedTarget;
42 : MOZ_INIT_OUTSIDE_CTOR int32_t mScreenX;
43 : MOZ_INIT_OUTSIDE_CTOR int32_t mScreenY;
44 :
45 : MouseEventInit();
46 :
47 0 : explicit inline MouseEventInit(const FastDictionaryInitializer& )
48 0 : : EventModifierInit(FastDictionaryInitializer())
49 : {
50 : // Do nothing here; this is used by our "Fast" subclass
51 0 : }
52 :
53 : explicit inline MouseEventInit(const MouseEventInit& aOther)
54 : {
55 : *this = aOther;
56 : }
57 :
58 : bool
59 : Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);
60 :
61 : bool
62 : ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const;
63 :
64 : void
65 : TraceDictionary(JSTracer* trc);
66 :
67 : MouseEventInit&
68 : operator=(const MouseEventInit& aOther);
69 :
70 : private:
71 : static bool
72 : InitIds(JSContext* cx, MouseEventInitAtoms* atomsCache);
73 : };
74 :
75 : namespace binding_detail {
76 0 : struct FastMouseEventInit : public MouseEventInit
77 : {
78 0 : inline FastMouseEventInit()
79 0 : : MouseEventInit(FastDictionaryInitializer())
80 : {
81 : // Doesn't matter what int we pass to the parent constructor
82 0 : }
83 : };
84 : } // namespace binding_detail
85 :
86 :
87 : namespace MouseEventBinding {
88 :
89 : typedef mozilla::dom::MouseEvent NativeType;
90 :
91 : JSObject*
92 : DefineDOMInterface(JSContext* aCx, JS::Handle<JSObject*> aGlobal, JS::Handle<jsid> id, bool aDefineOnGlobal);
93 :
94 : const JSClass*
95 : GetJSClass();
96 :
97 : bool
98 : Wrap(JSContext* aCx, mozilla::dom::MouseEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector);
99 :
100 : template <class T>
101 4 : inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto)
102 : {
103 8 : JS::Rooted<JSObject*> reflector(aCx);
104 8 : return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr;
105 : }
106 :
107 : // We declare this as an array so that retrieving a pointer to this
108 : // binding's property hooks only requires compile/link-time resolvable
109 : // address arithmetic. Declaring it as a pointer instead would require
110 : // doing a run-time load to fetch a pointer to this binding's property
111 : // hooks. And then structures which embedded a pointer to this structure
112 : // would require a run-time load for proper initialization, which would
113 : // then induce static constructors. Lots of static constructors.
114 : extern const NativePropertyHooks sNativePropertyHooks[];
115 :
116 : void
117 : CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal);
118 :
119 : JS::Handle<JSObject*>
120 : GetProtoObjectHandle(JSContext* aCx);
121 :
122 : JSObject*
123 : GetProtoObject(JSContext* aCx);
124 :
125 : JS::Handle<JSObject*>
126 : GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true);
127 :
128 : JSObject*
129 : GetConstructorObject(JSContext* aCx);
130 :
131 : } // namespace MouseEventBinding
132 :
133 :
134 :
135 : } // namespace dom
136 : } // namespace mozilla
137 :
138 : #endif // mozilla_dom_MouseEventBinding_h
|