Commit ffd6c2ed authored by Ell's avatar Ell

app: add GimpPaintTool::paint_prepare() vfunc

... which is called when starting to paint, before the tool's
paint-core is started, allowing the tool to configure the core.
Move the call to gimp_paint_core_set_show_all() to the default
implementation of paint_prepare().
parent 35f55ef0
......@@ -262,7 +262,9 @@ gimp_paint_tool_paint_start (GimpPaintTool *paint_tool,
if (gimp_paint_tool_paint_use_thread (paint_tool))
gimp_drawable_start_paint (drawable);
gimp_paint_core_set_show_all (core, shell->show_all);
/* Prepare to start the paint core */
if (GIMP_PAINT_TOOL_GET_CLASS (paint_tool)->paint_prepare)
GIMP_PAINT_TOOL_GET_CLASS (paint_tool)->paint_prepare (paint_tool, display);
/* Start the paint core */
if (! gimp_paint_core_start (core,
......
......@@ -99,6 +99,10 @@ static void gimp_paint_tool_oper_update (GimpTool *tool,
static void gimp_paint_tool_draw (GimpDrawTool *draw_tool);
static void
gimp_paint_tool_real_paint_prepare (GimpPaintTool *paint_tool,
GimpDisplay *display);
static GimpCanvasItem *
gimp_paint_tool_get_outline (GimpPaintTool *paint_tool,
GimpDisplay *display,
......@@ -142,6 +146,8 @@ gimp_paint_tool_class_init (GimpPaintToolClass *klass)
tool_class->oper_update = gimp_paint_tool_oper_update;
draw_tool_class->draw = gimp_paint_tool_draw;
klass->paint_prepare = gimp_paint_tool_real_paint_prepare;
}
static void
......@@ -817,6 +823,15 @@ gimp_paint_tool_draw (GimpDrawTool *draw_tool)
GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
}
static void
gimp_paint_tool_real_paint_prepare (GimpPaintTool *paint_tool,
GimpDisplay *display)
{
GimpDisplayShell *shell = gimp_display_get_shell (display);
gimp_paint_core_set_show_all (paint_tool->core, shell->show_all);
}
static GimpCanvasItem *
gimp_paint_tool_get_outline (GimpPaintTool *paint_tool,
GimpDisplay *display,
......
......@@ -69,6 +69,8 @@ struct _GimpPaintToolClass
{
GimpColorToolClass parent_class;
void (* paint_prepare) (GimpPaintTool *paint_tool,
GimpDisplay *display);
void (* paint_start) (GimpPaintTool *paint_tool);
void (* paint_end) (GimpPaintTool *paint_tool);
void (* paint_flush) (GimpPaintTool *paint_tool);
......
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