mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 19:30:10 +00:00
Remove unneeded code from GtkBindingSet
This commit is contained in:
parent
9a3466832c
commit
b5bee0a827
@ -1383,120 +1383,6 @@ gtk_binding_set_add_path (GtkBindingSet *binding_set,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
binding_match_activate (GSList *pspec_list,
|
||||
GObject *object,
|
||||
guint path_length,
|
||||
gchar *path,
|
||||
gchar *path_reversed,
|
||||
gboolean *unbound)
|
||||
{
|
||||
GSList *slist;
|
||||
|
||||
*unbound = FALSE;
|
||||
|
||||
for (slist = pspec_list; slist; slist = slist->next)
|
||||
{
|
||||
PatternSpec *pspec;
|
||||
GtkBindingSet *binding_set;
|
||||
|
||||
binding_set = NULL;
|
||||
pspec = slist->data;
|
||||
|
||||
if (pspec->type != GTK_PATH_WIDGET_CLASS)
|
||||
{
|
||||
if (g_pattern_match (pspec->pspec, path_length, path, path_reversed))
|
||||
binding_set = pspec->user_data;
|
||||
}
|
||||
|
||||
if (binding_set)
|
||||
{
|
||||
if (binding_set->current->marks_unbound)
|
||||
{
|
||||
*unbound = TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (gtk_binding_entry_activate (binding_set->current, object))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_binding_pattern_compare (gconstpointer new_pattern,
|
||||
gconstpointer existing_pattern)
|
||||
{
|
||||
register const PatternSpec *np = new_pattern;
|
||||
register const PatternSpec *ep = existing_pattern;
|
||||
|
||||
/* walk the list as long as the existing patterns have
|
||||
* higher priorities.
|
||||
*/
|
||||
|
||||
return np->seq_id < ep->seq_id;
|
||||
}
|
||||
|
||||
static GSList*
|
||||
gtk_binding_entries_sort_patterns (GSList *entries,
|
||||
GtkPathType path_id,
|
||||
gboolean is_release)
|
||||
{
|
||||
GSList *patterns;
|
||||
GSList *tmp_list;
|
||||
|
||||
patterns = NULL;
|
||||
for (tmp_list = entries; tmp_list; tmp_list = tmp_list->next)
|
||||
{
|
||||
GtkBindingEntry *entry = tmp_list->data;
|
||||
GtkBindingSet *binding_set;
|
||||
|
||||
binding_set = entry->binding_set;
|
||||
binding_set->current = NULL;
|
||||
}
|
||||
|
||||
for (; entries; entries = entries->next)
|
||||
{
|
||||
GtkBindingEntry *entry = entries->data;
|
||||
GtkBindingSet *binding_set;
|
||||
GSList *slist = NULL;
|
||||
|
||||
if (is_release != ((entry->modifiers & GDK_RELEASE_MASK) != 0))
|
||||
continue;
|
||||
|
||||
binding_set = entry->binding_set;
|
||||
|
||||
if (binding_set->current)
|
||||
continue;
|
||||
binding_set->current = entry;
|
||||
|
||||
switch (path_id)
|
||||
{
|
||||
case GTK_PATH_WIDGET:
|
||||
slist = binding_set->widget_path_pspecs;
|
||||
break;
|
||||
case GTK_PATH_WIDGET_CLASS:
|
||||
slist = binding_set->widget_class_pspecs;
|
||||
break;
|
||||
case GTK_PATH_CLASS:
|
||||
slist = binding_set->class_branch_pspecs;
|
||||
break;
|
||||
}
|
||||
|
||||
for (; slist; slist = slist->next)
|
||||
{
|
||||
PatternSpec *pspec;
|
||||
|
||||
pspec = slist->data;
|
||||
patterns = g_slist_insert_sorted (patterns, pspec, gtk_binding_pattern_compare);
|
||||
}
|
||||
}
|
||||
|
||||
return patterns;
|
||||
}
|
||||
|
||||
static gint
|
||||
find_entry_with_binding (GtkBindingEntry *entry,
|
||||
GtkBindingSet *binding_set)
|
||||
|
Loading…
Reference in New Issue
Block a user