Commit 41e2a325 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

Implemented #66921 (needs gimp-*-refresh in PDB)

2002-02-21  Michael Natterer  <mitch@gimp.org>

	Implemented #66921 (needs gimp-*-refresh in PDB)

	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/patterns.pdb: added gimp_*_refresh() procedures.

	* tools/pdbgen/pdb/palette.pdb: typo: s/patterns/palettes/

	* app/pdb/gradients_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/palette_cmds.c
	* app/pdb/patterns_cmds.c
	* libgimp/gimpgradients_pdb.[ch]
	* libgimp/gimppalette_pdb.c: regenerated.
parent 5153abaf
2002-02-21 Michael Natterer <mitch@gimp.org>
Implemented #66921 (needs gimp-*-refresh in PDB)
* tools/pdbgen/pdb/gradients.pdb
* tools/pdbgen/pdb/patterns.pdb: added gimp_*_refresh() procedures.
* tools/pdbgen/pdb/palette.pdb: typo: s/patterns/palettes/
* app/pdb/gradients_cmds.c
* app/pdb/internal_procs.c
* app/pdb/palette_cmds.c
* app/pdb/patterns_cmds.c
* libgimp/gimpgradients_pdb.[ch]
* libgimp/gimppalette_pdb.c: regenerated.
2002-02-21 Michael Natterer <mitch@gimp.org>
* app/tools/gimpdrawtool.c: return the corrent value in
g_retuen_val_if_fail().
g_return_val_if_fail().
* app/tools/gimppainttool.c: removed some more painting logic...
......
......@@ -36,6 +36,7 @@
#include "core/gimpgradient.h"
#include "core/gimplist.h"
static ProcRecord gradients_refresh_proc;
static ProcRecord gradients_get_list_proc;
static ProcRecord gradients_get_active_proc;
static ProcRecord gradients_set_active_proc;
......@@ -46,6 +47,7 @@ static ProcRecord gradients_get_gradient_data_proc;
void
register_gradients_procs (Gimp *gimp)
{
procedural_db_register (gimp, &gradients_refresh_proc);
procedural_db_register (gimp, &gradients_get_list_proc);
procedural_db_register (gimp, &gradients_get_active_proc);
procedural_db_register (gimp, &gradients_set_active_proc);
......@@ -54,6 +56,31 @@ register_gradients_procs (Gimp *gimp)
procedural_db_register (gimp, &gradients_get_gradient_data_proc);
}
static Argument *
gradients_refresh_invoker (Gimp *gimp,
Argument *args)
{
gimp_data_factory_data_save (gimp->gradient_factory);
gimp_data_factory_data_init (gimp->gradient_factory, FALSE);
return procedural_db_return_args (&gradients_refresh_proc, TRUE);
}
static ProcRecord gradients_refresh_proc =
{
"gimp_gradients_refresh",
"Refresh current gradients.",
"This procedure retrieves all gradients currently in the user's gradient path and updates the gradient dialogs accordingly.",
"Michael Natterer",
"Michael Natterer",
"2002",
GIMP_INTERNAL,
0,
NULL,
0,
NULL,
{ { gradients_refresh_invoker } }
};
static Argument *
gradients_get_list_invoker (Gimp *gimp,
Argument *args)
......
......@@ -65,7 +65,7 @@ void register_transform_tools_procs (Gimp *gimp);
void register_undo_procs (Gimp *gimp);
void register_unit_procs (Gimp *gimp);
/* 330 procedures registered total */
/* 332 procedures registered total */
void
internal_procs_init (Gimp *gimp,
......@@ -83,7 +83,7 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Channel"), 0.042);
register_channel_procs (gimp);
(* status_callback) (NULL, _("Color"), 0.091);
(* status_callback) (NULL, _("Color"), 0.09);
register_color_procs (gimp);
(* status_callback) (NULL, _("Convert"), 0.127);
......@@ -95,40 +95,40 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Drawable procedures"), 0.145);
register_drawable_procs (gimp);
(* status_callback) (NULL, _("Edit procedures"), 0.215);
(* status_callback) (NULL, _("Edit procedures"), 0.214);
register_edit_procs (gimp);
(* status_callback) (NULL, _("File Operations"), 0.233);
(* status_callback) (NULL, _("File Operations"), 0.232);
register_fileops_procs (gimp);
(* status_callback) (NULL, _("Floating selections"), 0.258);
(* status_callback) (NULL, _("Floating selections"), 0.256);
register_floating_sel_procs (gimp);
(* status_callback) (NULL, _("Gimprc procedures"), 0.276);
(* status_callback) (NULL, _("Gimprc procedures"), 0.274);
register_gimprc_procs (gimp);
(* status_callback) (NULL, _("Gradients"), 0.288);
(* status_callback) (NULL, _("Gradients"), 0.286);
register_gradients_procs (gimp);
(* status_callback) (NULL, _("Gradient UI"), 0.306);
(* status_callback) (NULL, _("Gradient UI"), 0.307);
register_gradient_select_procs (gimp);
(* status_callback) (NULL, _("Guide procedures"), 0.315);
(* status_callback) (NULL, _("Guide procedures"), 0.316);
register_guides_procs (gimp);
(* status_callback) (NULL, _("Help procedures"), 0.333);
(* status_callback) (NULL, _("Help procedures"), 0.334);
register_help_procs (gimp);
(* status_callback) (NULL, _("Image"), 0.336);
(* status_callback) (NULL, _("Image"), 0.337);
register_image_procs (gimp);
(* status_callback) (NULL, _("Layer"), 0.521);
register_layer_procs (gimp);
(* status_callback) (NULL, _("Interface"), 0.615);
(* status_callback) (NULL, _("Interface"), 0.614);
register_message_procs (gimp);
(* status_callback) (NULL, _("Miscellaneous"), 0.624);
(* status_callback) (NULL, _("Miscellaneous"), 0.623);
register_misc_procs (gimp);
(* status_callback) (NULL, _("Misc Tool procedures"), 0.63);
......@@ -137,37 +137,37 @@ internal_procs_init (Gimp *gimp,
(* status_callback) (NULL, _("Paint Tool procedures"), 0.639);
register_paint_tools_procs (gimp);
(* status_callback) (NULL, _("Palette"), 0.685);
(* status_callback) (NULL, _("Palette"), 0.684);
register_palette_procs (gimp);
(* status_callback) (NULL, _("Parasite procedures"), 0.718);
(* status_callback) (NULL, _("Parasite procedures"), 0.717);
register_parasite_procs (gimp);
(* status_callback) (NULL, _("Paths"), 0.755);
(* status_callback) (NULL, _("Paths"), 0.753);
register_paths_procs (gimp);
(* status_callback) (NULL, _("Pattern UI"), 0.794);
(* status_callback) (NULL, _("Pattern UI"), 0.792);
register_pattern_select_procs (gimp);
(* status_callback) (NULL, _("Patterns"), 0.803);
(* status_callback) (NULL, _("Patterns"), 0.801);
register_patterns_procs (gimp);
(* status_callback) (NULL, _("Plug-in"), 0.815);
(* status_callback) (NULL, _("Plug-in"), 0.816);
register_plug_in_procs (gimp);
(* status_callback) (NULL, _("Procedural database"), 0.833);
(* status_callback) (NULL, _("Procedural database"), 0.834);
register_procedural_db_procs (gimp);
(* status_callback) (NULL, _("Image mask"), 0.858);
register_selection_procs (gimp);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.912);
(* status_callback) (NULL, _("Selection Tool procedures"), 0.913);
register_selection_tools_procs (gimp);
(* status_callback) (NULL, _("Text procedures"), 0.927);
(* status_callback) (NULL, _("Text procedures"), 0.928);
register_text_tool_procs (gimp);
(* status_callback) (NULL, _("Tool procedures"), 0.939);
(* status_callback) (NULL, _("Tool procedures"), 0.94);
register_transform_tools_procs (gimp);
(* status_callback) (NULL, _("Undo"), 0.958);
......
......@@ -353,7 +353,7 @@ static ProcArg palette_list_outargs[] =
static ProcRecord palette_list_proc =
{
"gimp_palette_list",
"Retrieves a list of all of the available patterns",
"Retrieves a list of all of the available palettes",
"This procedure returns a complete listing of available palettes. Each name returned can be used as input to the command 'gimp_palette_set_palette'.",
"Nathan Summers <rock@gimp.org>",
"Nathan Summers",
......
......@@ -36,6 +36,7 @@
#include "core/gimplist.h"
#include "core/gimppattern.h"
static ProcRecord patterns_refresh_proc;
static ProcRecord patterns_get_pattern_proc;
static ProcRecord patterns_set_pattern_proc;
static ProcRecord patterns_list_proc;
......@@ -44,12 +45,38 @@ static ProcRecord patterns_get_pattern_data_proc;
void
register_patterns_procs (Gimp *gimp)
{
procedural_db_register (gimp, &patterns_refresh_proc);
procedural_db_register (gimp, &patterns_get_pattern_proc);
procedural_db_register (gimp, &patterns_set_pattern_proc);
procedural_db_register (gimp, &patterns_list_proc);
procedural_db_register (gimp, &patterns_get_pattern_data_proc);
}
static Argument *
patterns_refresh_invoker (Gimp *gimp,
Argument *args)
{
gimp_data_factory_data_save (gimp->pattern_factory);
gimp_data_factory_data_init (gimp->pattern_factory, FALSE);
return procedural_db_return_args (&patterns_refresh_proc, TRUE);
}
static ProcRecord patterns_refresh_proc =
{
"gimp_patterns_refresh",
"Refresh current patterns.",
"This procedure retrieves all patterns currently in the user's pattern path and updates the pattern dialogs accordingly.",
"Michael Natterer",
"Michael Natterer",
"2002",
GIMP_INTERNAL,
0,
NULL,
0,
NULL,
{ { patterns_refresh_invoker } }
};
static Argument *
patterns_get_pattern_invoker (Gimp *gimp,
Argument *args)
......
......@@ -25,6 +25,34 @@
#include "gimp.h"
/**
* gimp_gradients_refresh:
*
* Refresh current gradients.
*
* This procedure retrieves all gradients currently in the user's
* gradient path and updates the gradient dialogs accordingly.
*
* Returns: TRUE on success.
*/
gboolean
gimp_gradients_refresh (void)
{
GimpParam *return_vals;
gint nreturn_vals;
gboolean success = TRUE;
return_vals = gimp_run_procedure ("gimp_gradients_refresh",
&nreturn_vals,
GIMP_PDB_END);
success = return_vals[0].data.d_status == GIMP_PDB_SUCCESS;
gimp_destroy_params (return_vals, nreturn_vals);
return success;
}
/**
* gimp_gradients_get_list:
* @num_gradients: The number of loaded gradients.
......
......@@ -29,6 +29,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_gradients_refresh (void);
gchar** gimp_gradients_get_list (gint *num_gradients);
gchar* gimp_gradients_get_active (void);
gboolean gimp_gradients_set_active (gchar *name);
......
......@@ -242,7 +242,7 @@ gimp_palette_refresh (void)
* gimp_palette_list:
* @num_palettes: The number of palettes in the list.
*
* Retrieves a list of all of the available patterns
* Retrieves a list of all of the available palettes
*
* This procedure returns a complete listing of available palettes.
* Each name returned can be used as input to the command
......
......@@ -22,6 +22,29 @@ sub pdb_misc {
$date = '1997';
}
# The defs
sub gradients_refresh {
$blurb = 'Refresh current gradients.';
$help = <<'HELP';
This procedure retrieves all gradients currently in the user's gradient path
and updates the gradient dialogs accordingly.
HELP
$author = $copyright = 'Michael Natterer';
$date = '2002';
%invoke = (
code => <<'CODE'
{
gimp_data_factory_data_save (gimp->gradient_factory);
gimp_data_factory_data_init (gimp->gradient_factory, FALSE);
}
CODE
);
}
sub gradients_get_list {
$blurb = 'Retrieve the list of loaded gradients.';
......@@ -328,7 +351,8 @@ CODE
"core/gimpcontainer.h" "core/gimpdatafactory.h"
"core/gimplist.h" "core/gimpgradient.h");
@procs = qw(gradients_get_list gradients_get_active gradients_set_active
@procs = qw(gradients_refresh gradients_get_list
gradients_get_active gradients_set_active
gradients_sample_uniform gradients_sample_custom
gradients_get_gradient_data);
%exports = (app => [@procs], lib => [@procs]);
......
......@@ -196,7 +196,7 @@ CODE
}
sub palette_list {
$blurb = 'Retrieves a list of all of the available patterns';
$blurb = 'Retrieves a list of all of the available palettes';
$help = <<'HELP';
This procedure returns a complete listing of available palettes. Each name
......
......@@ -48,6 +48,27 @@ sub pattern_outargs {
# The defs
sub patterns_refresh {
$blurb = 'Refresh current patterns.';
$help = <<'HELP';
This procedure retrieves all patterns currently in the user's pattern path
and updates the pattern dialogs accordingly.
HELP
$author = $copyright = 'Michael Natterer';
$date = '2002';
%invoke = (
code => <<'CODE'
{
gimp_data_factory_data_save (gimp->pattern_factory);
gimp_data_factory_data_init (gimp->pattern_factory, FALSE);
}
CODE
);
}
sub patterns_get_pattern {
$blurb = 'Retrieve information about the currently active pattern.';
......@@ -223,9 +244,9 @@ CODE
@headers = qw("core/gimp.h" "core/gimpcontext.h" "core/gimpdatafactory.h"
"core/gimplist.h" "core/gimppattern.h" "base/temp-buf.h");
@procs = qw(patterns_get_pattern patterns_set_pattern patterns_list
patterns_get_pattern_data);
%exports = (app => [@procs], lib => [$procs[3]]);
@procs = qw(patterns_refresh patterns_get_pattern patterns_set_pattern
patterns_list patterns_get_pattern_data);
%exports = (app => [@procs], lib => [$procs[4]]);
$desc = 'Patterns';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment