| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.JavaScriptCore.Objects.Class
Description
Synopsis
- newtype Class = Class (ManagedPtr Class)
- class (GObject o, IsDescendantOf Class o) => IsClass o
- toClass :: (MonadIO m, IsClass o) => o -> m Class
- type family ResolveClassMethod (t :: Symbol) o where ...
- data ClassAddConstructorMethodInfo
- classAddConstructor :: (HasCallStack, MonadIO m, IsClass a) => a -> Maybe Text -> Callback -> GType -> Maybe [GType] -> m Value
- data ClassAddConstructorVariadicMethodInfo
- classAddConstructorVariadic :: (HasCallStack, MonadIO m, IsClass a) => a -> Maybe Text -> Callback -> GType -> m Value
- data ClassAddMethodMethodInfo
- classAddMethod :: (HasCallStack, MonadIO m, IsClass a) => a -> Text -> Callback -> GType -> Maybe [GType] -> m ()
- data ClassAddMethodVariadicMethodInfo
- classAddMethodVariadic :: (HasCallStack, MonadIO m, IsClass a) => a -> Text -> Callback -> GType -> m ()
- data ClassAddPropertyMethodInfo
- classAddProperty :: (HasCallStack, MonadIO m, IsClass a) => a -> Text -> GType -> Maybe Callback -> Maybe Callback -> m ()
- data ClassGetNameMethodInfo
- classGetName :: (HasCallStack, MonadIO m, IsClass a) => a -> m Text
- data ClassGetParentMethodInfo
- classGetParent :: (HasCallStack, MonadIO m, IsClass a) => a -> m Class
- data ClassContextPropertyInfo
- classContext :: AttrLabelProxy "context"
- constructClassContext :: (IsClass o, MonadIO m, IsContext a) => a -> m (GValueConstruct o)
- data ClassNamePropertyInfo
- className :: AttrLabelProxy "name"
- constructClassName :: (IsClass o, MonadIO m) => Text -> m (GValueConstruct o)
- getClassName :: (MonadIO m, IsClass o) => o -> m Text
- data ClassParentPropertyInfo
- classParent :: AttrLabelProxy "parent"
- constructClassParent :: (IsClass o, MonadIO m, IsClass a) => a -> m (GValueConstruct o)
- getClassParent :: (MonadIO m, IsClass o) => o -> m Class
Exported types
Memory-managed wrapper type.
Constructors
| Class (ManagedPtr Class) |
Instances
class (GObject o, IsDescendantOf Class o) => IsClass o Source #
Instances
| (GObject o, IsDescendantOf Class o) => IsClass o Source # | |
Defined in GI.JavaScriptCore.Objects.Class | |
Methods
Click to display all available methods, including inherited ones
Methods
addConstructor, addConstructorVariadic, addMethod, addMethodVariadic, addProperty, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getData, getName, getParent, getProperty, getQdata.
Setters
type family ResolveClassMethod (t :: Symbol) o where ... Source #
Equations
addConstructor
data ClassAddConstructorMethodInfo Source #
Instances
| (signature ~ (Maybe Text -> Callback -> GType -> Maybe [GType] -> m Value), MonadIO m, IsClass a) => OverloadedMethod ClassAddConstructorMethodInfo a signature Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods overloadedMethod :: a -> signature # | |
| OverloadedMethodInfo ClassAddConstructorMethodInfo (a :: Type) Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods | |
Arguments
| :: (HasCallStack, MonadIO m, IsClass a) | |
| => a |
|
| -> Maybe Text |
|
| -> Callback |
|
| -> GType |
|
| -> Maybe [GType] |
|
| -> m Value | Returns: a |
Add a constructor to jscClass. If name is Nothing, the class name will be used. When <function>new</function>
is used with the constructor or jsc_value_constructor_call() is called, callback is invoked receiving the
parameters and userData as the last parameter. When the constructor object is cleared in the Class context,
destroyNotify is called with userData as parameter.
This function creates the constructor, which needs to be added to an object as a property to be able to use it. Use
contextSetValue to make the constructor available in the global object.
Note that the value returned by callback is adopted by jscClass, and the DestroyNotify passed to
contextRegisterClass is responsible for disposing of it.
addConstructorVariadic
data ClassAddConstructorVariadicMethodInfo Source #
Instances
| (signature ~ (Maybe Text -> Callback -> GType -> m Value), MonadIO m, IsClass a) => OverloadedMethod ClassAddConstructorVariadicMethodInfo a signature Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods overloadedMethod :: a -> signature # | |
| OverloadedMethodInfo ClassAddConstructorVariadicMethodInfo (a :: Type) Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods | |
classAddConstructorVariadic Source #
Arguments
| :: (HasCallStack, MonadIO m, IsClass a) | |
| => a |
|
| -> Maybe Text |
|
| -> Callback |
|
| -> GType |
|
| -> m Value | Returns: a |
Add a constructor to jscClass. If name is Nothing, the class name will be used. When <function>new</function>
is used with the constructor or jsc_value_constructor_call() is called, callback is invoked receiving
a PtrArray of Values as arguments and userData as the last parameter. When the constructor object
is cleared in the Class context, destroyNotify is called with userData as parameter.
This function creates the constructor, which needs to be added to an object as a property to be able to use it. Use
contextSetValue to make the constructor available in the global object.
Note that the value returned by callback is adopted by jscClass, and the DestroyNotify passed to
contextRegisterClass is responsible for disposing of it.
addMethod
data ClassAddMethodMethodInfo Source #
Instances
| (signature ~ (Text -> Callback -> GType -> Maybe [GType] -> m ()), MonadIO m, IsClass a) => OverloadedMethod ClassAddMethodMethodInfo a signature Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods overloadedMethod :: a -> signature # | |
| OverloadedMethodInfo ClassAddMethodMethodInfo (a :: Type) Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods | |
Arguments
| :: (HasCallStack, MonadIO m, IsClass a) | |
| => a |
|
| -> Text |
|
| -> Callback |
|
| -> GType |
|
| -> Maybe [GType] |
|
| -> m () |
Add method with name to jscClass. When the method is called by JavaScript or jsc_value_object_invoke_method(),
callback is called receiving the class instance as first parameter, followed by the method parameters and then
userData as last parameter. When the method is cleared in the Class context, destroyNotify is called with
userData as parameter.
Note that the value returned by callback must be transfer full. In case of non-refcounted boxed types, you should use
G_TYPE_POINTER instead of the actual boxed GType to ensure that the instance owned by Class is used.
If you really want to return a new copy of the boxed type, use JSC_TYPE_VALUE and return a Value created
with valueNewObject that receives the copy as the instance parameter.
addMethodVariadic
data ClassAddMethodVariadicMethodInfo Source #
Instances
| (signature ~ (Text -> Callback -> GType -> m ()), MonadIO m, IsClass a) => OverloadedMethod ClassAddMethodVariadicMethodInfo a signature Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods overloadedMethod :: a -> signature # | |
| OverloadedMethodInfo ClassAddMethodVariadicMethodInfo (a :: Type) Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods | |
classAddMethodVariadic Source #
Arguments
| :: (HasCallStack, MonadIO m, IsClass a) | |
| => a |
|
| -> Text |
|
| -> Callback |
|
| -> GType |
|
| -> m () |
Add method with name to jscClass. When the method is called by JavaScript or jsc_value_object_invoke_method(),
callback is called receiving the class instance as first parameter, followed by a PtrArray of Values
with the method arguments and then userData as last parameter. When the method is cleared in the Class context,
destroyNotify is called with userData as parameter.
Note that the value returned by callback must be transfer full. In case of non-refcounted boxed types, you should use
G_TYPE_POINTER instead of the actual boxed GType to ensure that the instance owned by Class is used.
If you really want to return a new copy of the boxed type, use JSC_TYPE_VALUE and return a Value created
with valueNewObject that receives the copy as the instance parameter.
addProperty
data ClassAddPropertyMethodInfo Source #
Instances
| (signature ~ (Text -> GType -> Maybe Callback -> Maybe Callback -> m ()), MonadIO m, IsClass a) => OverloadedMethod ClassAddPropertyMethodInfo a signature Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods overloadedMethod :: a -> signature # | |
| OverloadedMethodInfo ClassAddPropertyMethodInfo (a :: Type) Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods | |
Arguments
| :: (HasCallStack, MonadIO m, IsClass a) | |
| => a |
|
| -> Text |
|
| -> GType |
|
| -> Maybe Callback |
|
| -> Maybe Callback |
|
| -> m () |
Add a property with name to jscClass. When the property value needs to be getted, getter is called
receiving the the class instance as first parameter and userData as last parameter. When the property
value needs to be set, setter is called receiving the the class instance as first parameter, followed
by the value to be set and then userData as the last parameter. When the property is cleared in the
Class context, destroyNotify is called with userData as parameter.
Note that the value returned by getter must be transfer full. In case of non-refcounted boxed types, you should use
G_TYPE_POINTER instead of the actual boxed GType to ensure that the instance owned by Class is used.
If you really want to return a new copy of the boxed type, use JSC_TYPE_VALUE and return a Value created
with valueNewObject that receives the copy as the instance parameter.
getName
data ClassGetNameMethodInfo Source #
Instances
| (signature ~ m Text, MonadIO m, IsClass a) => OverloadedMethod ClassGetNameMethodInfo a signature Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods overloadedMethod :: a -> signature # | |
| OverloadedMethodInfo ClassGetNameMethodInfo (a :: Type) Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods | |
Arguments
| :: (HasCallStack, MonadIO m, IsClass a) | |
| => a |
|
| -> m Text | Returns: the name of |
Get the class name of jscClass
getParent
data ClassGetParentMethodInfo Source #
Instances
| (signature ~ m Class, MonadIO m, IsClass a) => OverloadedMethod ClassGetParentMethodInfo a signature Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods overloadedMethod :: a -> signature # | |
| OverloadedMethodInfo ClassGetParentMethodInfo (a :: Type) Source # | |
Defined in GI.JavaScriptCore.Objects.Class Methods | |
Arguments
| :: (HasCallStack, MonadIO m, IsClass a) | |
| => a |
|
| -> m Class | Returns: the parent class of |
Get the parent class of jscClass
Properties
context
The Context in which the class was registered.
data ClassContextPropertyInfo Source #
Instances
classContext :: AttrLabelProxy "context" Source #
constructClassContext :: (IsClass o, MonadIO m, IsContext a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “context” property. This is rarely needed directly, but it is used by new.
name
The name of the class.
data ClassNamePropertyInfo Source #
Instances
| AttrInfo ClassNamePropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class Associated Types
Methods attrGet :: AttrBaseTypeConstraint ClassNamePropertyInfo o => o -> IO (AttrGetType ClassNamePropertyInfo) # attrSet :: (AttrBaseTypeConstraint ClassNamePropertyInfo o, AttrSetTypeConstraint ClassNamePropertyInfo b) => o -> b -> IO () # attrClear :: AttrBaseTypeConstraint ClassNamePropertyInfo o => o -> IO () # attrConstruct :: (AttrBaseTypeConstraint ClassNamePropertyInfo o, AttrSetTypeConstraint ClassNamePropertyInfo b) => b -> IO (GValueConstruct o) # attrTransfer :: (AttrBaseTypeConstraint ClassNamePropertyInfo o, AttrTransferTypeConstraint ClassNamePropertyInfo b) => Proxy o -> b -> IO (AttrTransferType ClassNamePropertyInfo) # attrPut :: AttrBaseTypeConstraint ClassNamePropertyInfo o => o -> AttrGetType ClassNamePropertyInfo -> IO () # | |||||||||||||||||||||||||||||||||
| type AttrAllowedOps ClassNamePropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrBaseTypeConstraint ClassNamePropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrGetType ClassNamePropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrLabel ClassNamePropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrOrigin ClassNamePropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrSetTypeConstraint ClassNamePropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrTransferType ClassNamePropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrTransferTypeConstraint ClassNamePropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
className :: AttrLabelProxy "name" Source #
constructClassName :: (IsClass o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “name” property. This is rarely needed directly, but it is used by new.
getClassName :: (MonadIO m, IsClass o) => o -> m Text Source #
Get the value of the “name” property.
When overloading is enabled, this is equivalent to
get class #name
parent
The parent class or Nothing in case of final classes.
data ClassParentPropertyInfo Source #
Instances
| AttrInfo ClassParentPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class Associated Types
Methods attrGet :: AttrBaseTypeConstraint ClassParentPropertyInfo o => o -> IO (AttrGetType ClassParentPropertyInfo) # attrSet :: (AttrBaseTypeConstraint ClassParentPropertyInfo o, AttrSetTypeConstraint ClassParentPropertyInfo b) => o -> b -> IO () # attrClear :: AttrBaseTypeConstraint ClassParentPropertyInfo o => o -> IO () # attrConstruct :: (AttrBaseTypeConstraint ClassParentPropertyInfo o, AttrSetTypeConstraint ClassParentPropertyInfo b) => b -> IO (GValueConstruct o) # attrTransfer :: (AttrBaseTypeConstraint ClassParentPropertyInfo o, AttrTransferTypeConstraint ClassParentPropertyInfo b) => Proxy o -> b -> IO (AttrTransferType ClassParentPropertyInfo) # attrPut :: AttrBaseTypeConstraint ClassParentPropertyInfo o => o -> AttrGetType ClassParentPropertyInfo -> IO () # | |||||||||||||||||||||||||||||||||
| type AttrAllowedOps ClassParentPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrBaseTypeConstraint ClassParentPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrGetType ClassParentPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrLabel ClassParentPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrOrigin ClassParentPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrSetTypeConstraint ClassParentPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrTransferType ClassParentPropertyInfo Source # | |||||||||||||||||||||||||||||||||
Defined in GI.JavaScriptCore.Objects.Class | |||||||||||||||||||||||||||||||||
| type AttrTransferTypeConstraint ClassParentPropertyInfo Source # | |||||||||||||||||||||||||||||||||
classParent :: AttrLabelProxy "parent" Source #
constructClassParent :: (IsClass o, MonadIO m, IsClass a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “parent” property. This is rarely needed directly, but it is used by new.
getClassParent :: (MonadIO m, IsClass o) => o -> m Class Source #
Get the value of the “parent” property.
When overloading is enabled, this is equivalent to
get class #parent