app: s/sprintf/g_snprintf/ in xcf_save_image()
[gimp.git] / libgimp / gimpfloatingsel_pdb.c
blob370de7dae0f252a429d3a112d5f4448ad2666752
1 /* LIBGIMP - The GIMP Library
2 * Copyright (C) 1995-2003 Peter Mattis and Spencer Kimball
4 * gimpfloatingsel_pdb.c
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 3 of the License, or (at your option) any later version.
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.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see
18 * <https://www.gnu.org/licenses/>.
21 /* NOTE: This file is auto-generated by pdbgen.pl */
23 #include "config.h"
25 #include "gimp.h"
28 /**
29 * SECTION: gimpfloatingsel
30 * @title: gimpfloatingsel
31 * @short_description: Functions for removing or attaching floating selections.
33 * Functions for removing or attaching floating selections.
34 **/
37 /**
38 * gimp_floating_sel_remove:
39 * @floating_sel_ID: The floating selection.
41 * Remove the specified floating selection from its associated
42 * drawable.
44 * This procedure removes the floating selection completely, without
45 * any side effects. The associated drawable is then set to active.
47 * Returns: TRUE on success.
48 **/
49 gboolean
50 gimp_floating_sel_remove (gint32 floating_sel_ID)
52 GimpParam *return_vals;
53 gint nreturn_vals;
54 gboolean success = TRUE;
56 return_vals = gimp_run_procedure ("gimp-floating-sel-remove",
57 &nreturn_vals,
58 GIMP_PDB_LAYER, floating_sel_ID,
59 GIMP_PDB_END);
61 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
63 gimp_destroy_params (return_vals, nreturn_vals);
65 return success;
68 /**
69 * gimp_floating_sel_anchor:
70 * @floating_sel_ID: The floating selection.
72 * Anchor the specified floating selection to its associated drawable.
74 * This procedure anchors the floating selection to its associated
75 * drawable. This is similar to merging with a merge type of
76 * ClipToBottomLayer. The floating selection layer is no longer valid
77 * after this operation.
79 * Returns: TRUE on success.
80 **/
81 gboolean
82 gimp_floating_sel_anchor (gint32 floating_sel_ID)
84 GimpParam *return_vals;
85 gint nreturn_vals;
86 gboolean success = TRUE;
88 return_vals = gimp_run_procedure ("gimp-floating-sel-anchor",
89 &nreturn_vals,
90 GIMP_PDB_LAYER, floating_sel_ID,
91 GIMP_PDB_END);
93 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
95 gimp_destroy_params (return_vals, nreturn_vals);
97 return success;
101 * gimp_floating_sel_to_layer:
102 * @floating_sel_ID: The floating selection.
104 * Transforms the specified floating selection into a layer.
106 * This procedure transforms the specified floating selection into a
107 * layer with the same offsets and extents. The composited image will
108 * look precisely the same, but the floating selection layer will no
109 * longer be clipped to the extents of the drawable it was attached to.
110 * The floating selection will become the active layer. This procedure
111 * will not work if the floating selection has a different base type
112 * from the underlying image. This might be the case if the floating
113 * selection is above an auxiliary channel or a layer mask.
115 * Returns: TRUE on success.
117 gboolean
118 gimp_floating_sel_to_layer (gint32 floating_sel_ID)
120 GimpParam *return_vals;
121 gint nreturn_vals;
122 gboolean success = TRUE;
124 return_vals = gimp_run_procedure ("gimp-floating-sel-to-layer",
125 &nreturn_vals,
126 GIMP_PDB_LAYER, floating_sel_ID,
127 GIMP_PDB_END);
129 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
131 gimp_destroy_params (return_vals, nreturn_vals);
133 return success;
137 * gimp_floating_sel_attach:
138 * @layer_ID: The layer (is attached as floating selection).
139 * @drawable_ID: The drawable (where to attach the floating selection).
141 * Attach the specified layer as floating to the specified drawable.
143 * This procedure attaches the layer as floating selection to the
144 * drawable.
146 * Returns: TRUE on success.
148 gboolean
149 gimp_floating_sel_attach (gint32 layer_ID,
150 gint32 drawable_ID)
152 GimpParam *return_vals;
153 gint nreturn_vals;
154 gboolean success = TRUE;
156 return_vals = gimp_run_procedure ("gimp-floating-sel-attach",
157 &nreturn_vals,
158 GIMP_PDB_LAYER, layer_ID,
159 GIMP_PDB_DRAWABLE, drawable_ID,
160 GIMP_PDB_END);
162 success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
164 gimp_destroy_params (return_vals, nreturn_vals);
166 return success;