Commit 91deb614 authored by Michael Natterer's avatar Michael Natterer 😴

app: add virtual functions GimpToolWidget::key_press() and ::key_release()

and api to call them. Not used anywhere yet.
parent d2bfbfb7
......@@ -492,6 +492,32 @@ gimp_tool_widget_hover (GimpToolWidget *widget,
coords, state, proximity);
}
gboolean
gimp_tool_widget_key_press (GimpToolWidget *widget,
GdkEventKey *kevent)
{
g_return_val_if_fail (GIMP_IS_TOOL_WIDGET (widget), FALSE);
g_return_val_if_fail (kevent != NULL, FALSE);
if (GIMP_TOOL_WIDGET_GET_CLASS (widget)->key_press)
return GIMP_TOOL_WIDGET_GET_CLASS (widget)->key_press (widget, kevent);
return FALSE;
}
gboolean
gimp_tool_widget_key_release (GimpToolWidget *widget,
GdkEventKey *kevent)
{
g_return_val_if_fail (GIMP_IS_TOOL_WIDGET (widget), FALSE);
g_return_val_if_fail (kevent != NULL, FALSE);
if (GIMP_TOOL_WIDGET_GET_CLASS (widget)->key_release)
return GIMP_TOOL_WIDGET_GET_CLASS (widget)->key_release (widget, kevent);
return FALSE;
}
void
gimp_tool_widget_motion_modifier (GimpToolWidget *widget,
GdkModifierType key,
......
......@@ -78,6 +78,11 @@ struct _GimpToolWidgetClass
GdkModifierType state,
gboolean proximity);
gboolean (* key_press) (GimpToolWidget *widget,
GdkEventKey *kevent);
gboolean (* key_release) (GimpToolWidget *widget,
GdkEventKey *kevent);
void (* motion_modifier) (GimpToolWidget *widget,
GdkModifierType key,
gboolean press,
......@@ -172,6 +177,11 @@ void gimp_tool_widget_hover (GimpToolWidget *widget,
GdkModifierType state,
gboolean proximity);
gboolean gimp_tool_widget_key_press (GimpToolWidget *widget,
GdkEventKey *kevent);
gboolean gimp_tool_widget_key_release (GimpToolWidget *widget,
GdkEventKey *kevent);
void gimp_tool_widget_motion_modifier (GimpToolWidget *widget,
GdkModifierType key,
gboolean press,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment