-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | JavaScriptCore bindings -- -- Bindings for JavaScriptCore, autogenerated by haskell-gi. @package gi-javascriptcore @version 6.0.4 -- | Build time configuration used during code generation. module GI.JavaScriptCore.Config -- | Overrides used when generating these bindings. overrides :: Text module GI.JavaScriptCore.Constants -- | Allows the LLINT to be used if True. Option type: -- OptionTypeBoolean Default value: True. -- -- Since: 2.24 pattern OPTIONS_USE_LLINT :: Text -- | Allows the executable pages to be allocated for JIT and thunks if -- True. Option type: OptionTypeBoolean Default value: -- True. -- -- Since: 2.24 pattern OPTIONS_USE_JIT :: Text -- | Allows the FTL JIT to be used if True. Option type: -- OptionTypeBoolean Default value: True. -- -- Since: 2.24 pattern OPTIONS_USE_FTL :: Text -- | Allows the DFG JIT to be used if True. Option type: -- OptionTypeBoolean Default value: True. -- -- Since: 2.24 pattern OPTIONS_USE_DFG :: Text -- | Like getMinorVersion, but from the headers used at application -- compile time, rather than from the library linked against at -- application run time. pattern MINOR_VERSION :: Int32 -- | Like getMicroVersion, but from the headers used at application -- compile time, rather than from the library linked against at -- application run time. pattern MICRO_VERSION :: Int32 -- | Like getMajorVersion, but from the headers used at application -- compile time, rather than from the library linked against at -- application run time. pattern MAJOR_VERSION :: Int32 module GI.JavaScriptCore.Enums -- | Enum values to specify a mode to check for syntax errors in -- contextCheckSyntax. data CheckSyntaxMode -- | mode to check syntax of a script CheckSyntaxModeScript :: CheckSyntaxMode -- | mode to check syntax of a module CheckSyntaxModeModule :: CheckSyntaxMode -- | Catch-all for unknown values AnotherCheckSyntaxMode :: Int -> CheckSyntaxMode -- | Enum values to specify the result of contextCheckSyntax. data CheckSyntaxResult -- | no errors CheckSyntaxResultSuccess :: CheckSyntaxResult -- | recoverable syntax error CheckSyntaxResultRecoverableError :: CheckSyntaxResult -- | irrecoverable syntax error CheckSyntaxResultIrrecoverableError :: CheckSyntaxResult -- | unterminated literal error CheckSyntaxResultUnterminatedLiteralError :: CheckSyntaxResult -- | out of memory error CheckSyntaxResultOutOfMemoryError :: CheckSyntaxResult -- | stack overflow error CheckSyntaxResultStackOverflowError :: CheckSyntaxResult -- | Catch-all for unknown values AnotherCheckSyntaxResult :: Int -> CheckSyntaxResult -- | Enum values for options types. -- -- Since: 2.24 data OptionType -- | A Bool option type. OptionTypeBoolean :: OptionType -- | A gint option type. OptionTypeInt :: OptionType -- | A guint option type. OptionTypeUint :: OptionType -- | A gsize options type. OptionTypeSize :: OptionType -- | A gdouble options type. OptionTypeDouble :: OptionType -- | A string option type. OptionTypeString :: OptionType -- | A range string option type. OptionTypeRangeString :: OptionType -- | Catch-all for unknown values AnotherOptionType :: Int -> OptionType -- | Possible types of the elements contained in a typed array. -- -- Since: 2.38 data TypedArrayType -- | Not a typed array, or type unsupported. TypedArrayTypeNone :: TypedArrayType -- | Array elements are 8-bit signed integers (int8_t). TypedArrayTypeInt8 :: TypedArrayType -- | Array elements are 16-bit signed integers (int16_t). TypedArrayTypeInt16 :: TypedArrayType -- | Array elements are 32-bit signed integers (int32_t). TypedArrayTypeInt32 :: TypedArrayType -- | Array elements are 64-bit signed integers (int64_t). TypedArrayTypeInt64 :: TypedArrayType -- | Array elements are 8-bit unsigned integers (uint8_t). TypedArrayTypeUint8 :: TypedArrayType -- | Array elements are 8-bit unsigned integers (uint8_t). TypedArrayTypeUint8Clamped :: TypedArrayType -- | Array elements are 16-bit unsigned integers (uint16_t). TypedArrayTypeUint16 :: TypedArrayType -- | Array elements are 32-bit unsigned integers (uint32_t). TypedArrayTypeUint32 :: TypedArrayType -- | Array elements are 64-bit unsigned integers (uint64_t). TypedArrayTypeUint64 :: TypedArrayType -- | Array elements are 32-bit floating point numbers (float). TypedArrayTypeFloat32 :: TypedArrayType -- | Array elements are 64-bit floating point numbers (double). TypedArrayTypeFloat64 :: TypedArrayType -- | Catch-all for unknown values AnotherTypedArrayType :: Int -> TypedArrayType instance GHC.Classes.Eq GI.JavaScriptCore.Enums.TypedArrayType instance GHC.Show.Show GI.JavaScriptCore.Enums.TypedArrayType instance GHC.Classes.Eq GI.JavaScriptCore.Enums.OptionType instance GHC.Show.Show GI.JavaScriptCore.Enums.OptionType instance GHC.Classes.Eq GI.JavaScriptCore.Enums.CheckSyntaxResult instance GHC.Show.Show GI.JavaScriptCore.Enums.CheckSyntaxResult instance GHC.Classes.Eq GI.JavaScriptCore.Enums.CheckSyntaxMode instance GHC.Show.Show GI.JavaScriptCore.Enums.CheckSyntaxMode instance GHC.Enum.Enum GI.JavaScriptCore.Enums.CheckSyntaxMode instance GHC.Classes.Ord GI.JavaScriptCore.Enums.CheckSyntaxMode instance GHC.Enum.Enum GI.JavaScriptCore.Enums.CheckSyntaxResult instance GHC.Classes.Ord GI.JavaScriptCore.Enums.CheckSyntaxResult instance GHC.Enum.Enum GI.JavaScriptCore.Enums.OptionType instance GHC.Classes.Ord GI.JavaScriptCore.Enums.OptionType instance GHC.Enum.Enum GI.JavaScriptCore.Enums.TypedArrayType instance GHC.Classes.Ord GI.JavaScriptCore.Enums.TypedArrayType module GI.JavaScriptCore.Flags -- | Flags used when defining properties with -- valueObjectDefinePropertyData and -- valueObjectDefinePropertyAccessor. data ValuePropertyFlags -- | the type of the property descriptor may be changed and the property -- may be deleted from the corresponding object. ValuePropertyFlagsConfigurable :: ValuePropertyFlags -- | the property shows up during enumeration of the properties on the -- corresponding object. ValuePropertyFlagsEnumerable :: ValuePropertyFlags -- | the value associated with the property may be changed with an -- assignment operator. This doesn't have any effect when passed to -- valueObjectDefinePropertyAccessor. ValuePropertyFlagsWritable :: ValuePropertyFlags -- | Catch-all for unknown values AnotherValuePropertyFlags :: Int -> ValuePropertyFlags instance GHC.Classes.Eq GI.JavaScriptCore.Flags.ValuePropertyFlags instance GHC.Show.Show GI.JavaScriptCore.Flags.ValuePropertyFlags instance GHC.Enum.Enum GI.JavaScriptCore.Flags.ValuePropertyFlags instance GHC.Classes.Ord GI.JavaScriptCore.Flags.ValuePropertyFlags instance Data.GI.Base.BasicTypes.IsGFlag GI.JavaScriptCore.Flags.ValuePropertyFlags -- | JSCException represents a JavaScript exception. module GI.JavaScriptCore.Objects.Exception -- | Memory-managed wrapper type. newtype Exception Exception :: ManagedPtr Exception -> Exception -- | Type class for types which can be safely cast to Exception, for -- instance with toException. class (GObject o, IsDescendantOf Exception o) => IsException o -- | Cast to Exception, for types for which this is known to be -- safe. For general casts, use castTo. toException :: (MonadIO m, IsException o) => o -> m Exception -- | Get a string with the exception backtrace. exceptionGetBacktraceString :: (HasCallStack, MonadIO m, IsException a) => a -> m (Maybe Text) -- | Get the column number at which exception happened. exceptionGetColumnNumber :: (HasCallStack, MonadIO m, IsException a) => a -> m Word32 -- | Get the line number at which exception happened. exceptionGetLineNumber :: (HasCallStack, MonadIO m, IsException a) => a -> m Word32 -- | Get the error message of exception. exceptionGetMessage :: (HasCallStack, MonadIO m, IsException a) => a -> m Text -- | Get the error name of exception exceptionGetName :: (HasCallStack, MonadIO m, IsException a) => a -> m Text -- | Get the source URI of exception. exceptionGetSourceUri :: (HasCallStack, MonadIO m, IsException a) => a -> m (Maybe Text) -- | Create a new Exception in context with -- message. exceptionNew :: (HasCallStack, MonadIO m, IsContext a) => a -> Text -> m Exception -- | Create a new Exception in context with -- name and message. exceptionNewWithName :: (HasCallStack, MonadIO m, IsContext a) => a -> Text -> Text -> m Exception -- | Return a report message of exception, containing all -- the possible details such us source URI, line, column and backtrace, -- and formatted to be printed. exceptionReport :: (HasCallStack, MonadIO m, IsException a) => a -> m Text -- | Get the string representation of exception error. exceptionToString :: (HasCallStack, MonadIO m, IsException a) => a -> m Text instance GHC.Classes.Eq GI.JavaScriptCore.Objects.Exception.Exception instance (Data.GI.Base.BasicTypes.GObject o, Data.GI.Base.Overloading.IsDescendantOf GI.JavaScriptCore.Objects.Exception.Exception o) => GI.JavaScriptCore.Objects.Exception.IsException o instance Data.GI.Base.BasicTypes.ManagedPtrNewtype GI.JavaScriptCore.Objects.Exception.Exception instance Data.GI.Base.BasicTypes.TypedObject GI.JavaScriptCore.Objects.Exception.Exception instance Data.GI.Base.BasicTypes.GObject GI.JavaScriptCore.Objects.Exception.Exception instance Data.GI.Base.Overloading.HasParentTypes GI.JavaScriptCore.Objects.Exception.Exception instance Data.GI.Base.GValue.IsGValue (GHC.Maybe.Maybe GI.JavaScriptCore.Objects.Exception.Exception) -- | JSCValue represents a reference to a value in a Context. The -- JSCValue protects the referenced value from being garbage collected. module GI.JavaScriptCore.Objects.Value -- | Memory-managed wrapper type. newtype Value Value :: ManagedPtr Value -> Value -- | Type class for types which can be safely cast to Value, for -- instance with toValue. class (GObject o, IsDescendantOf Value o) => IsValue o -- | Cast to Value, for types for which this is known to be safe. -- For general casts, use castTo. toValue :: (MonadIO m, IsValue o) => o -> m Value -- | Gets a pointer to memory that contains the array buffer data. -- -- Obtains a pointer to the memory region that holds the contents of the -- ArrayBuffer; modifications done to the data will be -- visible to JavaScript code. If size is not -- Nothing, the size in bytes of the memory region will also be -- stored in the pointed location. -- -- Note that the pointer returned by this function is not guaranteed to -- remain the same after calls to other JSC API functions. If you plan to -- access the data of the ArrayBuffer later, you can keep -- a reference to the value and obtain the data pointer -- at a later point. Keep in mind that if JavaScript code has a chance to -- run, for example due to main loop events that result in JSC being -- called, the contents of the memory region might be modified in the -- meantime. Consider taking a copy of the data and using the copy -- instead in asynchronous code. -- -- Since: 2.38 valueArrayBufferGetData :: (HasCallStack, MonadIO m, IsValue a) => a -> CSize -> m (Ptr ()) -- | Gets the size in bytes of the array buffer. -- -- Obtains the size in bytes of the memory region that holds the contents -- of an ArrayBuffer. -- -- Since: 2.38 valueArrayBufferGetSize :: (HasCallStack, MonadIO m, IsValue a) => a -> m CSize -- | Invoke <function>new</function> with constructor -- referenced by value. If nParameters is -- 0 no parameters will be passed to the constructor. valueConstructorCall :: (HasCallStack, MonadIO m, IsValue a) => a -> Maybe [Value] -> m Value -- | Call function referenced by value, passing the given -- parameters. If nParameters is 0 no -- parameters will be passed to the function. -- -- This function always returns a Value, in case of void functions -- a Value referencing <function>undefined</function> -- is returned valueFunctionCall :: (HasCallStack, MonadIO m, IsValue a) => a -> Maybe [Value] -> m Value -- | Get the Context in which value was created. valueGetContext :: (HasCallStack, MonadIO m, IsValue a) => a -> m Context -- | Get whether the value referenced by value is an array. valueIsArray :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Check whether the value is an -- ArrayBuffer. -- -- Since: 2.38 valueIsArrayBuffer :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Get whether the value referenced by value is a -- boolean. valueIsBoolean :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Get whether the value referenced by value is a -- constructor. valueIsConstructor :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Get whether the value referenced by value is a -- function valueIsFunction :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Get whether the value referenced by value is -- <function>null</function>. valueIsNull :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Get whether the value referenced by value is a number. valueIsNumber :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Get whether the value referenced by value is an -- object. valueIsObject :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Get whether the value referenced by value is a string valueIsString :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Determines whether a value is a typed array. -- -- Since: 2.38 valueIsTypedArray :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Get whether the value referenced by value is -- <function>undefined</function>. valueIsUndefined :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Creates a new ArrayBuffer from existing -- data in memory. -- -- The data is not copied: while this allows sharing data -- with JavaScript efficiently, the caller must ensure that the memory -- region remains valid until the newly created object is released by -- JSC. -- -- Optionally, a destroyNotify callback can be provided, -- which will be invoked with userData as parameter when -- the ArrayBuffer object is released. This is intended -- to be used for freeing resources related to the memory region which -- contains the data: -- --
--   !<-- language="C" -->
--   GMappedFile *f = g_mapped_file_new (file_path, TRUE, NULL);
--   JSCValue *value = jsc_value_new_array_buffer (context,
--       g_mapped_file_get_contents (f), g_mapped_file_get_length (f),
--       (GDestroyNotify) g_mapped_file_unref, f);
--   
-- -- Note that the userData can be the same value as -- data: -- --
--   !<-- language="C" -->
--   void *bytes = g_malloc0 (100);
--   JSCValue *value = jsc_value_new_array_buffer (context, bytes, 100, g_free, bytes);
--   
-- -- Since: 2.38 valueNewArrayBuffer :: (HasCallStack, MonadIO m, IsContext a) => a -> Ptr () -> CSize -> Maybe DestroyNotify -> m (Maybe Value) -- | Create a new Value referencing an array with the items from -- array. If array is Nothing or -- empty a new empty array will be created. Elements of -- array should be pointers to a Value. valueNewArrayFromGarray :: (HasCallStack, MonadIO m, IsContext a) => a -> Maybe [Value] -> m Value -- | Create a new Value referencing an array of strings with the -- items from strv. If array is -- Nothing or empty a new empty array will be created. valueNewArrayFromStrv :: (HasCallStack, MonadIO m, IsContext a) => a -> [Text] -> m Value -- | Create a new Value from value valueNewBoolean :: (HasCallStack, MonadIO m, IsContext a) => a -> Bool -> m Value -- | Create a new Value referencing a new value created by parsing -- json. -- -- Since: 2.28 valueNewFromJson :: (HasCallStack, MonadIO m, IsContext a) => a -> Text -> m Value -- | Create a function in context. If name -- is Nothing an anonymous function will be created. When the -- function is called by JavaScript or -- jsc_value_function_call(), callback is -- called receiving the function parameters and then -- userData as last parameter. When the function is -- cleared in context, destroyNotify is -- called with userData as parameter. -- -- Note that the value returned by callback must be fully -- transferred. In case of boxed types, you could 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 instance parameter. valueNewFunction :: (HasCallStack, MonadIO m, IsContext a) => a -> Maybe Text -> Callback -> GType -> Maybe [GType] -> m Value -- | Create a function in context. If name -- is Nothing an anonymous function will be created. When the -- function is called by JavaScript or -- jsc_value_function_call(), callback is -- called receiving an PtrArray of Values with the -- arguments and then userData as last parameter. When -- the function is cleared in context, -- destroyNotify is called with userData -- as parameter. -- -- Note that the value returned by callback must be fully -- transferred. In case of boxed types, you could 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 instance parameter. valueNewFunctionVariadic :: (HasCallStack, MonadIO m, IsContext a) => a -> Maybe Text -> Callback -> GType -> m Value -- | Create a new Value referencing -- <function>null</function> in context. valueNewNull :: (HasCallStack, MonadIO m, IsContext a) => a -> m Value -- | Create a new Value from number. valueNewNumber :: (HasCallStack, MonadIO m, IsContext a) => a -> Double -> m Value -- | Create a new Value from instance. If -- instance is Nothing a new empty object is -- created. When instance is provided, -- jscClass must be provided too. -- jscClass takes ownership of instance -- that will be freed by the DestroyNotify passed to -- contextRegisterClass. valueNewObject :: (HasCallStack, MonadIO m, IsContext a, IsClass b) => a -> Ptr () -> Maybe b -> m Value -- | Create a new Value from string. If you need to -- create a Value from a string containing null characters, use -- valueNewStringFromBytes instead. valueNewString :: (HasCallStack, MonadIO m, IsContext a) => a -> Maybe Text -> m Value -- | Create a new Value from bytes. valueNewStringFromBytes :: (HasCallStack, MonadIO m, IsContext a) => a -> Maybe Bytes -> m Value -- | Create a new typed array containing a given amount of elements. -- -- Create a Value referencing a new typed array with space for -- length elements of a given type. As -- all typed arrays must have an associated ArrayBuffer, a new -- one of suitable size will be allocated to store the elements, which -- will be initialized to zero. -- -- The type must *not* be TypedArrayTypeNone. -- -- Since: 2.38 valueNewTypedArray :: (HasCallStack, MonadIO m, IsContext a) => a -> TypedArrayType -> CSize -> m Value -- | Create a new typed array value with elements from an array buffer. -- -- Create a Value referencing a new typed array value containing -- elements of the given type, where the elements are -- stored at the memory region represented by the -- arrayBuffer. -- -- The type must *not* be TypedArrayTypeNone. -- -- The offset and length parameters can -- be used to indicate which part of the array buffer can be accessed -- through the typed array. If both are omitted (passing zero as -- offset, and -1 as length), -- the whole arrayBuffer is exposed through the typed -- array. Omitting the length with a non-zero -- offset will expose the remainder of the -- arrayBuffer starting at the indicated offset. -- -- Since: 2.38 valueNewTypedArrayWithBuffer :: (HasCallStack, MonadIO m, IsValue a) => a -> TypedArrayType -> CSize -> Int64 -> m Value -- | Create a new Value referencing -- <function>undefined</function> in context. valueNewUndefined :: (HasCallStack, MonadIO m, IsContext a) => a -> m Value -- | Define or modify a property with propertyName in -- object referenced by value. This is equivalent to -- JavaScript -- <function>Object.defineProperty()</function> -- when used with a data descriptor. valueObjectDefinePropertyData :: (HasCallStack, MonadIO m, IsValue a, IsValue b) => a -> Text -> [ValuePropertyFlags] -> Maybe b -> m () -- | Try to delete property with name from -- value. This function will return False if the -- property was defined without ValuePropertyFlagsConfigurable -- flag. valueObjectDeleteProperty :: (HasCallStack, MonadIO m, IsValue a) => a -> Text -> m Bool -- | Get the list of property names of value. Only -- properties defined with ValuePropertyFlagsEnumerable flag will -- be collected. valueObjectEnumerateProperties :: (HasCallStack, MonadIO m, IsValue a) => a -> m (Maybe [Text]) -- | Get property with name from value. valueObjectGetProperty :: (HasCallStack, MonadIO m, IsValue a) => a -> Text -> m Value -- | Get property at index from value. valueObjectGetPropertyAtIndex :: (HasCallStack, MonadIO m, IsValue a) => a -> Word32 -> m Value -- | Get whether value has property with -- name. valueObjectHasProperty :: (HasCallStack, MonadIO m, IsValue a) => a -> Text -> m Bool -- | Invoke method with name on object referenced by -- value, passing the given parameters. -- If nParameters is 0 no parameters will be passed to -- the method. The object instance will be handled automatically even -- when the method is a custom one registered with -- jsc_class_add_method(), so it should never be passed -- explicitly as parameter of this function. -- -- This function always returns a Value, in case of void methods a -- Value referencing <function>undefined</function> is -- returned. valueObjectInvokeMethod :: (HasCallStack, MonadIO m, IsValue a) => a -> Text -> Maybe [Value] -> m Value -- | Get whether the value referenced by value is an -- instance of class name. valueObjectIsInstanceOf :: (HasCallStack, MonadIO m, IsValue a) => a -> Text -> m Bool -- | Set property with name on -- value. valueObjectSetProperty :: (HasCallStack, MonadIO m, IsValue a, IsValue b) => a -> Text -> b -> m () -- | Set property at index on -- value. valueObjectSetPropertyAtIndex :: (HasCallStack, MonadIO m, IsValue a, IsValue b) => a -> Word32 -> b -> m () -- | Convert value to a boolean. valueToBoolean :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bool -- | Convert value to a double. valueToDouble :: (HasCallStack, MonadIO m, IsValue a) => a -> m Double -- | Convert value to a gint32. valueToInt32 :: (HasCallStack, MonadIO m, IsValue a) => a -> m Int32 -- | Create a JSON string of value serialization. If -- indent is 0, the resulting JSON will not contain -- newlines. The size of the indent is clamped to 10 spaces. -- -- Since: 2.28 valueToJson :: (HasCallStack, MonadIO m, IsValue a) => a -> Word32 -> m Text -- | Convert value to a string. Use -- valueToStringAsBytes instead, if you need to handle strings -- containing null characters. valueToString :: (HasCallStack, MonadIO m, IsValue a) => a -> m Text -- | Convert value to a string and return the results as -- Bytes. This is needed to handle strings with null characters. valueToStringAsBytes :: (HasCallStack, MonadIO m, IsValue a) => a -> m Bytes -- | Obtain the ArrayBuffer for the memory region of the -- typed array elements. -- -- Since: 2.38 valueTypedArrayGetBuffer :: (HasCallStack, MonadIO m, IsValue a) => a -> m Value -- | Obtains a pointer to the memory region that holds the elements of the -- typed array; modifications done to them will be visible to JavaScript -- code. If length is not Nothing, the number of -- elements contained in the typed array are also stored in the pointed -- location. -- -- The returned pointer needs to be casted to the appropriate type (see -- TypedArrayType), and has the offset over the -- underlying array buffer data applied—that is, points to the first -- element of the typed array: -- --

C code

-- --
--   if (jsc_value_typed_array_get_type(value) != JSC_TYPED_ARRAY_UINT32)
--       g_error ("Only arrays of uint32_t are supported");
--   
--   gsize count = 0;
--   uint32_t *elements = jsc_value_typed_array_get_contents (value, &count);
--   for (gsize i = 0; i < count; i++)
--        g_print ("index %zu, value %" PRIu32 "\n", i, elements[i]);
--   
-- -- Note that the pointer returned by this function is not guaranteed to -- remain the same after calls to other JSC API functions. See -- valueArrayBufferGetData for details. -- -- Since: 2.38 valueTypedArrayGetData :: (HasCallStack, MonadIO m, IsValue a) => a -> m (Ptr (), CSize) -- | Gets the number of elements in a typed array. -- -- Since: 2.38 valueTypedArrayGetLength :: (HasCallStack, MonadIO m, IsValue a) => a -> m CSize -- | Gets the offset over the underlying array buffer data. -- -- Since: 2.38 valueTypedArrayGetOffset :: (HasCallStack, MonadIO m, IsValue a) => a -> m CSize -- | Gets the size of a typed array. -- -- Since: 2.38 valueTypedArrayGetSize :: (HasCallStack, MonadIO m, IsValue a) => a -> m CSize -- | Gets the type of elements contained in a typed array. -- -- Since: 2.38 valueTypedArrayGetType :: (HasCallStack, MonadIO m, IsValue a) => a -> m TypedArrayType -- | Construct a GValueConstruct with valid value for the -- “context” property. This is rarely needed directly, but it is -- used by new. constructValueContext :: (IsValue o, MonadIO m, IsContext a) => a -> m (GValueConstruct o) -- | Get the value of the “context” property. When -- overloading is enabled, this is equivalent to -- --
--   get value #context
--   
getValueContext :: (MonadIO m, IsValue o) => o -> m Context instance GHC.Classes.Eq GI.JavaScriptCore.Objects.Value.Value instance (Data.GI.Base.BasicTypes.GObject o, Data.GI.Base.Overloading.IsDescendantOf GI.JavaScriptCore.Objects.Value.Value o) => GI.JavaScriptCore.Objects.Value.IsValue o instance Data.GI.Base.BasicTypes.ManagedPtrNewtype GI.JavaScriptCore.Objects.Value.Value instance Data.GI.Base.BasicTypes.TypedObject GI.JavaScriptCore.Objects.Value.Value instance Data.GI.Base.BasicTypes.GObject GI.JavaScriptCore.Objects.Value.Value instance Data.GI.Base.Overloading.HasParentTypes GI.JavaScriptCore.Objects.Value.Value instance Data.GI.Base.GValue.IsGValue (GHC.Maybe.Maybe GI.JavaScriptCore.Objects.Value.Value) -- | A JSSClass represents a custom JavaScript class registered by the user -- in a Context. 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 -- Callbacks to implement them. module GI.JavaScriptCore.Objects.Class -- | Memory-managed wrapper type. newtype Class Class :: ManagedPtr Class -> Class -- | Type class for types which can be safely cast to Class, for -- instance with toClass. class (GObject o, IsDescendantOf Class o) => IsClass o -- | Cast to Class, for types for which this is known to be safe. -- For general casts, use castTo. toClass :: (MonadIO m, IsClass o) => o -> m Class -- | 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. classAddConstructor :: (HasCallStack, MonadIO m, IsClass a) => a -> Maybe Text -> Callback -> GType -> Maybe [GType] -> m Value -- | 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. classAddConstructorVariadic :: (HasCallStack, MonadIO m, IsClass a) => a -> Maybe Text -> Callback -> GType -> m Value -- | 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. classAddMethod :: (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 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. classAddMethodVariadic :: (HasCallStack, MonadIO m, IsClass a) => a -> Text -> Callback -> GType -> 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. classAddProperty :: (HasCallStack, MonadIO m, IsClass a) => a -> Text -> GType -> Maybe Callback -> Maybe Callback -> m () -- | Get the class name of jscClass classGetName :: (HasCallStack, MonadIO m, IsClass a) => a -> m Text -- | Get the parent class of jscClass classGetParent :: (HasCallStack, MonadIO m, IsClass a) => a -> m Class -- | Construct a GValueConstruct with valid value for the -- “context” property. This is rarely needed directly, but it is -- used by new. constructClassContext :: (IsClass o, MonadIO m, IsContext a) => a -> m (GValueConstruct o) -- | Construct a GValueConstruct with valid value for the -- “name” property. This is rarely needed directly, but it is -- used by new. constructClassName :: (IsClass o, MonadIO m) => Text -> m (GValueConstruct o) -- | Get the value of the “name” property. When overloading -- is enabled, this is equivalent to -- --
--   get class #name
--   
getClassName :: (MonadIO m, IsClass o) => o -> m Text -- | Construct a GValueConstruct with valid value for the -- “parent” property. This is rarely needed directly, but it is -- used by new. constructClassParent :: (IsClass o, MonadIO m, IsClass a) => a -> m (GValueConstruct o) -- | Get the value of the “parent” property. When -- overloading is enabled, this is equivalent to -- --
--   get class #parent
--   
getClassParent :: (MonadIO m, IsClass o) => o -> m Class instance GHC.Classes.Eq GI.JavaScriptCore.Objects.Class.Class instance (Data.GI.Base.BasicTypes.GObject o, Data.GI.Base.Overloading.IsDescendantOf GI.JavaScriptCore.Objects.Class.Class o) => GI.JavaScriptCore.Objects.Class.IsClass o instance Data.GI.Base.BasicTypes.ManagedPtrNewtype GI.JavaScriptCore.Objects.Class.Class instance Data.GI.Base.BasicTypes.TypedObject GI.JavaScriptCore.Objects.Class.Class instance Data.GI.Base.BasicTypes.GObject GI.JavaScriptCore.Objects.Class.Class instance Data.GI.Base.Overloading.HasParentTypes GI.JavaScriptCore.Objects.Class.Class instance Data.GI.Base.GValue.IsGValue (GHC.Maybe.Maybe GI.JavaScriptCore.Objects.Class.Class) module GI.JavaScriptCore.Callbacks -- | Type for the callback on the (unwrapped) C side. type C_ClassDeletePropertyFunction = Ptr Class -> Ptr Context -> Ptr () -> CString -> IO CInt -- | The type of delete_property in ClassVTable. This is only -- required when you need to handle external properties not added to the -- prototype. type ClassDeletePropertyFunction = -- | /@jscClass@/: a t'GI.JavaScriptCore.Objects.Class.Class' Class -> -- | /@context@/: a t'GI.JavaScriptCore.Objects.Context.Context' Context -> -- | /@instance@/: the /@jscClass@/ instance Ptr () -> -- | /@name@/: the property name Text -> -- | __Returns:__ 'P.True' if handled or 'P.False' to to forward the request to the parent class or prototype chain. IO Bool -- | Given a pointer to a foreign C function, wrap it into a function -- callable from Haskell. dynamic_ClassDeletePropertyFunction :: (HasCallStack, MonadIO m, IsClass a, IsContext b) => FunPtr C_ClassDeletePropertyFunction -> a -> b -> Ptr () -> Text -> m Bool -- | Wrap the callback into a GClosure. genClosure_ClassDeletePropertyFunction :: MonadIO m => ClassDeletePropertyFunction -> m (GClosure C_ClassDeletePropertyFunction) -- | Generate a function pointer callable from C code, from a -- C_ClassDeletePropertyFunction. mk_ClassDeletePropertyFunction :: C_ClassDeletePropertyFunction -> IO (FunPtr C_ClassDeletePropertyFunction) -- | A convenience synonym for Nothing :: Maybe -- ClassDeletePropertyFunction. noClassDeletePropertyFunction :: Maybe ClassDeletePropertyFunction -- | Wrap a ClassDeletePropertyFunction into a -- C_ClassDeletePropertyFunction. wrap_ClassDeletePropertyFunction :: Maybe (Ptr (FunPtr C_ClassDeletePropertyFunction)) -> ClassDeletePropertyFunction -> C_ClassDeletePropertyFunction -- | Type for the callback on the (unwrapped) C side. type C_ClassEnumeratePropertiesFunction = Ptr Class -> Ptr Context -> Ptr () -> IO (Ptr CString) -- | The type of enumerate_properties in ClassVTable. This is only -- required when you need to handle external properties not added to the -- prototype. type ClassEnumeratePropertiesFunction = -- | /@jscClass@/: a t'GI.JavaScriptCore.Objects.Class.Class' Class -> -- | /@context@/: a t'GI.JavaScriptCore.Objects.Context.Context' Context -> -- | __Returns:__ a 'P.Nothing'-terminated array of strings -- containing the property names, or 'P.Nothing' if /@instance@/ doesn\'t have enumerable properties. IO (Maybe [Text]) -- | The type of enumerate_properties in ClassVTable. This is only -- required when you need to handle external properties not added to the -- prototype. type ClassEnumeratePropertiesFunction_WithClosures = -- | /@jscClass@/: a t'GI.JavaScriptCore.Objects.Class.Class' Class -> -- | /@context@/: a t'GI.JavaScriptCore.Objects.Context.Context' Context -> -- | /@instance@/: the /@jscClass@/ instance Ptr () -> -- | __Returns:__ a 'P.Nothing'-terminated array of strings -- containing the property names, or 'P.Nothing' if /@instance@/ doesn\'t have enumerable properties. IO (Maybe [Text]) -- | A simple wrapper that ignores the closure arguments. drop_closures_ClassEnumeratePropertiesFunction :: ClassEnumeratePropertiesFunction -> ClassEnumeratePropertiesFunction_WithClosures -- | Given a pointer to a foreign C function, wrap it into a function -- callable from Haskell. dynamic_ClassEnumeratePropertiesFunction :: (HasCallStack, MonadIO m, IsClass a, IsContext b) => FunPtr C_ClassEnumeratePropertiesFunction -> a -> b -> Ptr () -> m (Maybe [Text]) -- | Wrap the callback into a GClosure. genClosure_ClassEnumeratePropertiesFunction :: MonadIO m => ClassEnumeratePropertiesFunction -> m (GClosure C_ClassEnumeratePropertiesFunction) -- | Generate a function pointer callable from C code, from a -- C_ClassEnumeratePropertiesFunction. mk_ClassEnumeratePropertiesFunction :: C_ClassEnumeratePropertiesFunction -> IO (FunPtr C_ClassEnumeratePropertiesFunction) -- | A convenience synonym for Nothing :: Maybe -- ClassEnumeratePropertiesFunction. noClassEnumeratePropertiesFunction :: Maybe ClassEnumeratePropertiesFunction -- | A convenience synonym for Nothing :: Maybe -- ClassEnumeratePropertiesFunction_WithClosures. noClassEnumeratePropertiesFunction_WithClosures :: Maybe ClassEnumeratePropertiesFunction_WithClosures -- | Wrap a ClassEnumeratePropertiesFunction into a -- C_ClassEnumeratePropertiesFunction. wrap_ClassEnumeratePropertiesFunction :: Maybe (Ptr (FunPtr C_ClassEnumeratePropertiesFunction)) -> ClassEnumeratePropertiesFunction_WithClosures -> C_ClassEnumeratePropertiesFunction -- | Type for the callback on the (unwrapped) C side. type C_ClassGetPropertyFunction = Ptr Class -> Ptr Context -> Ptr () -> CString -> IO (Ptr Value) -- | The type of get_property in ClassVTable. This is only required -- when you need to handle external properties not added to the -- prototype. type ClassGetPropertyFunction = -- | /@jscClass@/: a t'GI.JavaScriptCore.Objects.Class.Class' Class -> -- | /@context@/: a t'GI.JavaScriptCore.Objects.Context.Context' Context -> -- | /@instance@/: the /@jscClass@/ instance Ptr () -> -- | /@name@/: the property name Text -> -- | __Returns:__ a t'GI.JavaScriptCore.Objects.Value.Value' or 'P.Nothing' to forward the request to -- the parent class or prototype chain IO (Maybe Value) -- | Given a pointer to a foreign C function, wrap it into a function -- callable from Haskell. dynamic_ClassGetPropertyFunction :: (HasCallStack, MonadIO m, IsClass a, IsContext b) => FunPtr C_ClassGetPropertyFunction -> a -> b -> Ptr () -> Text -> m (Maybe Value) -- | Wrap the callback into a GClosure. genClosure_ClassGetPropertyFunction :: MonadIO m => ClassGetPropertyFunction -> m (GClosure C_ClassGetPropertyFunction) -- | Generate a function pointer callable from C code, from a -- C_ClassGetPropertyFunction. mk_ClassGetPropertyFunction :: C_ClassGetPropertyFunction -> IO (FunPtr C_ClassGetPropertyFunction) -- | A convenience synonym for Nothing :: Maybe -- ClassGetPropertyFunction. noClassGetPropertyFunction :: Maybe ClassGetPropertyFunction -- | Wrap a ClassGetPropertyFunction into a -- C_ClassGetPropertyFunction. wrap_ClassGetPropertyFunction :: Maybe (Ptr (FunPtr C_ClassGetPropertyFunction)) -> ClassGetPropertyFunction -> C_ClassGetPropertyFunction -- | Type for the callback on the (unwrapped) C side. type C_ClassHasPropertyFunction = Ptr Class -> Ptr Context -> Ptr () -> CString -> IO CInt -- | The type of has_property in ClassVTable. This is only required -- when you need to handle external properties not added to the -- prototype. type ClassHasPropertyFunction = -- | /@jscClass@/: a t'GI.JavaScriptCore.Objects.Class.Class' Class -> -- | /@context@/: a t'GI.JavaScriptCore.Objects.Context.Context' Context -> -- | /@instance@/: the /@jscClass@/ instance Ptr () -> -- | /@name@/: the property name Text -> -- | __Returns:__ 'P.True' if /@instance@/ has a property with /@name@/ or 'P.False' to forward the request -- to the parent class or prototype chain. IO Bool -- | Given a pointer to a foreign C function, wrap it into a function -- callable from Haskell. dynamic_ClassHasPropertyFunction :: (HasCallStack, MonadIO m, IsClass a, IsContext b) => FunPtr C_ClassHasPropertyFunction -> a -> b -> Ptr () -> Text -> m Bool -- | Wrap the callback into a GClosure. genClosure_ClassHasPropertyFunction :: MonadIO m => ClassHasPropertyFunction -> m (GClosure C_ClassHasPropertyFunction) -- | Generate a function pointer callable from C code, from a -- C_ClassHasPropertyFunction. mk_ClassHasPropertyFunction :: C_ClassHasPropertyFunction -> IO (FunPtr C_ClassHasPropertyFunction) -- | A convenience synonym for Nothing :: Maybe -- ClassHasPropertyFunction. noClassHasPropertyFunction :: Maybe ClassHasPropertyFunction -- | Wrap a ClassHasPropertyFunction into a -- C_ClassHasPropertyFunction. wrap_ClassHasPropertyFunction :: Maybe (Ptr (FunPtr C_ClassHasPropertyFunction)) -> ClassHasPropertyFunction -> C_ClassHasPropertyFunction -- | Type for the callback on the (unwrapped) C side. type C_ClassSetPropertyFunction = Ptr Class -> Ptr Context -> Ptr () -> CString -> Ptr Value -> IO CInt -- | The type of set_property in ClassVTable. This is only required -- when you need to handle external properties not added to the -- prototype. type ClassSetPropertyFunction = -- | /@jscClass@/: a t'GI.JavaScriptCore.Objects.Class.Class' Class -> -- | /@context@/: a t'GI.JavaScriptCore.Objects.Context.Context' Context -> -- | /@instance@/: the /@jscClass@/ instance Ptr () -> -- | /@name@/: the property name Text -> -- | /@value@/: the t'GI.JavaScriptCore.Objects.Value.Value' to set Value -> -- | __Returns:__ 'P.True' if handled or 'P.False' to forward the request to the parent class or prototype chain. IO Bool -- | Given a pointer to a foreign C function, wrap it into a function -- callable from Haskell. dynamic_ClassSetPropertyFunction :: (HasCallStack, MonadIO m, IsClass a, IsContext b, IsValue c) => FunPtr C_ClassSetPropertyFunction -> a -> b -> Ptr () -> Text -> c -> m Bool -- | Wrap the callback into a GClosure. genClosure_ClassSetPropertyFunction :: MonadIO m => ClassSetPropertyFunction -> m (GClosure C_ClassSetPropertyFunction) -- | Generate a function pointer callable from C code, from a -- C_ClassSetPropertyFunction. mk_ClassSetPropertyFunction :: C_ClassSetPropertyFunction -> IO (FunPtr C_ClassSetPropertyFunction) -- | A convenience synonym for Nothing :: Maybe -- ClassSetPropertyFunction. noClassSetPropertyFunction :: Maybe ClassSetPropertyFunction -- | Wrap a ClassSetPropertyFunction into a -- C_ClassSetPropertyFunction. wrap_ClassSetPropertyFunction :: Maybe (Ptr (FunPtr C_ClassSetPropertyFunction)) -> ClassSetPropertyFunction -> C_ClassSetPropertyFunction -- | Type for the callback on the (unwrapped) C side. type C_ExceptionHandler = Ptr Context -> Ptr Exception -> Ptr () -> IO () -- | Function used to handle JavaScript exceptions in a Context. type ExceptionHandler = -- | /@context@/: a t'GI.JavaScriptCore.Objects.Context.Context' Context -> -- | /@exception@/: a t'GI.JavaScriptCore.Objects.Exception.Exception' Exception -> IO () -- | Function used to handle JavaScript exceptions in a Context. type ExceptionHandler_WithClosures = -- | /@context@/: a t'GI.JavaScriptCore.Objects.Context.Context' Context -> -- | /@exception@/: a t'GI.JavaScriptCore.Objects.Exception.Exception' Exception -> -- | /@userData@/: user data Ptr () -> IO () -- | A simple wrapper that ignores the closure arguments. drop_closures_ExceptionHandler :: ExceptionHandler -> ExceptionHandler_WithClosures -- | Given a pointer to a foreign C function, wrap it into a function -- callable from Haskell. dynamic_ExceptionHandler :: (HasCallStack, MonadIO m, IsContext a, IsException b) => FunPtr C_ExceptionHandler -> a -> b -> Ptr () -> m () -- | Wrap the callback into a GClosure. genClosure_ExceptionHandler :: MonadIO m => ExceptionHandler -> m (GClosure C_ExceptionHandler) -- | Generate a function pointer callable from C code, from a -- C_ExceptionHandler. mk_ExceptionHandler :: C_ExceptionHandler -> IO (FunPtr C_ExceptionHandler) -- | A convenience synonym for Nothing :: Maybe -- ExceptionHandler. noExceptionHandler :: Maybe ExceptionHandler -- | A convenience synonym for Nothing :: Maybe -- ExceptionHandler_WithClosures. noExceptionHandler_WithClosures :: Maybe ExceptionHandler_WithClosures -- | Wrap a ExceptionHandler into a C_ExceptionHandler. wrap_ExceptionHandler :: Maybe (Ptr (FunPtr C_ExceptionHandler)) -> ExceptionHandler_WithClosures -> C_ExceptionHandler -- | Type for the callback on the (unwrapped) C side. type C_OptionsFunc = CString -> CUInt -> CString -> Ptr () -> IO CInt -- | Function used to iterate options. -- -- Not that description string is not localized. -- -- Since: 2.24 type OptionsFunc = -- | /@option@/: the option name Text -> -- | /@type@/: the option t'GI.JavaScriptCore.Enums.OptionType' OptionType -> -- | /@description@/: the option description, or 'P.Nothing' Maybe Text -> -- | __Returns:__ 'P.True' to stop the iteration, or 'P.False' otherwise IO Bool -- | Function used to iterate options. -- -- Not that description string is not localized. -- -- Since: 2.24 type OptionsFunc_WithClosures = -- | /@option@/: the option name Text -> -- | /@type@/: the option t'GI.JavaScriptCore.Enums.OptionType' OptionType -> -- | /@description@/: the option description, or 'P.Nothing' Maybe Text -> -- | /@userData@/: user data Ptr () -> -- | __Returns:__ 'P.True' to stop the iteration, or 'P.False' otherwise IO Bool -- | A simple wrapper that ignores the closure arguments. drop_closures_OptionsFunc :: OptionsFunc -> OptionsFunc_WithClosures -- | Given a pointer to a foreign C function, wrap it into a function -- callable from Haskell. dynamic_OptionsFunc :: (HasCallStack, MonadIO m) => FunPtr C_OptionsFunc -> Text -> OptionType -> Maybe Text -> Ptr () -> m Bool -- | Wrap the callback into a GClosure. genClosure_OptionsFunc :: MonadIO m => OptionsFunc -> m (GClosure C_OptionsFunc) -- | Generate a function pointer callable from C code, from a -- C_OptionsFunc. mk_OptionsFunc :: C_OptionsFunc -> IO (FunPtr C_OptionsFunc) -- | A convenience synonym for Nothing :: Maybe -- OptionsFunc. noOptionsFunc :: Maybe OptionsFunc -- | A convenience synonym for Nothing :: Maybe -- OptionsFunc_WithClosures. noOptionsFunc_WithClosures :: Maybe OptionsFunc_WithClosures -- | Wrap a OptionsFunc into a C_OptionsFunc. wrap_OptionsFunc :: Maybe (Ptr (FunPtr C_OptionsFunc)) -> OptionsFunc_WithClosures -> C_OptionsFunc module GI.JavaScriptCore.Functions -- | Returns the major version number of the JavaScriptCore library. (e.g. -- in JavaScriptCore version 1.8.3 this is 1.) -- -- This function is in the library, so it represents the JavaScriptCore -- library your code is running against. Contrast with the -- MAJOR_VERSION macro, which represents the major version of the -- JavaScriptCore headers you have included when compiling your code. getMajorVersion :: (HasCallStack, MonadIO m) => m Word32 -- | Returns the micro version number of the JavaScriptCore library. (e.g. -- in JavaScriptCore version 1.8.3 this is 3.) -- -- This function is in the library, so it represents the JavaScriptCore -- library your code is running against. Contrast with the -- MICRO_VERSION macro, which represents the micro version of the -- JavaScriptCore headers you have included when compiling your code. getMicroVersion :: (HasCallStack, MonadIO m) => m Word32 -- | Returns the minor version number of the JavaScriptCore library. (e.g. -- in JavaScriptCore version 1.8.3 this is 8.) -- -- This function is in the library, so it represents the JavaScriptCore -- library your code is running against. Contrast with the -- MINOR_VERSION macro, which represents the minor version of the -- JavaScriptCore headers you have included when compiling your code. getMinorVersion :: (HasCallStack, MonadIO m) => m Word32 -- | Iterates all available options calling function for -- each one. Iteration can stop early if function returns -- False. -- -- Since: 2.24 optionsForeach :: (HasCallStack, MonadIO m) => OptionsFunc -> m () -- | Get option as a Bool value. -- -- Since: 2.24 optionsGetBoolean :: (HasCallStack, MonadIO m) => Text -> m (Bool, Bool) -- | Get option as a gdouble value. -- -- Since: 2.24 optionsGetDouble :: (HasCallStack, MonadIO m) => Text -> m (Bool, Double) -- | Get option as a gint value. -- -- Since: 2.24 optionsGetInt :: (HasCallStack, MonadIO m) => Text -> m (Bool, Int32) -- | Create a OptionGroup to handle JSCOptions as command line -- arguments. The options will be exposed as command line arguments with -- the form -- <emphasis>--jsc-&lt;option&gt;=&lt;value&gt;</emphasis>. -- Each entry in the returned OptionGroup is configured to apply -- the corresponding option during command line parsing. Applications -- only need to pass the returned group to optionContextAddGroup, -- and the rest will be taken care for automatically. -- -- Since: 2.24 optionsGetOptionGroup :: (HasCallStack, MonadIO m) => m OptionGroup -- | Get option as a range string. The string must be in -- the format -- <emphasis>[!]&lt;low&gt;[:&lt;high&gt;]</emphasis> -- where low and high are guint values. Values between -- low and high (both included) will be considered in the range, unless -- <emphasis>!</emphasis> is used to invert the range. -- -- Since: 2.24 optionsGetRangeString :: (HasCallStack, MonadIO m) => Text -> m (Bool, Text) -- | Get option as a gsize value. -- -- Since: 2.24 optionsGetSize :: (HasCallStack, MonadIO m) => Text -> m (Bool, CSize) -- | Get option as a string. -- -- Since: 2.24 optionsGetString :: (HasCallStack, MonadIO m) => Text -> m (Bool, Text) -- | Get option as a guint value. -- -- Since: 2.24 optionsGetUint :: (HasCallStack, MonadIO m) => Text -> m (Bool, Word32) -- | Set option as a Bool value. -- -- Since: 2.24 optionsSetBoolean :: (HasCallStack, MonadIO m) => Text -> Bool -> m Bool -- | Set option as a gdouble value. -- -- Since: 2.24 optionsSetDouble :: (HasCallStack, MonadIO m) => Text -> Double -> m Bool -- | Set option as a gint value. -- -- Since: 2.24 optionsSetInt :: (HasCallStack, MonadIO m) => Text -> Int32 -> m Bool -- | Set option as a range string. The string must be in -- the format -- <emphasis>[!]&lt;low&gt;[:&lt;high&gt;]</emphasis> -- where low and high are guint values. Values between -- low and high (both included) will be considered in the range, unless -- <emphasis>!</emphasis> is used to invert the range. -- -- Since: 2.24 optionsSetRangeString :: (HasCallStack, MonadIO m) => Text -> Text -> m Bool -- | Set option as a gsize value. -- -- Since: 2.24 optionsSetSize :: (HasCallStack, MonadIO m) => Text -> CSize -> m Bool -- | Set option as a string. -- -- Since: 2.24 optionsSetString :: (HasCallStack, MonadIO m) => Text -> Text -> m Bool -- | Set option as a guint value. -- -- Since: 2.24 optionsSetUint :: (HasCallStack, MonadIO m) => Text -> Word32 -> m Bool -- | JSCVirtualMachine represents a group of JSCContexts. It allows -- concurrent JavaScript execution by creating a different instance of -- JSCVirtualMachine in each thread. -- -- To create a group of JSCContexts pass the same JSCVirtualMachine -- instance to every JSCContext constructor. module GI.JavaScriptCore.Objects.VirtualMachine -- | Memory-managed wrapper type. newtype VirtualMachine VirtualMachine :: ManagedPtr VirtualMachine -> VirtualMachine -- | Type class for types which can be safely cast to -- VirtualMachine, for instance with toVirtualMachine. class (GObject o, IsDescendantOf VirtualMachine o) => IsVirtualMachine o -- | Cast to VirtualMachine, for types for which this is known to be -- safe. For general casts, use castTo. toVirtualMachine :: (MonadIO m, IsVirtualMachine o) => o -> m VirtualMachine -- | Create a new VirtualMachine. virtualMachineNew :: (HasCallStack, MonadIO m) => m VirtualMachine instance GHC.Classes.Eq GI.JavaScriptCore.Objects.VirtualMachine.VirtualMachine instance (Data.GI.Base.BasicTypes.GObject o, Data.GI.Base.Overloading.IsDescendantOf GI.JavaScriptCore.Objects.VirtualMachine.VirtualMachine o) => GI.JavaScriptCore.Objects.VirtualMachine.IsVirtualMachine o instance Data.GI.Base.BasicTypes.ManagedPtrNewtype GI.JavaScriptCore.Objects.VirtualMachine.VirtualMachine instance Data.GI.Base.BasicTypes.TypedObject GI.JavaScriptCore.Objects.VirtualMachine.VirtualMachine instance Data.GI.Base.BasicTypes.GObject GI.JavaScriptCore.Objects.VirtualMachine.VirtualMachine instance Data.GI.Base.Overloading.HasParentTypes GI.JavaScriptCore.Objects.VirtualMachine.VirtualMachine instance Data.GI.Base.GValue.IsGValue (GHC.Maybe.Maybe GI.JavaScriptCore.Objects.VirtualMachine.VirtualMachine) -- | JSCWeakValue represents a weak reference to a value in a -- Context. It can be used to keep a reference to a JavaScript -- value without protecting it from being garbage collected and without -- referencing the Context either. module GI.JavaScriptCore.Objects.WeakValue -- | Memory-managed wrapper type. newtype WeakValue WeakValue :: ManagedPtr WeakValue -> WeakValue -- | Type class for types which can be safely cast to WeakValue, for -- instance with toWeakValue. class (GObject o, IsDescendantOf WeakValue o) => IsWeakValue o -- | Cast to WeakValue, for types for which this is known to be -- safe. For general casts, use castTo. toWeakValue :: (MonadIO m, IsWeakValue o) => o -> m WeakValue -- | Get a Value referencing the JavaScript value of -- weakValue. weakValueGetValue :: (HasCallStack, MonadIO m, IsWeakValue a) => a -> m Value -- | Create a new WeakValue for the JavaScript value referenced by -- value. weakValueNew :: (HasCallStack, MonadIO m, IsValue a) => a -> m WeakValue -- | Construct a GValueConstruct with valid value for the -- “value” property. This is rarely needed directly, but it is -- used by new. constructWeakValueValue :: (IsWeakValue o, MonadIO m, IsValue a) => a -> m (GValueConstruct o) -- | This signal is emitted when the JavaScript value is destroyed. type WeakValueClearedCallback = IO () -- | Connect a signal handler for the cleared signal, to be run -- after the default handler. When overloading is enabled, this is -- equivalent to -- --
--   after weakValue #cleared callback
--   
-- -- By default the object invoking the signal is not passed to the -- callback. If you need to access it, you can use the implit -- ?self parameter. Note that this requires activating the -- ImplicitParams GHC extension. afterWeakValueCleared :: (IsWeakValue a, MonadIO m) => a -> ((?self :: a) => WeakValueClearedCallback) -> m SignalHandlerId -- | Connect a signal handler for the cleared signal, to be run -- before the default handler. When overloading is enabled, this -- is equivalent to -- --
--   on weakValue #cleared callback
--   
onWeakValueCleared :: (IsWeakValue a, MonadIO m) => a -> ((?self :: a) => WeakValueClearedCallback) -> m SignalHandlerId instance GHC.Classes.Eq GI.JavaScriptCore.Objects.WeakValue.WeakValue instance (Data.GI.Base.BasicTypes.GObject o, Data.GI.Base.Overloading.IsDescendantOf GI.JavaScriptCore.Objects.WeakValue.WeakValue o) => GI.JavaScriptCore.Objects.WeakValue.IsWeakValue o instance Data.GI.Base.BasicTypes.ManagedPtrNewtype GI.JavaScriptCore.Objects.WeakValue.WeakValue instance Data.GI.Base.BasicTypes.TypedObject GI.JavaScriptCore.Objects.WeakValue.WeakValue instance Data.GI.Base.BasicTypes.GObject GI.JavaScriptCore.Objects.WeakValue.WeakValue instance Data.GI.Base.Overloading.HasParentTypes GI.JavaScriptCore.Objects.WeakValue.WeakValue instance Data.GI.Base.GValue.IsGValue (GHC.Maybe.Maybe GI.JavaScriptCore.Objects.WeakValue.WeakValue) -- | Virtual table for a JSCClass. This can be optionally used when -- registering a Class in a Context to provide a custom -- implementation for the class. All virtual functions are optional and -- can be set to Nothing to fallback to the default -- implementation. module GI.JavaScriptCore.Structs.ClassVTable -- | Memory-managed wrapper type. newtype ClassVTable ClassVTable :: ManagedPtr ClassVTable -> ClassVTable -- | Construct a ClassVTable struct initialized to zero. newZeroClassVTable :: MonadIO m => m ClassVTable -- | Set the value of the “delete_property” field to -- Nothing. When overloading is enabled, this is equivalent -- to -- --
--   clear #deleteProperty
--   
clearClassVTableDeleteProperty :: MonadIO m => ClassVTable -> m () -- | Get the value of the “delete_property” field. When -- overloading is enabled, this is equivalent to -- --
--   get classVTable #deleteProperty
--   
getClassVTableDeleteProperty :: MonadIO m => ClassVTable -> m (Maybe ClassDeletePropertyFunction) -- | Set the value of the “delete_property” field. When -- overloading is enabled, this is equivalent to -- --
--   set classVTable [ #deleteProperty := value ]
--   
setClassVTableDeleteProperty :: MonadIO m => ClassVTable -> FunPtr C_ClassDeletePropertyFunction -> m () -- | Set the value of the “enumerate_properties” field to -- Nothing. When overloading is enabled, this is equivalent -- to -- --
--   clear #enumerateProperties
--   
clearClassVTableEnumerateProperties :: MonadIO m => ClassVTable -> m () -- | Get the value of the “enumerate_properties” field. When -- overloading is enabled, this is equivalent to -- --
--   get classVTable #enumerateProperties
--   
getClassVTableEnumerateProperties :: MonadIO m => ClassVTable -> m (Maybe ClassEnumeratePropertiesFunction_WithClosures) -- | Set the value of the “enumerate_properties” field. When -- overloading is enabled, this is equivalent to -- --
--   set classVTable [ #enumerateProperties := value ]
--   
setClassVTableEnumerateProperties :: MonadIO m => ClassVTable -> FunPtr C_ClassEnumeratePropertiesFunction -> m () -- | Set the value of the “get_property” field to Nothing. -- When overloading is enabled, this is equivalent to -- --
--   clear #getProperty
--   
clearClassVTableGetProperty :: MonadIO m => ClassVTable -> m () -- | Get the value of the “get_property” field. When -- overloading is enabled, this is equivalent to -- --
--   get classVTable #getProperty
--   
getClassVTableGetProperty :: MonadIO m => ClassVTable -> m (Maybe ClassGetPropertyFunction) -- | Set the value of the “get_property” field. When -- overloading is enabled, this is equivalent to -- --
--   set classVTable [ #getProperty := value ]
--   
setClassVTableGetProperty :: MonadIO m => ClassVTable -> FunPtr C_ClassGetPropertyFunction -> m () -- | Set the value of the “has_property” field to Nothing. -- When overloading is enabled, this is equivalent to -- --
--   clear #hasProperty
--   
clearClassVTableHasProperty :: MonadIO m => ClassVTable -> m () -- | Get the value of the “has_property” field. When -- overloading is enabled, this is equivalent to -- --
--   get classVTable #hasProperty
--   
getClassVTableHasProperty :: MonadIO m => ClassVTable -> m (Maybe ClassHasPropertyFunction) -- | Set the value of the “has_property” field. When -- overloading is enabled, this is equivalent to -- --
--   set classVTable [ #hasProperty := value ]
--   
setClassVTableHasProperty :: MonadIO m => ClassVTable -> FunPtr C_ClassHasPropertyFunction -> m () -- | Set the value of the “set_property” field to Nothing. -- When overloading is enabled, this is equivalent to -- --
--   clear #setProperty
--   
clearClassVTableSetProperty :: MonadIO m => ClassVTable -> m () -- | Get the value of the “set_property” field. When -- overloading is enabled, this is equivalent to -- --
--   get classVTable #setProperty
--   
getClassVTableSetProperty :: MonadIO m => ClassVTable -> m (Maybe ClassSetPropertyFunction) -- | Set the value of the “set_property” field. When -- overloading is enabled, this is equivalent to -- --
--   set classVTable [ #setProperty := value ]
--   
setClassVTableSetProperty :: MonadIO m => ClassVTable -> FunPtr C_ClassSetPropertyFunction -> m () instance GHC.Classes.Eq GI.JavaScriptCore.Structs.ClassVTable.ClassVTable instance Data.GI.Base.BasicTypes.ManagedPtrNewtype GI.JavaScriptCore.Structs.ClassVTable.ClassVTable instance Data.GI.Base.BasicTypes.BoxedPtr GI.JavaScriptCore.Structs.ClassVTable.ClassVTable instance Data.GI.Base.BasicTypes.CallocPtr GI.JavaScriptCore.Structs.ClassVTable.ClassVTable instance (tag GHC.Types.~ 'Data.GI.Base.Attributes.AttrSet) => Data.GI.Base.Constructible.Constructible GI.JavaScriptCore.Structs.ClassVTable.ClassVTable tag module GI.JavaScriptCore.Structs -- | JSCContext represents a JavaScript execution context, where all -- operations take place and where the values will be associated. -- -- When a new context is created, a global object is allocated and the -- built-in JavaScript objects (Object, Function, String, Array) are -- populated. You can execute JavaScript in the context by using -- contextEvaluate or contextEvaluateWithSourceUri. It's -- also possible to register custom objects in the context with -- contextRegisterClass. module GI.JavaScriptCore.Objects.Context -- | Memory-managed wrapper type. newtype Context Context :: ManagedPtr Context -> Context -- | Type class for types which can be safely cast to Context, for -- instance with toContext. class (GObject o, IsDescendantOf Context o) => IsContext o -- | Cast to Context, for types for which this is known to be safe. -- For general casts, use castTo. toContext :: (MonadIO m, IsContext o) => o -> m Context -- | Check the given code in context for -- syntax errors. The lineNumber is the starting line -- number in uri; the value is one-based so the first -- line is 1. uri and lineNumber are only -- used to fill the exception. In case of errors -- exception will be set to a new Exception with -- the details. You can pass Nothing to exception -- to ignore the error details. contextCheckSyntax :: (HasCallStack, MonadIO m, IsContext a) => a -> Text -> Int64 -> CheckSyntaxMode -> Text -> Word32 -> m (CheckSyntaxResult, Exception) -- | Clear the uncaught exception in context if any. contextClearException :: (HasCallStack, MonadIO m, IsContext a) => a -> m () -- | Evaluate code in context. contextEvaluate :: (HasCallStack, MonadIO m, IsContext a) => a -> Text -> Int64 -> m Value -- | Evaluate code and create an new object where symbols -- defined in code will be added as properties, instead -- of being added to context global object. The new -- object is returned as object parameter. Similar to how -- valueNewObject works, if objectInstance is not -- Nothing objectClass must be provided too. The -- lineNumber is the starting line number in -- uri; the value is one-based so the first line is 1. -- uri and lineNumber will be shown in -- exceptions and they don't affect the behavior of the script. contextEvaluateInObject :: (HasCallStack, MonadIO m, IsContext a, IsClass b) => a -> Text -> Int64 -> Ptr () -> Maybe b -> Text -> Word32 -> m (Value, Value) -- | Evaluate code in context using -- uri as the source URI. The lineNumber -- is the starting line number in uri; the value is -- one-based so the first line is 1. uri and -- lineNumber will be shown in exceptions and they don't -- affect the behavior of the script. contextEvaluateWithSourceUri :: (HasCallStack, MonadIO m, IsContext a) => a -> Text -> Int64 -> Text -> Word32 -> m Value -- | Get the Context that is currently executing a function. This -- should only be called within a function or method callback, otherwise -- Nothing will be returned. contextGetCurrent :: (HasCallStack, MonadIO m) => m (Maybe Context) -- | Get the last unhandled exception thrown in context by -- API functions calls. contextGetException :: (HasCallStack, MonadIO m, IsContext a) => a -> m (Maybe Exception) -- | Get a Value referencing the context global -- object contextGetGlobalObject :: (HasCallStack, MonadIO m, IsContext a) => a -> m Value -- | Get a property of context global object with -- name. contextGetValue :: (HasCallStack, MonadIO m, IsContext a) => a -> Text -> m Value -- | Get the VirtualMachine where context was -- created. contextGetVirtualMachine :: (HasCallStack, MonadIO m, IsContext a) => a -> m VirtualMachine -- | Create a new Context. The context is created in a new -- VirtualMachine. Use contextNewWithVirtualMachine to -- create a new Context in an existing VirtualMachine. contextNew :: (HasCallStack, MonadIO m) => m Context -- | Create a new Context in virtualMachine. contextNewWithVirtualMachine :: (HasCallStack, MonadIO m, IsVirtualMachine a) => a -> m Context -- | Remove the last ExceptionHandler previously pushed to -- context with contextPushExceptionHandler. contextPopExceptionHandler :: (HasCallStack, MonadIO m, IsContext a) => a -> m () -- | Push an exception handler in context. Whenever a -- JavaScript exception happens in the Context, the given -- handler will be called. The default -- ExceptionHandler simply calls contextThrowException to -- throw the exception to the Context. If you don't want to catch -- the exception, but only get notified about it, call -- contextThrowException in handler like the -- default one does. The last exception handler pushed is the only one -- used by the Context, use contextPopExceptionHandler to -- remove it and set the previous one. When handler is -- removed from the context, destroyNotify i called with -- userData as parameter. contextPushExceptionHandler :: (HasCallStack, MonadIO m, IsContext a) => a -> ExceptionHandler -> m () -- | Register a custom class in context using the given -- name. If the new class inherits from another -- Class, the parent should be passed as -- parentClass, otherwise Nothing 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 Class is cleared in the context, -- destroyNotify is called with the instance as -- parameter. contextRegisterClass :: (HasCallStack, MonadIO m, IsContext a, IsClass b) => a -> Text -> Maybe b -> Maybe ClassVTable -> Maybe DestroyNotify -> m Class -- | Set a property of context global object with -- name and value. contextSetValue :: (HasCallStack, MonadIO m, IsContext a, IsValue b) => a -> Text -> b -> m () -- | Throw an exception to context using the given error -- message. The created Exception can be retrieved with -- contextGetException. contextThrow :: (HasCallStack, MonadIO m, IsContext a) => a -> Text -> m () -- | Throw exception to context. contextThrowException :: (HasCallStack, MonadIO m, IsContext a, IsException b) => a -> b -> m () -- | Throw an exception to context using the given error -- name and message. The created Exception can be retrieved with -- contextGetException. contextThrowWithName :: (HasCallStack, MonadIO m, IsContext a) => a -> Text -> Text -> m () -- | Construct a GValueConstruct with valid value for the -- “virtual-machine” property. This is rarely needed directly, -- but it is used by new. constructContextVirtualMachine :: (IsContext o, MonadIO m, IsVirtualMachine a) => a -> m (GValueConstruct o) -- | Get the value of the “virtual-machine” property. When -- overloading is enabled, this is equivalent to -- --
--   get context #virtualMachine
--   
getContextVirtualMachine :: (MonadIO m, IsContext o) => o -> m VirtualMachine instance GHC.Classes.Eq GI.JavaScriptCore.Objects.Context.Context instance (Data.GI.Base.BasicTypes.GObject o, Data.GI.Base.Overloading.IsDescendantOf GI.JavaScriptCore.Objects.Context.Context o) => GI.JavaScriptCore.Objects.Context.IsContext o instance Data.GI.Base.BasicTypes.ManagedPtrNewtype GI.JavaScriptCore.Objects.Context.Context instance Data.GI.Base.BasicTypes.TypedObject GI.JavaScriptCore.Objects.Context.Context instance Data.GI.Base.BasicTypes.GObject GI.JavaScriptCore.Objects.Context.Context instance Data.GI.Base.Overloading.HasParentTypes GI.JavaScriptCore.Objects.Context.Context instance Data.GI.Base.GValue.IsGValue (GHC.Maybe.Maybe GI.JavaScriptCore.Objects.Context.Context) module GI.JavaScriptCore.Objects module GI.JavaScriptCore