javascriptcore/auto/class.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files.git)
3// from webkit2gtk-gir-files
4// DO NOT EDIT
5
6use glib::translate::*;
7use std::fmt;
8
9glib::wrapper! {
10 #[doc(alias = "JSCClass")]
11 pub struct Class(Object<ffi::JSCClass, ffi::JSCClassClass>);
12
13 match fn {
14 type_ => || ffi::jsc_class_get_type(),
15 }
16}
17
18impl Class {
19 //#[doc(alias = "jsc_class_add_constructor")]
20 //pub fn add_constructor<P: Fn() + 'static>(&self, name: Option<&str>, callback: P, user_data: /*Unimplemented*/Option<Basic: Pointer>, return_type: glib::types::Type, n_params: u32, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) -> Option<Value> {
21 // unsafe { TODO: call ffi:jsc_class_add_constructor() }
22 //}
23
24 //#[doc(alias = "jsc_class_add_constructor_variadic")]
25 //pub fn add_constructor_variadic(&self, name: Option<&str>, callback: /*Unimplemented*/Fn(/*Ignored*/glib::PtrArray) -> /*Unimplemented*/Basic: Pointer, user_data: /*Unimplemented*/Option<Basic: Pointer>, return_type: glib::types::Type) -> Option<Value> {
26 // unsafe { TODO: call ffi:jsc_class_add_constructor_variadic() }
27 //}
28
29 //#[doc(alias = "jsc_class_add_constructorv")]
30 //pub fn add_constructorv<P: Fn() + 'static>(&self, name: Option<&str>, callback: P, user_data: /*Unimplemented*/Option<Basic: Pointer>, return_type: glib::types::Type, n_parameters: u32) -> Option<Value> {
31 // unsafe { TODO: call ffi:jsc_class_add_constructorv() }
32 //}
33
34 //#[doc(alias = "jsc_class_add_method")]
35 //pub fn add_method<P: Fn() + 'static>(&self, name: &str, callback: P, user_data: /*Unimplemented*/Option<Basic: Pointer>, return_type: glib::types::Type, n_params: u32, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) {
36 // unsafe { TODO: call ffi:jsc_class_add_method() }
37 //}
38
39 //#[doc(alias = "jsc_class_add_method_variadic")]
40 //pub fn add_method_variadic(&self, name: &str, callback: /*Unimplemented*/Fn(/*Unimplemented*/Basic: Pointer, /*Ignored*/glib::PtrArray) -> Value, user_data: /*Unimplemented*/Option<Basic: Pointer>, return_type: glib::types::Type) {
41 // unsafe { TODO: call ffi:jsc_class_add_method_variadic() }
42 //}
43
44 //#[doc(alias = "jsc_class_add_methodv")]
45 //pub fn add_methodv<P: Fn() + 'static>(&self, name: &str, callback: P, user_data: /*Unimplemented*/Option<Basic: Pointer>, return_type: glib::types::Type, n_parameters: u32) {
46 // unsafe { TODO: call ffi:jsc_class_add_methodv() }
47 //}
48
49 //#[doc(alias = "jsc_class_add_property")]
50 //pub fn add_property(&self, name: &str, property_type: glib::types::Type, getter: /*Unimplemented*/Fn(/*Unimplemented*/Basic: Pointer) -> Value, setter: /*Unimplemented*/Fn(/*Unimplemented*/Basic: Pointer, &Value), user_data: /*Unimplemented*/Option<Basic: Pointer>) {
51 // unsafe { TODO: call ffi:jsc_class_add_property() }
52 //}
53
54 #[doc(alias = "jsc_class_get_name")]
55 #[doc(alias = "get_name")]
56 pub fn name(&self) -> Option<glib::GString> {
57 unsafe { from_glib_none(ffi::jsc_class_get_name(self.to_glib_none().0)) }
58 }
59
60 #[doc(alias = "jsc_class_get_parent")]
61 #[doc(alias = "get_parent")]
62 #[must_use]
63 pub fn parent(&self) -> Option<Class> {
64 unsafe { from_glib_none(ffi::jsc_class_get_parent(self.to_glib_none().0)) }
65 }
66}
67
68impl fmt::Display for Class {
69 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
70 f.write_str("Class")
71 }
72}