Muteki
EABI code execution on Besta® RTOS devices.
Loading...
Searching...
No Matches
filepicker.h File Reference

Functions related to the file picker modal. More...

#include "../../common.h"

Go to the source code of this file.

Data Structures

struct  ui_filepicker_context_s
 The file picker context. More...

Macros

#define FILEPICKER_CONTEXT_OUTPUT_ALLOC(calloc_impl, entries, is_utf16)
 Allocate output buffer for ui_filepicker_context_t.
#define FILEPICKER_CONTEXT_OUTPUT_MAX_LFN   260
 Max LFN path size for file picker.

Typedefs

typedef struct ui_filepicker_context_s ui_filepicker_context_t
 The file picker context type.

Enumerations

enum  ui_filepicker_flag_e { FILEPICKER_ALLOW_MULTIPLE =0x200 , FILEPICKER_USE_MB =0x40000 }
 Known file picker flags. More...

Functions

bool _GetOpenFileName (ui_filepicker_context_t *ctx)
 Show a file picker in open mode.
bool _GetSaveFileName (ui_filepicker_context_t *ctx)
 Show a file picker in save mode.
int _GetNextFileName (ui_filepicker_context_t *ctx, UTF16 *out)
 Read the next path from a context struct.

Detailed Description

Functions related to the file picker modal.

Macro Definition Documentation

◆ FILEPICKER_CONTEXT_OUTPUT_ALLOC

#define FILEPICKER_CONTEXT_OUTPUT_ALLOC ( calloc_impl,
entries,
is_utf16 )
Value:
calloc_impl(entries * 260 + 2, is_utf16 ? sizeof(UTF16) : sizeof(char))
#define UTF16
"Portable" Besta UTF-16 type used by other headers.
Definition common.h:54

Allocate output buffer for ui_filepicker_context_t.

Parameters
calloc_implImplementation of calloc().
entriesMaximum number of entries allowed. Must be the same as ui_filepicker_context_t::npaths.
is_utf16true if the buffer should be UTF16 type. Set to false if the flag FILEPICKER_USE_MB is set.
Returns
Allocated buffer.

Enumeration Type Documentation

◆ ui_filepicker_flag_e

Known file picker flags.

Todo
Add more.
Enumerator
FILEPICKER_ALLOW_MULTIPLE 

Allow multiple files.

FILEPICKER_USE_MB 

Use multi-byte strings in the current locale's encoding instead of UTF16.

Function Documentation

◆ _GetNextFileName()

int _GetNextFileName ( ui_filepicker_context_t * ctx,
UTF16 * out )
extern

Read the next path from a context struct.

Syscall Number
0x101d4
Parameters
ctxThe file picker context.
[out]outUTF16 string. Recommended to be at least 260 CUs long.
Return values
0The operation was completed successfully.
1The operation failed with error.

◆ _GetOpenFileName()

bool _GetOpenFileName ( ui_filepicker_context_t * ctx)
extern

Show a file picker in open mode.

Syscall Number
0x101d2
Parameters
ctxThe file picker context.
Returns
true The operation was completed successfully.
false The operation failed with error.

◆ _GetSaveFileName()

bool _GetSaveFileName ( ui_filepicker_context_t * ctx)
extern

Show a file picker in save mode.

Syscall Number
0x101d3
Parameters
ctxThe file picker context.
Returns
true The operation was completed successfully.
false The operation failed with error.