## gok-editor gok-editor |

## Synopsis

    void                gok_editor_run                      (void);
    void                gok_editor_close                    (void);
    void                gok_editor_on_exit                  (void);
    void                gok_editor_new                      (void);
    void                gok_editor_open_file                (void);
    void                gok_editor_new_file                 (void);
    void                gok_editor_touch_file               (gboolean modified);
    void                gok_editor_show_parameters          (GokKey *pKey);
    void                gok_editor_next_key                 (void);
    void                gok_editor_previous_key             (void);
    void                gok_editor_add_key                  (void);
    void                gok_editor_delete_key               (void);
    void                gok_editor_duplicate_key            (void);
    void                gok_editor_update_key               (void);
    void                gok_editor_update_keyboard          (GokKeyboard *pKeyboard);
    gboolean            on_editor_keyboard_delete_event     (GtkWidget *widget,
                                                             GdkEvent *event,
                                                             gpointer user_data);
    void                gok_editor_keyboard_key_press       (GtkWidget *pWidget);
    gboolean            gok_editor_save_current_keyboard    (void);
    gboolean            gok_editor_save_current_keyboard_as (void);
    gboolean            gok_editor_save_keyboard            (GokKeyboard *pKeyboard,
                                                             gchar *Filename);
    gboolean            gok_editor_print_outputs            (FILE *pFile,
                                                             GokOutput *pOutput,
                                                             gboolean bWrapper);
    gboolean            gok_editor_validate_keyboard        (GokKeyboard *pKeyboard);
    void                gok_editor_message_filename_bad     (gchar *Filename);
    void                gok_editor_update_title             (void);

## Description

## Details

### gok_editor_run ()

    void                gok_editor_run                      (void);

Runs the GOK keyboard editor.

### gok_editor_close ()

    void                gok_editor_close                    (void);

Closes the GOK keyboard editor.

### gok_editor_on_exit ()

    void                gok_editor_on_exit                  (void);

The menu item to close the program has been selected so close it.

### gok_editor_new ()

    void                gok_editor_new                      (void);

### gok_editor_open_file ()

    void                gok_editor_open_file                (void);

Opens an existing keyboard file for editing.

### gok_editor_new_file ()

    void                gok_editor_new_file                 (void);

Create a new GOK keyboard file.

### gok_editor_touch_file ()

    void                gok_editor_touch_file               (gboolean modified);

Marks the file as having modifications (or not)

`modified` : | should the file be marked as modified?

### gok_editor_show_parameters ()

    void                gok_editor_show_parameters          (GokKey *pKey);

Displays the parameters for the given key on the editor dialog.

`pKey` : | Pointer to the key that will be edited.

### gok_editor_next_key ()

    void                gok_editor_next_key                 (void);

Display parameters for the next key on the keyboard.

### gok_editor_previous_key ()

    void                gok_editor_previous_key             (void);

Select the previous key properties

### gok_editor_add_key ()

    void                gok_editor_add_key                  (void);

Add a default key to the keyboard.

### gok_editor_delete_key ()

    void                gok_editor_delete_key               (void);

Delete the currently selected key..

### gok_editor_duplicate_key ()

    void                gok_editor_duplicate_key            (void);

Add a copy of the currently selected key.

### gok_editor_update_key ()

    void                gok_editor_update_key               (void);

Call this if a key property changes.

### gok_editor_update_keyboard ()

    void                gok_editor_update_keyboard          (GokKeyboard *pKeyboard);

update the display of the keyboard and recalculate rows and columns

`pKeyboard` : | Pointer to the keyboard that will be updated.

### on_editor_keyboard_delete_event ()

    gboolean            on_editor_keyboard_delete_event     (GtkWidget *widget,
                                                             GdkEvent *event,
                                                             gpointer user_data);

Prevents the keyboard window from closing.

`widget` : |
`event` : |
`user_data` : |
Returns : | TRUE so the keyboard window will NOT close.

### gok_editor_keyboard_key_press ()

    void                gok_editor_keyboard_key_press       (GtkWidget *pWidget);

The user has just pressed a key on the keyboard.

`pWidget` : |

### gok_editor_save_current_keyboard ()

    gboolean            gok_editor_save_current_keyboard    (void);

Saves the current keyboard back to its original file.

Returns : | TRUE if the keyboard was saved, FALSE if keyboard was not saved.

### gok_editor_save_current_keyboard_as ()

    gboolean            gok_editor_save_current_keyboard_as (void);

Saves the current keyboard under a new filename.

Returns : | TRUE if the keyboard was saved, FALSE if keyboard was not saved.

### gok_editor_save_keyboard ()

    gboolean            gok_editor_save_keyboard            (GokKeyboard *pKeyboard,
                                                             gchar *Filename);

Saves the given keyboard to the given file.

`pKeyboard`: Pointer to the keyboard that will be saved to disk. `Filename`: Name of the file where the keyboard will be saved.

`pKeyboard` : |
`Filename` : |
Returns : | TRUE if the keyboard was saved, FALSE if keyboard was not saved.

### gok_editor_print_outputs ()

    gboolean            gok_editor_print_outputs            (FILE *pFile,
                                                             GokOutput *pOutput,
                                                             gboolean bWrapper);

Prints the outputs in XML format to the given file.

`pFile` : | Pointer to the XML file that gets the outputs.
`pOutput` : | Pointer to the first output that gets written.
`bWrapper` : |
Returns : | TRUE if the outputs were written, FALSE if not.

### gok_editor_validate_keyboard ()

    gboolean            gok_editor_validate_keyboard        (GokKeyboard *pKeyboard);

Validates the current keyboard to make sure it is OK.

`pKeyboard` : |
Returns : | TRUE if the keyboard is OK, FALSE if not.

### gok_editor_message_filename_bad ()

    void                gok_editor_message_filename_bad     (gchar *Filename);

Inform the user that the selected file name is not a valid GOK keyboard file name.

`Filename` : | Pointer to the file name.

### gok_editor_update_title ()

    void                gok_editor_update_title             (void);

Displays the filename and modification status in the titlebar.