| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Properties.Unsafe
Synopsis
- sDL_GetGlobalProperties :: IO SDL_PropertiesID
- sDL_CreateProperties :: IO SDL_PropertiesID
- sDL_CopyProperties :: SDL_PropertiesID -> SDL_PropertiesID -> IO CBool
- sDL_LockProperties :: SDL_PropertiesID -> IO CBool
- sDL_UnlockProperties :: SDL_PropertiesID -> IO ()
- sDL_SetPointerPropertyWithCleanup :: SDL_PropertiesID -> PtrConst CChar -> Ptr Void -> SDL_CleanupPropertyCallback -> Ptr Void -> IO CBool
- sDL_SetPointerProperty :: SDL_PropertiesID -> PtrConst CChar -> Ptr Void -> IO CBool
- sDL_SetStringProperty :: SDL_PropertiesID -> PtrConst CChar -> PtrConst CChar -> IO CBool
- sDL_SetNumberProperty :: SDL_PropertiesID -> PtrConst CChar -> Sint64 -> IO CBool
- sDL_SetFloatProperty :: SDL_PropertiesID -> PtrConst CChar -> CFloat -> IO CBool
- sDL_SetBooleanProperty :: SDL_PropertiesID -> PtrConst CChar -> CBool -> IO CBool
- sDL_HasProperty :: SDL_PropertiesID -> PtrConst CChar -> IO CBool
- sDL_GetPropertyType :: SDL_PropertiesID -> PtrConst CChar -> IO SDL_PropertyType
- sDL_GetPointerProperty :: SDL_PropertiesID -> PtrConst CChar -> Ptr Void -> IO (Ptr Void)
- sDL_GetStringProperty :: SDL_PropertiesID -> PtrConst CChar -> PtrConst CChar -> IO (PtrConst CChar)
- sDL_GetNumberProperty :: SDL_PropertiesID -> PtrConst CChar -> Sint64 -> IO Sint64
- sDL_GetFloatProperty :: SDL_PropertiesID -> PtrConst CChar -> CFloat -> IO CFloat
- sDL_GetBooleanProperty :: SDL_PropertiesID -> PtrConst CChar -> CBool -> IO CBool
- sDL_ClearProperty :: SDL_PropertiesID -> PtrConst CChar -> IO CBool
- sDL_EnumerateProperties :: SDL_PropertiesID -> SDL_EnumeratePropertiesCallback -> Ptr Void -> IO CBool
- sDL_DestroyProperties :: SDL_PropertiesID -> IO ()
Documentation
sDL_GetGlobalProperties :: IO SDL_PropertiesID Source #
Get the global SDL properties.
- Returns
- a valid property ID on success or 0 on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_GetGlobalProperties, defined atSDL3/SDL_properties.h 118:46
Since: 3.2.0
sDL_CreateProperties :: IO SDL_PropertiesID Source #
Create a group of properties.
All properties are automatically destroyed when SDL_Quit() is called.
- Returns
- an ID for a new group of properties, or 0 on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_DestroyProperties- C declaration
SDL_CreateProperties, defined atSDL3/SDL_properties.h 134:46
Since: 3.2.0
Arguments
| :: SDL_PropertiesID |
|
| -> SDL_PropertiesID |
|
| -> IO CBool |
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 SDL_SetPointerPropertyWithCleanup()), which will not be copied. Any property that already exists on dst will be overwritten.
- Returns
- true on success or false on failure; call SDL_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.
- C declaration
SDL_CopyProperties, defined atSDL3/SDL_properties.h 155:34
Since: 3.2.0
Arguments
| :: SDL_PropertiesID |
|
| -> IO CBool |
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 SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_UnlockProperties- C declaration
SDL_LockProperties, defined atSDL3/SDL_properties.h 179:34
Since: 3.2.0
Arguments
| :: SDL_PropertiesID |
|
| -> IO () |
Unlock a group of properties.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_LockProperties- C declaration
SDL_UnlockProperties, defined atSDL3/SDL_properties.h 192:34
Since: 3.2.0
sDL_SetPointerPropertyWithCleanup Source #
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> Ptr Void |
|
| -> SDL_CleanupPropertyCallback |
|
| -> Ptr Void |
|
| -> IO CBool |
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 SDL_SetNumberProperty, SDL_SetBooleanProperty, or SDL_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 SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetPointerProperty,sDL_SetPointerProperty,SDL_CleanupPropertyCallback- C declaration
SDL_SetPointerPropertyWithCleanup, defined atSDL3/SDL_properties.h 247:34
Since: 3.2.0
sDL_SetPointerProperty Source #
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> Ptr Void |
|
| -> IO CBool |
Set a pointer property in a group of properties.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetPointerProperty,sDL_HasProperty,sDL_SetBooleanProperty,sDL_SetFloatProperty,sDL_SetNumberProperty,sDL_SetPointerPropertyWithCleanup,sDL_SetStringProperty- C declaration
SDL_SetPointerProperty, defined atSDL3/SDL_properties.h 270:34
Since: 3.2.0
sDL_SetStringProperty Source #
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> PtrConst CChar |
|
| -> IO CBool |
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 SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetStringProperty- C declaration
SDL_SetStringProperty, defined atSDL3/SDL_properties.h 290:34
Since: 3.2.0
sDL_SetNumberProperty Source #
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> Sint64 |
|
| -> IO CBool |
Set an integer property in a group of properties.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetNumberProperty- C declaration
SDL_SetNumberProperty, defined atSDL3/SDL_properties.h 307:34
Since: 3.2.0
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> CFloat |
|
| -> IO CBool |
Set a floating point property in a group of properties.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetFloatProperty- C declaration
SDL_SetFloatProperty, defined atSDL3/SDL_properties.h 324:34
Since: 3.2.0
sDL_SetBooleanProperty Source #
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> CBool |
|
| -> IO CBool |
Set a boolean property in a group of properties.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetBooleanProperty- C declaration
SDL_SetBooleanProperty, defined atSDL3/SDL_properties.h 341:34
Since: 3.2.0
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> IO CBool |
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
sDL_GetPropertyType- C declaration
SDL_HasProperty, defined atSDL3/SDL_properties.h 356:34
Since: 3.2.0
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> 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
sDL_HasProperty- C declaration
SDL_GetPropertyType, defined atSDL3/SDL_properties.h 372:46
Since: 3.2.0
sDL_GetPointerProperty Source #
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> Ptr Void |
|
| -> 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_valueif 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
SDL_SetPointerProperty()orSDL_ClearProperty()on these properties from another thread. If you need to avoid this, useSDL_LockProperties()andSDL_UnlockProperties(). - See also
sDL_GetBooleanProperty,sDL_GetFloatProperty,sDL_GetNumberProperty,sDL_GetPropertyType,sDL_GetStringProperty,sDL_HasProperty,sDL_SetPointerProperty- C declaration
SDL_GetPointerProperty, defined atSDL3/SDL_properties.h 405:36
Since: 3.2.0
sDL_GetStringProperty Source #
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> PtrConst CChar |
|
| -> IO (PtrConst CChar) |
Get a string property from a group of properties.
- Returns
- the value of the property, or
default_valueif 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
SDL_SetStringProperty()orSDL_ClearProperty()on these properties from another thread. If you need to avoid this, useSDL_LockProperties()andSDL_UnlockProperties(). - See also
sDL_GetPropertyType,sDL_HasProperty,sDL_SetStringProperty- C declaration
SDL_GetStringProperty, defined atSDL3/SDL_properties.h 429:42
Since: 3.2.0
sDL_GetNumberProperty Source #
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> Sint64 |
|
| -> IO Sint64 |
Get a number property from a group of properties.
You can use SDL_GetPropertyType() to query whether the property exists and is a number property.
- Returns
- the value of the property, or
default_valueif it is not set or not a number property. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetPropertyType,sDL_HasProperty,sDL_SetNumberProperty- C declaration
SDL_GetNumberProperty, defined atSDL3/SDL_properties.h 451:36
Since: 3.2.0
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> CFloat |
|
| -> IO CFloat |
Get a floating point property from a group of properties.
You can use SDL_GetPropertyType() to query whether the property exists and is a floating point property.
- Returns
- the value of the property, or
default_valueif it is not set or not a float property. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetPropertyType,sDL_HasProperty,sDL_SetFloatProperty- C declaration
SDL_GetFloatProperty, defined atSDL3/SDL_properties.h 473:35
Since: 3.2.0
sDL_GetBooleanProperty Source #
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> CBool |
|
| -> IO CBool |
Get a boolean property from a group of properties.
You can use SDL_GetPropertyType() to query whether the property exists and is a boolean property.
- Returns
- the value of the property, or
default_valueif it is not set or not a boolean property. - Thread safety
- It is safe to call this function from any thread.
- See also
sDL_GetPropertyType,sDL_HasProperty,sDL_SetBooleanProperty- C declaration
SDL_GetBooleanProperty, defined atSDL3/SDL_properties.h 495:34
Since: 3.2.0
Arguments
| :: SDL_PropertiesID |
|
| -> PtrConst CChar |
|
| -> IO CBool |
Clear a property from a group of properties.
- Returns
- true on success or false on failure; call SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_ClearProperty, defined atSDL3/SDL_properties.h 509:34
Since: 3.2.0
sDL_EnumerateProperties Source #
Arguments
| :: SDL_PropertiesID |
|
| -> SDL_EnumeratePropertiesCallback |
|
| -> Ptr Void |
|
| -> IO CBool |
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 SDL_GetError() for more information.
- Thread safety
- It is safe to call this function from any thread.
- C declaration
SDL_EnumerateProperties, defined atSDL3/SDL_properties.h 546:34
Since: 3.2.0
sDL_DestroyProperties Source #
Arguments
| :: SDL_PropertiesID |
|
| -> 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
sDL_CreateProperties- C declaration
SDL_DestroyProperties, defined atSDL3/SDL_properties.h 564:34
Since: 3.2.0