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

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimpbrushselect_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_brushes_popup:
  28.  * @brush_callback: The callback PDB proc to call when brush selection is made.
  29.  * @popup_title: Title to give the brush popup window.
  30.  * @initial_brush: The name of the brush to set as the first selected.
  31.  * @opacity: The initial opacity of the brush.
  32.  * @spacing: The initial spacing of the brush (if < 0 then use brush default spacing).
  33.  * @paint_mode: The initial paint mode.
  34.  *
  35.  * Invokes the Gimp brush selection.
  36.  *
  37.  * This procedure popups the brush selection dialog.
  38.  *
  39.  * Returns: TRUE on success.
  40.  */
  41. gboolean
  42. gimp_brushes_popup (gchar                *brush_callback,
  43.             gchar                *popup_title,
  44.             gchar                *initial_brush,
  45.             gdouble               opacity,
  46.             gint                  spacing,
  47.             GimpLayerModeEffects  paint_mode)
  48. {
  49.   GimpParam *return_vals;
  50.   gint nreturn_vals;
  51.   gboolean success = TRUE;
  52.  
  53.   return_vals = gimp_run_procedure ("gimp_brushes_popup",
  54.                     &nreturn_vals,
  55.                     GIMP_PDB_STRING, brush_callback,
  56.                     GIMP_PDB_STRING, popup_title,
  57.                     GIMP_PDB_STRING, initial_brush,
  58.                     GIMP_PDB_FLOAT, opacity,
  59.                     GIMP_PDB_INT32, spacing,
  60.                     GIMP_PDB_INT32, paint_mode,
  61.                     GIMP_PDB_END);
  62.  
  63.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  64.  
  65.   gimp_destroy_params (return_vals, nreturn_vals);
  66.  
  67.   return success;
  68. }
  69.  
  70. /**
  71.  * gimp_brushes_close_popup:
  72.  * @brush_callback: The name of the callback registered for this popup.
  73.  *
  74.  * Popdown the Gimp brush selection.
  75.  *
  76.  * This procedure closes an opened brush selection dialog.
  77.  *
  78.  * Returns: TRUE on success.
  79.  */
  80. gboolean
  81. gimp_brushes_close_popup (gchar *brush_callback)
  82. {
  83.   GimpParam *return_vals;
  84.   gint nreturn_vals;
  85.   gboolean success = TRUE;
  86.  
  87.   return_vals = gimp_run_procedure ("gimp_brushes_close_popup",
  88.                     &nreturn_vals,
  89.                     GIMP_PDB_STRING, brush_callback,
  90.                     GIMP_PDB_END);
  91.  
  92.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  93.  
  94.   gimp_destroy_params (return_vals, nreturn_vals);
  95.  
  96.   return success;
  97. }
  98.  
  99. /**
  100.  * gimp_brushes_set_popup:
  101.  * @brush_callback: The name of the callback registered for this popup.
  102.  * @brush_name: The name of the brush to set as selected.
  103.  * @opacity: The initial opacity of the brush.
  104.  * @spacing: The initial spacing of the brush (if < 0 then use brush default spacing).
  105.  * @paint_mode: The initial paint mode.
  106.  *
  107.  * Sets the current brush selection in a popup.
  108.  *
  109.  * Sets the current brush selection in a popup.
  110.  *
  111.  * Returns: TRUE on success.
  112.  */
  113. gboolean
  114. gimp_brushes_set_popup (gchar                *brush_callback,
  115.             gchar                *brush_name,
  116.             gdouble               opacity,
  117.             gint                  spacing,
  118.             GimpLayerModeEffects  paint_mode)
  119. {
  120.   GimpParam *return_vals;
  121.   gint nreturn_vals;
  122.   gboolean success = TRUE;
  123.  
  124.   return_vals = gimp_run_procedure ("gimp_brushes_set_popup",
  125.                     &nreturn_vals,
  126.                     GIMP_PDB_STRING, brush_callback,
  127.                     GIMP_PDB_STRING, brush_name,
  128.                     GIMP_PDB_FLOAT, opacity,
  129.                     GIMP_PDB_INT32, spacing,
  130.                     GIMP_PDB_INT32, paint_mode,
  131.                     GIMP_PDB_END);
  132.  
  133.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  134.  
  135.   gimp_destroy_params (return_vals, nreturn_vals);
  136.  
  137.   return success;
  138. }
  139.