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

  1. /* LIBGIMP - The GIMP Library
  2.  * Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
  3.  *
  4.  * gimpedit_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_edit_cut:
  28.  * @drawable_ID: The drawable to cut from.
  29.  *
  30.  * Cut from the specified drawable.
  31.  *
  32.  * If there is a selection in the image, then the area specified by the
  33.  * selection is cut from the specified drawable and placed in an
  34.  * internal GIMP edit buffer. It can subsequently be retrieved using
  35.  * the 'gimp-edit-paste' command. If there is no selection, then the
  36.  * specified drawable will be removed and its contents stored in the
  37.  * internal GIMP edit buffer. The drawable MUST belong to the specified
  38.  * image, or an error is returned.
  39.  *
  40.  * Returns: TRUE on success.
  41.  */
  42. gboolean
  43. gimp_edit_cut (gint32 drawable_ID)
  44. {
  45.   GimpParam *return_vals;
  46.   gint nreturn_vals;
  47.   gboolean success = TRUE;
  48.  
  49.   return_vals = gimp_run_procedure ("gimp_edit_cut",
  50.                     &nreturn_vals,
  51.                     GIMP_PDB_DRAWABLE, drawable_ID,
  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_edit_copy:
  63.  * @drawable_ID: The drawable to copy from.
  64.  *
  65.  * Copy from the specified drawable.
  66.  *
  67.  * If there is a selection in the image, then the area specified by the
  68.  * selection is copied from the specified drawable and placed in an
  69.  * internal GIMP edit buffer. It can subsequently be retrieved using
  70.  * the 'gimp-edit-paste' command. If there is no selection, then the
  71.  * specified drawable's contents will be stored in the internal GIMP
  72.  * edit buffer. The drawable MUST belong to the specified image, or an
  73.  * error is returned.
  74.  *
  75.  * Returns: TRUE on success.
  76.  */
  77. gboolean
  78. gimp_edit_copy (gint32 drawable_ID)
  79. {
  80.   GimpParam *return_vals;
  81.   gint nreturn_vals;
  82.   gboolean success = TRUE;
  83.  
  84.   return_vals = gimp_run_procedure ("gimp_edit_copy",
  85.                     &nreturn_vals,
  86.                     GIMP_PDB_DRAWABLE, drawable_ID,
  87.                     GIMP_PDB_END);
  88.  
  89.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  90.  
  91.   gimp_destroy_params (return_vals, nreturn_vals);
  92.  
  93.   return success;
  94. }
  95.  
  96. /**
  97.  * gimp_edit_paste:
  98.  * @drawable_ID: The drawable to paste to.
  99.  * @paste_into: Clear selection, or paste behind it?
  100.  *
  101.  * Paste buffer to the specified drawable.
  102.  *
  103.  * This procedure pastes a copy of the internal GIMP edit buffer to the
  104.  * specified drawable. The GIMP edit buffer will be empty unless a call
  105.  * was previously made to either 'gimp-edit-cut' or 'gimp-edit-copy'.
  106.  * The \"paste_into\" option specifies whether to clear the current
  107.  * image selection, or to paste the buffer \"behind\" the selection.
  108.  * This allows the selection to act as a mask for the pasted buffer.
  109.  * Anywhere that the selection mask is non-zero, the pasted buffer will
  110.  * show through. The pasted buffer will be a new layer in the image
  111.  * which is designated as the image floating selection. If the image
  112.  * has a floating selection at the time of pasting, the old floating
  113.  * selection will be anchored to it's drawable before the new floating
  114.  * selection is added. This procedure returns the new floating layer.
  115.  * The resulting floating selection will already be attached to the
  116.  * specified drawable, and a subsequent call to floating_sel_attach is
  117.  * not needed.
  118.  *
  119.  * Returns: The new floating selection.
  120.  */
  121. gint32
  122. gimp_edit_paste (gint32   drawable_ID,
  123.          gboolean paste_into)
  124. {
  125.   GimpParam *return_vals;
  126.   gint nreturn_vals;
  127.   gint32 floating_sel_ID = -1;
  128.  
  129.   return_vals = gimp_run_procedure ("gimp_edit_paste",
  130.                     &nreturn_vals,
  131.                     GIMP_PDB_DRAWABLE, drawable_ID,
  132.                     GIMP_PDB_INT32, paste_into,
  133.                     GIMP_PDB_END);
  134.  
  135.   if (return_vals[0].data.d_status == GIMP_PDB_SUCCESS)
  136.     floating_sel_ID = return_vals[1].data.d_layer;
  137.  
  138.   gimp_destroy_params (return_vals, nreturn_vals);
  139.  
  140.   return floating_sel_ID;
  141. }
  142.  
  143. /**
  144.  * gimp_edit_clear:
  145.  * @drawable_ID: The drawable to clear from.
  146.  *
  147.  * Clear selected area of drawable.
  148.  *
  149.  * This procedure clears the specified drawable. If the drawable has an
  150.  * alpha channel, the cleared pixels will become transparent. If the
  151.  * drawable does not have an alpha channel, cleared pixels will be set
  152.  * to the background color. This procedure only affects regions within
  153.  * a selection if there is a selection active.
  154.  *
  155.  * Returns: TRUE on success.
  156.  */
  157. gboolean
  158. gimp_edit_clear (gint32 drawable_ID)
  159. {
  160.   GimpParam *return_vals;
  161.   gint nreturn_vals;
  162.   gboolean success = TRUE;
  163.  
  164.   return_vals = gimp_run_procedure ("gimp_edit_clear",
  165.                     &nreturn_vals,
  166.                     GIMP_PDB_DRAWABLE, drawable_ID,
  167.                     GIMP_PDB_END);
  168.  
  169.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  170.  
  171.   gimp_destroy_params (return_vals, nreturn_vals);
  172.  
  173.   return success;
  174. }
  175.  
  176. /**
  177.  * gimp_edit_fill:
  178.  * @drawable_ID: The drawable to fill to.
  179.  * @fill_type: The type of fill.
  180.  *
  181.  * Fill selected area of drawable.
  182.  *
  183.  * This procedure fills the specified drawable with the fill mode. If
  184.  * the fill mode is foreground, the current foreground color is used.
  185.  * If the fill mode is background, the current background color is
  186.  * used. Other fill modes should not be used. This procedure only
  187.  * affects regions within a selection if there is a selection active.
  188.  *
  189.  * Returns: TRUE on success.
  190.  */
  191. gboolean
  192. gimp_edit_fill (gint32       drawable_ID,
  193.         GimpFillType fill_type)
  194. {
  195.   GimpParam *return_vals;
  196.   gint nreturn_vals;
  197.   gboolean success = TRUE;
  198.  
  199.   return_vals = gimp_run_procedure ("gimp_edit_fill",
  200.                     &nreturn_vals,
  201.                     GIMP_PDB_DRAWABLE, drawable_ID,
  202.                     GIMP_PDB_INT32, fill_type,
  203.                     GIMP_PDB_END);
  204.  
  205.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  206.  
  207.   gimp_destroy_params (return_vals, nreturn_vals);
  208.  
  209.   return success;
  210. }
  211.  
  212. /**
  213.  * gimp_edit_stroke:
  214.  * @drawable_ID: The drawable to stroke to.
  215.  *
  216.  * Stroke the current selection
  217.  *
  218.  * This procedure strokes the current selection, painting along the
  219.  * selection boundary with the active brush and foreground color. The
  220.  * paint is applied to the specified drawable regardless of the active
  221.  * selection.
  222.  *
  223.  * Returns: TRUE on success.
  224.  */
  225. gboolean
  226. gimp_edit_stroke (gint32 drawable_ID)
  227. {
  228.   GimpParam *return_vals;
  229.   gint nreturn_vals;
  230.   gboolean success = TRUE;
  231.  
  232.   return_vals = gimp_run_procedure ("gimp_edit_stroke",
  233.                     &nreturn_vals,
  234.                     GIMP_PDB_DRAWABLE, drawable_ID,
  235.                     GIMP_PDB_END);
  236.  
  237.   success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
  238.  
  239.   gimp_destroy_params (return_vals, nreturn_vals);
  240.  
  241.   return success;
  242. }
  243.