gimpgradientselect_pdb.c 4.08 KB
Newer Older
1
/* LIBGIMP - The GIMP Library
2
 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
3 4 5
 *
 * gimpgradientselect_pdb.c
 *
6
 * This library is free software: you can redistribute it and/or
7 8
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
9
 * version 3 of the License, or (at your option) any later version.
10 11 12 13 14 15 16
 *
 * 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
17 18
 * License along with this library.  If not, see
 * <http://www.gnu.org/licenses/>.
19 20
 */

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

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

25 26
#include "gimp.h"

27 28 29 30 31 32 33 34 35 36

/**
 * SECTION: gimpgradientselect
 * @title: gimpgradientselect
 * @short_description: Functions providing a gradient selection dialog.
 *
 * Functions providing a gradient selection dialog.
 **/


37 38
/**
 * gimp_gradients_popup:
39
 * @gradient_callback: The callback PDB proc to call when gradient selection is made.
40 41
 * @popup_title: Title of the gradient selection dialog.
 * @initial_gradient: The name of the gradient to set as the first selected.
42 43 44 45
 * @sample_size: Size of the sample to return when the gradient is changed.
 *
 * Invokes the Gimp gradients selection.
 *
46
 * This procedure opens the gradient selection dialog.
47 48
 *
 * Returns: TRUE on success.
49
 **/
50
gboolean
51
gimp_gradients_popup (const gchar *gradient_callback,
52 53 54
                      const gchar *popup_title,
                      const gchar *initial_gradient,
                      gint         sample_size)
55
{
56
  GimpParam *return_vals;
57
  gint nreturn_vals;
58
  gboolean success = TRUE;
59

60
  return_vals = gimp_run_procedure ("gimp-gradients-popup",
61 62 63 64 65 66
                                    &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);
67

68 69
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

70
  gimp_destroy_params (return_vals, nreturn_vals);
71 72

  return success;
73 74
}

75 76
/**
 * gimp_gradients_close_popup:
77
 * @gradient_callback: The name of the callback registered for this pop-up.
78
 *
79
 * Close the gradient selection dialog.
80 81 82 83
 *
 * This procedure closes an opened gradient selection dialog.
 *
 * Returns: TRUE on success.
84
 **/
85
gboolean
86
gimp_gradients_close_popup (const gchar *gradient_callback)
87
{
88
  GimpParam *return_vals;
89
  gint nreturn_vals;
90
  gboolean success = TRUE;
91

92
  return_vals = gimp_run_procedure ("gimp-gradients-close-popup",
93 94 95
                                    &nreturn_vals,
                                    GIMP_PDB_STRING, gradient_callback,
                                    GIMP_PDB_END);
96

97 98
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

99
  gimp_destroy_params (return_vals, nreturn_vals);
100 101

  return success;
102 103
}

104 105
/**
 * gimp_gradients_set_popup:
106
 * @gradient_callback: The name of the callback registered for this pop-up.
107 108
 * @gradient_name: The name of the gradient to set as selected.
 *
109
 * Sets the current gradient in a gradient selection dialog.
110
 *
111
 * Sets the current gradient in a gradient selection dialog.
112 113
 *
 * Returns: TRUE on success.
114
 **/
115
gboolean
116
gimp_gradients_set_popup (const gchar *gradient_callback,
117
                          const gchar *gradient_name)
118
{
119
  GimpParam *return_vals;
120
  gint nreturn_vals;
121
  gboolean success = TRUE;
122

123
  return_vals = gimp_run_procedure ("gimp-gradients-set-popup",
124 125 126 127
                                    &nreturn_vals,
                                    GIMP_PDB_STRING, gradient_callback,
                                    GIMP_PDB_STRING, gradient_name,
                                    GIMP_PDB_END);
128

129 130
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

131
  gimp_destroy_params (return_vals, nreturn_vals);
132 133

  return success;
134
}