gimpgradientselect_pdb.c 3.95 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
 *
 * gimpgradientselect_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
/**
 * gimp_gradients_popup:
30
 * @gradient_callback: The callback PDB proc to call when gradient selection is made.
31 32
 * @popup_title: Title of the gradient selection dialog.
 * @initial_gradient: The name of the gradient to set as the first selected.
33 34 35 36
 * @sample_size: Size of the sample to return when the gradient is changed.
 *
 * Invokes the Gimp gradients selection.
 *
37
 * This procedure opens the gradient selection dialog.
38 39 40
 *
 * Returns: TRUE on success.
 */
41
gboolean
42
gimp_gradients_popup (const gchar *gradient_callback,
43 44 45
                      const gchar *popup_title,
                      const gchar *initial_gradient,
                      gint         sample_size)
46
{
47
  GimpParam *return_vals;
48
  gint nreturn_vals;
49
  gboolean success = TRUE;
50

51
  return_vals = gimp_run_procedure ("gimp-gradients-popup",
52 53 54 55 56 57
                                    &nreturn_vals,
                                    GIMP_PDB_STRING, gradient_callback,
                                    GIMP_PDB_STRING, popup_title,
                                    GIMP_PDB_STRING, initial_gradient,
                                    GIMP_PDB_INT32, sample_size,
                                    GIMP_PDB_END);
58

59 60
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

61
  gimp_destroy_params (return_vals, nreturn_vals);
62 63

  return success;
64 65
}

66 67
/**
 * gimp_gradients_close_popup:
68
 * @gradient_callback: The name of the callback registered for this pop-up.
69
 *
70
 * Close the gradient selection dialog.
71 72 73 74 75
 *
 * This procedure closes an opened gradient selection dialog.
 *
 * Returns: TRUE on success.
 */
76
gboolean
77
gimp_gradients_close_popup (const gchar *gradient_callback)
78
{
79
  GimpParam *return_vals;
80
  gint nreturn_vals;
81
  gboolean success = TRUE;
82

83
  return_vals = gimp_run_procedure ("gimp-gradients-close-popup",
84 85 86
                                    &nreturn_vals,
                                    GIMP_PDB_STRING, gradient_callback,
                                    GIMP_PDB_END);
87

88 89
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

90
  gimp_destroy_params (return_vals, nreturn_vals);
91 92

  return success;
93 94
}

95 96
/**
 * gimp_gradients_set_popup:
97
 * @gradient_callback: The name of the callback registered for this pop-up.
98 99
 * @gradient_name: The name of the gradient to set as selected.
 *
100
 * Sets the current gradient in a gradient selection dialog.
101
 *
102
 * Sets the current gradient in a gradient selection dialog.
103 104 105
 *
 * Returns: TRUE on success.
 */
106
gboolean
107
gimp_gradients_set_popup (const gchar *gradient_callback,
108
                          const gchar *gradient_name)
109
{
110
  GimpParam *return_vals;
111
  gint nreturn_vals;
112
  gboolean success = TRUE;
113

114
  return_vals = gimp_run_procedure ("gimp-gradients-set-popup",
115 116 117 118
                                    &nreturn_vals,
                                    GIMP_PDB_STRING, gradient_callback,
                                    GIMP_PDB_STRING, gradient_name,
                                    GIMP_PDB_END);
119

120 121
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

122
  gimp_destroy_params (return_vals, nreturn_vals);
123 124

  return success;
125
}