Commit f4fd1017 authored by Michael Natterer's avatar Michael Natterer 😴

app: implement GimpTool::oper_update() in GimpDrawTool

and remove its implementations from most widget-ported subclasses.
parent 4e50eb50
......@@ -71,11 +71,6 @@ static void gimp_crop_tool_active_modifier_key (GimpTool
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_crop_tool_oper_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display);
static void gimp_crop_tool_cursor_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
......@@ -161,7 +156,6 @@ gimp_crop_tool_class_init (GimpCropToolClass *klass)
tool_class->button_release = gimp_crop_tool_button_release;
tool_class->motion = gimp_crop_tool_motion;
tool_class->active_modifier_key = gimp_crop_tool_active_modifier_key;
tool_class->oper_update = gimp_crop_tool_oper_update;
tool_class->cursor_update = gimp_crop_tool_cursor_update;
tool_class->options_notify = gimp_crop_tool_options_notify;
}
......@@ -382,21 +376,6 @@ gimp_crop_tool_active_modifier_key (GimpTool *tool,
}
}
static void
gimp_crop_tool_oper_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display)
{
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
if (crop_tool->rectangle && display == tool->display)
{
gimp_tool_widget_hover (crop_tool->rectangle, coords, state, proximity);
}
}
static void
gimp_crop_tool_cursor_update (GimpTool *tool,
const GimpCoords *coords,
......
......@@ -74,6 +74,11 @@ static gboolean gimp_draw_tool_key_press (GimpTool *tool,
static gboolean gimp_draw_tool_key_release (GimpTool *tool,
GdkEventKey *kevent,
GimpDisplay *display);
static void gimp_draw_tool_oper_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display);
static void gimp_draw_tool_draw (GimpDrawTool *draw_tool);
static void gimp_draw_tool_undraw (GimpDrawTool *draw_tool);
......@@ -98,6 +103,7 @@ gimp_draw_tool_class_init (GimpDrawToolClass *klass)
tool_class->control = gimp_draw_tool_control;
tool_class->key_press = gimp_draw_tool_key_press;
tool_class->key_release = gimp_draw_tool_key_release;
tool_class->oper_update = gimp_draw_tool_oper_update;
klass->draw = gimp_draw_tool_real_draw;
}
......@@ -213,6 +219,26 @@ gimp_draw_tool_key_release (GimpTool *tool,
return GIMP_TOOL_CLASS (parent_class)->key_release (tool, kevent, display);
}
static void
gimp_draw_tool_oper_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display)
{
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
if (draw_tool->widget && display == draw_tool->display)
{
gimp_tool_widget_hover (draw_tool->widget, coords, state, proximity);
}
else
{
GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state,
proximity, display);
}
}
#ifdef USE_TIMEOUT
static gboolean
gimp_draw_tool_draw_timeout (GimpDrawTool *draw_tool)
......
......@@ -91,11 +91,6 @@ static void gimp_transform_tool_modifier_key (GimpTool
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_transform_tool_oper_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display);
static void gimp_transform_tool_cursor_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
......@@ -191,7 +186,6 @@ gimp_transform_tool_class_init (GimpTransformToolClass *klass)
tool_class->motion = gimp_transform_tool_motion;
tool_class->modifier_key = gimp_transform_tool_modifier_key;
tool_class->active_modifier_key = gimp_transform_tool_modifier_key;
tool_class->oper_update = gimp_transform_tool_oper_update;
tool_class->cursor_update = gimp_transform_tool_cursor_update;
tool_class->get_undo_desc = gimp_transform_tool_get_undo_desc;
tool_class->get_redo_desc = gimp_transform_tool_get_redo_desc;
......@@ -520,24 +514,6 @@ gimp_transform_tool_modifier_key (GimpTool *tool,
}
}
static void
gimp_transform_tool_oper_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display)
{
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (tool);
if (tr_tool->widget)
{
if (display == tool->display)
{
gimp_tool_widget_hover (tr_tool->widget, coords, state, proximity);
}
}
}
static void
gimp_transform_tool_cursor_update (GimpTool *tool,
const GimpCoords *coords,
......
......@@ -93,11 +93,6 @@ static void gimp_vector_tool_modifier_key (GimpTool *tool,
gboolean press,
GdkModifierType state,
GimpDisplay *display);
static void gimp_vector_tool_oper_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display);
static void gimp_vector_tool_cursor_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
......@@ -189,7 +184,6 @@ gimp_vector_tool_class_init (GimpVectorToolClass *klass)
tool_class->button_release = gimp_vector_tool_button_release;
tool_class->motion = gimp_vector_tool_motion;
tool_class->modifier_key = gimp_vector_tool_modifier_key;
tool_class->oper_update = gimp_vector_tool_oper_update;
tool_class->cursor_update = gimp_vector_tool_cursor_update;
}
......@@ -358,21 +352,6 @@ gimp_vector_tool_modifier_key (GimpTool *tool,
}
}
static void
gimp_vector_tool_oper_update (GimpTool *tool,
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display)
{
GimpVectorTool *vector_tool = GIMP_VECTOR_TOOL (tool);
if (display == tool->display && vector_tool->path)
{
gimp_tool_widget_hover (vector_tool->path, coords, state, proximity);
}
}
static void
gimp_vector_tool_cursor_update (GimpTool *tool,
const GimpCoords *coords,
......
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