sdl3-bindgen-sys
Safe HaskellNone
LanguageGHC2021

SDL3.Sys.Properties

Description

A property is a variable that can be created and retrieved by name at runtime.

All properties are part of a property group (SDL_PropertiesID). A property group can be created with the createProperties function and destroyed with the destroyProperties function.

Properties can be added to and retrieved from a property group through the following functions:

Properties can be removed from a group by using clearProperty. An ID that represents a properties set.

FFI conventions

Unsuffixed aliases are unsafe foreign imports; aliases suffixed Safe are safe. Functions whose callbacks fire during the call export only the Safe alias (the genuine unsafe import stays reachable under SDL3.Sys.Bindgen.Properties.Unsafe); functions curated unsafe-only export only the unsuffixed one. Each alias's documentation records its flavor and rationale.

Full conventions: SDL3.Sys.

Since: 3.2.0

Synopsis

Documentation

Function aliases

getGlobalProperties :: IO SDL_PropertiesID Source #

Get the global SDL properties.

Returns
a valid property ID on success or 0 on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_GetGlobalProperties. The safe flavor is getGlobalPropertiesSafe .
C declaration
SDL_GetGlobalProperties, defined at SDL3/SDL_properties.h 118:46

Since: 3.2.0

getGlobalPropertiesSafe :: IO SDL_PropertiesID Source #

Get the global SDL properties.

Returns
a valid property ID on success or 0 on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_GetGlobalProperties. The unsafe flavor is getGlobalProperties .
C declaration
SDL_GetGlobalProperties, defined at SDL3/SDL_properties.h 118:46

Since: 3.2.0

createProperties :: IO SDL_PropertiesID Source #

Create a group of properties.

All properties are automatically destroyed when quit is called.

Returns
an ID for a new group of properties, or 0 on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
destroyProperties

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_CreateProperties. The safe flavor is createPropertiesSafe .
C declaration
SDL_CreateProperties, defined at SDL3/SDL_properties.h 134:46

Since: 3.2.0

createPropertiesSafe :: IO SDL_PropertiesID Source #

Create a group of properties.

All properties are automatically destroyed when quit is called.

Returns
an ID for a new group of properties, or 0 on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
destroyProperties

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_CreateProperties. The unsafe flavor is createProperties .
C declaration
SDL_CreateProperties, defined at SDL3/SDL_properties.h 134:46

Since: 3.2.0

copyProperties Source #

Arguments

:: SDL_PropertiesID
src
the properties to copy.
-> SDL_PropertiesID
dst
the destination properties.
-> IO Bool 

Copy a group of properties.

Copy all the properties from one group of properties to another, with the exception of properties requiring cleanup (set using setPointerPropertyWithCleanupSafe), which will not be copied. Any property that already exists on dst will be overwritten.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread. This function acquires simultaneous mutex locks on both the source and destination property sets.

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_CopyProperties. The safe flavor is copyPropertiesSafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_CopyProperties, defined at SDL3/SDL_properties.h 155:34

Since: 3.2.0

copyPropertiesSafe Source #

Arguments

:: SDL_PropertiesID
src
the properties to copy.
-> SDL_PropertiesID
dst
the destination properties.
-> IO Bool 

Copy a group of properties.

Copy all the properties from one group of properties to another, with the exception of properties requiring cleanup (set using setPointerPropertyWithCleanupSafe), which will not be copied. Any property that already exists on dst will be overwritten.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread. This function acquires simultaneous mutex locks on both the source and destination property sets.

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_CopyProperties. The unsafe flavor is copyProperties .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_CopyProperties, defined at SDL3/SDL_properties.h 155:34

Since: 3.2.0

lockProperties Source #

Arguments

:: SDL_PropertiesID
props
the properties to lock.
-> IO Bool 

Lock a group of properties.

Obtain a multi-threaded lock for these properties. Other threads will wait while trying to lock these properties until they are unlocked. Properties must be unlocked before they are destroyed.

The lock is automatically taken when setting individual properties, this function is only needed when you want to set several properties atomically or want to guarantee that properties being queried aren't freed in another thread.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
unlockProperties

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_LockProperties. The safe flavor is lockPropertiesSafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_LockProperties, defined at SDL3/SDL_properties.h 179:34

Since: 3.2.0

lockPropertiesSafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to lock.
-> IO Bool 

Lock a group of properties.

Obtain a multi-threaded lock for these properties. Other threads will wait while trying to lock these properties until they are unlocked. Properties must be unlocked before they are destroyed.

The lock is automatically taken when setting individual properties, this function is only needed when you want to set several properties atomically or want to guarantee that properties being queried aren't freed in another thread.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
unlockProperties

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_LockProperties. The unsafe flavor is lockProperties .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_LockProperties, defined at SDL3/SDL_properties.h 179:34

Since: 3.2.0

unlockProperties Source #

Arguments

:: SDL_PropertiesID
props
the properties to unlock.
-> IO () 

Unlock a group of properties.

Thread safety
It is safe to call this function from any thread.
See also
lockProperties

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_UnlockProperties. The safe flavor is unlockPropertiesSafe .
C declaration
SDL_UnlockProperties, defined at SDL3/SDL_properties.h 192:34

Since: 3.2.0

unlockPropertiesSafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to unlock.
-> IO () 

Unlock a group of properties.

Thread safety
It is safe to call this function from any thread.
See also
lockProperties

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_UnlockProperties. The unsafe flavor is unlockProperties .
C declaration
SDL_UnlockProperties, defined at SDL3/SDL_properties.h 192:34

Since: 3.2.0

setPointerPropertyWithCleanupSafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> Ptr Void
value
the new value of the property, or NULL to delete the property.
-> SDL_CleanupPropertyCallback
cleanup
the function to call when this property is deleted, or NULL if no cleanup is necessary.
-> Ptr Void
userdata
a pointer that is passed to the cleanup function.
-> IO Bool 

Set a pointer property in a group of properties with a cleanup function that is called when the property is deleted.

The cleanup function is also called if setting the property fails for any reason.

For simply setting basic data types, like numbers, bools, or strings, use setNumberProperty, setBooleanProperty, or setStringProperty instead, as those functions will handle cleanup on your behalf. This function is only for more complex, custom data.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getPointerProperty, setPointerProperty, SDL_CleanupPropertyCallback

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_SetPointerPropertyWithCleanup. The unsafe import is not exported : invokes the cleanup callback synchronously on failure or overwrite. If your callback is a non-Haskell function pointer that never re-enters the Haskell runtime, the unsafe import remains available as SDL3.Sys.Bindgen.Properties.Unsafe.sDL_SetPointerPropertyWithCleanup.
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetPointerPropertyWithCleanup, defined at SDL3/SDL_properties.h 247:34

Since: 3.2.0

setPointerProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> Ptr Void
value
the new value of the property, or NULL to delete the property.
-> IO Bool 

Set a pointer property in a group of properties.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getPointerProperty, hasProperty, setBooleanProperty, setFloatProperty, setNumberProperty, setPointerPropertyWithCleanupSafe, setStringProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_SetPointerProperty. The safe flavor is setPointerPropertySafe : overwriting a cleanup property invokes its cleanup synchronously.
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetPointerProperty, defined at SDL3/SDL_properties.h 270:34

Since: 3.2.0

setPointerPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> Ptr Void
value
the new value of the property, or NULL to delete the property.
-> IO Bool 

Set a pointer property in a group of properties.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getPointerProperty, hasProperty, setBooleanProperty, setFloatProperty, setNumberProperty, setPointerPropertyWithCleanupSafe, setStringProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_SetPointerProperty. The unsafe flavor is setPointerProperty : overwriting a cleanup property invokes its cleanup synchronously.
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetPointerProperty, defined at SDL3/SDL_properties.h 270:34

Since: 3.2.0

setStringProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> PtrConst CChar
value
the new value of the property, or NULL to delete the property.
-> IO Bool 

Set a string property in a group of properties.

This function makes a copy of the string; the caller does not have to preserve the data after this call completes.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getStringProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_SetStringProperty. The safe flavor is setStringPropertySafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetStringProperty, defined at SDL3/SDL_properties.h 290:34

Since: 3.2.0

setStringPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> PtrConst CChar
value
the new value of the property, or NULL to delete the property.
-> IO Bool 

Set a string property in a group of properties.

This function makes a copy of the string; the caller does not have to preserve the data after this call completes.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getStringProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_SetStringProperty. The unsafe flavor is setStringProperty .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetStringProperty, defined at SDL3/SDL_properties.h 290:34

Since: 3.2.0

setNumberProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> Int64
value
the new value of the property.
-> IO Bool 

Set an integer property in a group of properties.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getNumberProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_SetNumberProperty. The safe flavor is setNumberPropertySafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetNumberProperty, defined at SDL3/SDL_properties.h 307:34

Since: 3.2.0

setNumberPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> Int64
value
the new value of the property.
-> IO Bool 

Set an integer property in a group of properties.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getNumberProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_SetNumberProperty. The unsafe flavor is setNumberProperty .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetNumberProperty, defined at SDL3/SDL_properties.h 307:34

Since: 3.2.0

setFloatProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> Float
value
the new value of the property.
-> IO Bool 

Set a floating point property in a group of properties.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getFloatProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_SetFloatProperty. The safe flavor is setFloatPropertySafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetFloatProperty, defined at SDL3/SDL_properties.h 324:34

Since: 3.2.0

setFloatPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> Float
value
the new value of the property.
-> IO Bool 

Set a floating point property in a group of properties.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getFloatProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_SetFloatProperty. The unsafe flavor is setFloatProperty .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetFloatProperty, defined at SDL3/SDL_properties.h 324:34

Since: 3.2.0

setBooleanProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> Bool
value
the new value of the property.
-> IO Bool 

Set a boolean property in a group of properties.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getBooleanProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_SetBooleanProperty. The safe flavor is setBooleanPropertySafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetBooleanProperty, defined at SDL3/SDL_properties.h 341:34

Since: 3.2.0

setBooleanPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to modify.
-> Bool
value
the new value of the property.
-> IO Bool 

Set a boolean property in a group of properties.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.
See also
getBooleanProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_SetBooleanProperty. The unsafe flavor is setBooleanProperty .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_SetBooleanProperty, defined at SDL3/SDL_properties.h 341:34

Since: 3.2.0

hasProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> IO Bool 

Return whether a property exists in a group of properties.

Returns
true if the property exists, or false if it doesn't.
Thread safety
It is safe to call this function from any thread.
See also
getPropertyType

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_HasProperty. The safe flavor is hasPropertySafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_HasProperty, defined at SDL3/SDL_properties.h 356:34

Since: 3.2.0

hasPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> IO Bool 

Return whether a property exists in a group of properties.

Returns
true if the property exists, or false if it doesn't.
Thread safety
It is safe to call this function from any thread.
See also
getPropertyType

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_HasProperty. The unsafe flavor is hasProperty .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_HasProperty, defined at SDL3/SDL_properties.h 356:34

Since: 3.2.0

getPropertyType Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> IO SDL_PropertyType 

Get the type of a property in a group of properties.

Returns
the type of the property, or SDL_PROPERTY_TYPE_INVALID if it is not set.
Thread safety
It is safe to call this function from any thread.
See also
hasProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_GetPropertyType. The safe flavor is getPropertyTypeSafe .
C declaration
SDL_GetPropertyType, defined at SDL3/SDL_properties.h 372:46

Since: 3.2.0

getPropertyTypeSafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> IO SDL_PropertyType 

Get the type of a property in a group of properties.

Returns
the type of the property, or SDL_PROPERTY_TYPE_INVALID if it is not set.
Thread safety
It is safe to call this function from any thread.
See also
hasProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_GetPropertyType. The unsafe flavor is getPropertyType .
C declaration
SDL_GetPropertyType, defined at SDL3/SDL_properties.h 372:46

Since: 3.2.0

getPointerProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> Ptr Void
default_value
the default value of the property.
-> IO (Ptr Void) 

Get a pointer property from a group of properties.

By convention, the names of properties that SDL exposes on objects will start with "SDL.", and properties that SDL uses internally will start with "SDL.internal.". These should be considered read-only and should not be modified by applications.

Returns
the value of the property, or default_value if it is not set or not a pointer property.
Thread safety
It is safe to call this function from any thread, although the data returned is not protected and could potentially be freed if you call setPointerProperty or clearProperty on these properties from another thread. If you need to avoid this, use lockProperties and unlockProperties.
See also
getBooleanProperty, getFloatProperty, getNumberProperty, getPropertyType, getStringProperty, hasProperty, setPointerProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_GetPointerProperty. The safe flavor is getPointerPropertySafe .
C declaration
SDL_GetPointerProperty, defined at SDL3/SDL_properties.h 405:36

Since: 3.2.0

getPointerPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> Ptr Void
default_value
the default value of the property.
-> IO (Ptr Void) 

Get a pointer property from a group of properties.

By convention, the names of properties that SDL exposes on objects will start with "SDL.", and properties that SDL uses internally will start with "SDL.internal.". These should be considered read-only and should not be modified by applications.

Returns
the value of the property, or default_value if it is not set or not a pointer property.
Thread safety
It is safe to call this function from any thread, although the data returned is not protected and could potentially be freed if you call setPointerProperty or clearProperty on these properties from another thread. If you need to avoid this, use lockProperties and unlockProperties.
See also
getBooleanProperty, getFloatProperty, getNumberProperty, getPropertyType, getStringProperty, hasProperty, setPointerProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_GetPointerProperty. The unsafe flavor is getPointerProperty .
C declaration
SDL_GetPointerProperty, defined at SDL3/SDL_properties.h 405:36

Since: 3.2.0

getStringProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> PtrConst CChar
default_value
the default value of the property.
-> IO (PtrConst CChar) 

Get a string property from a group of properties.

Returns
the value of the property, or default_value if it is not set or not a string property.
Thread safety
It is safe to call this function from any thread, although the data returned is not protected and could potentially be freed if you call setStringProperty or clearProperty on these properties from another thread. If you need to avoid this, use lockProperties and unlockProperties.
See also
getPropertyType, hasProperty, setStringProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_GetStringProperty. The safe flavor is getStringPropertySafe .
C declaration
SDL_GetStringProperty, defined at SDL3/SDL_properties.h 429:42

Since: 3.2.0

getStringPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> PtrConst CChar
default_value
the default value of the property.
-> IO (PtrConst CChar) 

Get a string property from a group of properties.

Returns
the value of the property, or default_value if it is not set or not a string property.
Thread safety
It is safe to call this function from any thread, although the data returned is not protected and could potentially be freed if you call setStringProperty or clearProperty on these properties from another thread. If you need to avoid this, use lockProperties and unlockProperties.
See also
getPropertyType, hasProperty, setStringProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_GetStringProperty. The unsafe flavor is getStringProperty .
C declaration
SDL_GetStringProperty, defined at SDL3/SDL_properties.h 429:42

Since: 3.2.0

getNumberProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> Int64
default_value
the default value of the property.
-> IO Int64 

Get a number property from a group of properties.

You can use getPropertyType to query whether the property exists and is a number property.

Returns
the value of the property, or default_value if it is not set or not a number property.
Thread safety
It is safe to call this function from any thread.
See also
getPropertyType, hasProperty, setNumberProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_GetNumberProperty. The safe flavor is getNumberPropertySafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_GetNumberProperty, defined at SDL3/SDL_properties.h 451:36

Since: 3.2.0

getNumberPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> Int64
default_value
the default value of the property.
-> IO Int64 

Get a number property from a group of properties.

You can use getPropertyType to query whether the property exists and is a number property.

Returns
the value of the property, or default_value if it is not set or not a number property.
Thread safety
It is safe to call this function from any thread.
See also
getPropertyType, hasProperty, setNumberProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_GetNumberProperty. The unsafe flavor is getNumberProperty .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_GetNumberProperty, defined at SDL3/SDL_properties.h 451:36

Since: 3.2.0

getFloatProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> Float
default_value
the default value of the property.
-> IO Float 

Get a floating point property from a group of properties.

You can use getPropertyType to query whether the property exists and is a floating point property.

Returns
the value of the property, or default_value if it is not set or not a float property.
Thread safety
It is safe to call this function from any thread.
See also
getPropertyType, hasProperty, setFloatProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_GetFloatProperty. The safe flavor is getFloatPropertySafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_GetFloatProperty, defined at SDL3/SDL_properties.h 473:35

Since: 3.2.0

getFloatPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> Float
default_value
the default value of the property.
-> IO Float 

Get a floating point property from a group of properties.

You can use getPropertyType to query whether the property exists and is a floating point property.

Returns
the value of the property, or default_value if it is not set or not a float property.
Thread safety
It is safe to call this function from any thread.
See also
getPropertyType, hasProperty, setFloatProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_GetFloatProperty. The unsafe flavor is getFloatProperty .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_GetFloatProperty, defined at SDL3/SDL_properties.h 473:35

Since: 3.2.0

getBooleanProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> Bool
default_value
the default value of the property.
-> IO Bool 

Get a boolean property from a group of properties.

You can use getPropertyType to query whether the property exists and is a boolean property.

Returns
the value of the property, or default_value if it is not set or not a boolean property.
Thread safety
It is safe to call this function from any thread.
See also
getPropertyType, hasProperty, setBooleanProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_GetBooleanProperty. The safe flavor is getBooleanPropertySafe .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_GetBooleanProperty, defined at SDL3/SDL_properties.h 495:34

Since: 3.2.0

getBooleanPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> PtrConst CChar
name
the name of the property to query.
-> Bool
default_value
the default value of the property.
-> IO Bool 

Get a boolean property from a group of properties.

You can use getPropertyType to query whether the property exists and is a boolean property.

Returns
the value of the property, or default_value if it is not set or not a boolean property.
Thread safety
It is safe to call this function from any thread.
See also
getPropertyType, hasProperty, setBooleanProperty

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_GetBooleanProperty. The unsafe flavor is getBooleanProperty .
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_GetBooleanProperty, defined at SDL3/SDL_properties.h 495:34

Since: 3.2.0

clearProperty Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to clear.
-> IO Bool 

Clear a property from a group of properties.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_ClearProperty. The safe flavor is clearPropertySafe : clearing a cleanup property invokes its cleanup synchronously.
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_ClearProperty, defined at SDL3/SDL_properties.h 509:34

Since: 3.2.0

clearPropertySafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to modify.
-> PtrConst CChar
name
the name of the property to clear.
-> IO Bool 

Clear a property from a group of properties.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_ClearProperty. The unsafe flavor is clearProperty : clearing a cleanup property invokes its cleanup synchronously.
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_ClearProperty, defined at SDL3/SDL_properties.h 509:34

Since: 3.2.0

enumeratePropertiesSafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to query.
-> SDL_EnumeratePropertiesCallback
callback
the function to call for each property.
-> Ptr Void
userdata
a pointer that is passed to callback.
-> IO Bool 

Enumerate the properties contained in a group of properties.

The callback function is called for each property in the group of properties. The properties are locked during enumeration.

Returns
true on success or false on failure; call getError for more information.
Thread safety
It is safe to call this function from any thread.

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_EnumerateProperties. The unsafe import is not exported : invokes the callback per property synchronously. If your callback is a non-Haskell function pointer that never re-enters the Haskell runtime, the unsafe import remains available as SDL3.Sys.Bindgen.Properties.Unsafe.sDL_EnumerateProperties.
Scalars
The binding generation has mapped C scalars to native Haskell scalars for this function. Pointers and structs are untouched by this best-effort mapping. Higher-level bindings are expected to map structs and pointers as appropriate.
C declaration
SDL_EnumerateProperties, defined at SDL3/SDL_properties.h 546:34

Since: 3.2.0

destroyProperties Source #

Arguments

:: SDL_PropertiesID
props
the properties to destroy.
-> IO () 

Destroy a group of properties.

All properties are deleted and their cleanup functions will be called, if any.

Thread safety
This function should not be called while these properties are locked or other threads might be setting or getting values from these properties.
See also
createProperties

sdl3-bindgen-sys notes

Expand
FFI safety
Unsafe foreign import of SDL_DestroyProperties. The safe flavor is destroyPropertiesSafe : invokes cleanup callbacks synchronously.
C declaration
SDL_DestroyProperties, defined at SDL3/SDL_properties.h 564:34

Since: 3.2.0

destroyPropertiesSafe Source #

Arguments

:: SDL_PropertiesID
props
the properties to destroy.
-> IO () 

Destroy a group of properties.

All properties are deleted and their cleanup functions will be called, if any.

Thread safety
This function should not be called while these properties are locked or other threads might be setting or getting values from these properties.
See also
createProperties

sdl3-bindgen-sys notes

Expand
FFI safety
Safe foreign import of SDL_DestroyProperties. The unsafe flavor is destroyProperties : invokes cleanup callbacks synchronously.
C declaration
SDL_DestroyProperties, defined at SDL3/SDL_properties.h 564:34

Since: 3.2.0