module-process

module-process

Functions

Includes

#include <libgwyapp/gwyapp.h>

Description

Functions

GwyProcessFunc()

void
(*GwyProcessFunc) (GwyFile *data,
                   GwyRunModeFlags run);

The type of data processing function.

Parameters

data

The data container to operate on.

 

run

Run mode.

 

gwy_process_func_register()

gboolean
gwy_process_func_register (const gchar *name,
                           GwyProcessFunc func,
                           const gchar *menu_path,
                           const gchar *icon_name,
                           GwyRunModeFlags run,
                           guint sens_mask,
                           const gchar *tooltip);

Registers a data processing function.

Note: the string arguments are not copied as modules are not expected to vanish. If they are constructed (non-constant) strings, do not free them. Should modules ever become unloadable they will get a chance to clean-up.

Parameters

name

Name of function to register. It should be a valid identifier and if a module registers only one function, module and function names should be the same.

 

func

The function itself.

 

menu_path

Menu path under Data Process menu. The menu path should be marked translatabe, but passed untranslated (to allow merging of translated and untranslated submenus).

 

icon_name

Stock icon id for toolbar.

 

run

Supported run modes. Data processing functions can have two run modes: GWY_RUN_IMMEDIATE (no questions asked) and GWY_RUN_INTERACTIVE (a modal dialog with parameters).

 

sens_mask

Sensitivity mask (a combination of GwyMenuSensFlags flags). Usually it contains GWY_MENU_FLAG_IMAGE, possibly other requirements.

 

tooltip

Tooltip for this function.

 

Returns

Normally TRUE; FALSE on failure.


gwy_process_func_run()

void
gwy_process_func_run (const gchar *name,
                      GwyFile *data,
                      GwyRunModeFlags run);

Runs a data processing function identified by name .

Parameters

name

Data processing function name.

 

data

Data (a GwyFile).

 

run

How the function should be run.

 

gwy_process_func_exists()

gboolean
gwy_process_func_exists (const gchar *name);

Checks whether a data processing function exists.

Parameters

name

Data processing function name.

 

Returns

TRUE if function name exists, FALSE otherwise.


gwy_process_func_get_run_types()

GwyRunModeFlags
gwy_process_func_get_run_types (const gchar *name);

Returns run modes supported by a data processing function.

Parameters

name

Data processing function name.

 

Returns

The run mode bit mask.


gwy_process_func_get_menu_path()

const gchar *
gwy_process_func_get_menu_path (const gchar *name);

Returns the menu path of a data processing function.

The returned menu path is only the tail part registered by the function, i.e., without any leading "/Data Process".

Parameters

name

Data processing function name.

 

Returns

The menu path. The returned string is owned by the module.


gwy_process_func_get_icon_name()

const gchar *
gwy_process_func_get_icon_name (const gchar *name);

Gets icon name of a data processing function.

Parameters

name

Data processing function name.

 

Returns

The icon name. The returned string is owned by the module.


gwy_process_func_get_tooltip()

const gchar *
gwy_process_func_get_tooltip (const gchar *name);

Gets tooltip for a data processing function.

Parameters

name

Data processing function name.

 

Returns

The tooltip. The returned string is owned by the module.


gwy_process_func_get_sensitivity_mask()

guint
gwy_process_func_get_sensitivity_mask (const gchar *name);

Gets menu sensititivy mask for a data processing function.

Parameters

name

Data processing function name.

 

Returns

The menu item sensitivity mask (a combination of GwyMenuSensFlags flags).


gwy_process_func_foreach()

void
gwy_process_func_foreach (GwyNameFunc function,
                          gpointer user_data);

Calls a function for each process function.

Parameters

function

Function to run for each image processing function, passed by name.

[scope call]

user_data

Data to pass to function .

 

gwy_process_func_current()

const gchar *
gwy_process_func_current (void);

Obtains the name of currently running data processing function.

If no process function is currently running, NULL is returned.

If multiple nested functions are running (which is not usual but technically possible), the innermost function name is returned.

Returns

The name of currently running data processing function or NULL.