1
# GIMP - The GNU Image Manipulation Program
2
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
20
sub buffers_get_list {
21
$blurb = 'Retrieve a complete listing of the available buffers.';
24
This procedure returns a complete listing of available named buffers.
27
&mitch_pdb_misc('2005', '2.4');
30
{ name => 'filter', type => 'string', null_ok => 1,
31
desc => 'An optional regular expression used to filter the list' }
35
{ name => 'buffer_list', type => 'stringarray',
36
desc => 'The list of buffer names',
37
array => { name => 'num_buffers',
38
desc => 'The number of buffers' } }
44
buffer_list = gimp_container_get_filtered_name_array (gimp->named_buffers,
45
filter, &num_buffers);
52
$blurb = 'Renames a named buffer.';
53
$help = 'This procedure renames a named buffer.';
55
&mitch_pdb_misc('2005', '2.4');
58
{ name => 'buffer_name', type => 'string',
59
desc => 'The buffer name' },
60
{ name => 'new_name', type => 'string',
61
desc => 'The buffer\'s new name' }
65
{ name => 'real_name', type => 'string',
66
desc => 'The real name given to the buffer' }
72
GimpBuffer *buffer = (GimpBuffer *)
73
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
75
if (buffer && strlen (new_name))
77
gimp_object_set_name (GIMP_OBJECT (buffer), new_name);
78
real_name = g_strdup (gimp_object_get_name (GIMP_OBJECT (buffer)));
88
$blurb = 'Deletes a named buffer.';
89
$help = 'This procedure deletes a named buffer.';
91
$author = $copyright = 'David Gowers <neota@softhome.net>';
96
{ name => 'buffer_name', type => 'string',
97
desc => 'The buffer name' }
103
GimpBuffer *buffer = (GimpBuffer *)
104
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
107
success = gimp_container_remove (gimp->named_buffers, GIMP_OBJECT (buffer));
115
sub buffer_get_width {
116
$blurb = "Retrieves the specified buffer's width.";
117
$help = "This procedure retrieves the specified named buffer's width.";
119
&mitch_pdb_misc('2005', '2.4');
122
{ name => 'buffer_name', type => 'string',
123
desc => 'The buffer name' }
127
{ name => 'width', type => 'int32',
128
desc => "The buffer width" }
134
GimpBuffer *buffer = (GimpBuffer *)
135
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
138
width = gimp_buffer_get_width (buffer);
146
sub buffer_get_height {
147
$blurb = "Retrieves the specified buffer's height.";
148
$help = "This procedure retrieves the specified named buffer's height.";
150
&mitch_pdb_misc('2005', '2.4');
153
{ name => 'buffer_name', type => 'string',
154
desc => 'The buffer name' }
158
{ name => 'height', type => 'int32',
159
desc => "The buffer height" }
165
GimpBuffer *buffer = (GimpBuffer *)
166
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
169
height = gimp_buffer_get_height (buffer);
177
sub buffer_get_bytes {
178
$blurb = "Retrieves the specified buffer's bytes.";
179
$help = "This procedure retrieves the specified named buffer's bytes.";
181
&mitch_pdb_misc('2005', '2.4');
184
{ name => 'buffer_name', type => 'string',
185
desc => 'The buffer name' }
189
{ name => 'bytes', type => 'int32',
190
desc => "The buffer bpp" }
196
GimpBuffer *buffer = (GimpBuffer *)
197
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
200
bytes = gimp_buffer_get_bytes (buffer);
208
sub buffer_get_image_type {
209
$blurb = "Retrieves the specified buffer's image type.";
210
$help = "This procedure retrieves the specified named buffer's image type.";
212
&mitch_pdb_misc('2005', '2.4');
215
{ name => 'buffer_name', type => 'string',
216
desc => 'The buffer name' }
220
{ name => 'image_type', type => 'enum GimpImageBaseType',
221
desc => "The buffer image type" }
227
GimpBuffer *buffer = (GimpBuffer *)
228
gimp_container_get_child_by_name (gimp->named_buffers, buffer_name);
231
image_type = gimp_buffer_get_image_type (buffer);
240
@headers = qw(<string.h> "core/gimp.h" "core/gimpbuffer.h"
241
"core/gimpcontainer.h" "core/gimpcontainer-filter.h"
244
@procs = qw(buffers_get_list
245
buffer_rename buffer_delete
246
buffer_get_width buffer_get_height
247
buffer_get_bytes buffer_get_image_type);
249
%exports = (app => [@procs], lib => [@procs]);
251
$desc = 'Buffer procedures';