libgimpwidgets: add gdk_event_triggers_context_menu() to gimp3migration.[ch]

and remove gimp_button_event_triggers_context_menu() again. Update
all callers to use the new function.
This commit is contained in:
Michael Natterer
2011-10-02 16:23:59 +02:00
parent fb6fea3b11
commit f1d4dde36a
21 changed files with 65 additions and 60 deletions

View File

@ -1239,40 +1239,3 @@ gimp_label_set_attributes (GtkLabel *label,
gtk_label_set_attributes (label, attrs);
pango_attr_list_unref (attrs);
}
/**
* gimp_button_event_triggers_context_menu:
* @event: a #GdkEventButton
*
* Use this function instead of checking for event->button == 3.
*
* Note that this function is a temporary solution, GTK+ 3.4 will
* include a similar function which GIMP will use and this function
* will be deprecated/removed.
*
* Returns: #TRUE if the passed @event triggers a context menu, which
* is a platform-dependent decision.
*
* Since: GIMP 2.8
**/
gboolean
gimp_button_event_triggers_context_menu (GdkEventButton *event)
{
g_return_val_if_fail (event != NULL, FALSE);
if (event->type == GDK_BUTTON_PRESS)
{
if (event->button == 3 &&
! (event->state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK)))
return TRUE;
#ifdef GDK_WINDOWING_QUARTZ
if (event->button == 1 &&
! (event->state & (GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) &&
(event->state & GDK_CONTROL_MASK))
return TRUE;
#endif
}
return FALSE;
}