Class

class Class(val jscClassPointer: <Error class: unknown class><<Error class: unknown class>>)

A JSSClass represents a custom JavaScript class registered by the user in a #JSCContext. It allows to create new JavaScripts objects whose instances are created by the user using this API. It's possible to add constructors, properties and methods for a JSSClass by providing #GCallbacks to implement them.

Skipped during bindings generation

  • parameter parameter_types: Array parameter of type GType is not supported

  • parameter parameter_types: Array parameter of type GType is not supported

  • parameter getter: GObject.Callback

  • method context: Property has no getter nor setter

Constructors

Link copied to clipboard
constructor(jscClassPointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val jscClassPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

The name of the class.

Link copied to clipboard

The parent class or null in case of final classes.

Functions

Link copied to clipboard
fun addConstructorVariadic(name: String? = null, callback: <Error class: unknown class>, returnType: <Error class: unknown class>): Value

Add a constructor to @jsc_class. If @name is null, the class name will be used. When new is used with the constructor or jsc_value_constructor_call() is called, @callback is invoked receiving a #GPtrArray of #JSCValues as arguments and @user_data as the last parameter. When the constructor object is cleared in the #JSCClass context, @destroy_notify is called with @user_data as parameter.

Link copied to clipboard
fun addMethodVariadic(name: String, callback: <Error class: unknown class>, returnType: <Error class: unknown class>)

Add method with @name to @jsc_class. When the method is called by JavaScript or jsc_value_object_invoke_method(),