| 194 | } |
| 195 | |
| 196 | bool 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 | |
| 223 | JSObject* gjs_param_from_g_param(JSContext* cx, GParamSpec* gparam) { |
| 224 | if (!gparam) |
no test coverage detected