2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2005-09-27 17:05:55 +08:00
|
|
|
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2007-01-09 18:52:47 +08:00
|
|
|
/* NOTE: This file is auto-generated by pdbgen.pl. */
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
|
|
|
|
|
|
|
#include "pdb-types.h"
|
|
|
|
|
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "core/gimpbuffer.h"
|
2005-09-28 02:29:27 +08:00
|
|
|
#include "core/gimpcontainer-filter.h"
|
2005-09-27 17:05:55 +08:00
|
|
|
#include "core/gimpcontainer.h"
|
2008-02-08 01:08:54 +08:00
|
|
|
#include "core/gimpparamspecs.h"
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2008-02-08 01:08:54 +08:00
|
|
|
#include "gimppdb.h"
|
|
|
|
#include "gimppdb-utils.h"
|
|
|
|
#include "gimpprocedure.h"
|
2008-04-04 19:15:55 +08:00
|
|
|
#include "internal-procs.h"
|
2006-11-01 03:02:56 +08:00
|
|
|
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
static GValueArray *
|
2007-12-03 02:05:54 +08:00
|
|
|
buffers_get_list_invoker (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args,
|
|
|
|
GError **error)
|
2005-09-28 02:29:27 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-04-04 18:30:58 +08:00
|
|
|
GValueArray *return_vals;
|
2006-04-03 00:03:32 +08:00
|
|
|
const gchar *filter;
|
2006-03-15 23:32:39 +08:00
|
|
|
gint32 num_buffers = 0;
|
2005-09-28 02:29:27 +08:00
|
|
|
gchar **buffer_list = NULL;
|
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
filter = g_value_get_string (&args->values[0]);
|
2005-09-28 02:29:27 +08:00
|
|
|
|
|
|
|
if (success)
|
2006-03-23 01:19:14 +08:00
|
|
|
{
|
|
|
|
buffer_list = gimp_container_get_filtered_name_array (gimp->named_buffers,
|
|
|
|
filter, &num_buffers);
|
|
|
|
}
|
2005-09-28 02:29:27 +08:00
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-09-28 02:29:27 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2006-04-04 18:30:58 +08:00
|
|
|
g_value_set_int (&return_vals->values[1], num_buffers);
|
|
|
|
gimp_value_take_stringarray (&return_vals->values[2], buffer_list, num_buffers);
|
2005-09-28 02:29:27 +08:00
|
|
|
}
|
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-09-28 02:29:27 +08:00
|
|
|
}
|
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
static GValueArray *
|
2007-12-03 02:05:54 +08:00
|
|
|
buffer_rename_invoker (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args,
|
|
|
|
GError **error)
|
2005-09-27 17:05:55 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-04-04 18:30:58 +08:00
|
|
|
GValueArray *return_vals;
|
2006-04-03 00:03:32 +08:00
|
|
|
const gchar *buffer_name;
|
|
|
|
const gchar *new_name;
|
2005-09-27 17:05:55 +08:00
|
|
|
gchar *real_name = NULL;
|
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
buffer_name = g_value_get_string (&args->values[0]);
|
|
|
|
new_name = g_value_get_string (&args->values[1]);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2007-12-11 17:54:41 +08:00
|
|
|
GimpBuffer *buffer = gimp_pdb_get_buffer (gimp, buffer_name, error);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2007-04-25 22:23:05 +08:00
|
|
|
if (buffer)
|
2005-09-27 17:05:55 +08:00
|
|
|
{
|
|
|
|
gimp_object_set_name (GIMP_OBJECT (buffer), new_name);
|
|
|
|
real_name = g_strdup (gimp_object_get_name (GIMP_OBJECT (buffer)));
|
|
|
|
}
|
2006-03-23 01:19:14 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
2006-04-04 18:30:58 +08:00
|
|
|
g_value_take_string (&return_vals->values[1], real_name);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
static GValueArray *
|
2007-12-03 02:05:54 +08:00
|
|
|
buffer_delete_invoker (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args,
|
|
|
|
GError **error)
|
2005-09-27 17:05:55 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-04-03 00:03:32 +08:00
|
|
|
const gchar *buffer_name;
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
buffer_name = g_value_get_string (&args->values[0]);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2007-12-11 17:54:41 +08:00
|
|
|
GimpBuffer *buffer = gimp_pdb_get_buffer (gimp, buffer_name, error);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-03-23 01:19:14 +08:00
|
|
|
if (buffer)
|
2005-09-27 17:05:55 +08:00
|
|
|
success = gimp_container_remove (gimp->named_buffers, GIMP_OBJECT (buffer));
|
2006-03-23 01:19:14 +08:00
|
|
|
else
|
|
|
|
success = FALSE;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
static GValueArray *
|
2007-12-03 02:05:54 +08:00
|
|
|
buffer_get_width_invoker (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args,
|
|
|
|
GError **error)
|
2005-09-27 17:05:55 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-04-04 18:30:58 +08:00
|
|
|
GValueArray *return_vals;
|
2006-04-03 00:03:32 +08:00
|
|
|
const gchar *buffer_name;
|
2006-03-15 05:35:50 +08:00
|
|
|
gint32 width = 0;
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
buffer_name = g_value_get_string (&args->values[0]);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2007-12-11 17:54:41 +08:00
|
|
|
GimpBuffer *buffer = gimp_pdb_get_buffer (gimp, buffer_name, error);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-03-15 05:35:50 +08:00
|
|
|
if (buffer)
|
|
|
|
width = gimp_buffer_get_width (buffer);
|
|
|
|
else
|
|
|
|
success = FALSE;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
2006-04-04 18:30:58 +08:00
|
|
|
g_value_set_int (&return_vals->values[1], width);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
static GValueArray *
|
2007-12-03 02:05:54 +08:00
|
|
|
buffer_get_height_invoker (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args,
|
|
|
|
GError **error)
|
2005-09-27 17:05:55 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-04-04 18:30:58 +08:00
|
|
|
GValueArray *return_vals;
|
2006-04-03 00:03:32 +08:00
|
|
|
const gchar *buffer_name;
|
2006-03-15 05:35:50 +08:00
|
|
|
gint32 height = 0;
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
buffer_name = g_value_get_string (&args->values[0]);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2007-12-11 17:54:41 +08:00
|
|
|
GimpBuffer *buffer = gimp_pdb_get_buffer (gimp, buffer_name, error);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-03-15 05:35:50 +08:00
|
|
|
if (buffer)
|
|
|
|
height = gimp_buffer_get_height (buffer);
|
|
|
|
else
|
|
|
|
success = FALSE;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
2006-04-04 18:30:58 +08:00
|
|
|
g_value_set_int (&return_vals->values[1], height);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
static GValueArray *
|
2007-12-03 02:05:54 +08:00
|
|
|
buffer_get_bytes_invoker (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args,
|
|
|
|
GError **error)
|
2005-09-27 17:05:55 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-04-04 18:30:58 +08:00
|
|
|
GValueArray *return_vals;
|
2006-04-03 00:03:32 +08:00
|
|
|
const gchar *buffer_name;
|
2006-03-15 05:35:50 +08:00
|
|
|
gint32 bytes = 0;
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
buffer_name = g_value_get_string (&args->values[0]);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2007-12-11 17:54:41 +08:00
|
|
|
GimpBuffer *buffer = gimp_pdb_get_buffer (gimp, buffer_name, error);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-03-15 05:35:50 +08:00
|
|
|
if (buffer)
|
|
|
|
bytes = gimp_buffer_get_bytes (buffer);
|
|
|
|
else
|
|
|
|
success = FALSE;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
2006-04-04 18:30:58 +08:00
|
|
|
g_value_set_int (&return_vals->values[1], bytes);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
static GValueArray *
|
2007-12-03 02:05:54 +08:00
|
|
|
buffer_get_image_type_invoker (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args,
|
|
|
|
GError **error)
|
2005-09-27 17:05:55 +08:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-04-04 18:30:58 +08:00
|
|
|
GValueArray *return_vals;
|
2006-04-03 00:03:32 +08:00
|
|
|
const gchar *buffer_name;
|
2006-03-15 05:35:50 +08:00
|
|
|
gint32 image_type = 0;
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-04-04 18:30:58 +08:00
|
|
|
buffer_name = g_value_get_string (&args->values[0]);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2007-12-11 17:54:41 +08:00
|
|
|
GimpBuffer *buffer = gimp_pdb_get_buffer (gimp, buffer_name, error);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-03-15 05:35:50 +08:00
|
|
|
if (buffer)
|
|
|
|
image_type = gimp_buffer_get_image_type (buffer);
|
|
|
|
else
|
|
|
|
success = FALSE;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2008-08-16 21:57:57 +08:00
|
|
|
return_vals = gimp_procedure_get_return_values (procedure, success,
|
|
|
|
error ? *error : NULL);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
|
|
|
if (success)
|
2006-04-04 18:30:58 +08:00
|
|
|
g_value_set_enum (&return_vals->values[1], image_type);
|
2005-09-27 17:05:55 +08:00
|
|
|
|
2006-03-28 05:09:32 +08:00
|
|
|
return return_vals;
|
2005-09-27 17:05:55 +08:00
|
|
|
}
|
|
|
|
|
2006-04-05 05:11:45 +08:00
|
|
|
void
|
2006-04-26 17:13:47 +08:00
|
|
|
register_buffer_procs (GimpPDB *pdb)
|
2005-09-27 17:05:55 +08:00
|
|
|
{
|
2006-04-05 05:11:45 +08:00
|
|
|
GimpProcedure *procedure;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-buffers-get-list
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (buffers_get_list_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-buffers-get-list");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
"gimp-buffers-get-list",
|
|
|
|
"Retrieve a complete listing of the available buffers.",
|
|
|
|
"This procedure returns a complete listing of available named buffers.",
|
|
|
|
"Michael Natterer <mitch@gimp.org>",
|
|
|
|
"Michael Natterer",
|
|
|
|
"2005",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("filter",
|
|
|
|
"filter",
|
|
|
|
"An optional regular expression used to filter the list",
|
2007-04-25 22:23:05 +08:00
|
|
|
FALSE, TRUE, FALSE,
|
2006-04-05 05:11:45 +08:00
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
gimp_param_spec_int32 ("num-buffers",
|
|
|
|
"num buffers",
|
|
|
|
"The number of buffers",
|
|
|
|
0, G_MAXINT32, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
gimp_param_spec_string_array ("buffer-list",
|
|
|
|
"buffer list",
|
|
|
|
"The list of buffer names",
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-buffer-rename
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (buffer_rename_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-buffer-rename");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
"gimp-buffer-rename",
|
|
|
|
"Renames a named buffer.",
|
|
|
|
"This procedure renames a named buffer.",
|
|
|
|
"Michael Natterer <mitch@gimp.org>",
|
|
|
|
"Michael Natterer",
|
|
|
|
"2005",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("buffer-name",
|
|
|
|
"buffer name",
|
|
|
|
"The buffer name",
|
2007-12-11 17:54:41 +08:00
|
|
|
FALSE, FALSE, TRUE,
|
2006-04-05 05:11:45 +08:00
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("new-name",
|
|
|
|
"new name",
|
|
|
|
"The buffer's new name",
|
2007-04-25 22:23:05 +08:00
|
|
|
FALSE, FALSE, TRUE,
|
2006-04-05 05:11:45 +08:00
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
gimp_param_spec_string ("real-name",
|
|
|
|
"real name",
|
|
|
|
"The real name given to the buffer",
|
2007-04-25 22:23:05 +08:00
|
|
|
FALSE, FALSE, FALSE,
|
2006-04-05 05:11:45 +08:00
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-buffer-delete
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (buffer_delete_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-buffer-delete");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
"gimp-buffer-delete",
|
|
|
|
"Deletes a named buffer.",
|
|
|
|
"This procedure deletes a named buffer.",
|
|
|
|
"David Gowers <neota@softhome.net>",
|
|
|
|
"David Gowers <neota@softhome.net>",
|
|
|
|
"2005",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("buffer-name",
|
|
|
|
"buffer name",
|
|
|
|
"The buffer name",
|
2007-12-11 17:54:41 +08:00
|
|
|
FALSE, FALSE, TRUE,
|
2006-04-05 05:11:45 +08:00
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-buffer-get-width
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (buffer_get_width_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-buffer-get-width");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
"gimp-buffer-get-width",
|
|
|
|
"Retrieves the specified buffer's width.",
|
|
|
|
"This procedure retrieves the specified named buffer's width.",
|
|
|
|
"Michael Natterer <mitch@gimp.org>",
|
|
|
|
"Michael Natterer",
|
|
|
|
"2005",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("buffer-name",
|
|
|
|
"buffer name",
|
|
|
|
"The buffer name",
|
2007-12-11 17:54:41 +08:00
|
|
|
FALSE, FALSE, TRUE,
|
2006-04-05 05:11:45 +08:00
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
gimp_param_spec_int32 ("width",
|
|
|
|
"width",
|
|
|
|
"The buffer width",
|
|
|
|
G_MININT32, G_MAXINT32, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-buffer-get-height
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (buffer_get_height_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-buffer-get-height");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
"gimp-buffer-get-height",
|
|
|
|
"Retrieves the specified buffer's height.",
|
|
|
|
"This procedure retrieves the specified named buffer's height.",
|
|
|
|
"Michael Natterer <mitch@gimp.org>",
|
|
|
|
"Michael Natterer",
|
|
|
|
"2005",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("buffer-name",
|
|
|
|
"buffer name",
|
|
|
|
"The buffer name",
|
2007-12-11 17:54:41 +08:00
|
|
|
FALSE, FALSE, TRUE,
|
2006-04-05 05:11:45 +08:00
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
gimp_param_spec_int32 ("height",
|
|
|
|
"height",
|
|
|
|
"The buffer height",
|
|
|
|
G_MININT32, G_MAXINT32, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-buffer-get-bytes
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (buffer_get_bytes_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-buffer-get-bytes");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
"gimp-buffer-get-bytes",
|
|
|
|
"Retrieves the specified buffer's bytes.",
|
|
|
|
"This procedure retrieves the specified named buffer's bytes.",
|
|
|
|
"Michael Natterer <mitch@gimp.org>",
|
|
|
|
"Michael Natterer",
|
|
|
|
"2005",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("buffer-name",
|
|
|
|
"buffer name",
|
|
|
|
"The buffer name",
|
2007-12-11 17:54:41 +08:00
|
|
|
FALSE, FALSE, TRUE,
|
2006-04-05 05:11:45 +08:00
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
gimp_param_spec_int32 ("bytes",
|
|
|
|
"bytes",
|
|
|
|
"The buffer bpp",
|
|
|
|
G_MININT32, G_MAXINT32, 0,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-buffer-get-image-type
|
|
|
|
*/
|
2006-04-06 18:01:30 +08:00
|
|
|
procedure = gimp_procedure_new (buffer_get_image_type_invoker);
|
2008-04-04 18:58:56 +08:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure),
|
|
|
|
"gimp-buffer-get-image-type");
|
2006-04-05 05:11:45 +08:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
"gimp-buffer-get-image-type",
|
|
|
|
"Retrieves the specified buffer's image type.",
|
|
|
|
"This procedure retrieves the specified named buffer's image type.",
|
|
|
|
"Michael Natterer <mitch@gimp.org>",
|
|
|
|
"Michael Natterer",
|
|
|
|
"2005",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("buffer-name",
|
|
|
|
"buffer name",
|
|
|
|
"The buffer name",
|
2007-12-11 17:54:41 +08:00
|
|
|
FALSE, FALSE, TRUE,
|
2006-04-05 05:11:45 +08:00
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_return_value (procedure,
|
|
|
|
g_param_spec_enum ("image-type",
|
|
|
|
"image type",
|
2006-05-19 01:25:15 +08:00
|
|
|
"The buffer image type",
|
2006-04-05 05:11:45 +08:00
|
|
|
GIMP_TYPE_IMAGE_BASE_TYPE,
|
|
|
|
GIMP_RGB,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 17:13:47 +08:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 16:16:26 +08:00
|
|
|
g_object_unref (procedure);
|
2006-04-05 05:11:45 +08:00
|
|
|
}
|