## gva-ui gva-ui — User Interface Support |

## Synopsis

    #define             GVA_ACTION_ABOUT
    #define             GVA_ACTION_AUTO_SAVE
    #define             GVA_ACTION_CONTENTS
    #define             GVA_ACTION_FULL_SCREEN
    #define             GVA_ACTION_INSERT_FAVORITE
    #define             GVA_ACTION_NEXT_GAME
    #define             GVA_ACTION_PLAY_BACK
    #define             GVA_ACTION_PREFERENCES
    #define             GVA_ACTION_PREVIOUS_GAME
    #define             GVA_ACTION_PROPERTIES
    #define             GVA_ACTION_QUIT
    #define             GVA_ACTION_RECORD
    #define             GVA_ACTION_REMOVE_COLUMN
    #define             GVA_ACTION_REMOVE_FAVORITE
    #define             GVA_ACTION_SAVE_ERRORS
    #define             GVA_ACTION_SEARCH
    #define             GVA_ACTION_SHOW_CLONES
    #define             GVA_ACTION_SHOW_PLAY_BACK
    #define             GVA_ACTION_START
    #define             GVA_ACTION_VIEW_AVAILABLE
    #define             GVA_ACTION_VIEW_FAVORITES
    #define             GVA_ACTION_VIEW_RESULTS
    GtkAction *         gva_ui_get_action                   (const gchar *action_name);
    GtkWidget *         gva_ui_get_widget                   (const gchar *widget_name);
    GtkWidget *         gva_ui_get_managed_widget           (const gchar *widget_path);
    void                gva_ui_add_column_actions           (GtkTreeView *view);

## Description

These functions and macros provide easy access to global actions and widgets in the application.

## Details

### GVA_ACTION_ABOUT

    #define GVA_ACTION_ABOUT                (gva_ui_get_action ("about"))

Activation of this action displays the application's About dialog.

Main menu item: Help -> About

### GVA_ACTION_AUTO_SAVE

    #define GVA_ACTION_AUTO_SAVE            (gva_ui_get_action ("auto-save"))

This toggle action tracks the user's preference for whether to restore the emulated machine's previous state when starting a game.

### GVA_ACTION_CONTENTS

    #define GVA_ACTION_CONTENTS             (gva_ui_get_action ("contents"))

Activation of this action opens the user manual for GNOME Video Arcade.

Main menu item: Help -> Contents

### GVA_ACTION_FULL_SCREEN

    #define GVA_ACTION_FULL_SCREEN          (gva_ui_get_action ("full-screen"))

This toggle action tracks the user's preference for whether to start games in full screen mode.

### GVA_ACTION_INSERT_FAVORITE

    #define GVA_ACTION_INSERT_FAVORITE      (gva_ui_get_action ("insert-favorite"))

Activation of this action adds the currently selected game to the user's list of favorites.

Main menu item: Game -> Add to Favorites

### GVA_ACTION_NEXT_GAME

    #define GVA_ACTION_NEXT_GAME            (gva_ui_get_action ("next-game"))

Activation of this action selects the next game, rolling over to the first game if necessary.

### GVA_ACTION_PLAY_BACK

    #define GVA_ACTION_PLAY_BACK            (gva_ui_get_action ("play-back"))

Activation of this action plays back the selected game recording.

### GVA_ACTION_PREFERENCES

    #define GVA_ACTION_PREFERENCES          (gva_ui_get_action ("preferences"))

Activation of this action presents the "Preferences" window.

Main menu item: Edit -> Preferences

### GVA_ACTION_PREVIOUS_GAME

    #define GVA_ACTION_PREVIOUS_GAME        (gva_ui_get_action ("previous-game"))

Activation of this action selects the previous game, rolling over to the last game if necessary.

### GVA_ACTION_PROPERTIES

    #define GVA_ACTION_PROPERTIES           (gva_ui_get_action ("properties"))

Activation of this action presents the "Properties" window.

Main menu item: View -> Properties

### GVA_ACTION_QUIT

    #define GVA_ACTION_QUIT                 (gva_ui_get_action ("quit"))

Activation of this action initiates application shutdown.

Main menu item: Game -> Quit

### GVA_ACTION_RECORD

    #define GVA_ACTION_RECORD               (gva_ui_get_action ("record"))

Activation of this action starts the selected game with MAME recording user inputs to a file. The "Recorded Games" window will automatically be displayed when the user exits the game.

Main menu item: Game -> Record

### GVA_ACTION_REMOVE_COLUMN

    #define GVA_ACTION_REMOVE_COLUMN        (gva_ui_get_action ("remove-column"))

Activation of this action removes the currently selected column from the game list.

### GVA_ACTION_REMOVE_FAVORITE

    #define GVA_ACTION_REMOVE_FAVORITE      (gva_ui_get_action ("remove-favorite"))

Activation of this action removes the currently selected game from the user's list of favorites.

Main menu item: Game -> Remove from Favorites

### GVA_ACTION_SAVE_ERRORS

    #define GVA_ACTION_SAVE_ERRORS          (gva_ui_get_action ("save-errors"))

Activation of this action saves the errors from a ROM audit to a file.

### GVA_ACTION_SEARCH

    #define GVA_ACTION_SEARCH               (gva_ui_get_action ("search"))

Activation of this action presents the "Search for Games" window.

Main menu item: Edit -> Search...

### GVA_ACTION_SHOW_CLONES

    #define GVA_ACTION_SHOW_CLONES          (gva_ui_get_action ("show-clones"))

This toggle action tracks the user's preference for whether to show cloned games in the main window's game list.

### GVA_ACTION_SHOW_PLAY_BACK

    #define GVA_ACTION_SHOW_PLAY_BACK       (gva_ui_get_action ("show-play-back"))

Activation of this action presents the "Recorded Games" window.

Main menu item: Game -> Play Back...

### GVA_ACTION_START

    #define GVA_ACTION_START                (gva_ui_get_action ("start"))

Activation of this action starts the selected game.

Main menu item: Game -> Start

### GVA_ACTION_VIEW_AVAILABLE

    #define GVA_ACTION_VIEW_AVAILABLE       (gva_ui_get_action ("view-available"))

Activation of this action queries the database for all available games.

Main menu item: View -> Available Games

### GVA_ACTION_VIEW_FAVORITES

    #define GVA_ACTION_VIEW_FAVORITES       (gva_ui_get_action ("view-favorites"))

Activation of this action queries the database for the user's favorite games.

Main menu item: View -> Favorite Games

### GVA_ACTION_VIEW_RESULTS

    #define GVA_ACTION_VIEW_RESULTS         (gva_ui_get_action ("view-results"))

Activation of this action executes a custom database query.

Main menu item: View -> Search Results

### gva_ui_get_action ()

    GtkAction *         gva_ui_get_action                   (const gchar *action_name);

Returns the GtkAction named `action_name` from the resident GtkUIManager. Failure to find the action indicates a programming error and causes the application to abort, so the return value is guaranteed to be valid.

`action_name` : | the name of a GtkAction
Returns : | the GtkAction named `action_name`

### gva_ui_get_widget ()

    GtkWidget *         gva_ui_get_widget                   (const gchar *widget_name);

Returns the GtkWidget named `widget_name` from the UI specification. Failure to find the widget indicates a programming error and causes the application to abort, so the return value is guaranteed to be valid.

`widget_name` : | the name of a GtkWidget
Returns : | the GtkWidget named `widget_name`

### gva_ui_get_managed_widget ()

    GtkWidget *         gva_ui_get_managed_widget           (const gchar *widget_path);

Returns the GtkWidget located at `widget_path` from the resident GtkUIManager. Failure to find the widget indicates a programming error and causes the application to abort, so the return value is guaranteed to be valid.

`widget_path` : | the path to the managed GtkWidget
Returns : | the GtkWidget located at `widget_path`

### gva_ui_add_column_actions ()

    void                gva_ui_add_column_actions           (GtkTreeView *view);

Creates "add-column" actions for each of the columns in `view`. These appear as menu items in the tree view's context menu. The columns' visibility controls the menu items' visibility in that only invisible columns are listed in the context menu.

`view` : | a GtkTreeView