Commit 8cee4963 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

check for GIMP_IS_DISPLAY(gdisp) again.

2003-04-15  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.c: check for GIMP_IS_DISPLAY(gdisp) again.

	* app/tools/gimptool.h: don't #include "gimptoolcontrol.h"

	* app/tools/[all tools].c: #include "gimptoolcontrol.h"
parent 6899ca21
2003-04-15 Michael Natterer <mitch@gimp.org>
* app/tools/gimptool.c: check for GIMP_IS_DISPLAY(gdisp) again.
* app/tools/gimptool.h: don't #include "gimptoolcontrol.h"
* app/tools/[all tools].c: #include "gimptoolcontrol.h"
2003-04-15 Sven Neumann <sven@gimp.org>
* app/tools/Makefile.am
......@@ -48,6 +48,7 @@
#include "gimpinkoptions.h"
#include "gimpinktool.h"
#include "gimpinktool-blob.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -32,6 +32,7 @@
#include "widgets/gimppropwidgets.h"
#include "gimpairbrushtool.h"
#include "gimptoolcontrol.h"
#include "paint_options.h"
#include "gimp-intl.h"
......
......@@ -52,6 +52,7 @@
#include "gimpeditselectiontool.h"
#include "gimpbezierselecttool.h"
#include "gimpselectionoptions.h"
#include "gimptoolcontrol.h"
#include "tool_manager.h"
#include "app_procs.h"
......
......@@ -39,6 +39,7 @@
#include "gimpblendoptions.h"
#include "gimpblendtool.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -46,6 +46,7 @@
#include "gimpcolorpickeroptions.h"
#include "gimpcolorpickertool.h"
#include "gimppainttool.h"
#include "gimptoolcontrol.h"
#include "tool_manager.h"
#include "gimp-intl.h"
......
......@@ -38,6 +38,7 @@
#include "gimpbucketfilloptions.h"
#include "gimpbucketfilltool.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -35,6 +35,7 @@
#include "gimpbycolorselecttool.h"
#include "gimpselectionoptions.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -37,6 +37,7 @@
#include "widgets/gimppropwidgets.h"
#include "gimpclonetool.h"
#include "gimptoolcontrol.h"
#include "paint_options.h"
#include "gimp-intl.h"
......
......@@ -46,6 +46,7 @@
#include "gimpcolorpickeroptions.h"
#include "gimpcolorpickertool.h"
#include "gimptoolcontrol.h"
#include "tool_manager.h"
#include "gimp-intl.h"
......
......@@ -44,6 +44,7 @@
#include "widgets/gimpwidgets-utils.h"
#include "gimpconvolvetool.h"
#include "gimptoolcontrol.h"
#include "paint_options.h"
#include "gimp-intl.h"
......
......@@ -46,6 +46,7 @@
#include "gimpcropoptions.h"
#include "gimpcroptool.h"
#include "gimptoolcontrol.h"
#include "tool_manager.h"
#include "gimp-intl.h"
......
......@@ -50,6 +50,7 @@
#include "display/gimpdisplay.h"
#include "gimpcurvestool.h"
#include "gimptoolcontrol.h"
#include "tool_manager.h"
#include "gimp-intl.h"
......
......@@ -33,6 +33,7 @@
#include "widgets/gimpwidgets-utils.h"
#include "gimpdodgeburntool.h"
#include "gimptoolcontrol.h"
#include "paint_options.h"
#include "gimp-intl.h"
......
......@@ -31,7 +31,6 @@
#include "base/boundary.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-guides.h"
#include "core/gimpimage-mask.h"
......@@ -47,8 +46,9 @@
#include "display/gimpdisplayshell-selection.h"
#include "display/gimpdisplayshell-transform.h"
#include "gimpeditselectiontool.h"
#include "gimpdrawtool.h"
#include "gimpeditselectiontool.h"
#include "gimptoolcontrol.h"
#include "tool_manager.h"
#include "path_transform.h"
......
......@@ -36,6 +36,7 @@
#include "gimpellipseselecttool.h"
#include "gimpselectionoptions.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -33,6 +33,7 @@
#include "widgets/gimpwidgets-utils.h"
#include "gimperasertool.h"
#include "gimptoolcontrol.h"
#include "paint_options.h"
#include "gimp-intl.h"
......
......@@ -39,6 +39,7 @@
#include "gimpflipoptions.h"
#include "gimpfliptool.h"
#include "gimptoolcontrol.h"
#include "path_transform.h"
......
......@@ -41,6 +41,7 @@
#include "gimpeditselectiontool.h"
#include "gimpfreeselecttool.h"
#include "gimpselectionoptions.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -32,7 +32,6 @@
#include "base/pixel-region.h"
#include "core/gimpchannel.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-contiguous-region.h"
#include "core/gimpimage-mask.h"
......@@ -48,6 +47,7 @@
#include "gimpeditselectiontool.h"
#include "gimpfuzzyselecttool.h"
#include "gimpselectionoptions.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -36,6 +36,7 @@
#include "display/gimpdisplayshell.h"
#include "gimpimagemaptool.h"
#include "gimptoolcontrol.h"
#include "tool_manager.h"
#include "gimp-intl.h"
......
......@@ -48,6 +48,7 @@
#include "gimpinkoptions.h"
#include "gimpinktool.h"
#include "gimpinktool-blob.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -77,6 +77,7 @@
#include "gimpiscissorstool.h"
#include "gimpeditselectiontool.h"
#include "gimpselectionoptions.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -54,6 +54,7 @@
#include "display/gimpdisplay.h"
#include "gimplevelstool.h"
#include "gimptoolcontrol.h"
#include "tool_manager.h"
#include "gimp-intl.h"
......
......@@ -42,6 +42,7 @@
#include "gimpmagnifyoptions.h"
#include "gimpmagnifytool.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -51,6 +51,7 @@
#include "gimpmeasureoptions.h"
#include "gimpmeasuretool.h"
#include "gimptoolcontrol.h"
#include "tool_manager.h"
#include "gimp-intl.h"
......
......@@ -44,6 +44,7 @@
#include "gimpeditselectiontool.h"
#include "gimpmoveoptions.h"
#include "gimpmovetool.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -28,6 +28,7 @@
#include "paint/gimppaintoptions.h"
#include "gimppaintbrushtool.h"
#include "gimptoolcontrol.h"
#include "paint_options.h"
#include "gimp-intl.h"
......
......@@ -46,6 +46,7 @@
#include "gimpcolorpickeroptions.h"
#include "gimpcolorpickertool.h"
#include "gimppainttool.h"
#include "gimptoolcontrol.h"
#include "tool_manager.h"
#include "gimp-intl.h"
......
......@@ -28,6 +28,7 @@
#include "paint/gimppaintoptions.h"
#include "gimppenciltool.h"
#include "gimptoolcontrol.h"
#include "paint_options.h"
#include "gimp-intl.h"
......
......@@ -40,6 +40,7 @@
#include "gui/info-dialog.h"
#include "gimpperspectivetool.h"
#include "gimptoolcontrol.h"
#include "gimptransformoptions.h"
#include "gimp-intl.h"
......
......@@ -43,6 +43,7 @@
#include "gimpeditselectiontool.h"
#include "gimprectselecttool.h"
#include "gimpselectionoptions.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -32,7 +32,6 @@
#include "base/pixel-region.h"
#include "core/gimpchannel.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-contiguous-region.h"
#include "core/gimpimage-mask.h"
......@@ -48,6 +47,7 @@
#include "gimpeditselectiontool.h"
#include "gimpfuzzyselecttool.h"
#include "gimpselectionoptions.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -43,6 +43,7 @@
#include "gui/info-dialog.h"
#include "gimprotatetool.h"
#include "gimptoolcontrol.h"
#include "gimptransformoptions.h"
#include "gimp-intl.h"
......
......@@ -42,6 +42,7 @@
#include "gui/info-dialog.h"
#include "gimpscaletool.h"
#include "gimptoolcontrol.h"
#include "gimptransformoptions.h"
#include "gimp-intl.h"
......
......@@ -34,6 +34,7 @@
#include "gimpeditselectiontool.h"
#include "gimpselectiontool.h"
#include "gimpselectionoptions.h"
#include "gimptoolcontrol.h"
static void gimp_selection_tool_class_init (GimpSelectionToolClass *klass);
......
......@@ -42,6 +42,7 @@
#include "gui/info-dialog.h"
#include "gimpsheartool.h"
#include "gimptoolcontrol.h"
#include "gimptransformoptions.h"
#include "gimp-intl.h"
......
......@@ -32,6 +32,7 @@
#include "widgets/gimppropwidgets.h"
#include "gimpsmudgetool.h"
#include "gimptoolcontrol.h"
#include "paint_options.h"
#include "gimp-intl.h"
......
......@@ -37,6 +37,7 @@
#include "widgets/gimppropwidgets.h"
#include "gimpclonetool.h"
#include "gimptoolcontrol.h"
#include "paint_options.h"
#include "gimp-intl.h"
......
......@@ -50,6 +50,7 @@
#include "gimptextoptions.h"
#include "gimptexttool.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
......
......@@ -170,7 +170,28 @@ gimp_tool_real_control (GimpTool *tool,
{
}
static void
gimp_tool_real_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
tool->gdisp = gdisp;
tool->drawable = gimp_image_active_drawable (gdisp->gimage);
gimp_tool_control_activate (tool->control);
}
static void
gimp_tool_real_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
gimp_tool_control_halt (tool->control);
}
static void
gimp_tool_real_motion (GimpTool *tool,
......@@ -235,6 +256,7 @@ gimp_tool_initialize (GimpTool *tool,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
GIMP_TOOL_GET_CLASS (tool)->initialize (tool, gdisp);
}
......@@ -291,9 +313,7 @@ gimp_tool_button_press (GimpTool *tool,
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
GIMP_TOOL_GET_CLASS (tool)->button_press (tool, coords, time, state, gdisp);
}
......@@ -307,9 +327,7 @@ gimp_tool_button_release (GimpTool *tool,
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
GIMP_TOOL_GET_CLASS (tool)->button_release (tool, coords, time, state, gdisp);
}
......@@ -323,8 +341,7 @@ gimp_tool_motion (GimpTool *tool,
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
GIMP_TOOL_GET_CLASS (tool)->motion (tool, coords, time, state, gdisp);
}
......@@ -335,8 +352,7 @@ gimp_tool_arrow_key (GimpTool *tool,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
/* FIXME */
/* g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); */
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
GIMP_TOOL_GET_CLASS (tool)->arrow_key (tool, kevent, gdisp);
}
......@@ -349,8 +365,7 @@ gimp_tool_modifier_key (GimpTool *tool,
GimpDisplay *gdisp)
{
g_return_if_fail (GIMP_IS_TOOL (tool));
/* FIXME */
/* g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); */
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
GIMP_TOOL_GET_CLASS (tool)->modifier_key (tool, key, press, state, gdisp);
}
......@@ -363,8 +378,7 @@ gimp_tool_oper_update (GimpTool *tool,
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME*/
/*g_return_if_fail (GIMP_IS_DISPLAY (gdisp));*/
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
GIMP_TOOL_GET_CLASS (tool)->oper_update (tool, coords, state, gdisp);
}
......@@ -377,8 +391,7 @@ gimp_tool_cursor_update (GimpTool *tool,
{
g_return_if_fail (GIMP_IS_TOOL (tool));
g_return_if_fail (coords != NULL);
/* FIXME */
/* g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); */
g_return_if_fail (GIMP_IS_DISPLAY (gdisp));
GIMP_TOOL_GET_CLASS (tool)->cursor_update (tool, coords, state, gdisp);
}
......@@ -453,27 +466,3 @@ gimp_tool_set_cursor (GimpTool *tool,
tool_cursor,
modifier);
}
void
gimp_tool_real_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
tool->gdisp = gdisp;
tool->drawable = gimp_image_active_drawable (gdisp->gimage);
gimp_tool_control_activate (tool->control);
}
void
gimp_tool_real_button_release (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *gdisp)
{
gimp_tool_control_halt (tool->control);
}
......@@ -19,8 +19,8 @@
#ifndef __GIMP_TOOL_H__
#define __GIMP_TOOL_H__
#include "core/gimpobject.h"
#include "gimptoolcontrol.h"
#define GIMP_TYPE_TOOL (gimp_tool_get_type ())
......@@ -35,16 +35,16 @@ typedef struct _GimpToolClass GimpToolClass;
struct _GimpTool
{
GimpObject parent_instance;
GimpObject parent_instance;
GimpToolInfo *tool_info;
GimpToolInfo *tool_info;
gint ID; /* unique tool ID */
gint ID; /* unique tool ID */
GimpToolControl *control;
GimpToolControl *control;
GimpDisplay *gdisp; /* pointer to currently active gdisp */
GimpDrawable *drawable; /* pointer to the tool's current drawable */
GimpDisplay *gdisp; /* pointer to currently active gdisp */
GimpDrawable *drawable; /* pointer to the tool's current drawable */
};
struct _GimpToolClass
......
......@@ -28,6 +28,7 @@
#include "core/gimpimage.h"
#include "core/gimpundo.h"
#include "gimptoolcontrol.h"
#include "gimptransformtool.h"
#include "gimptransformtool-undo.h"
#include "tool_manager.h"
......
......@@ -54,6 +54,7 @@
#include "display/gimpdisplay-foreach.h"
#include "display/gimpprogress.h"
#include "gimptoolcontrol.h"
#include "gimptransformoptions.h"
#include "gimptransformtool.h"
#include "gimptransformtool-undo.h"
......
......@@ -44,6 +44,7 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "gimptoolcontrol.h"
#include "gimpvectoroptions.h"
#include "gimpvectortool.h"
......
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