gimppatternselect_pdb.c 3.85 KB
Newer Older
1
/* LIBGIMP - The GIMP Library
2
 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
3 4 5
 *
 * gimppatternselect_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: gimppatternselect
 * @title: gimppatternselect
 * @short_description: Functions providing a pattern selection dialog.
 *
 * Functions providing a pattern selection dialog.
 **/


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

58
  return_vals = gimp_run_procedure ("gimp-patterns-popup",
59 60 61 62 63
                                    &nreturn_vals,
                                    GIMP_PDB_STRING, pattern_callback,
                                    GIMP_PDB_STRING, popup_title,
                                    GIMP_PDB_STRING, initial_pattern,
                                    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_patterns_close_popup:
74
 * @pattern_callback: The name of the callback registered for this pop-up.
75
 *
76
 * Close the pattern selection dialog.
77 78 79 80
 *
 * This procedure closes an opened pattern selection dialog.
 *
 * Returns: TRUE on success.
81
 **/
82
gboolean
83
gimp_patterns_close_popup (const gchar *pattern_callback)
84
{
85
  GimpParam *return_vals;
86
  gint nreturn_vals;
87
  gboolean success = TRUE;
88

89
  return_vals = gimp_run_procedure ("gimp-patterns-close-popup",
90 91 92
                                    &nreturn_vals,
                                    GIMP_PDB_STRING, pattern_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_patterns_set_popup:
103
 * @pattern_callback: The name of the callback registered for this pop-up.
104 105
 * @pattern_name: The name of the pattern to set as selected.
 *
106
 * Sets the current pattern in a pattern selection dialog.
107
 *
108
 * Sets the current pattern in a pattern selection dialog.
109 110
 *
 * Returns: TRUE on success.
111
 **/
112
gboolean
113
gimp_patterns_set_popup (const gchar *pattern_callback,
114
                         const gchar *pattern_name)
115
{
116
  GimpParam *return_vals;
117
  gint nreturn_vals;
118
  gboolean success = TRUE;
119

120
  return_vals = gimp_run_procedure ("gimp-patterns-set-popup",
121 122 123 124
                                    &nreturn_vals,
                                    GIMP_PDB_STRING, pattern_callback,
                                    GIMP_PDB_STRING, pattern_name,
                                    GIMP_PDB_END);
125

126 127
  success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;

128
  gimp_destroy_params (return_vals, nreturn_vals);
129 130

  return success;
131
}