gimpbrushselect_pdb.c 4.06 KB
Newer Older
1
/* LIBGIMP - The GIMP Library
2
 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * gimpbrushselect_pdb.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.
 */

/* NOTE: This file is autogenerated by pdbgen.pl */

Sven Neumann's avatar
Sven Neumann committed
24 25
#include "config.h"

26 27
#include "gimp.h"

28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
/**
 * gimp_brushes_popup:
 * @brush_callback: The callback PDB proc to call when brush selection is made.
 * @popup_title: Title to give the brush popup window.
 * @initial_brush: The name of the brush to set as the first selected.
 * @opacity: The initial opacity of the brush.
 * @spacing: The initial spacing of the brush (if < 0 then use brush default spacing).
 * @paint_mode: The initial paint mode.
 *
 * Invokes the Gimp brush selection.
 *
 * This procedure popups the brush selection dialog.
 *
 * Returns: TRUE on success.
 */
43
gboolean
44 45 46
gimp_brushes_popup (const gchar          *brush_callback,
		    const gchar          *popup_title,
		    const gchar          *initial_brush,
47 48 49 50
		    gdouble               opacity,
		    gint                  spacing,
		    GimpLayerModeEffects  paint_mode)
{
51
  GimpParam *return_vals;
52
  gint nreturn_vals;
53
  gboolean success = TRUE;
54 55 56

  return_vals = gimp_run_procedure ("gimp_brushes_popup",
				    &nreturn_vals,
57 58 59 60 61 62 63
				    GIMP_PDB_STRING, brush_callback,
				    GIMP_PDB_STRING, popup_title,
				    GIMP_PDB_STRING, initial_brush,
				    GIMP_PDB_FLOAT, opacity,
				    GIMP_PDB_INT32, spacing,
				    GIMP_PDB_INT32, paint_mode,
				    GIMP_PDB_END);
64

65 66
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

67
  gimp_destroy_params (return_vals, nreturn_vals);
68 69

  return success;
70 71
}

72 73 74 75 76 77 78 79 80 81
/**
 * gimp_brushes_close_popup:
 * @brush_callback: The name of the callback registered for this popup.
 *
 * Popdown the Gimp brush selection.
 *
 * This procedure closes an opened brush selection dialog.
 *
 * Returns: TRUE on success.
 */
82
gboolean
83
gimp_brushes_close_popup (const gchar *brush_callback)
84
{
85
  GimpParam *return_vals;
86
  gint nreturn_vals;
87
  gboolean success = TRUE;
88 89 90

  return_vals = gimp_run_procedure ("gimp_brushes_close_popup",
				    &nreturn_vals,
91 92
				    GIMP_PDB_STRING, brush_callback,
				    GIMP_PDB_END);
93

94 95
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

96
  gimp_destroy_params (return_vals, nreturn_vals);
97 98

  return success;
99 100
}

101 102 103 104 105 106 107 108 109 110 111 112 113 114
/**
 * gimp_brushes_set_popup:
 * @brush_callback: The name of the callback registered for this popup.
 * @brush_name: The name of the brush to set as selected.
 * @opacity: The initial opacity of the brush.
 * @spacing: The initial spacing of the brush (if < 0 then use brush default spacing).
 * @paint_mode: The initial paint mode.
 *
 * Sets the current brush selection in a popup.
 *
 * Sets the current brush selection in a popup.
 *
 * Returns: TRUE on success.
 */
115
gboolean
116 117
gimp_brushes_set_popup (const gchar          *brush_callback,
			const gchar          *brush_name,
118 119 120 121
			gdouble               opacity,
			gint                  spacing,
			GimpLayerModeEffects  paint_mode)
{
122
  GimpParam *return_vals;
123
  gint nreturn_vals;
124
  gboolean success = TRUE;
125 126 127

  return_vals = gimp_run_procedure ("gimp_brushes_set_popup",
				    &nreturn_vals,
128 129 130 131 132 133
				    GIMP_PDB_STRING, brush_callback,
				    GIMP_PDB_STRING, brush_name,
				    GIMP_PDB_FLOAT, opacity,
				    GIMP_PDB_INT32, spacing,
				    GIMP_PDB_INT32, paint_mode,
				    GIMP_PDB_END);
134

135 136
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

137
  gimp_destroy_params (return_vals, nreturn_vals);
138 139

  return success;
140
}