Context.registerClass

Register a custom class in @context using the given @name. If the new class inherits from another #JSCClass, the parent should be passed as @parent_class, otherwise %NULL should be used. The optional @vtable parameter allows to provide a custom implementation for handling the class, for example, to handle external properties not added to the prototype. When an instance of the #JSCClass is cleared in the context, @destroy_notify is called with the instance as parameter.

class Context
registerClass

Parameters

name string

the class name

parentClass Class

a #JSCClass or %NULL

vtable JSCClassVTable*

an optional #JSCClassVTable or %NULL

destroyNotify GDestroyNotify

a destroy notifier for class instances

Return Value

Type: Class

a #JSCClass

Meta