menu: Gwyddion Application Library Reference Manual

## menu menu — Menu and sensitivity functions |

## Functions

GtkWidget * | gwy_app_image_menu ()
GtkWidget * | gwy_app_graph_menu ()
GtkWidget * | gwy_app_xyz_menu ()
GtkWidget * | gwy_app_cmap_menu ()
GtkWidget * | gwy_app_synth_menu ()
GtkWidget * | gwy_app_volume_menu ()
GwyRunModeFlags | gwy_app_run_image_func ()
void | gwy_app_run_image_func_in_mode ()
void | gwy_app_run_graph_func ()
GwyRunModeFlags | gwy_app_run_volume_func ()
void | gwy_app_run_volume_func_in_mode ()
GwyRunModeFlags | gwy_app_run_xyz_func ()
void | gwy_app_run_xyz_func_in_mode ()
GwyRunModeFlags | gwy_app_run_cmap_func ()
void | gwy_app_run_cmap_func_in_mode ()
GwyRunModeFlags | gwy_app_run_synth_func ()
void | gwy_app_run_synth_func_in_mode ()
GtkWidget * | gwy_app_create_recent_func_menu ()
GwySensitivityGroup * | gwy_app_sensitivity_get_group ()
void | gwy_app_sensitivity_add_widget ()
void | gwy_app_sensitivity_set_state ()

## Types and Values

enum | GwyMenuSensFlags

## Includes

    #include <libgwyapp/gwyapp.h>

## Description

Menu and toolbox item sensitivity is updated by main application whenever its state changes. Possible states that may affect widget sesitivity are defined in GwyMenuSensFlags.

## Functions

### gwy_app_image_menu()

    GtkWidget *
    gwy_app_image_menu (GwySensitivityGroup *sens_group);

Constructs the application Data Process menu.

The menu is created from data processing functions registered by modules, therefore module registration has to be done first for this function to make sense.

#### Parameters

sens_group | Sensitvity group for the menu. |

#### Returns

Newly created image data processing menu.

[transfer full]

### gwy_app_graph_menu()

    GtkWidget *
    gwy_app_graph_menu (GwySensitivityGroup *sens_group);

Constructs the application Graph menu.

The menu is created from graph functions registered by modules, therefore module registration has to be done first for this function to make sense.

#### Parameters

sens_group | Sensitvity group for the menu. |

#### Returns

Newly created graph data processing menu.

[transfer full]

### gwy_app_xyz_menu()

    GtkWidget *
    gwy_app_xyz_menu (GwySensitivityGroup *sens_group);

Constructs the application XYZ Data menu.

The menu is created from XYZ data processing functions registered by modules, therefore module registration has to be done first for this function to make sense.

#### Parameters

sens_group | Sensitvity group for the menu. |

#### Returns

Newly created XYZ data processing menu.

[transfer full]

### gwy_app_cmap_menu()

    GtkWidget *
    gwy_app_cmap_menu (GwySensitivityGroup *sens_group);

Constructs the application Curve Maps menu.

The menu is created from curve map data processing functions registered by modules, therefore module registration has to be done first for this function to make sense.

#### Parameters

sens_group | Sensitvity group for the menu. |

#### Returns

Newly created curve map data processing menu.

[transfer full]

### gwy_app_synth_menu()

    GtkWidget *
    gwy_app_synth_menu (GwySensitivityGroup *sens_group);

Constructs the application Curve Maps menu.

The menu is created from curve map data processing functions registered by modules, therefore module registration has to be done first for this function to make sense.

#### Parameters

sens_group | Sensitvity group for the menu. |

#### Returns

Newly created curve map data processing menu.

[transfer full]

### gwy_app_volume_menu()

    GtkWidget *
    gwy_app_volume_menu (GwySensitivityGroup *sens_group);

Constructs the application Volume Data menu.

The menu is created from volume data processing functions registered by modules, therefore module registration has to be done first for this function to make sense.

#### Parameters

sens_group | Sensitvity group for the menu. |

#### Returns

Newly created volume data processing menu.

[transfer full]

### gwy_app_run_image_func()

    GwyRunModeFlags
    gwy_app_run_image_func (const gchar *name);

Runs a data processing function on the current data.

From the run modes function `name` supports, the most interactive one is selected.

#### Parameters

name | A data processing function name. |

#### Returns

The actually used mode (nonzero), or 0 on failure.

### gwy_app_run_image_func_in_mode()

    void
    gwy_app_run_image_func_in_mode (const gchar *name,
                                    GwyRunModeFlags run);

Runs a data processing function on current data in specified mode.

#### Parameters

name | A data processing function name. |
run | A run mode. |

### gwy_app_run_graph_func()

    void
    gwy_app_run_graph_func (const gchar *name);

Runs a graph function on the current graph.

#### Parameters

name | A graph function name. |

### gwy_app_run_volume_func()

    GwyRunModeFlags
    gwy_app_run_volume_func (const gchar *name);

Runs a volume data processing function on the current data.

From the run modes function `name` supports, the most interactive one is selected.

#### Parameters

name | A volume data processing function name. |

#### Returns

The actually used mode (nonzero), or 0 on failure.

### gwy_app_run_volume_func_in_mode()

    void
    gwy_app_run_volume_func_in_mode (const gchar *name,
                                     GwyRunModeFlags run);

Runs a volume data processing function on current data in specified mode.

#### Parameters

name | A volume data processing function name. |
run | A run mode. |

### gwy_app_run_xyz_func()

    GwyRunModeFlags
    gwy_app_run_xyz_func (const gchar *name);

Runs a XYZ data processing function on the current data.

From the run modes function `name` supports, the most interactive one is selected.

#### Parameters

name | A XYZ data processing function name. |

#### Returns

The actually used mode (nonzero), or 0 on failure.

### gwy_app_run_xyz_func_in_mode()

    void
    gwy_app_run_xyz_func_in_mode (const gchar *name,
                                  GwyRunModeFlags run);

Runs a XYZ data processing function on current data in specified mode.

#### Parameters

name | A XYZ data processing function name. |
run | A run mode. |

### gwy_app_run_cmap_func()

    GwyRunModeFlags
    gwy_app_run_cmap_func (const gchar *name);

Runs a curve map processing function on the current data.

From the run modes function `name` supports, the most interactive one is selected.

#### Parameters

name | A curve map processing function name. |

#### Returns

The actually used mode (nonzero), or 0 on failure.

### gwy_app_run_cmap_func_in_mode()

    void
    gwy_app_run_cmap_func_in_mode (const gchar *name,
                                   GwyRunModeFlags run);

Runs a curve map processing function on current data in specified mode.

#### Parameters

name | A curve map processing function name. |
run | A run mode. |

### gwy_app_run_synth_func()

    GwyRunModeFlags
    gwy_app_run_synth_func (const gchar *name);

Runs a synthetic data function on the current data.

From the run modes function `name` supports, the most interactive one is selected.

#### Parameters

name | A synthetic data function name. |

#### Returns

The actually used mode (nonzero), or 0 on failure.

### gwy_app_run_synth_func_in_mode()

    void
    gwy_app_run_synth_func_in_mode (const gchar *name,
                                    GwyRunModeFlags run);

Runs a synthetic data function on current data in specified mode.

#### Parameters

name | A synthetic data function name. |
run | A run mode. |

### gwy_app_create_recent_func_menu()

    GtkWidget *
    gwy_app_create_recent_func_menu (GwyAppDataWindow *window,
                                     GtkAccelGroup *accel_group,
                                     GwySensitivityGroup *sens_group);

Creates a recent function menu for a data window.

The menu content is updated automatically when function such as `gwy_app_run_volume_func()` is used.

#### Parameters

window | Data window the menu will be added to. It determines the data kind and thus the menu type. |
accel_group | Acceleration group to be associated with the menu. |
sens_group | Sensitvity group for the menu. |

#### Returns

New recent function menu as a GtkWidget.

[transfer full]

### gwy_app_sensitivity_get_group()

    GwySensitivityGroup *
    gwy_app_sensitivity_get_group (void);

Gets the application-wide widget sensitvity group.

The flags to be used with this sensitvity group are defined in GwyMenuSensFlags.

#### Returns

The global sensitvity group instead. No reference is added, you can add yours, but the returned object will exist to the end of program anyway.

### gwy_app_sensitivity_add_widget()

    void
    gwy_app_sensitivity_add_widget (GtkWidget *widget,
                                    GwyMenuSensFlags mask);

Adds a widget to the application-wide widget sensitvity group.

The semantics of this function is the same as `gwy_sensitivity_group_add_widget()` (in fact, it's a simple wrapper around it).

#### Parameters

widget | Widget to add. |
mask | Which flags the widget is sensitive to. |

### gwy_app_sensitivity_set_state()

    void
    gwy_app_sensitivity_set_state (GwyMenuSensFlags affected_mask,
                                   GwyMenuSensFlags state);

Sets the state of application-wide widget sensitvity group.

The semantics of this function is the same as `gwy_sensitivity_group_set_state()` (in fact, it's a simple wrapper around it).

#### Parameters

affected_mask | Which bits in `state` to copy to state. |
state | The new state (masked with `affected_mask` ). |

## Types and Values

### enum GwyMenuSensFlags

Sensitivity flags indicating the availability of various data kinds.

They represent various application states that may be preconditions for widgets to become sensitive.

#### Members

GWY_MENU_FLAG_FILE | A file is open, with any type of data. |
GWY_MENU_FLAG_UNDO | There is something to undo (for the current window). |
GWY_MENU_FLAG_REDO | There is something to redo (for the current window). |
GWY_MENU_FLAG_IMAGE | An image window is active on which image functions can be used. |
GWY_MENU_FLAG_IMAGE_SHOW | There is a presentation on the image. |
GWY_MENU_FLAG_IMAGE_MASK | There is a mask on the image. |
GWY_MENU_FLAG_GL | An OpenGL 3D view is present. |
GWY_MENU_FLAG_GRAPH | A graph window is active on which graph functions can be used. |
GWY_MENU_FLAG_GRAPH_CURVE | There current graph window contains at least one curve. This ensures a graph function will not be run on an empty graph. |
GWY_MENU_FLAG_SPECTRA | A spectra graph window is active on which spectra functions can be used. |
GWY_MENU_FLAG_VOLUME | A volume image window is active on which volume data functions can be used. |
GWY_MENU_FLAG_XYZ | An XYZ image window is active on which XYZ data functions can be used. |
GWY_MENU_FLAG_CMAP | A curve map image window is active on which curve map functions can be used. |