Commit 81256e00 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

removed the opacity and paint_mode functions...

2004-09-22  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/brushes.pdb: removed the opacity and paint_mode
	functions...

	* tools/pdbgen/pdb/context.pdb: ...and added them here.

	* app/pdb/procedural_db.c: added them to the pdb_compat hash table.

	* libgimp/Makefile.am
	* libgimp/gimpbrushes.[ch]: new files with compat functions
	which call the gimp_context_*() functions.

	* libgimp/gimp.h: changed accordingly.

	* app/pdb/brushes_cmds.c
	* app/pdb/context_cmds.c
	* app/pdb/internal_procs.c
	* libgimp/gimpbrushes_pdb.[ch]
	* libgimp/gimpcontext_pdb.[ch]: regenerated.
parent 35b372ea
2004-09-22 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/brushes.pdb: removed the opacity and paint_mode
functions...
* tools/pdbgen/pdb/context.pdb: ...and added them here.
* app/pdb/procedural_db.c: added them to the pdb_compat hash table.
* libgimp/Makefile.am
* libgimp/gimpbrushes.[ch]: new files with compat functions
which call the gimp_context_*() functions.
* libgimp/gimp.h: changed accordingly.
* app/pdb/brushes_cmds.c
* app/pdb/context_cmds.c
* app/pdb/internal_procs.c
* libgimp/gimpbrushes_pdb.[ch]
* libgimp/gimpcontext_pdb.[ch]: regenerated.
2004-09-22 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/Makefile.am
......
......@@ -39,12 +39,8 @@ static ProcRecord brushes_refresh_proc;
static ProcRecord brushes_get_list_proc;
static ProcRecord brushes_get_brush_proc;
static ProcRecord brushes_set_brush_proc;
static ProcRecord brushes_get_opacity_proc;
static ProcRecord brushes_set_opacity_proc;
static ProcRecord brushes_get_spacing_proc;
static ProcRecord brushes_set_spacing_proc;
static ProcRecord brushes_get_paint_mode_proc;
static ProcRecord brushes_set_paint_mode_proc;
static ProcRecord brushes_get_brush_data_proc;
void
......@@ -54,12 +50,8 @@ register_brushes_procs (Gimp *gimp)
procedural_db_register (gimp, &brushes_get_list_proc);
procedural_db_register (gimp, &brushes_get_brush_proc);
procedural_db_register (gimp, &brushes_set_brush_proc);
procedural_db_register (gimp, &brushes_get_opacity_proc);
procedural_db_register (gimp, &brushes_set_opacity_proc);
procedural_db_register (gimp, &brushes_get_spacing_proc);
procedural_db_register (gimp, &brushes_set_spacing_proc);
procedural_db_register (gimp, &brushes_get_paint_mode_proc);
procedural_db_register (gimp, &brushes_set_paint_mode_proc);
procedural_db_register (gimp, &brushes_get_brush_data_proc);
}
......@@ -277,89 +269,6 @@ static ProcRecord brushes_set_brush_proc =
{ { brushes_set_brush_invoker } }
};
static Argument *
brushes_get_opacity_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
Argument *return_args;
return_args = procedural_db_return_args (&brushes_get_opacity_proc, TRUE);
return_args[1].value.pdb_float = gimp_context_get_opacity (context) * 100.0;
return return_args;
}
static ProcArg brushes_get_opacity_outargs[] =
{
{
GIMP_PDB_FLOAT,
"opacity",
"The brush opacity: 0 <= opacity <= 100"
}
};
static ProcRecord brushes_get_opacity_proc =
{
"gimp_brushes_get_opacity",
"Get the brush opacity.",
"This procedure returns the opacity setting for brushes. This value is set globally and will remain the same even if the brush mask is changed. The return value is a floating point number between 0 and 100.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
0,
NULL,
1,
brushes_get_opacity_outargs,
{ { brushes_get_opacity_invoker } }
};
static Argument *
brushes_set_opacity_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gdouble opacity;
opacity = args[0].value.pdb_float;
if (opacity < 0.0 || opacity > 100.0)
success = FALSE;
if (success)
gimp_context_set_opacity (context, opacity / 100.0);
return procedural_db_return_args (&brushes_set_opacity_proc, success);
}
static ProcArg brushes_set_opacity_inargs[] =
{
{
GIMP_PDB_FLOAT,
"opacity",
"The brush opacity: 0 <= opacity <= 100"
}
};
static ProcRecord brushes_set_opacity_proc =
{
"gimp_brushes_set_opacity",
"Set the brush opacity.",
"This procedure modifies the opacity setting for brushes. This value is set globally and will remain the same even if the brush mask is changed. The value should be a floating point number between 0 and 100.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
1,
brushes_set_opacity_inargs,
0,
NULL,
{ { brushes_set_opacity_invoker } }
};
static Argument *
brushes_get_spacing_invoker (Gimp *gimp,
GimpContext *context,
......@@ -443,89 +352,6 @@ static ProcRecord brushes_set_spacing_proc =
{ { brushes_set_spacing_invoker } }
};
static Argument *
brushes_get_paint_mode_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
Argument *return_args;
return_args = procedural_db_return_args (&brushes_get_paint_mode_proc, TRUE);
return_args[1].value.pdb_int = gimp_context_get_paint_mode (context);
return return_args;
}
static ProcArg brushes_get_paint_mode_outargs[] =
{
{
GIMP_PDB_INT32,
"paint_mode",
"The paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }"
}
};
static ProcRecord brushes_get_paint_mode_proc =
{
"gimp_brushes_get_paint_mode",
"Get the brush paint mode.",
"This procedure returns the paint-mode setting for brushes. This value is set globally and will not change if a different brush is selected. The return value is an integer which corresponds to the values listed in the argument description.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
0,
NULL,
1,
brushes_get_paint_mode_outargs,
{ { brushes_get_paint_mode_invoker } }
};
static Argument *
brushes_set_paint_mode_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gint32 paint_mode;
paint_mode = args[0].value.pdb_int;
if (paint_mode < GIMP_NORMAL_MODE || paint_mode > GIMP_COLOR_ERASE_MODE)
success = FALSE;
if (success)
gimp_context_set_paint_mode (context, paint_mode);
return procedural_db_return_args (&brushes_set_paint_mode_proc, success);
}
static ProcArg brushes_set_paint_mode_inargs[] =
{
{
GIMP_PDB_INT32,
"paint_mode",
"The paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }"
}
};
static ProcRecord brushes_set_paint_mode_proc =
{
"gimp_brushes_set_paint_mode",
"Set the brush paint mode.",
"This procedure modifies the paint_mode setting for the current brush. This value is set globally and will not change if a different brush mask is selected.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
GIMP_INTERNAL,
1,
brushes_set_paint_mode_inargs,
0,
NULL,
{ { brushes_set_paint_mode_invoker } }
};
static Argument *
brushes_get_brush_data_invoker (Gimp *gimp,
GimpContext *context,
......
......@@ -41,6 +41,10 @@ static ProcRecord context_get_background_proc;
static ProcRecord context_set_background_proc;
static ProcRecord context_set_default_colors_proc;
static ProcRecord context_swap_colors_proc;
static ProcRecord context_get_opacity_proc;
static ProcRecord context_set_opacity_proc;
static ProcRecord context_get_paint_mode_proc;
static ProcRecord context_set_paint_mode_proc;
void
register_context_procs (Gimp *gimp)
......@@ -53,6 +57,10 @@ register_context_procs (Gimp *gimp)
procedural_db_register (gimp, &context_set_background_proc);
procedural_db_register (gimp, &context_set_default_colors_proc);
procedural_db_register (gimp, &context_swap_colors_proc);
procedural_db_register (gimp, &context_get_opacity_proc);
procedural_db_register (gimp, &context_set_opacity_proc);
procedural_db_register (gimp, &context_get_paint_mode_proc);
procedural_db_register (gimp, &context_set_paint_mode_proc);
}
static Argument *
......@@ -326,9 +334,9 @@ static ProcRecord context_swap_colors_proc =
"gimp_context_swap_colors",
"Swap the current GIMP foreground and background colors.",
"This procedure swaps the current GIMP foreground and background colors, so that the new foreground color becomes the old background color and vice versa.",
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
"Michael Natterer & Sven Neumann",
"2004",
GIMP_INTERNAL,
0,
NULL,
......@@ -336,3 +344,169 @@ static ProcRecord context_swap_colors_proc =
NULL,
{ { context_swap_colors_invoker } }
};
static Argument *
context_get_opacity_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
Argument *return_args;
return_args = procedural_db_return_args (&context_get_opacity_proc, TRUE);
return_args[1].value.pdb_float = gimp_context_get_opacity (context) * 100.0;
return return_args;
}
static ProcArg context_get_opacity_outargs[] =
{
{
GIMP_PDB_FLOAT,
"opacity",
"The opacity: 0 <= opacity <= 100"
}
};
static ProcRecord context_get_opacity_proc =
{
"gimp_context_get_opacity",
"Get the opacity.",
"This procedure returns the opacity setting. The return value is a floating point number between 0 and 100.",
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
"Michael Natterer & Sven Neumann",
"2004",
GIMP_INTERNAL,
0,
NULL,
1,
context_get_opacity_outargs,
{ { context_get_opacity_invoker } }
};
static Argument *
context_set_opacity_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gdouble opacity;
opacity = args[0].value.pdb_float;
if (opacity < 0.0 || opacity > 100.0)
success = FALSE;
if (success)
gimp_context_set_opacity (context, opacity / 100.0);
return procedural_db_return_args (&context_set_opacity_proc, success);
}
static ProcArg context_set_opacity_inargs[] =
{
{
GIMP_PDB_FLOAT,
"opacity",
"The opacity: 0 <= opacity <= 100"
}
};
static ProcRecord context_set_opacity_proc =
{
"gimp_context_set_opacity",
"Set the opacity.",
"This procedure modifies the opacity setting. The value should be a floating point number between 0 and 100.",
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
"Michael Natterer & Sven Neumann",
"2004",
GIMP_INTERNAL,
1,
context_set_opacity_inargs,
0,
NULL,
{ { context_set_opacity_invoker } }
};
static Argument *
context_get_paint_mode_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
Argument *return_args;
return_args = procedural_db_return_args (&context_get_paint_mode_proc, TRUE);
return_args[1].value.pdb_int = gimp_context_get_paint_mode (context);
return return_args;
}
static ProcArg context_get_paint_mode_outargs[] =
{
{
GIMP_PDB_INT32,
"paint_mode",
"The paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }"
}
};
static ProcRecord context_get_paint_mode_proc =
{
"gimp_context_get_paint_mode",
"Get the paint mode.",
"This procedure returns the paint-mode setting. The return value is an integer which corresponds to the values listed in the argument description.",
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
"Michael Natterer & Sven Neumann",
"2004",
GIMP_INTERNAL,
0,
NULL,
1,
context_get_paint_mode_outargs,
{ { context_get_paint_mode_invoker } }
};
static Argument *
context_set_paint_mode_invoker (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
Argument *args)
{
gboolean success = TRUE;
gint32 paint_mode;
paint_mode = args[0].value.pdb_int;
if (paint_mode < GIMP_NORMAL_MODE || paint_mode > GIMP_COLOR_ERASE_MODE)
success = FALSE;
if (success)
gimp_context_set_paint_mode (context, paint_mode);
return procedural_db_return_args (&context_set_paint_mode_proc, success);
}
static ProcArg context_set_paint_mode_inargs[] =
{
{
GIMP_PDB_INT32,
"paint_mode",
"The paint mode: { GIMP_NORMAL_MODE (0), GIMP_DISSOLVE_MODE (1), GIMP_BEHIND_MODE (2), GIMP_MULTIPLY_MODE (3), GIMP_SCREEN_MODE (4), GIMP_OVERLAY_MODE (5), GIMP_DIFFERENCE_MODE (6), GIMP_ADDITION_MODE (7), GIMP_SUBTRACT_MODE (8), GIMP_DARKEN_ONLY_MODE (9), GIMP_LIGHTEN_ONLY_MODE (10), GIMP_HUE_MODE (11), GIMP_SATURATION_MODE (12), GIMP_COLOR_MODE (13), GIMP_VALUE_MODE (14), GIMP_DIVIDE_MODE (15), GIMP_DODGE_MODE (16), GIMP_BURN_MODE (17), GIMP_HARDLIGHT_MODE (18), GIMP_SOFTLIGHT_MODE (19), GIMP_GRAIN_EXTRACT_MODE (20), GIMP_GRAIN_MERGE_MODE (21), GIMP_COLOR_ERASE_MODE (22) }"
}
};
static ProcRecord context_set_paint_mode_proc =
{
"gimp_context_set_paint_mode",
"Set the paint mode.",
"This procedure modifies the paint_mode setting.",
"Michael Natterer <mitch@gimp.org> & Sven Neumann <sven@gimp.org>",
"Michael Natterer & Sven Neumann",
"2004",
GIMP_INTERNAL,
1,
context_set_paint_mode_inargs,
0,
NULL,
{ { context_set_paint_mode_invoker } }
};
......@@ -103,6 +103,10 @@ procedural_db_init_procs (Gimp *gimp,
compat_procs[] =
{
{ "gimp_blend", "gimp_edit_blend" },
{ "gimp_brushes_get_opacity", "gimp_context_get_opacity" },
{ "gimp_brushes_set_opacity", "gimp_context_set_opacity" },
{ "gimp_brushes_get_paint_mode", "gimp_context_get_paint_mode" },
{ "gimp_brushes_set_paint_mode", "gimp_context_set_paint_mode" },
{ "gimp_brushes_list", "gimp_brushes_get_list" },
{ "gimp_bucket_fill", "gimp_edit_bucket_fill" },
{ "gimp_channel_delete", "gimp_drawable_delete" },
......
......@@ -103,6 +103,10 @@ procedural_db_init_procs (Gimp *gimp,
compat_procs[] =
{
{ "gimp_blend", "gimp_edit_blend" },
{ "gimp_brushes_get_opacity", "gimp_context_get_opacity" },
{ "gimp_brushes_set_opacity", "gimp_context_set_opacity" },
{ "gimp_brushes_get_paint_mode", "gimp_context_get_paint_mode" },
{ "gimp_brushes_set_paint_mode", "gimp_context_set_paint_mode" },
{ "gimp_brushes_list", "gimp_brushes_get_list" },
{ "gimp_bucket_fill", "gimp_edit_bucket_fill" },
{ "gimp_channel_delete", "gimp_drawable_delete" },
......
......@@ -103,6 +103,10 @@ procedural_db_init_procs (Gimp *gimp,
compat_procs[] =
{
{ "gimp_blend", "gimp_edit_blend" },
{ "gimp_brushes_get_opacity", "gimp_context_get_opacity" },
{ "gimp_brushes_set_opacity", "gimp_context_set_opacity" },
{ "gimp_brushes_get_paint_mode", "gimp_context_get_paint_mode" },
{ "gimp_brushes_set_paint_mode", "gimp_context_set_paint_mode" },
{ "gimp_brushes_list", "gimp_brushes_get_list" },
{ "gimp_bucket_fill", "gimp_edit_bucket_fill" },
{ "gimp_channel_delete", "gimp_drawable_delete" },
......
......@@ -85,13 +85,13 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Brushes"), 0.008);
register_brushes_procs (gimp);
(* status_callback) (NULL, _("Channel"), 0.037);
(* status_callback) (NULL, _("Channel"), 0.026);
register_channel_procs (gimp);
(* status_callback) (NULL, _("Color"), 0.06);
(* status_callback) (NULL, _("Color"), 0.05);
register_color_procs (gimp);
(* status_callback) (NULL, _("Context"), 0.094);
(* status_callback) (NULL, _("Context"), 0.084);
register_context_procs (gimp);
(* status_callback) (NULL, _("Convert"), 0.115);
......
......@@ -103,6 +103,10 @@ procedural_db_init_procs (Gimp *gimp,
compat_procs[] =
{
{ "gimp_blend", "gimp_edit_blend" },
{ "gimp_brushes_get_opacity", "gimp_context_get_opacity" },
{ "gimp_brushes_set_opacity", "gimp_context_set_opacity" },
{ "gimp_brushes_get_paint_mode", "gimp_context_get_paint_mode" },
{ "gimp_brushes_set_paint_mode", "gimp_context_set_paint_mode" },
{ "gimp_brushes_list", "gimp_brushes_get_list" },
{ "gimp_bucket_fill", "gimp_edit_bucket_fill" },
{ "gimp_channel_delete", "gimp_drawable_delete" },
......
......@@ -163,6 +163,8 @@ libgimp_2_0_la_SOURCES = \
gimptypes.h \
${PDB_WRAPPERS_C} \
${PDB_WRAPPERS_H} \
gimpbrushes.c \
gimpbrushes.h \
gimpbrushselect.c \
gimpbrushselect.h \
gimpchannel.c \
......@@ -238,6 +240,7 @@ gimpinclude_HEADERS = \
gimpcompat.h \
gimptypes.h \
${PDB_WRAPPERS_H} \
gimpbrushes.h \
gimpbrushselect.h \
gimpchannel.h \
gimpdrawable.h \
......
......@@ -31,6 +31,7 @@
#include <libgimp/gimpenums.h>
#include <libgimp/gimptypes.h>
#include <libgimp/gimpbrushes.h>
#include <libgimp/gimpbrushselect.h>
#include <libgimp/gimpchannel.h>
#include <libgimp/gimpdrawable.h>
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpbrushes.c
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <string.h>
#include "gimp.h"
/**
* gimp_brushes_get_opacity:
*
* Get the brush opacity.
*
* This procedure returns the opacity setting for brushes. This value
* is set globally and will remain the same even if the brush mask is
* changed. The return value is a floating point number between 0 and
* 100.
*
* Returns: The brush opacity.
*/
gdouble
gimp_brushes_get_opacity (void)
{
return gimp_context_get_opacity ();
}
/**
* gimp_brushes_set_opacity:
* @opacity: The brush opacity.
*
* Set the brush opacity.
*
* This procedure modifies the opacity setting for brushes. This value
* is set globally and will remain the same even if the brush mask is
* changed. The value should be a floating point number between 0 and
* 100.
*
* Returns: TRUE on success.
*/
gboolean
gimp_brushes_set_opacity (gdouble opacity)
{
return gimp_context_set_opacity (opacity);
}
/**
* gimp_brushes_get_paint_mode:
*
* Get the brush paint mode.
*
* This procedure returns the paint-mode setting for brushes. This
* value is set globally and will not change if a different brush is
* selected. The return value is an integer which corresponds to the
* values listed in the argument description.
*
* Returns: The paint mode.
*/
GimpLayerModeEffects
gimp_brushes_get_paint_mode (void)
{
return gimp_context_get_paint_mode ();
}
/**
* gimp_brushes_set_paint_mode:
* @paint_mode: The paint mode.
*
* Set the brush paint mode.
*
* This procedure modifies the paint_mode setting for the current
* brush. This value is set globally and will not change if a different
* brush mask is selected.
*
* Returns: TRUE on success.
*/
gboolean
gimp_brushes_set_paint_mode (GimpLayerModeEffects paint_mode)
{
return gimp_context_set_paint_mode (paint_mode);
}
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
*
* gimpbrushes.h
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_BRUSHES_H__
#define __GIMP_BRUSHES_H__
G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
#ifndef GIMP_DISABLE_DEPRECATED
gdouble gimp_brushes_get_opacity (void);
gboolean gimp_brushes_set_opacity (gdouble opacity);
GimpLayerModeEffects gimp_brushes_get_paint_mode (void);
gboolean gimp_brushes_set_paint_mode (GimpLayerModeEffects paint_mode);
#endif /* GIMP_DISABLE_DEPRECATED */
G_END_DECLS
#endif /* __GIMP_BRUSHES_PDB_H__ */
......@@ -173,69 +173,6 @@ gimp_brushes_set_brush (const gchar *name)
return success;
}
/**
* gimp_brushes_get_opacity:
*
* Get the brush opacity.
*
* This procedure returns the opacity setting for brushes. This value
* is set globally and will remain the same even if the brush mask is
* changed. The return value is a floating point number between 0 and
* 100.
*
* Returns: The brush opacity.
*/
gdouble
gimp_brushes_get_opacity (void)
{
GimpParam *return_vals;
gint nreturn_vals;
gdouble opacity = 0;
return_vals = gimp_run_procedure ("gimp_brushes_get_opacity",
&nreturn_vals,
GIMP_PDB_END);
if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
opacity = return_vals[1].data.d_float;
gimp_destroy_params (return_vals, nreturn_vals);
return opacity;
}
/**
* gimp_brushes_set_opacity:
* @opacity: The brush opacity.
*
* Set the brush opacity.
*
* This procedure modifies the opacity setting for brushes. This value
* is set globally and will remain the same even if the brush mask is
* changed. The value should be a floating point number between 0 and
* 100.
*
* Returns: TRUE on success.
*/
gboolean
gimp_brushes_set_opacity (gdouble opacity)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_brushes_set_opacity",
&nreturn_vals,
GIMP_PDB_FLOAT, opacity,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_brushes_get_spacing:
*
......@@ -299,68 +236,6 @@ gimp_brushes_set_spacing (gint spacing)
return success;
}
/**
* gimp_brushes_get_paint_mode:
*
* Get the brush paint mode.
*
* This procedure returns the paint-mode setting for brushes. This
* value is set globally and will not change if a different brush is
* selected. The return value is an integer which corresponds to the
* values listed in the argument description.
*
* Returns: The paint mode.
*/
GimpLayerModeEffects