gimpbrushselect_pdb.c 4.72 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
 *
 * 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.
 */

22
/* NOTE: This file is auto-generated by pdbgen.pl */
23

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

26 27
#include "gimp.h"

28 29 30
/**
 * gimp_brushes_popup:
 * @brush_callback: The callback PDB proc to call when brush selection is made.
31
 * @popup_title: Title of the brush selection dialog.
32 33 34 35 36 37 38
 * @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.
 *
39
 * This procedure opens the brush selection dialog.
40 41 42
 *
 * Returns: TRUE on success.
 */
43
gboolean
44
gimp_brushes_popup (const gchar          *brush_callback,
45 46 47 48 49
                    const gchar          *popup_title,
                    const gchar          *initial_brush,
                    gdouble               opacity,
                    gint                  spacing,
                    GimpLayerModeEffects  paint_mode)
50
{
51
  GimpParam *return_vals;
52
  gint nreturn_vals;
53
  gboolean success = TRUE;
54

55
  return_vals = gimp_run_procedure ("gimp-brushes-popup",
56 57 58 59 60 61 62 63
                                    &nreturn_vals,
                                    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
/**
 * gimp_brushes_close_popup:
74
 * @brush_callback: The name of the callback registered for this pop-up.
75
 *
76
 * Close the brush selection dialog.
77 78 79 80 81
 *
 * 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
  return_vals = gimp_run_procedure ("gimp-brushes-close-popup",
90 91 92
                                    &nreturn_vals,
                                    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
/**
 * gimp_brushes_set_popup:
103
 * @brush_callback: The name of the callback registered for this pop-up.
104 105 106 107 108
 * @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.
 *
109
 * Sets the current brush in a brush selection dialog.
110
 *
111
 * Sets the current brush in a brush selection dialog.
112 113 114
 *
 * Returns: TRUE on success.
 */
115
gboolean
116
gimp_brushes_set_popup (const gchar          *brush_callback,
117 118 119 120
                        const gchar          *brush_name,
                        gdouble               opacity,
                        gint                  spacing,
                        GimpLayerModeEffects  paint_mode)
121
{
122
  GimpParam *return_vals;
123
  gint nreturn_vals;
124
  gboolean success = TRUE;
125

126
  return_vals = gimp_run_procedure ("gimp-brushes-set-popup",
127 128 129 130 131 132 133
                                    &nreturn_vals,
                                    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
}