[gimp] app: implement GimpTool::oper_update() in GimpDrawTool
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: implement GimpTool::oper_update() in GimpDrawTool
- Date: Mon, 26 Jun 2017 18:30:35 +0000 (UTC)
commit f4fd10179e766387721677055c8d521cf9ed4339
Author: Michael Natterer <mitch gimp org>
Date: Mon Jun 26 20:29:42 2017 +0200
app: implement GimpTool::oper_update() in GimpDrawTool
and remove its implementations from most widget-ported subclasses.
app/tools/gimpcroptool.c | 21 ---------------------
app/tools/gimpdrawtool.c | 26 ++++++++++++++++++++++++++
app/tools/gimptransformtool.c | 24 ------------------------
app/tools/gimpvectortool.c | 21 ---------------------
4 files changed, 26 insertions(+), 66 deletions(-)
---
diff --git a/app/tools/gimpcroptool.c b/app/tools/gimpcroptool.c
index 2a9fba8..ac1165b 100644
--- a/app/tools/gimpcroptool.c
+++ b/app/tools/gimpcroptool.c
@@ -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;
}
@@ -383,21 +377,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,
GdkModifierType state,
diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c
index f4225a5..84b365c 100644
--- a/app/tools/gimpdrawtool.c
+++ b/app/tools/gimpdrawtool.c
@@ -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)
diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c
index ab6f1f3..7d418c0 100644
--- a/app/tools/gimptransformtool.c
+++ b/app/tools/gimptransformtool.c
@@ -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;
@@ -521,24 +515,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,
GdkModifierType state,
diff --git a/app/tools/gimpvectortool.c b/app/tools/gimpvectortool.c
index 97322c6..c221194 100644
--- a/app/tools/gimpvectortool.c
+++ b/app/tools/gimpvectortool.c
@@ -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;
}
@@ -359,21 +353,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,
GdkModifierType state,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]