/work/obj-fuzz/dist/include/mozilla/dom/ScreenBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM Screen.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_ScreenBinding_h |
4 | | #define mozilla_dom_ScreenBinding_h |
5 | | |
6 | | #include "GeckoProfiler.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/Nullable.h" |
12 | | #include "mozilla/dom/PrototypeList.h" |
13 | | |
14 | | class nsScreen; |
15 | | struct nsScreenAtoms; |
16 | | |
17 | | namespace mozilla { |
18 | | namespace dom { |
19 | | |
20 | | struct NativePropertyHooks; |
21 | | class ProtoAndIfaceCache; |
22 | | class ScreenLuminance; |
23 | | struct ScreenLuminanceAtoms; |
24 | | |
25 | | } // namespace dom |
26 | | } // namespace mozilla |
27 | | |
28 | | namespace mozilla { |
29 | | namespace dom { |
30 | | |
31 | | enum class ScreenColorGamut : uint8_t { |
32 | | Srgb, |
33 | | P3, |
34 | | Rec2020, |
35 | | EndGuard_ |
36 | | }; |
37 | | |
38 | | namespace ScreenColorGamutValues { |
39 | | extern const EnumEntry strings[4]; |
40 | | } // namespace ScreenColorGamutValues |
41 | | |
42 | | bool |
43 | | ToJSValue(JSContext* aCx, ScreenColorGamut aArgument, JS::MutableHandle<JS::Value> aValue); |
44 | | |
45 | | |
46 | | namespace Screen_Binding { |
47 | | |
48 | | typedef nsScreen NativeType; |
49 | | |
50 | | const JSClass* |
51 | | GetJSClass(); |
52 | | |
53 | | bool |
54 | | Wrap(JSContext* aCx, nsScreen* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
55 | | |
56 | | template <class T> |
57 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
58 | 0 | { |
59 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
60 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
61 | 0 | } |
62 | | |
63 | | // We declare this as an array so that retrieving a pointer to this |
64 | | // binding's property hooks only requires compile/link-time resolvable |
65 | | // address arithmetic. Declaring it as a pointer instead would require |
66 | | // doing a run-time load to fetch a pointer to this binding's property |
67 | | // hooks. And then structures which embedded a pointer to this structure |
68 | | // would require a run-time load for proper initialization, which would |
69 | | // then induce static constructors. Lots of static constructors. |
70 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
71 | | |
72 | | void |
73 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
74 | | |
75 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
76 | 0 | { |
77 | 0 | /* Get the interface prototype object for this class. This will create the |
78 | 0 | object as needed. */ |
79 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::Screen, |
80 | 0 | &CreateInterfaceObjects, |
81 | 0 | /* aDefineOnGlobal = */ true); |
82 | 0 |
|
83 | 0 | } |
84 | | |
85 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
86 | 0 | { |
87 | 0 | /* Get the interface object for this class. This will create the object as |
88 | 0 | needed. */ |
89 | 0 |
|
90 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::Screen, |
91 | 0 | &CreateInterfaceObjects, |
92 | 0 | aDefineOnGlobal); |
93 | 0 | } |
94 | | |
95 | | JSObject* |
96 | | GetConstructorObject(JSContext* aCx); |
97 | | |
98 | | } // namespace Screen_Binding |
99 | | |
100 | | |
101 | | |
102 | | namespace ScreenLuminance_Binding { |
103 | | |
104 | | typedef mozilla::dom::ScreenLuminance NativeType; |
105 | | |
106 | | bool |
107 | | ConstructorEnabled(JSContext* aCx, JS::Handle<JSObject*> aObj); |
108 | | |
109 | | const JSClass* |
110 | | GetJSClass(); |
111 | | |
112 | | bool |
113 | | Wrap(JSContext* aCx, mozilla::dom::ScreenLuminance* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
114 | | |
115 | | template <class T> |
116 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
117 | 0 | { |
118 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
119 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
120 | 0 | } |
121 | | |
122 | | // We declare this as an array so that retrieving a pointer to this |
123 | | // binding's property hooks only requires compile/link-time resolvable |
124 | | // address arithmetic. Declaring it as a pointer instead would require |
125 | | // doing a run-time load to fetch a pointer to this binding's property |
126 | | // hooks. And then structures which embedded a pointer to this structure |
127 | | // would require a run-time load for proper initialization, which would |
128 | | // then induce static constructors. Lots of static constructors. |
129 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
130 | | |
131 | | void |
132 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
133 | | |
134 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
135 | 0 | { |
136 | 0 | /* Get the interface prototype object for this class. This will create the |
137 | 0 | object as needed. */ |
138 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::ScreenLuminance, |
139 | 0 | &CreateInterfaceObjects, |
140 | 0 | /* aDefineOnGlobal = */ true); |
141 | 0 |
|
142 | 0 | } |
143 | | |
144 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
145 | 0 | { |
146 | 0 | /* Get the interface object for this class. This will create the object as |
147 | 0 | needed. */ |
148 | 0 |
|
149 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::ScreenLuminance, |
150 | 0 | &CreateInterfaceObjects, |
151 | 0 | aDefineOnGlobal); |
152 | 0 | } |
153 | | |
154 | | JSObject* |
155 | | GetConstructorObject(JSContext* aCx); |
156 | | |
157 | | } // namespace ScreenLuminance_Binding |
158 | | |
159 | | |
160 | | |
161 | | } // namespace dom |
162 | | } // namespace mozilla |
163 | | |
164 | | #endif // mozilla_dom_ScreenBinding_h |