| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
SDL3.Sys.Bindgen.Dialog.FunPtr
Synopsis
- sDL_ShowOpenFileDialog :: FunPtr (SDL_DialogFileCallback -> Ptr Void -> Ptr SDL_Window -> PtrConst SDL_DialogFileFilter -> CInt -> PtrConst CChar -> CBool -> IO ())
- sDL_ShowSaveFileDialog :: FunPtr (SDL_DialogFileCallback -> Ptr Void -> Ptr SDL_Window -> PtrConst SDL_DialogFileFilter -> CInt -> PtrConst CChar -> IO ())
- sDL_ShowOpenFolderDialog :: FunPtr (SDL_DialogFileCallback -> Ptr Void -> Ptr SDL_Window -> PtrConst CChar -> CBool -> IO ())
- sDL_ShowFileDialogWithProperties :: FunPtr (SDL_FileDialogType -> SDL_DialogFileCallback -> Ptr Void -> SDL_PropertiesID -> IO ())
Documentation
sDL_ShowOpenFileDialog :: FunPtr (SDL_DialogFileCallback -> Ptr Void -> Ptr SDL_Window -> PtrConst SDL_DialogFileFilter -> CInt -> PtrConst CChar -> CBool -> IO ()) Source #
Displays a dialog that lets the user select a file on their filesystem.
This is an asynchronous function; it will return immediately, and the result will be passed to the callback.
The callback will be invoked with a null-terminated list of files the user chose. The list will be empty if the user canceled the dialog, and it will be NULL if an error occurred.
Note that the callback may be called from a different thread than the one the function was invoked on.
Depending on the platform, the user may be allowed to input paths that don't yet exist.
On Linux, dialogs may require XDG Portals, which requires DBus, which requires an event-handling loop. Apps that do not use SDL to handle events should add a call to SDL_PumpEvents in their main loop.
callback- a function pointer to be invoked when the user selects a file and accepts, or cancels the dialog, or an error occurs.
userdata- an optional pointer to pass extra data to the callback when it will be invoked.
window- the window that the dialog should be modal for, may be NULL. Not all platforms support this option.
filters- a list of filters, may be NULL. See the
SDL_DialogFileFilterdocumentation for examples]. Not all platforms support this option, and platforms that do support it may allow the user to ignore the filters. If non-NULL, it must remain valid at least until the callback is invoked. nfilters- the number of filters. Ignored if filters is NULL.
default_location- the default folder or file to start the dialog at, may be NULL. Not all platforms support this option.
allow_many- if non-zero, the user will be allowed to select multiple entries. Not all platforms support this option.
- Thread safety
- This function should be called only from the main thread. The callback may be invoked from the same thread or from a different one, depending on the OS's constraints.
- See also
SDL_DialogFileCallback,SDL_DialogFileFilter,sDL_ShowSaveFileDialog,sDL_ShowOpenFolderDialog,sDL_ShowFileDialogWithProperties- C declaration
SDL_ShowOpenFileDialog, defined atSDL3/SDL_dialog.h 166:34
Since: 3.2.0
sDL_ShowSaveFileDialog :: FunPtr (SDL_DialogFileCallback -> Ptr Void -> Ptr SDL_Window -> PtrConst SDL_DialogFileFilter -> CInt -> PtrConst CChar -> IO ()) Source #
Displays a dialog that lets the user choose a new or existing file on their filesystem.
This is an asynchronous function; it will return immediately, and the result will be passed to the callback.
The callback will be invoked with a null-terminated list of files the user chose. The list will be empty if the user canceled the dialog, and it will be NULL if an error occurred.
Note that the callback may be called from a different thread than the one the function was invoked on.
The chosen file may or may not already exist.
On Linux, dialogs may require XDG Portals, which requires DBus, which requires an event-handling loop. Apps that do not use SDL to handle events should add a call to SDL_PumpEvents in their main loop.
callback- a function pointer to be invoked when the user selects a file and accepts, or cancels the dialog, or an error occurs.
userdata- an optional pointer to pass extra data to the callback when it will be invoked.
window- the window that the dialog should be modal for, may be NULL. Not all platforms support this option.
filters- a list of filters, may be NULL. Not all platforms support this option, and platforms that do support it may allow the user to ignore the filters. If non-NULL, it must remain valid at least until the callback is invoked.
nfilters- the number of filters. Ignored if filters is NULL.
default_location- the default folder or file to start the dialog at, may be NULL. Not all platforms support this option.
- Thread safety
- This function should be called only from the main thread. The callback may be invoked from the same thread or from a different one, depending on the OS's constraints.
- See also
SDL_DialogFileCallback,SDL_DialogFileFilter,sDL_ShowOpenFileDialog,sDL_ShowOpenFolderDialog,sDL_ShowFileDialogWithProperties- C declaration
SDL_ShowSaveFileDialog, defined atSDL3/SDL_dialog.h 215:34
Since: 3.2.0
sDL_ShowOpenFolderDialog :: FunPtr (SDL_DialogFileCallback -> Ptr Void -> Ptr SDL_Window -> PtrConst CChar -> CBool -> IO ()) Source #
Displays a dialog that lets the user select a folder on their filesystem.
This is an asynchronous function; it will return immediately, and the result will be passed to the callback.
The callback will be invoked with a null-terminated list of files the user chose. The list will be empty if the user canceled the dialog, and it will be NULL if an error occurred.
Note that the callback may be called from a different thread than the one the function was invoked on.
Depending on the platform, the user may be allowed to input paths that don't yet exist.
On Linux, dialogs may require XDG Portals, which requires DBus, which requires an event-handling loop. Apps that do not use SDL to handle events should add a call to SDL_PumpEvents in their main loop.
callback- a function pointer to be invoked when the user selects a file and accepts, or cancels the dialog, or an error occurs.
userdata- an optional pointer to pass extra data to the callback when it will be invoked.
window- the window that the dialog should be modal for, may be NULL. Not all platforms support this option.
default_location- the default folder or file to start the dialog at, may be NULL. Not all platforms support this option.
allow_many- if non-zero, the user will be allowed to select multiple entries. Not all platforms support this option.
- Thread safety
- This function should be called only from the main thread. The callback may be invoked from the same thread or from a different one, depending on the OS's constraints.
- See also
SDL_DialogFileCallback,sDL_ShowOpenFileDialog,sDL_ShowSaveFileDialog,sDL_ShowFileDialogWithProperties- C declaration
SDL_ShowOpenFolderDialog, defined atSDL3/SDL_dialog.h 260:34
Since: 3.2.0
sDL_ShowFileDialogWithProperties :: FunPtr (SDL_FileDialogType -> SDL_DialogFileCallback -> Ptr Void -> SDL_PropertiesID -> IO ()) Source #
Create and launch a file dialog with the specified properties.
These are the supported properties:
: a pointer to a list ofsDL_PROP_FILE_DIALOG_FILTERS_POINTERSDL_DialogFileFilterstructs, which will be used as filters for file-based selections. Ignored if the dialog is an "Open Folder" dialog. If non-NULL, the array of filters must remain valid at least until the callback is invoked.: the number of filters in the array of filters, if it exists.sDL_PROP_FILE_DIALOG_NFILTERS_NUMBER: the window that the dialog should be modal for.sDL_PROP_FILE_DIALOG_WINDOW_POINTER: the default folder or file to start the dialog at.sDL_PROP_FILE_DIALOG_LOCATION_STRING: true to allow the user to select more than one entry.sDL_PROP_FILE_DIALOG_MANY_BOOLEAN: the title for the dialog.sDL_PROP_FILE_DIALOG_TITLE_STRING: the label that the accept button should have.sDL_PROP_FILE_DIALOG_ACCEPT_STRING: the label that the cancel button should have.sDL_PROP_FILE_DIALOG_CANCEL_STRING
Note that each platform may or may not support any of the properties.
type- the type of file dialog.
callback- a function pointer to be invoked when the user selects a file and accepts, or cancels the dialog, or an error occurs.
userdata- an optional pointer to pass extra data to the callback when it will be invoked.
props- the properties to use.
- Thread safety
- This function should be called only from the main thread. The callback may be invoked from the same thread or from a different one, depending on the OS's constraints.
- See also
SDL_FileDialogType,SDL_DialogFileCallback,SDL_DialogFileFilter,sDL_ShowOpenFileDialog,sDL_ShowSaveFileDialog,sDL_ShowOpenFolderDialog- C declaration
SDL_ShowFileDialogWithProperties, defined atSDL3/SDL_dialog.h 326:34
Since: 3.2.0