gi-javascriptcore-4.0.27: JavaScriptCore bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.JavaScriptCore.Callbacks

Description

 
Synopsis

Signals

ClassDeletePropertyFunction

type C_ClassDeletePropertyFunction = Ptr Class -> Ptr Context -> Ptr () -> CString -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type ClassDeletePropertyFunction Source #

Arguments

 = Class

jscClass: a Class

-> Context

context: a Context

-> Ptr ()

instance: the jscClass instance

-> Text

name: the property name

-> IO Bool

Returns: True if handled or False to to forward the request to the parent class or prototype chain.

The type of delete_property in ClassVTable. This is only required when you need to handle external properties not added to the prototype.

dynamic_ClassDeletePropertyFunction Source #

Arguments

:: (HasCallStack, MonadIO m, IsClass a, IsContext b) 
=> FunPtr C_ClassDeletePropertyFunction 
-> a

jscClass: a Class

-> b

context: a Context

-> Ptr ()

instance: the jscClass instance

-> Text

name: the property name

-> m Bool

Returns: True if handled or False to to forward the request to the parent class or prototype chain.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

ClassEnumeratePropertiesFunction

type C_ClassEnumeratePropertiesFunction = Ptr Class -> Ptr Context -> Ptr () -> IO (Ptr CString) Source #

Type for the callback on the (unwrapped) C side.

type ClassEnumeratePropertiesFunction Source #

Arguments

 = Class

jscClass: a Class

-> Context

context: a Context

-> Ptr ()

instance: the jscClass instance

-> IO (Maybe [Text])

Returns: a Nothing-terminated array of strings containing the property names, or Nothing if instance doesn't have enumerable properties.

The type of enumerate_properties in ClassVTable. This is only required when you need to handle external properties not added to the prototype.

dynamic_ClassEnumeratePropertiesFunction Source #

Arguments

:: (HasCallStack, MonadIO m, IsClass a, IsContext b) 
=> FunPtr C_ClassEnumeratePropertiesFunction 
-> a

jscClass: a Class

-> b

context: a Context

-> Ptr ()

instance: the jscClass instance

-> m (Maybe [Text])

Returns: a Nothing-terminated array of strings containing the property names, or Nothing if instance doesn't have enumerable properties.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

ClassGetPropertyFunction

type C_ClassGetPropertyFunction = Ptr Class -> Ptr Context -> Ptr () -> CString -> IO (Ptr Value) Source #

Type for the callback on the (unwrapped) C side.

type ClassGetPropertyFunction Source #

Arguments

 = Class

jscClass: a Class

-> Context

context: a Context

-> Ptr ()

instance: the jscClass instance

-> Text

name: the property name

-> IO (Maybe Value)

Returns: a Value or Nothing to forward the request to the parent class or prototype chain

The type of get_property in ClassVTable. This is only required when you need to handle external properties not added to the prototype.

dynamic_ClassGetPropertyFunction Source #

Arguments

:: (HasCallStack, MonadIO m, IsClass a, IsContext b) 
=> FunPtr C_ClassGetPropertyFunction 
-> a

jscClass: a Class

-> b

context: a Context

-> Ptr ()

instance: the jscClass instance

-> Text

name: the property name

-> m (Maybe Value)

Returns: a Value or Nothing to forward the request to the parent class or prototype chain

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

ClassHasPropertyFunction

type C_ClassHasPropertyFunction = Ptr Class -> Ptr Context -> Ptr () -> CString -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type ClassHasPropertyFunction Source #

Arguments

 = Class

jscClass: a Class

-> Context

context: a Context

-> Ptr ()

instance: the jscClass instance

-> Text

name: the property name

-> IO Bool

Returns: True if instance has a property with name or False to forward the request to the parent class or prototype chain.

The type of has_property in ClassVTable. This is only required when you need to handle external properties not added to the prototype.

dynamic_ClassHasPropertyFunction Source #

Arguments

:: (HasCallStack, MonadIO m, IsClass a, IsContext b) 
=> FunPtr C_ClassHasPropertyFunction 
-> a

jscClass: a Class

-> b

context: a Context

-> Ptr ()

instance: the jscClass instance

-> Text

name: the property name

-> m Bool

Returns: True if instance has a property with name or False to forward the request to the parent class or prototype chain.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

ClassSetPropertyFunction

type C_ClassSetPropertyFunction = Ptr Class -> Ptr Context -> Ptr () -> CString -> Ptr Value -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type ClassSetPropertyFunction Source #

Arguments

 = Class

jscClass: a Class

-> Context

context: a Context

-> Ptr ()

instance: the jscClass instance

-> Text

name: the property name

-> Value

value: the Value to set

-> IO Bool

Returns: True if handled or False to forward the request to the parent class or prototype chain.

The type of set_property in ClassVTable. This is only required when you need to handle external properties not added to the prototype.

dynamic_ClassSetPropertyFunction Source #

Arguments

:: (HasCallStack, MonadIO m, IsClass a, IsContext b, IsValue c) 
=> FunPtr C_ClassSetPropertyFunction 
-> a

jscClass: a Class

-> b

context: a Context

-> Ptr ()

instance: the jscClass instance

-> Text

name: the property name

-> c

value: the Value to set

-> m Bool

Returns: True if handled or False to forward the request to the parent class or prototype chain.

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

ExceptionHandler

type C_ExceptionHandler = Ptr Context -> Ptr Exception -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type ExceptionHandler Source #

Arguments

 = Context

context: a Context

-> Exception

exception: a Exception

-> IO () 

Function used to handle JavaScript exceptions in a Context.

type ExceptionHandler_WithClosures Source #

Arguments

 = Context

context: a Context

-> Exception

exception: a Exception

-> Ptr ()

userData: user data

-> IO () 

Function used to handle JavaScript exceptions in a Context.

drop_closures_ExceptionHandler :: ExceptionHandler -> ExceptionHandler_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_ExceptionHandler Source #

Arguments

:: (HasCallStack, MonadIO m, IsContext a, IsException b) 
=> FunPtr C_ExceptionHandler 
-> a

context: a Context

-> b

exception: a Exception

-> Ptr ()

userData: user data

-> m () 

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_ExceptionHandler :: MonadIO m => ExceptionHandler -> m (GClosure C_ExceptionHandler) Source #

Wrap the callback into a GClosure.

mk_ExceptionHandler :: C_ExceptionHandler -> IO (FunPtr C_ExceptionHandler) Source #

Generate a function pointer callable from C code, from a C_ExceptionHandler.

OptionsFunc

type C_OptionsFunc = CString -> CUInt -> CString -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type OptionsFunc Source #

Arguments

 = Text

option: the option name

-> OptionType

type: the option OptionType

-> Maybe Text

description: the option description, or Nothing

-> IO Bool

Returns: True to stop the iteration, or False otherwise

Function used to iterate options.

Not that description string is not localized.

Since: 2.24

type OptionsFunc_WithClosures Source #

Arguments

 = Text

option: the option name

-> OptionType

type: the option OptionType

-> Maybe Text

description: the option description, or Nothing

-> Ptr ()

userData: user data

-> IO Bool

Returns: True to stop the iteration, or False otherwise

Function used to iterate options.

Not that description string is not localized.

Since: 2.24

drop_closures_OptionsFunc :: OptionsFunc -> OptionsFunc_WithClosures Source #

A simple wrapper that ignores the closure arguments.

dynamic_OptionsFunc Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FunPtr C_OptionsFunc 
-> Text

option: the option name

-> OptionType

type: the option OptionType

-> Maybe Text

description: the option description, or Nothing

-> Ptr ()

userData: user data

-> m Bool

Returns: True to stop the iteration, or False otherwise

Given a pointer to a foreign C function, wrap it into a function callable from Haskell.

genClosure_OptionsFunc :: MonadIO m => OptionsFunc -> m (GClosure C_OptionsFunc) Source #

Wrap the callback into a GClosure.

mk_OptionsFunc :: C_OptionsFunc -> IO (FunPtr C_OptionsFunc) Source #

Generate a function pointer callable from C code, from a C_OptionsFunc.