app: add gimp_tool_widget_{set,get}_focus(); "focus-changed" signal

The next few commits are going to add support for using multiple
tool widgets simultaneously.  As a first step, add a notion of a
focused tool widget, by adding gimp_tool_widget_{set,get}_focus(),
which tools/subclasses can use to control focus, and a
corresponding "focus-changed" signal, which tools/subclasses can
use to respond to focus changes.

(cherry picked from commit eeed9c413b)
This commit is contained in:
Ell
2018-06-02 01:38:38 -04:00
parent 1b1a89978f
commit f4f1ecf54a
2 changed files with 39 additions and 0 deletions

View File

@ -69,6 +69,7 @@ struct _GimpToolWidgetClass
const gchar *separator,
gdouble y,
const gchar *help);
void (* focus_changed) (GimpToolWidget *widget);
/* virtual functions */
gint (* button_press) (GimpToolWidget *widget,
@ -119,6 +120,10 @@ GType gimp_tool_widget_get_type (void) G_GNUC_CONST;
GimpDisplayShell * gimp_tool_widget_get_shell (GimpToolWidget *widget);
GimpCanvasItem * gimp_tool_widget_get_item (GimpToolWidget *widget);
void gimp_tool_widget_set_focus (GimpToolWidget *widget,
gboolean focus);
gboolean gimp_tool_widget_get_focus (GimpToolWidget *widget);
/* for subclasses, to notify the handling tool
*/
void gimp_tool_widget_response (GimpToolWidget *widget,