app, libgimp, pdb: renaming a few PDB functions.

- s/gimp_buffers_get_list/gimp_buffers_get_name_list/
- s/gimp_context_get_dynamics/gimp_context_get_dynamics_name/
- s/gimp_context_set_dynamics/gimp_context_set_dynamics_name/
- s/gimp_dynamics_get_list/gimp_dynamics_get_name_list/

Named buffers and dynamics don't have their own classes. Using
*_get_name_list() will make sure that *_get_list() is available so that
we have constant naming if we add the new types, even during the 3.0
series. Same for the gimp_context_*() functions.

Note that the buffer API in particular has a few more functions which
we'd like to be able to reuse (e.g. gimp_buffer_rename()) with a proper
type. But we'll probably name this type GimpNamedBuffer anyway
(GimpBuffer is too similarly-named with GeglBuffer IMO) so it will be
easy to create new API for the new type.

See also #12268.
This commit is contained in:
Jehan 2024-11-03 17:00:21 +01:00
parent 6541e4d8da
commit a7064a18c3
13 changed files with 64 additions and 64 deletions

View file

@ -45,12 +45,12 @@
static GimpValueArray *
buffers_get_list_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
buffers_get_name_list_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpValueArray *return_vals;
@ -286,11 +286,11 @@ register_buffer_procs (GimpPDB *pdb)
GimpProcedure *procedure;
/*
* gimp-buffers-get-list
* gimp-buffers-get-name-list
*/
procedure = gimp_procedure_new (buffers_get_list_invoker);
procedure = gimp_procedure_new (buffers_get_name_list_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-buffers-get-list");
"gimp-buffers-get-name-list");
gimp_procedure_set_static_help (procedure,
"Retrieve a complete listing of the available buffers.",
"This procedure returns a complete listing of available named buffers.",

View file

@ -1330,12 +1330,12 @@ context_set_brush_force_invoker (GimpProcedure *procedure,
}
static GimpValueArray *
context_get_dynamics_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
context_get_dynamics_name_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpValueArray *return_vals;
@ -1358,12 +1358,12 @@ context_get_dynamics_invoker (GimpProcedure *procedure,
}
static GimpValueArray *
context_set_dynamics_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
context_set_dynamics_name_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
const gchar *name;
@ -4238,11 +4238,11 @@ register_context_procs (GimpPDB *pdb)
g_object_unref (procedure);
/*
* gimp-context-get-dynamics
* gimp-context-get-dynamics-name
*/
procedure = gimp_procedure_new (context_get_dynamics_invoker);
procedure = gimp_procedure_new (context_get_dynamics_name_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-context-get-dynamics");
"gimp-context-get-dynamics-name");
gimp_procedure_set_static_help (procedure,
"Get the currently active paint dynamics.",
"Returns the name of the currently active paint dynamics. If enabled, all paint operations and stroke operations use this paint dynamics to control the application of paint to the image. If disabled, the dynamics will be ignored during paint actions.\n"
@ -4263,11 +4263,11 @@ register_context_procs (GimpPDB *pdb)
g_object_unref (procedure);
/*
* gimp-context-set-dynamics
* gimp-context-set-dynamics-name
*/
procedure = gimp_procedure_new (context_set_dynamics_invoker);
procedure = gimp_procedure_new (context_set_dynamics_name_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-context-set-dynamics");
"gimp-context-set-dynamics-name");
gimp_procedure_set_static_help (procedure,
"Set the active paint dynamics.",
"Sets the active paint dynamics. The paint dynamics will be used in all subsequent paint operations when dynamics are enabled. The name should be a name of an installed paint dynamics. Returns an error if no matching paint dynamics is found.",

View file

@ -54,12 +54,12 @@ dynamics_refresh_invoker (GimpProcedure *procedure,
}
static GimpValueArray *
dynamics_get_list_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
dynamics_get_name_list_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
{
gboolean success = TRUE;
GimpValueArray *return_vals;
@ -106,11 +106,11 @@ register_dynamics_procs (GimpPDB *pdb)
g_object_unref (procedure);
/*
* gimp-dynamics-get-list
* gimp-dynamics-get-name-list
*/
procedure = gimp_procedure_new (dynamics_get_list_invoker);
procedure = gimp_procedure_new (dynamics_get_name_list_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-dynamics-get-list");
"gimp-dynamics-get-name-list");
gimp_procedure_set_static_help (procedure,
"Retrieve the list of loaded paint dynamics.",
"This procedure returns a list of the paint dynamics that are currently available.",

View file

@ -39,7 +39,7 @@ EXPORTS
gimp_buffer_get_image_type
gimp_buffer_get_width
gimp_buffer_rename
gimp_buffers_get_list
gimp_buffers_get_name_list
gimp_channel_combine_masks
gimp_channel_copy
gimp_channel_get_by_id
@ -71,7 +71,7 @@ EXPORTS
gimp_context_get_brush_spacing
gimp_context_get_diagonal_neighbors
gimp_context_get_distance_metric
gimp_context_get_dynamics
gimp_context_get_dynamics_name
gimp_context_get_emulate_brush_dynamics
gimp_context_get_feather
gimp_context_get_feather_radius
@ -130,7 +130,7 @@ EXPORTS
gimp_context_set_defaults
gimp_context_set_diagonal_neighbors
gimp_context_set_distance_metric
gimp_context_set_dynamics
gimp_context_set_dynamics_name
gimp_context_set_emulate_brush_dynamics
gimp_context_set_feather
gimp_context_set_feather_radius
@ -252,7 +252,7 @@ EXPORTS
gimp_drawables_close_popup
gimp_drawables_popup
gimp_drawables_set_popup
gimp_dynamics_get_list
gimp_dynamics_get_name_list
gimp_dynamics_refresh
gimp_edit_copy
gimp_edit_copy_visible

View file

@ -37,7 +37,7 @@
/**
* gimp_buffers_get_list:
* gimp_buffers_get_name_list:
* @filter: An optional regular expression used to filter the list.
*
* Retrieve a complete listing of the available buffers.
@ -52,7 +52,7 @@
* Since: 2.4
**/
gchar **
gimp_buffers_get_list (const gchar *filter)
gimp_buffers_get_name_list (const gchar *filter)
{
GimpValueArray *args;
GimpValueArray *return_vals;
@ -63,7 +63,7 @@ gimp_buffers_get_list (const gchar *filter)
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-buffers-get-list",
"gimp-buffers-get-name-list",
args);
gimp_value_array_unref (args);

View file

@ -32,7 +32,7 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gchar** gimp_buffers_get_list (const gchar *filter);
gchar** gimp_buffers_get_name_list (const gchar *filter);
gchar* gimp_buffer_rename (const gchar *buffer_name,
const gchar *new_name);
gboolean gimp_buffer_delete (const gchar *buffer_name);

View file

@ -1804,7 +1804,7 @@ gimp_context_set_brush_force (gdouble force)
}
/**
* gimp_context_get_dynamics:
* gimp_context_get_dynamics_name:
*
* Get the currently active paint dynamics.
*
@ -1821,7 +1821,7 @@ gimp_context_set_brush_force (gdouble force)
* Since: 2.8
**/
gchar *
gimp_context_get_dynamics (void)
gimp_context_get_dynamics_name (void)
{
GimpValueArray *args;
GimpValueArray *return_vals;
@ -1831,7 +1831,7 @@ gimp_context_get_dynamics (void)
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-context-get-dynamics",
"gimp-context-get-dynamics-name",
args);
gimp_value_array_unref (args);
@ -1844,7 +1844,7 @@ gimp_context_get_dynamics (void)
}
/**
* gimp_context_set_dynamics:
* gimp_context_set_dynamics_name:
* @name: A name of a paint dynamics.
*
* Set the active paint dynamics.
@ -1859,7 +1859,7 @@ gimp_context_get_dynamics (void)
* Since: 2.8
**/
gboolean
gimp_context_set_dynamics (const gchar *name)
gimp_context_set_dynamics_name (const gchar *name)
{
GimpValueArray *args;
GimpValueArray *return_vals;
@ -1870,7 +1870,7 @@ gimp_context_set_dynamics (const gchar *name)
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-context-set-dynamics",
"gimp-context-set-dynamics-name",
args);
gimp_value_array_unref (args);

View file

@ -83,8 +83,8 @@ gboolean gimp_context_set_brush_hardness (gdoub
gboolean gimp_context_set_brush_default_hardness (void);
gdouble gimp_context_get_brush_force (void);
gboolean gimp_context_set_brush_force (gdouble force);
gchar* gimp_context_get_dynamics (void);
gboolean gimp_context_set_dynamics (const gchar *name);
gchar* gimp_context_get_dynamics_name (void);
gboolean gimp_context_set_dynamics_name (const gchar *name);
gboolean gimp_context_are_dynamics_enabled (void);
gboolean gimp_context_enable_dynamics (gboolean enable);
gboolean gimp_context_get_emulate_brush_dynamics (void);

View file

@ -72,7 +72,7 @@ gimp_dynamics_refresh (void)
}
/**
* gimp_dynamics_get_list:
* gimp_dynamics_get_name_list:
* @filter: An optional regular expression used to filter the list.
*
* Retrieve the list of loaded paint dynamics.
@ -87,7 +87,7 @@ gimp_dynamics_refresh (void)
* Since: 2.8
**/
gchar **
gimp_dynamics_get_list (const gchar *filter)
gimp_dynamics_get_name_list (const gchar *filter)
{
GimpValueArray *args;
GimpValueArray *return_vals;
@ -98,7 +98,7 @@ gimp_dynamics_get_list (const gchar *filter)
G_TYPE_NONE);
return_vals = _gimp_pdb_run_procedure_array (gimp_get_pdb (),
"gimp-dynamics-get-list",
"gimp-dynamics-get-name-list",
args);
gimp_value_array_unref (args);

View file

@ -32,8 +32,8 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
gboolean gimp_dynamics_refresh (void);
gchar** gimp_dynamics_get_list (const gchar *filter);
gboolean gimp_dynamics_refresh (void);
gchar** gimp_dynamics_get_name_list (const gchar *filter);
G_END_DECLS

View file

@ -16,7 +16,7 @@
# "Perlized" from C source by Manish Singh <yosh@gimp.org>
sub buffers_get_list {
sub buffers_get_name_list {
$blurb = 'Retrieve a complete listing of the available buffers.';
$help = <<'HELP';
@ -240,7 +240,7 @@ CODE
"core/gimpcontainer-filter.h"
"gimppdb-utils.h");
@procs = qw(buffers_get_list
@procs = qw(buffers_get_name_list
buffer_rename
buffer_delete
buffer_get_width

View file

@ -1438,7 +1438,7 @@ CODE
);
}
sub context_get_dynamics {
sub context_get_dynamics_name {
$blurb = 'Get the currently active paint dynamics.';
$help = <<'HELP';
@ -1472,7 +1472,7 @@ CODE
);
}
sub context_set_dynamics {
sub context_set_dynamics_name {
$blurb = 'Set the active paint dynamics.';
$help = <<'HELP';
@ -3521,7 +3521,7 @@ CODE
context_set_brush_hardness context_set_brush_default_hardness
context_get_brush_force
context_set_brush_force
context_get_dynamics context_set_dynamics
context_get_dynamics_name context_set_dynamics_name
context_are_dynamics_enabled context_enable_dynamics
context_get_emulate_brush_dynamics context_set_emulate_brush_dynamics
context_get_mypaint_brush context_set_mypaint_brush

View file

@ -36,7 +36,7 @@ CODE
);
}
sub dynamics_get_list {
sub dynamics_get_name_list {
$blurb = 'Retrieve the list of loaded paint dynamics.';
$help = <<'HELP';
@ -73,7 +73,7 @@ CODE
"core/gimpdatafactory.h");
@procs = qw(dynamics_refresh
dynamics_get_list);
dynamics_get_name_list);
%exports = (app => [@procs], lib => [@procs]);