示例#1
0
static void
g_paste_keybinder_deactivate_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_deactivate (keybinding);
}
示例#2
0
static void
g_paste_keybinding_dispose (GObject *object)
{
    GPasteKeybinding *self = G_PASTE_KEYBINDING (object);
    GPasteKeybindingPrivate *priv = g_paste_keybinding_get_instance_private (self);

    if (priv->active)
        g_paste_keybinding_deactivate (self);

    G_OBJECT_CLASS (g_paste_keybinding_parent_class)->dispose (object);
}
示例#3
0
static void
g_paste_keybinding_dispose (GObject *object)
{
    GPasteKeybinding *self = G_PASTE_KEYBINDING (object);
    GPasteKeybindingPrivate *priv = self->priv;

    if (priv->active)
        g_paste_keybinding_deactivate (self);
    g_object_unref (priv->xcb_wrapper);

    G_OBJECT_CLASS (g_paste_keybinding_parent_class)->dispose (object);
}
示例#4
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);
    }
}