Crossfire Client, Branch  R11627
Functions
GTK-V2 client keybinding window functions.

EndOf GtkV2KeyBinding. More...

Functions

static void keybinding_get_data (uint32 *keysym, uint8 *flags, const char **command)
 Gets the state information from what checkboxes and other data in the window and puts it in the variables passed passed.
gboolean keybinding_selection_func (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer userdata)
 Called when the user clicks one of the entries in the list of keybindings and places information about it into the input fields on the dialog.
void on_keybinding_button_bind_clicked (GtkButton *button, gpointer user_data)
 Sets up a new binding when the "Add" button is clicked.
void on_keybinding_button_clear_clicked (GtkButton *button, gpointer user_data)
 Implements the "Clear Fields" button function on the keybinding dialog.
void on_keybinding_button_close_clicked (GtkButton *button, gpointer user_data)
 Deactivates the keybinding dialog when the "Close Window" button is clicked.
void on_keybinding_button_remove_clicked (GtkButton *button, gpointer user_data)
 Implements the "Remove Binding" button function that unbinds the currently selected keybinding.
void on_keybinding_button_update_clicked (GtkButton *button, gpointer user_data)
 Implements the "Update Binding" button to update the currently selected keybinding to match the currently shown identifiers, key, or command input fields.
gboolean on_keybinding_entry_key_key_press_event (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
 Respond to a key press in the "Key" input box.
void on_keybindings_activate (GtkMenuItem *menuitem, gpointer user_data)
 Menubar item to activate keybindings window.
void reset_keybinding_status (void)
 Reset the state of the keybinding dialog.
void update_keybinding_list (void)
 Update the keybinding dialog to reflect the current state of the keys file.

Detailed Description

EndOf GtkV2KeyBinding.


Function Documentation

static void keybinding_get_data ( uint32 keysym,
uint8 flags,
const char **  command 
) [static]

Gets the state information from what checkboxes and other data in the window and puts it in the variables passed passed.

This is used by both the update and add functions.

Parameters:
keysym
flags
command

Definition at line 1882 of file keys.c.

References bind_buf, draw_info(), keybinding_checkbutton_alt, keybinding_checkbutton_control, keybinding_checkbutton_edit, keybinding_checkbutton_meta, keybinding_checkbutton_shift, keybinding_entry_command, keybinding_entry_key, KEYF_ALT, KEYF_EDIT, KEYF_FIRE, KEYF_META, KEYF_MODIFIERS, KEYF_NORMAL, KEYF_RUN, LOG(), LOG_ERROR, MAX_BUF, and NDI_RED.

Referenced by on_keybinding_button_bind_clicked(), and on_keybinding_button_update_clicked().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean keybinding_selection_func ( GtkTreeSelection *  selection,
GtkTreeModel *  model,
GtkTreePath *  path,
gboolean  path_currently_selected,
gpointer  userdata 
)

Called when the user clicks one of the entries in the list of keybindings and places information about it into the input fields on the dialog.

This allows the player to edit and update, or remove bindings.

Parameters:
selection
model
path
path_currently_selected
userdata
Returns:
TRUE

Definition at line 2029 of file keys.c.

References Keys::command, FALSE, Keys::flags, keybinding_button_remove, keybinding_button_update, keybinding_checkbutton_alt, keybinding_checkbutton_control, keybinding_checkbutton_edit, keybinding_checkbutton_meta, keybinding_checkbutton_shift, keybinding_entry_command, keybinding_entry_key, KEYF_ALT, KEYF_EDIT, KEYF_FIRE, KEYF_META, KEYF_RUN, Keys::keysym, KLIST_KEY_ENTRY, LOG(), LOG_ERROR, and TRUE.

Referenced by keys_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_keybinding_button_bind_clicked ( GtkButton *  button,
gpointer  user_data 
)

Sets up a new binding when the "Add" button is clicked.

Parameters:
button
user_data

Definition at line 1945 of file keys.c.

References Keys::command, Keys::flags, insert_key(), keybinding_get_data(), Keys::keysym, reset_keybinding_status(), save_keys(), and update_keybinding_list().

Referenced by keys_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_keybinding_button_clear_clicked ( GtkButton *  button,
gpointer  user_data 
)

Implements the "Clear Fields" button function on the keybinding dialog.

If a keybinding is highlighted (selected), de-select it first, then clear all of * the input boxes and reset any buttons to an appropriate state.

Parameters:
button
user_data

Definition at line 2126 of file keys.c.

References keybinding_selection, and reset_keybinding_status().

Referenced by keys_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_keybinding_button_close_clicked ( GtkButton *  button,
gpointer  user_data 
)

Deactivates the keybinding dialog when the "Close Window" button is clicked.

Parameters:
button
user_data

Definition at line 2011 of file keys.c.

References keybinding_window.

Referenced by keys_init().

Here is the caller graph for this function:

void on_keybinding_button_remove_clicked ( GtkButton *  button,
gpointer  user_data 
)

Implements the "Remove Binding" button function that unbinds the currently selected keybinding.

Parameters:
button
user_data

Definition at line 1825 of file keys.c.

References Keys::command, keybinding_selection, KEYHASH, KLIST_KEY_ENTRY, LOG(), LOG_ERROR, Keys::next, save_keys(), and update_keybinding_list().

Referenced by keys_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void on_keybinding_button_update_clicked ( GtkButton *  button,
gpointer  user_data 
)

Implements the "Update Binding" button to update the currently selected keybinding to match the currently shown identifiers, key, or command input fields.

If a keybinding is highlighted, so something. If not, log an error since the "Update Binding" button should have been disabled.

Parameters:
button
user_data

Definition at line 1977 of file keys.c.

References Keys::command, Keys::flags, keybinding_get_data(), keybinding_selection, Keys::keysym, KLIST_KEY_ENTRY, LOG(), LOG_ERROR, save_keys(), strdup_local(), and update_keybinding_list().

Referenced by keys_init().

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean on_keybinding_entry_key_key_press_event ( GtkWidget *  widget,
GdkEventKey *  event,
gpointer  user_data 
)

Respond to a key press in the "Key" input box.

If the keyboard has modifier keys pressed, set the appropriate "Keybinding Modifiers" checkboxes if the shift or control keys happens to be pressed at the time. Oddly, the Alt and Meta keys are not similarly handled. Checkboxes are never cleared here in case the user had just set the checkboxes ahead of time.i

Parameters:
widget
event
user_data
Returns:
TRUE (Returning TRUE prevents widget from getting this event.)

Definition at line 1771 of file keys.c.

References FALSE, keybinding_checkbutton_alt, keybinding_checkbutton_control, keybinding_checkbutton_meta, keybinding_checkbutton_shift, keybinding_entry_key, and TRUE.

Referenced by keys_init().

Here is the caller graph for this function:

void on_keybindings_activate ( GtkMenuItem *  menuitem,
gpointer  user_data 
)

Menubar item to activate keybindings window.

Parameters:
menuitem
user_data

Definition at line 1751 of file keys.c.

References keybinding_window, and update_keybinding_list().

Referenced by enable_menu_items().

Here is the call graph for this function:

Here is the caller graph for this function:

void reset_keybinding_status ( void  )

Reset the state of the keybinding dialog.

Uncheck all modifier checkboxes, clear the key input box, clear the command input box, and disable the two update and remove keybinding buttons.

Definition at line 2099 of file keys.c.

References FALSE, keybinding_button_remove, keybinding_button_update, keybinding_checkbutton_alt, keybinding_checkbutton_control, keybinding_checkbutton_edit, keybinding_checkbutton_meta, keybinding_checkbutton_shift, keybinding_entry_command, and keybinding_entry_key.

Referenced by on_keybinding_button_bind_clicked(), on_keybinding_button_clear_clicked(), and update_keybinding_list().

Here is the caller graph for this function:

void update_keybinding_list ( void  )

Update the keybinding dialog to reflect the current state of the keys file.

Definition at line 1706 of file keys.c.

References Keys::command, Keys::flags, keybinding_store, KEYF_ALT, KEYF_EDIT, KEYF_FIRE, KEYF_META, KEYF_MODIFIERS, KEYF_RUN, KEYF_STANDARD, KEYHASH, Keys::keysym, KLIST_COMMAND, KLIST_EDIT, KLIST_ENTRY, KLIST_KEY, KLIST_KEY_ENTRY, KLIST_MODS, Keys::next, and reset_keybinding_status().

Referenced by on_keybinding_button_bind_clicked(), on_keybinding_button_remove_clicked(), on_keybinding_button_update_clicked(), and on_keybindings_activate().

Here is the call graph for this function:

Here is the caller graph for this function: