MCPcopy Create free account
hub / github.com/GNOME/gjs / gjs_define_param_class

Function gjs_define_param_class

gi/param.cpp:196–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

194}
195
196bool gjs_define_param_class(JSContext* cx, JS::HandleObject in_object) {
197 JS::RootedObject prototype{cx}, constructor{cx};
198 if (!gjs_init_class_dynamic(
199 cx, in_object, nullptr, "GObject", "ParamSpec", &gjs_param_class,
200 gjs_param_constructor, 0,
201 proto_props, // props of prototype
202 nullptr, // funcs of prototype
203 nullptr, // props of constructor, MyConstructor.myprop
204 nullptr, // funcs of constructor
205 &prototype, &constructor))
206 return false;
207
208 if (!gjs_wrapper_define_gtype_prop(cx, constructor, G_TYPE_PARAM))
209 return false;
210
211 GI::Repository repo;
212 GI::AutoObjectInfo info{
213 repo.find_by_gtype<GI::InfoTag::OBJECT>(G_TYPE_PARAM).value()};
214 if (!gjs_define_static_methods(cx, constructor, G_TYPE_PARAM, info))
215 return false;
216
217 gjs_debug(GJS_DEBUG_GPARAM,
218 "Defined class ParamSpec prototype is %p class %p in object %p",
219 prototype.get(), &gjs_param_class, in_object.get());
220 return true;
221}
222
223JSObject* gjs_param_from_g_param(JSContext* cx, GParamSpec* gparam) {
224 if (!gparam)

Callers 1

gjs_define_infoFunction · 0.85

Calls 6

gjs_init_class_dynamicFunction · 0.85
gjs_debugFunction · 0.85
valueMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected