| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Hints
Contents
Description
This file contains functions to set and get configuration hints, as well as listing each of them alphabetically.
The convention for naming hints is SDL_HINT_X, where "SDL_X" is the environment variable that can be used to override the default.
In general these hints are just that - they may or may not be supported or applicable on any given platform, but they provide a way for an application or user to give the library a hint as to how they would like the library to work. Specify the behavior of Alt+Tab while the keyboard is grabbed.
By default, SDL emulates Alt+Tab functionality while the keyboard is grabbed and your window is full-screen. This prevents the user from getting stuck in your application if you've enabled keyboard grab.
The variable can be set to the following values:
- "0": SDL will not handle Alt+Tab. Your application is responsible for handling Alt+Tab while the keyboard is grabbed.
- "1": SDL will minimize your window when Alt+Tab is pressed (default)
This hint can be set anytime.
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.Hints.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
- module SDL3.Sys.Bindgen.Hints
- setHintWithPriority :: PtrConst CChar -> PtrConst CChar -> SDL_HintPriority -> IO Bool
- setHintWithPrioritySafe :: PtrConst CChar -> PtrConst CChar -> SDL_HintPriority -> IO Bool
- setHint :: PtrConst CChar -> PtrConst CChar -> IO Bool
- setHintSafe :: PtrConst CChar -> PtrConst CChar -> IO Bool
- resetHint :: PtrConst CChar -> IO Bool
- resetHintSafe :: PtrConst CChar -> IO Bool
- resetHints :: IO ()
- resetHintsSafe :: IO ()
- getHint :: PtrConst CChar -> IO (PtrConst CChar)
- getHintSafe :: PtrConst CChar -> IO (PtrConst CChar)
- getHintBoolean :: PtrConst CChar -> Bool -> IO Bool
- getHintBooleanSafe :: PtrConst CChar -> Bool -> IO Bool
- addHintCallbackSafe :: PtrConst CChar -> SDL_HintCallback -> Ptr Void -> IO Bool
- removeHintCallback :: PtrConst CChar -> SDL_HintCallback -> Ptr Void -> IO ()
- removeHintCallbackSafe :: PtrConst CChar -> SDL_HintCallback -> Ptr Void -> IO ()
Documentation
module SDL3.Sys.Bindgen.Hints
Function aliases
Arguments
| :: PtrConst CChar |
|
| -> PtrConst CChar |
|
| -> SDL_HintPriority |
|
| -> IO Bool |
Set a hint with a specific priority.
The priority controls the behavior when setting a hint that already has a value. Hints will replace existing hints of their priority and lower. Environment variables are considered to have override priority.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getHint,resetHint,setHint
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetHintWithPriority. The safe flavor issetHintWithPrioritySafe: runs registered hint callbacks 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_SetHintWithPriority, defined atSDL3/SDL_hints.h 4870:34
Since: 3.2.0
setHintWithPrioritySafe Source #
Arguments
| :: PtrConst CChar |
|
| -> PtrConst CChar |
|
| -> SDL_HintPriority |
|
| -> IO Bool |
Set a hint with a specific priority.
The priority controls the behavior when setting a hint that already has a value. Hints will replace existing hints of their priority and lower. Environment variables are considered to have override priority.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getHint,resetHint,setHint
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetHintWithPriority. The unsafe flavor issetHintWithPriority: runs registered hint callbacks 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_SetHintWithPriority, defined atSDL3/SDL_hints.h 4870:34
Since: 3.2.0
Arguments
| :: PtrConst CChar |
|
| -> PtrConst CChar |
|
| -> IO Bool |
Set a hint with normal priority.
Hints will not be set if there is an existing override hint or environment variable that takes precedence. You can use to set the hint with override priority instead.setHintWithPriority
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getHint,resetHint,setHintWithPriority
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_SetHint. The safe flavor issetHintSafe: runs registered hint callbacks 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_SetHint, defined atSDL3/SDL_hints.h 4892:34
Since: 3.2.0
Arguments
| :: PtrConst CChar |
|
| -> PtrConst CChar |
|
| -> IO Bool |
Set a hint with normal priority.
Hints will not be set if there is an existing override hint or environment variable that takes precedence. You can use to set the hint with override priority instead.setHintWithPriority
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
getHint,resetHint,setHintWithPriority
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_SetHint. The unsafe flavor issetHint: runs registered hint callbacks 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_SetHint, defined atSDL3/SDL_hints.h 4892:34
Since: 3.2.0
Reset a hint to the default value.
This will reset a hint to the value of the environment variable, or NULL if the environment isn't set. Callbacks will be called normally with this change.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setHint,resetHints
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ResetHint. The safe flavor isresetHintSafe: runs registered hint callbacks 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_ResetHint, defined atSDL3/SDL_hints.h 4912:34
Since: 3.2.0
Reset a hint to the default value.
This will reset a hint to the value of the environment variable, or NULL if the environment isn't set. Callbacks will be called normally with this change.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
setHint,resetHints
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ResetHint. The unsafe flavor isresetHint: runs registered hint callbacks 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_ResetHint, defined atSDL3/SDL_hints.h 4912:34
Since: 3.2.0
resetHints :: IO () Source #
Reset all hints to the default values.
This will reset all hints to the value of the associated environment variable, or NULL if the environment isn't set. Callbacks will be called normally with this change.
- Thread safety
- It is safe to call this function from any thread.
- See also
resetHint
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_ResetHints. The safe flavor isresetHintsSafe: runs registered hint callbacks synchronously. - C declaration
SDL_ResetHints, defined atSDL3/SDL_hints.h 4927:34
Since: 3.2.0
resetHintsSafe :: IO () Source #
Reset all hints to the default values.
This will reset all hints to the value of the associated environment variable, or NULL if the environment isn't set. Callbacks will be called normally with this change.
- Thread safety
- It is safe to call this function from any thread.
- See also
resetHint
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_ResetHints. The unsafe flavor isresetHints: runs registered hint callbacks synchronously. - C declaration
SDL_ResetHints, defined atSDL3/SDL_hints.h 4927:34
Since: 3.2.0
Get the value of a hint.
- Returns
- the string value of a hint or NULL if the hint isn't set.
- Thread safety
- It is safe to call this function from any thread.
- See also
setHint,setHintWithPriority
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetHint. The safe flavor isgetHintSafe. - C declaration
SDL_GetHint, defined atSDL3/SDL_hints.h 4942:41
Since: 3.2.0
Get the value of a hint.
- Returns
- the string value of a hint or NULL if the hint isn't set.
- Thread safety
- It is safe to call this function from any thread.
- See also
setHint,setHintWithPriority
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetHint. The unsafe flavor isgetHint. - C declaration
SDL_GetHint, defined atSDL3/SDL_hints.h 4942:41
Since: 3.2.0
Arguments
| :: PtrConst CChar |
|
| -> Bool |
|
| -> IO Bool |
Get the boolean value of a hint variable.
- Returns
- the boolean value of a hint or the provided default value if the hint does not exist.
- Thread safety
- It is safe to call this function from any thread.
- See also
getHint,setHint
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_GetHintBoolean. The safe flavor isgetHintBooleanSafe. - 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_GetHintBoolean, defined atSDL3/SDL_hints.h 4959:34
Since: 3.2.0
Arguments
| :: PtrConst CChar |
|
| -> Bool |
|
| -> IO Bool |
Get the boolean value of a hint variable.
- Returns
- the boolean value of a hint or the provided default value if the hint does not exist.
- Thread safety
- It is safe to call this function from any thread.
- See also
getHint,setHint
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_GetHintBoolean. The unsafe flavor isgetHintBoolean. - 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_GetHintBoolean, defined atSDL3/SDL_hints.h 4959:34
Since: 3.2.0
Arguments
| :: PtrConst CChar |
|
| -> SDL_HintCallback |
|
| -> Ptr Void |
|
| -> IO Bool |
Add a function to watch a particular hint.
The callback function is called during this function, to provide it an initial value, and again each time the hint's value changes.
- Returns
- true on success or false on failure; call
getErrorfor more information. - Thread safety
- It is safe to call this function from any thread.
- See also
removeHintCallback
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_AddHintCallback. The unsafe import is not exported : invokes the callback once immediately with the current hint value. If your callback is a non-Haskell function pointer that never re-enters the Haskell runtime, the unsafe import remains available asSDL3.Sys.Bindgen.Hints.Unsafe.sDL_AddHintCallback. - 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_AddHintCallback, defined atSDL3/SDL_hints.h 5002:34
Since: 3.2.0
Arguments
| :: PtrConst CChar |
|
| -> SDL_HintCallback |
|
| -> Ptr Void |
|
| -> IO () |
Remove a function watching a particular hint.
- Thread safety
- It is safe to call this function from any thread.
- See also
addHintCallbackSafe
sdl3-bindgen-sys notes
- FFI safety
- Unsafe foreign import of
SDL_RemoveHintCallback. The safe flavor isremoveHintCallbackSafe: deregistration only. - C declaration
SDL_RemoveHintCallback, defined atSDL3/SDL_hints.h 5018:34
Since: 3.2.0
removeHintCallbackSafe Source #
Arguments
| :: PtrConst CChar |
|
| -> SDL_HintCallback |
|
| -> Ptr Void |
|
| -> IO () |
Remove a function watching a particular hint.
- Thread safety
- It is safe to call this function from any thread.
- See also
addHintCallbackSafe
sdl3-bindgen-sys notes
- FFI safety
- Safe foreign import of
SDL_RemoveHintCallback. The unsafe flavor isremoveHintCallback: deregistration only. - C declaration
SDL_RemoveHintCallback, defined atSDL3/SDL_hints.h 5018:34
Since: 3.2.0