Пример #1
0
static void
g_paste_keybinder_activate_keybinding_func (gpointer data,
                                            gpointer user_data G_GNUC_UNUSED)
{
    GPasteKeybinding *keybinding = G_PASTE_KEYBINDING (data);

    if (!g_paste_keybinding_is_active (keybinding))
        g_paste_keybinding_activate (keybinding);
}
Пример #2
0
/**
 * g_paste_keybinding_rebind:
 * @self: a #GPasteKeybinding instance
 * @binding: the new keybinding
 *
 * Rebind to a new keybinding
 *
 * Returns:
 */
G_PASTE_VISIBLE void
g_paste_keybinding_rebind (GPasteKeybinding  *self,
                           const gchar       *binding)
{
    g_return_if_fail (G_PASTE_IS_KEYBINDING (self));
    g_return_if_fail (binding != NULL);

    GPasteKeybindingPrivate *priv = self->priv;

    g_free (priv->binding);
    priv->binding = g_strdup (binding);

    if (priv->active)
    {
        g_paste_keybinding_deactivate (self);
        g_paste_keybinding_activate (self);
    }
}