Libfm file launchers

Libfm file launchers — File launching utilities with callbacks to GUI.

Functions

gboolean (*FmLaunchFolderFunc) ()
gboolean fm_launch_files ()
gboolean fm_launch_paths ()
gboolean fm_launch_desktop_entry ()

Types and Values

Description

include : libfm/fm.h

Functions

FmLaunchFolderFunc ()

gboolean
(*FmLaunchFolderFunc) (GAppLaunchContext *ctx,
                       GList *folder_infos,
                       gpointer user_data,
                       GError **err);

fm_launch_files ()

gboolean
fm_launch_files (GAppLaunchContext *ctx,
                 GList *file_infos,
                 FmFileLauncher *launcher,
                 gpointer user_data);

Launches files using callbacks in launcher .

Parameters

ctx

a launch context.

[allow-none]

file_infos

files to launch.

[element-type FmFileInfo]

launcher

FmFileLauncher with callbacks

 

user_data

data supplied for callbacks

 

Returns

TRUE in case of success.

Since: 0.1.0


fm_launch_paths ()

gboolean
fm_launch_paths (GAppLaunchContext *ctx,
                 GList *paths,
                 FmFileLauncher *launcher,
                 gpointer user_data);

Launches files using callbacks in launcher .

Parameters

ctx

a launch context.

[allow-none]

paths

files to launch.

[element-type FmPath]

launcher

FmFileLauncher with callbacks

 

user_data

data supplied for callbacks

 

Returns

TRUE in case of success.

Since: 0.1.0


fm_launch_desktop_entry ()

gboolean
fm_launch_desktop_entry (GAppLaunchContext *ctx,
                         const char *file_or_id,
                         GList *uris,
                         FmFileLauncher *launcher,
                         gpointer user_data);

Launches a desktop entry with optional files.

Parameters

ctx

a launch context.

[allow-none]

file_or_id

a desktop entry to launch

 

uris

files to use in run substitutions.

[element-type char *]

launcher

FmFileLauncher with callbacks

 

user_data

data supplied for callbacks

 

Returns

TRUE in case of success.

Since: 0.1.0

Types and Values

enum FmFileLauncherExecAction

Members

FM_FILE_LAUNCHER_EXEC

execute the file

 

FM_FILE_LAUNCHER_EXEC_IN_TERMINAL

execute the file in terminal

 

FM_FILE_LAUNCHER_EXEC_OPEN

open file with some application

 

FM_FILE_LAUNCHER_EXEC_CANCEL

do nothing

 

struct FmFileLauncher

struct FmFileLauncher {
    GAppInfo* (*get_app)(GList* file_infos, FmMimeType* mime_type, gpointer user_data, GError** err);
    /* gboolean (*before_open)(GAppLaunchContext* ctx, GList* folder_infos, gpointer user_data); */
    FmLaunchFolderFunc open_folder;
    FmFileLauncherExecAction (*exec_file)(FmFileInfo* file, gpointer user_data);
    /* returns TRUE to continue, FALSE to retry */
    gboolean (*error)(GAppLaunchContext* ctx, GError* err, FmPath* file, gpointer user_data);
    int (*ask)(const char* msg, char* const* btn_labels, int default_btn, gpointer user_data);
};

Members

get_app ()

callback to get new GAppInfo

 

FmLaunchFolderFunc open_folder;

callback to open folders

 

exec_file ()

callback to select file execution mode

 

error ()

callback to show error message; returns TRUE to continue, FALSE to retry

 

ask ()

callback to ask for user interaction; returns choise from btn_labels