home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / libgimp / gimppatternselect_pdb.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-08-25  |  3.4 KB  |  121 lines

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimppatternselect_pdb.c
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Lesser General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Lesser General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Lesser General Public
  17.  * License along with this library; if not, write to the
  18.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  * Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22. /* NOTE: This file is autogenerated by pdbgen.pl */
  23.  
  24. #include "gimp.h"
  25.  
  26. /**
  27.  * gimp_patterns_popup:
  28.  * @pattern_callback: The callback PDB proc to call when pattern selection is made.
  29.  * @popup_title: Title to give the pattern popup window.
  30.  * @initial_pattern: The name of the pattern to set as the first selected.
  31.  *
  32.  * Invokes the Gimp pattern selection.
  33.  *
  34.  * This procedure popups the pattern selection dialog.
  35.  *
  36.  * Returns: TRUE on success.
  37.  */
  38. gboolean
  39. gimp_patterns_popup (gchar *pattern_callback,
  40.              gchar *popup_title,
  41.              gchar *initial_pattern)
  42. {
  43.   GimpParam *return_vals;
  44.   gint nreturn_vals;
  45.   gboolean success = TRUE;
  46.  
  47.   return_vals = gimp_run_procedure ("gimp_patterns_popup",
  48.                     &nreturn_vals,
  49.                     GIMP_PDB_STRING, pattern_callback,
  50.                     GIMP_PDB_STRING, popup_title,
  51.                     GIMP_PDB_STRING, initial_pattern,
  52.                     GIMP_PDB_END);
  53.  
  54.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  55.  
  56.   gimp_destroy_params (return_vals, nreturn_vals);
  57.  
  58.   return success;
  59. }
  60.  
  61. /**
  62.  * gimp_patterns_close_popup:
  63.  * @pattern_callback: The name of the callback registered for this popup.
  64.  *
  65.  * Popdown the Gimp pattern selection.
  66.  *
  67.  * This procedure closes an opened pattern selection dialog.
  68.  *
  69.  * Returns: TRUE on success.
  70.  */
  71. gboolean
  72. gimp_patterns_close_popup (gchar *pattern_callback)
  73. {
  74.   GimpParam *return_vals;
  75.   gint nreturn_vals;
  76.   gboolean success = TRUE;
  77.  
  78.   return_vals = gimp_run_procedure ("gimp_patterns_close_popup",
  79.                     &nreturn_vals,
  80.                     GIMP_PDB_STRING, pattern_callback,
  81.                     GIMP_PDB_END);
  82.  
  83.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  84.  
  85.   gimp_destroy_params (return_vals, nreturn_vals);
  86.  
  87.   return success;
  88. }
  89.  
  90. /**
  91.  * gimp_patterns_set_popup:
  92.  * @pattern_callback: The name of the callback registered for this popup.
  93.  * @pattern_name: The name of the pattern to set as selected.
  94.  *
  95.  * Sets the current pattern selection in a popup.
  96.  *
  97.  * Sets the current pattern selection in a popup.
  98.  *
  99.  * Returns: TRUE on success.
  100.  */
  101. gboolean
  102. gimp_patterns_set_popup (gchar *pattern_callback,
  103.              gchar *pattern_name)
  104. {
  105.   GimpParam *return_vals;
  106.   gint nreturn_vals;
  107.   gboolean success = TRUE;
  108.  
  109.   return_vals = gimp_run_procedure ("gimp_patterns_set_popup",
  110.                     &nreturn_vals,
  111.                     GIMP_PDB_STRING, pattern_callback,
  112.                     GIMP_PDB_STRING, pattern_name,
  113.                     GIMP_PDB_END);
  114.  
  115.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  116.  
  117.   gimp_destroy_params (return_vals, nreturn_vals);
  118.  
  119.   return success;
  120. }
  121.