2002-03-12 21:02:10 +00:00
|
|
|
/* The GIMP -- an image manipulation program
|
2003-07-03 00:47:26 +00:00
|
|
|
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
|
2002-03-12 21:02:10 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* NOTE: This file is autogenerated by pdbgen.pl. */
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
2004-07-09 19:14:59 +00:00
|
|
|
#include <glib-object.h>
|
2002-03-12 21:02:10 +00:00
|
|
|
|
|
|
|
#include "pdb-types.h"
|
2006-04-26 09:13:47 +00:00
|
|
|
#include "gimppdb.h"
|
2006-03-31 09:15:08 +00:00
|
|
|
#include "gimpprocedure.h"
|
2006-03-28 19:58:00 +00:00
|
|
|
#include "core/gimpparamspecs.h"
|
2002-03-12 21:02:10 +00:00
|
|
|
|
|
|
|
#include "core/gimp.h"
|
|
|
|
#include "core/gimpdatafactory.h"
|
|
|
|
|
2006-10-31 19:02:56 +00:00
|
|
|
#include "internal_procs.h"
|
|
|
|
|
2002-03-12 21:02:10 +00:00
|
|
|
|
2006-04-04 10:30:58 +00:00
|
|
|
static GValueArray *
|
|
|
|
palettes_popup_invoker (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args)
|
2002-03-12 21:02:10 +00:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-04-02 16:03:32 +00:00
|
|
|
const gchar *palette_callback;
|
|
|
|
const gchar *popup_title;
|
|
|
|
const gchar *initial_palette;
|
2002-03-12 21:02:10 +00:00
|
|
|
|
2006-04-04 10:30:58 +00:00
|
|
|
palette_callback = g_value_get_string (&args->values[0]);
|
|
|
|
popup_title = g_value_get_string (&args->values[1]);
|
|
|
|
initial_palette = g_value_get_string (&args->values[2]);
|
2002-03-12 21:02:10 +00:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2004-07-09 19:14:59 +00:00
|
|
|
if (gimp->no_interface ||
|
2006-04-26 09:13:47 +00:00
|
|
|
! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) ||
|
2006-09-22 09:24:41 +00:00
|
|
|
! gimp_pdb_dialog_new (gimp, context, progress,
|
|
|
|
gimp->palette_factory->container,
|
2004-07-09 19:14:59 +00:00
|
|
|
popup_title, palette_callback, initial_palette,
|
|
|
|
NULL))
|
2004-03-26 16:49:18 +00:00
|
|
|
success = FALSE;
|
2002-03-12 21:02:10 +00:00
|
|
|
}
|
|
|
|
|
2006-03-31 17:42:13 +00:00
|
|
|
return gimp_procedure_get_return_values (procedure, success);
|
2002-03-12 21:02:10 +00:00
|
|
|
}
|
|
|
|
|
2006-04-04 10:30:58 +00:00
|
|
|
static GValueArray *
|
|
|
|
palettes_close_popup_invoker (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args)
|
2002-03-12 21:02:10 +00:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-04-02 16:03:32 +00:00
|
|
|
const gchar *palette_callback;
|
2002-03-12 21:02:10 +00:00
|
|
|
|
2006-04-04 10:30:58 +00:00
|
|
|
palette_callback = g_value_get_string (&args->values[0]);
|
2002-03-12 21:02:10 +00:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2004-07-09 19:14:59 +00:00
|
|
|
if (gimp->no_interface ||
|
2006-04-26 09:13:47 +00:00
|
|
|
! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) ||
|
2004-07-09 19:14:59 +00:00
|
|
|
! gimp_pdb_dialog_close (gimp, gimp->palette_factory->container,
|
|
|
|
palette_callback))
|
2004-03-26 16:49:18 +00:00
|
|
|
success = FALSE;
|
2002-03-12 21:02:10 +00:00
|
|
|
}
|
|
|
|
|
2006-03-31 17:42:13 +00:00
|
|
|
return gimp_procedure_get_return_values (procedure, success);
|
2002-03-12 21:02:10 +00:00
|
|
|
}
|
|
|
|
|
2006-04-04 10:30:58 +00:00
|
|
|
static GValueArray *
|
|
|
|
palettes_set_popup_invoker (GimpProcedure *procedure,
|
|
|
|
Gimp *gimp,
|
|
|
|
GimpContext *context,
|
|
|
|
GimpProgress *progress,
|
|
|
|
const GValueArray *args)
|
2002-03-12 21:02:10 +00:00
|
|
|
{
|
|
|
|
gboolean success = TRUE;
|
2006-04-02 16:03:32 +00:00
|
|
|
const gchar *palette_callback;
|
|
|
|
const gchar *palette_name;
|
2002-03-12 21:02:10 +00:00
|
|
|
|
2006-04-04 10:30:58 +00:00
|
|
|
palette_callback = g_value_get_string (&args->values[0]);
|
|
|
|
palette_name = g_value_get_string (&args->values[1]);
|
2002-03-12 21:02:10 +00:00
|
|
|
|
|
|
|
if (success)
|
|
|
|
{
|
2004-07-09 19:14:59 +00:00
|
|
|
if (gimp->no_interface ||
|
2006-04-26 09:13:47 +00:00
|
|
|
! gimp_pdb_lookup_procedure (gimp->pdb, palette_callback) ||
|
2004-07-09 19:14:59 +00:00
|
|
|
! gimp_pdb_dialog_set (gimp, gimp->palette_factory->container,
|
|
|
|
palette_callback, palette_name,
|
|
|
|
NULL))
|
2004-03-26 16:49:18 +00:00
|
|
|
success = FALSE;
|
2002-03-12 21:02:10 +00:00
|
|
|
}
|
|
|
|
|
2006-03-31 17:42:13 +00:00
|
|
|
return gimp_procedure_get_return_values (procedure, success);
|
2002-03-12 21:02:10 +00:00
|
|
|
}
|
|
|
|
|
2006-04-04 21:11:45 +00:00
|
|
|
void
|
2006-04-26 09:13:47 +00:00
|
|
|
register_palette_select_procs (GimpPDB *pdb)
|
2002-03-12 21:02:10 +00:00
|
|
|
{
|
2006-04-04 21:11:45 +00:00
|
|
|
GimpProcedure *procedure;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-palettes-popup
|
|
|
|
*/
|
2006-04-06 10:01:30 +00:00
|
|
|
procedure = gimp_procedure_new (palettes_popup_invoker);
|
2006-04-07 10:04:27 +00:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-palettes-popup");
|
2006-04-04 21:11:45 +00:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
"gimp-palettes-popup",
|
|
|
|
"Invokes the Gimp palette selection.",
|
|
|
|
"This procedure popups the palette selection dialog.",
|
|
|
|
"Michael Natterer <mitch@gimp.org>",
|
|
|
|
"Michael Natterer",
|
|
|
|
"2002",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("palette-callback",
|
|
|
|
"palette callback",
|
|
|
|
"The callback PDB proc to call when palette selection is made",
|
|
|
|
FALSE, FALSE,
|
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("popup-title",
|
|
|
|
"popup title",
|
|
|
|
"Title to give the palette popup window",
|
|
|
|
FALSE, FALSE,
|
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("initial-palette",
|
|
|
|
"initial palette",
|
|
|
|
"The name of the palette to set as the first selected",
|
|
|
|
FALSE, TRUE,
|
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 09:13:47 +00:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 08:16:26 +00:00
|
|
|
g_object_unref (procedure);
|
2006-04-04 21:11:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-palettes-close-popup
|
|
|
|
*/
|
2006-04-06 10:01:30 +00:00
|
|
|
procedure = gimp_procedure_new (palettes_close_popup_invoker);
|
2006-04-07 10:04:27 +00:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-palettes-close-popup");
|
2006-04-04 21:11:45 +00:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
"gimp-palettes-close-popup",
|
|
|
|
"Popdown the Gimp palette selection.",
|
|
|
|
"This procedure closes an opened palette selection dialog.",
|
|
|
|
"Michael Natterer <mitch@gimp.org>",
|
|
|
|
"Michael Natterer",
|
|
|
|
"2002",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("palette-callback",
|
|
|
|
"palette callback",
|
|
|
|
"The name of the callback registered for this popup",
|
|
|
|
FALSE, FALSE,
|
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 09:13:47 +00:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 08:16:26 +00:00
|
|
|
g_object_unref (procedure);
|
2006-04-04 21:11:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* gimp-palettes-set-popup
|
|
|
|
*/
|
2006-04-06 10:01:30 +00:00
|
|
|
procedure = gimp_procedure_new (palettes_set_popup_invoker);
|
2006-04-07 10:04:27 +00:00
|
|
|
gimp_object_set_static_name (GIMP_OBJECT (procedure), "gimp-palettes-set-popup");
|
2006-04-04 21:11:45 +00:00
|
|
|
gimp_procedure_set_static_strings (procedure,
|
|
|
|
"gimp-palettes-set-popup",
|
|
|
|
"Sets the current palette selection in a popup.",
|
|
|
|
"Sets the current palette selection in a popup.",
|
|
|
|
"Michael Natterer <mitch@gimp.org>",
|
|
|
|
"Michael Natterer",
|
|
|
|
"2002",
|
|
|
|
NULL);
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("palette-callback",
|
|
|
|
"palette callback",
|
|
|
|
"The name of the callback registered for this popup",
|
|
|
|
FALSE, FALSE,
|
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
|
|
|
gimp_procedure_add_argument (procedure,
|
|
|
|
gimp_param_spec_string ("palette-name",
|
|
|
|
"palette name",
|
|
|
|
"The name of the palette to set as selected",
|
|
|
|
FALSE, FALSE,
|
|
|
|
NULL,
|
|
|
|
GIMP_PARAM_READWRITE));
|
2006-04-26 09:13:47 +00:00
|
|
|
gimp_pdb_register_procedure (pdb, procedure);
|
2006-04-07 08:16:26 +00:00
|
|
|
g_object_unref (procedure);
|
2006-04-04 21:11:45 +00:00
|
|
|
}
|