Commit 667d8626 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

app/tools/gimptool.[ch] removed all *_get_PDB_string() functions and

2001-08-15  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.[ch]
	* app/tools/tool_manager.[ch]: removed all *_get_PDB_string()
	functions and GimpToolClass' "pdb_string" field as this info is
	stored independent from a specific tool instance in GimpToolInfo

	* app/tools/gimpbezierselecttool.c: use GimpToolInfo's "pdb_string".
parent cf622160
2001-08-15 Michael Natterer <mitch@gimp.org>
* app/tools/gimptool.[ch]
* app/tools/tool_manager.[ch]: removed all *_get_PDB_string()
functions and GimpToolClass' "pdb_string" field as this info is
stored independent from a specific tool instance in GimpToolInfo
* app/tools/gimpbezierselecttool.c: use GimpToolInfo's "pdb_string".
2001-08-14 Michael Natterer <mitch@gimp.org>
* app/interface.c
......
......@@ -36,6 +36,7 @@
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-mask.h"
#include "core/gimptoolinfo.h"
#include "pdb/procedural_db.h"
......@@ -3814,6 +3815,7 @@ bezier_stroke (GimpBezierSelectTool *bezier_sel,
gint nreturn_vals;
BezierRenderPnts *next_rpnts;
BezierRenderPnts *rpnts;
const gchar *pdb_string;
rpnts = g_new0 (BezierRenderPnts, 1);
......@@ -3822,6 +3824,8 @@ bezier_stroke (GimpBezierSelectTool *bezier_sel,
bezier_gen_points (bezier_sel,open_path,rpnts);
pdb_string = gimp_context_get_tool (gimp_get_current_context (gdisp->gimage->gimp))->pdb_string;
do
{
if (rpnts->stroke_points)
......@@ -3844,7 +3848,7 @@ bezier_stroke (GimpBezierSelectTool *bezier_sel,
/* Stroke with the correct tool */
return_vals =
procedural_db_run_proc (gdisp->gimage->gimp,
tool_manager_active_get_PDB_string (gdisp->gimage->gimp),
pdb_string,
&nreturn_vals,
GIMP_PDB_DRAWABLE, gimp_drawable_get_ID (drawable),
GIMP_PDB_INT32, (gint32) rpnts->num_stroke_points * 2,
......
......@@ -358,19 +358,6 @@ gimp_tool_oper_update (GimpTool *tool,
}
const gchar *
gimp_tool_get_PDB_string (GimpTool *tool)
{
GimpToolClass *tool_class;
g_return_val_if_fail (GIMP_IS_TOOL (tool), NULL);
tool_class = GIMP_TOOL_GET_CLASS (tool);
return tool_class->pdb_string;
}
/* standard member functions */
static void
......
......@@ -70,11 +70,6 @@ struct _GimpToolClass
{
GimpObjectClass parent_class;
/* stuff to be filled in by child classes */
/* FIXME: most of this stuff must go away */
gchar *pdb_string;
void (* initialize) (GimpTool *tool,
GDisplay *gdisp);
void (* control) (GimpTool *tool,
......@@ -132,7 +127,6 @@ void gimp_tool_cursor_update (GimpTool *tool,
void gimp_tool_oper_update (GimpTool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp);
const gchar * gimp_tool_get_PDB_string (GimpTool *tool);
#endif /* __GIMP_TOOL_H__ */
......@@ -529,60 +529,6 @@ tool_manager_get_info_by_tool (Gimp *gimp,
return tool_manager_get_info_by_type (gimp, G_TYPE_FROM_INSTANCE (tool));
}
const gchar *
tool_manager_active_get_PDB_string (Gimp *gimp)
{
GimpToolManager *tool_manager;
GimpToolInfo *tool_info;
const gchar *tool_str = "gimp_paintbrush_default";
/* Return the correct PDB function for the active tool
* The default is paintbrush if the tool is not recognized
*/
tool_manager = tool_manager_get (gimp);
if (! tool_manager->active_tool)
return tool_str;
tool_info = gimp_context_get_tool (gimp_get_user_context (gimp));
if (tool_info->tool_type == GIMP_TYPE_PENCIL_TOOL)
{
tool_str = "gimp_pencil";
}
else if (tool_info->tool_type == GIMP_TYPE_PAINTBRUSH_TOOL)
{
tool_str = "gimp_paintbrush_default";
}
else if (tool_info->tool_type == GIMP_TYPE_ERASER_TOOL)
{
tool_str = "gimp_eraser_default";
}
else if (tool_info->tool_type == GIMP_TYPE_AIRBRUSH_TOOL)
{
tool_str = "gimp_airbrush_default";
}
else if (tool_info->tool_type == GIMP_TYPE_CLONE_TOOL)
{
tool_str = "gimp_clone_default";
}
else if (tool_info->tool_type == GIMP_TYPE_CONVOLVE_TOOL)
{
tool_str = "gimp_convolve_default";
}
else if (tool_info->tool_type == GIMP_TYPE_SMUDGE_TOOL)
{
tool_str = "gimp_smudge_default";
}
else if (tool_info->tool_type == GIMP_TYPE_DODGEBURN_TOOL)
{
tool_str = "gimp_dodgeburn_default";
}
return tool_str;
}
const gchar *
tool_manager_active_get_help_data (Gimp *gimp)
{
......
......@@ -44,7 +44,6 @@ void tool_manager_control_active (Gimp *gimp,
ToolAction action,
GDisplay *gdisp);
const gchar * tool_manager_active_get_PDB_string (Gimp *gimp);
const gchar * tool_manager_active_get_help_data (Gimp *gimp);
......
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