muteki
Loading...
Searching...
No Matches
filepicker.h File Reference

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

#include <muteki/ui/common.h>

Go to the source code of this file.

Data Structures

struct  filepicker_context_s
 The file picker context. More...
 

Macros

#define FILEPICKER_CONTEXT_OUTPUT_ALLOC(calloc_impl, entries, is_utf16)    calloc_impl(entries * 260 + 2, is_utf16 ? sizeof(UTF16) : sizeof(char))
 Allocate output buffer for filepicker_context_t.
 
#define FILEPICKER_CONTEXT_OUTPUT_MAX_LFN   260
 Max LFN path size for file picker.
 

Typedefs

typedef struct filepicker_context_s filepicker_context_t
 

Enumerations

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

Functions

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

Detailed Description

Functions related to the file picker view.

Macro Definition Documentation

◆ FILEPICKER_CONTEXT_OUTPUT_ALLOC

#define FILEPICKER_CONTEXT_OUTPUT_ALLOC (   calloc_impl,
  entries,
  is_utf16 
)     calloc_impl(entries * 260 + 2, is_utf16 ? sizeof(UTF16) : sizeof(char))

Allocate output buffer for filepicker_context_t.

Parameters
calloc_implImplementation of calloc().
entriesMaximum number of entries allowed. Must be the same as 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

◆ 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 ( 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 ( 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 ( 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.