pdb: add "lib_private" on procedures too, to make them private

This replaces the "wrap" field on proc args and values, this belongs
to the procedure not to its args or values.
This commit is contained in:
Michael Natterer 2019-08-07 19:09:00 +02:00
parent e437e00adf
commit 6584839bf2
13 changed files with 159 additions and 60 deletions

View File

@ -33,6 +33,8 @@ HELP
&std_pdb_misc;
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image to which to add the channel' },
@ -50,7 +52,7 @@ HELP
);
@outargs = (
{ name => 'channel', type => 'channel', wrap => 1,
{ name => 'channel', type => 'channel',
desc => 'The newly created channel' }
);

View File

@ -281,13 +281,15 @@ HELP
&mitch_pdb_misc('2012', '2.10');
$lib_private = 1;
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
@outargs = (
{ name => 'format', type => 'string', wrap => 1,
{ name => 'format', type => 'string',
desc => "The drawable's Babl format" }
);
@ -316,13 +318,15 @@ HELP
&mitch_pdb_misc('2019', '2.10.14');
$lib_private = 1;
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' }
);
@outargs = (
{ name => 'format', type => 'string', wrap => 1,
{ name => 'format', type => 'string',
desc => "The drawable's thumbnail Babl format" }
);
@ -737,6 +741,8 @@ HELP
&andy_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' },
@ -754,7 +760,7 @@ HELP
{ name => 'bpp', type => 'int32',
desc => 'The previews bpp' },
{ name => 'thumbnail_data', type => 'int8array',
desc => 'The thumbnail data', wrap => 1,
desc => 'The thumbnail data',
array => { name => 'thumbnail_data_count',
desc => 'The number of bytes in thumbnail data' } }
);
@ -815,6 +821,8 @@ HELP
&mitch_pdb_misc('2004', '2.2');
$lib_private = 1;
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable' },
@ -840,7 +848,7 @@ HELP
{ name => 'bpp', type => 'int32',
desc => 'The previews bpp' },
{ name => 'thumbnail_data', type => 'int8array',
desc => 'The thumbnail data', wrap => 1,
desc => 'The thumbnail data',
array => { name => 'thumbnail_data_count',
desc => 'The number of bytes in thumbnail data' } }
);

View File

@ -176,10 +176,11 @@ sub get_color_configuration {
&neo_pdb_misc('2005', '2.4');
$lib_private = 1;
@outargs = (
{ name => 'config', type => 'string',
desc => 'Serialized color management configuration',
wrap => 1 }
desc => 'Serialized color management configuration' }
);
%invoke = (

View File

@ -1427,13 +1427,15 @@ HELP
&std_pdb_misc;
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'colormap', type => 'int8array', wrap => 1,
{ name => 'colormap', type => 'int8array',
desc => "The image's colormap.",
array => { name => 'num_bytes',
desc => 'Number of bytes in the colormap array' } }
@ -1462,10 +1464,12 @@ HELP
&std_pdb_misc;
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'colormap', type => 'int8array', wrap => 1,
{ name => 'colormap', type => 'int8array',
desc => 'The new colormap values',
array => { name => 'num_bytes', type => '0 <= int32 <= 768',
desc => 'Number of bytes in the colormap array' } }
@ -1487,13 +1491,15 @@ sub image_get_metadata {
&std_pdb_misc('2013', '2.10');
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'metadata_string', type => 'string', wrap => 1,
{ name => 'metadata_string', type => 'string',
desc => 'The exif/ptc/xmp metadata as a string'}
);
@ -1515,10 +1521,12 @@ sub image_set_metadata {
&std_pdb_misc('2013', '2.10');
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'metadata_string', type => 'string', wrap => 1,
{ name => 'metadata_string', type => 'string',
desc => 'The exif/ptc/xmp metadata as a string' }
);
@ -2841,6 +2849,8 @@ HELP
&andy_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
@ -2857,7 +2867,7 @@ HELP
desc => 'The previews height' },
{ name => 'bpp', type => 'int32',
desc => 'The previews bpp' },
{ name => 'thumbnail_data', type => 'int8array', wrap => 1,
{ name => 'thumbnail_data', type => 'int8array',
desc => 'The thumbnail data',
array => { name => 'thumbnail_data_count',
desc => 'The number of bytes in thumbnail data' } }

View File

@ -26,13 +26,15 @@ HELP
&mitch_pdb_misc('2015', '2.10');
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'profile_data', type => 'int8array', wrap => 1,
{ name => 'profile_data', type => 'int8array',
desc => "The image's serialized color profile.",
array => { name => 'num_bytes',
desc => 'Number of bytes in the color_profile array' } }
@ -72,13 +74,15 @@ HELP
&mitch_pdb_misc('2015', '2.10');
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' }
);
@outargs = (
{ name => 'profile_data', type => 'int8array', wrap => 1,
{ name => 'profile_data', type => 'int8array',
desc => "The image's serialized color profile.",
array => { name => 'num_bytes',
desc => 'Number of bytes in the color_profile array' } }
@ -119,10 +123,12 @@ HELP
&mitch_pdb_misc('2015', '2.10');
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'color_profile', type => 'int8array', wrap => 1,
{ name => 'color_profile', type => 'int8array',
desc => 'The new serialized color profile',
array => { name => 'num_bytes',
desc => 'Number of bytes in the color_profile array' } }
@ -222,10 +228,12 @@ HELP
&mitch_pdb_misc('2015', '2.10');
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'color_profile', type => 'int8array', wrap => 1,
{ name => 'color_profile', type => 'int8array',
desc => 'The serialized color profile',
array => { name => 'num_bytes',
desc => 'Number of bytes in the color_profile array' } },

View File

@ -30,6 +30,8 @@ HELP
&std_pdb_misc;
$lib_private = 1;
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image to which to add the layer' },
@ -49,7 +51,7 @@ HELP
);
@outargs = (
{ name => 'layer', type => 'layer', wrap => 1,
{ name => 'layer', type => 'layer',
desc => 'The newly created layer' }
);
@ -268,6 +270,8 @@ HELP
&std_pdb_misc;
$lib_private = 1;
@inargs = (
{ name => 'layer', type => 'layer',
desc => 'The layer to copy' },
@ -276,7 +280,7 @@ HELP
);
@outargs = (
{ name => 'layer_copy', type => 'layer', wrap => 1,
{ name => 'layer_copy', type => 'layer',
desc => 'The newly copied layer' }
);

View File

@ -26,8 +26,10 @@ HELP
&andy_pdb_misc('1998');
$lib_private = 1;
@outargs = (
{ name => 'temp_name', type => 'string', wrap => 1,
{ name => 'temp_name', type => 'string',
desc => 'A unique temporary name for a temporary PDB entry' }
);
@ -146,13 +148,15 @@ HELP
&neo_pdb_misc('2008', '2.6');
$lib_private = 1;
@inargs = (
{ name => 'procedure_name', type => 'string', non_empty => 1,
desc => 'The procedure name' }
);
@outargs = (
{ name => 'exists', type => 'boolean', wrap => 1,
{ name => 'exists', type => 'boolean',
desc => 'Whether a procedure of that name is registered' }
);
@ -199,13 +203,15 @@ HELP
&std_pdb_misc;
$date = '1997';
$lib_private = 1;
@inargs = (
{ name => 'procedure_name', type => 'string', non_empty => 1,
desc => 'The procedure name' }
);
@outargs = (
{ name => 'blurb', type => 'string', void_ret => 1, wrap => 1,
{ name => 'blurb', type => 'string', void_ret => 1,
desc => 'A short blurb' },
{ name => 'help', type => 'string',
desc => 'Detailed procedure help' },
@ -376,8 +382,10 @@ HELP
&std_pdb_misc;
$date = '1997';
$lib_private = 1;
@inargs = (
{ name => 'procedure_name', type => 'string', non_empty => 1, wrap => 1,
{ name => 'procedure_name', type => 'string', non_empty => 1,
desc => 'The procedure name' },
{ name => 'arg_num', type => 'int32',
desc => 'The argument number' }
@ -444,8 +452,10 @@ HELP
&std_pdb_misc;
$date = '1997';
$lib_private = 1;
@inargs = (
{ name => 'procedure_name', type => 'string', non_empty => 1, wrap => 1,
{ name => 'procedure_name', type => 'string', non_empty => 1,
desc => 'The procedure name' },
{ name => 'val_num', type => 'int32',
desc => 'The return value number' }
@ -510,13 +520,15 @@ HELP
&std_pdb_misc;
$date = '1997';
$lib_private = 1;
@inargs = (
{ name => 'identifier', type => 'string', non_empty => 1,
desc => 'The identifier associated with data' }
);
@outargs = (
{ name => 'data', type => 'int8array', wrap => 1, void_ret => 1,
{ name => 'data', type => 'int8array', void_ret => 1,
desc => 'A byte array containing data',
array => { name => 'bytes', type => '1 <= int32',
desc => 'The number of bytes in the data' } }
@ -553,8 +565,10 @@ HELP
&nick_pdb_misc('1998');
$lib_private = 1;
@inargs = (
{ name => 'identifier', type => 'string', non_empty => 1, wrap => 1,
{ name => 'identifier', type => 'string', non_empty => 1,
desc => 'The identifier associated with data' }
);
@ -589,11 +603,13 @@ HELP
&std_pdb_misc;
$date = '1997';
$lib_private = 1;
@inargs = (
{ name => 'identifier', type => 'string', non_empty => 1,
desc => 'The identifier associated with data' },
{ name => 'data', type => 'int8array',
desc => 'A byte array containing data', wrap => 1,
desc => 'A byte array containing data',
array => { name => 'bytes', type => '1 <= int32',
desc => 'The number of bytes in the data' } }
);

View File

@ -22,13 +22,15 @@ sub plugins_query {
&andy_pdb_misc('1998');
$lib_private = 1;
@inargs = (
{ name => 'search_string', type => 'string', no_validate => 1,
desc => 'If not an empty string then use this as a search pattern' }
);
@outargs = (
{ name => 'menu_path', type => 'stringarray', wrap => 1,
{ name => 'menu_path', type => 'stringarray',
desc => 'The menu path of the plug-in',
array => { name => 'num_plugins',
desc => 'The number of plug-ins' } },
@ -87,8 +89,10 @@ HELP
&neo_pdb_misc('2000');
$lib_private = 1;
@inargs = (
{ name => 'domain_name', type => 'string', wrap => 1,
{ name => 'domain_name', type => 'string',
desc => 'The name of the textdomain (must be unique)' },
{ name => 'domain_path', type => 'string', no_validate => 1,
desc => 'The absolute path to the compiled message catalog (may be
@ -128,8 +132,10 @@ HELP
&mitch_pdb_misc('2000');
$lib_private = 1;
@inargs = (
{ name => 'domain_name', type => 'string', wrap => 1,
{ name => 'domain_name', type => 'string',
desc => "The XML namespace of the plug-in's help pages" },
{ name => 'domain_uri', type => 'string',
desc => "The root URI of the plug-in's help pages" }
@ -163,8 +169,10 @@ HELP
&mitch_pdb_misc('2004', '2.2');
$lib_private = 1;
@inargs = (
{ name => 'procedure_name', type => 'string', wrap => 1, non_empty => 1,
{ name => 'procedure_name', type => 'string', non_empty => 1,
desc => 'The procedure for which to install the menu path' },
{ name => 'menu_path', type => 'string',
desc => "The procedure's additional menu path" }
@ -201,8 +209,10 @@ HELP
&mitch_pdb_misc('2005', '2.4');
$lib_private = 1;
@inargs = (
{ name => 'menu_path', type => 'string', wrap => 1,
{ name => 'menu_path', type => 'string',
desc => "The sub-menu's menu path" },
{ name => 'menu_name', type => 'string',
desc => 'The name of the sub-menu' }
@ -236,8 +246,10 @@ HELP
&mitch_pdb_misc('2004', '2.2');
$lib_private = 1;
@inargs = (
{ name => 'procedure_name', type => 'string', wrap => 1, non_empty => 1,
{ name => 'procedure_name', type => 'string', non_empty => 1,
desc => 'The procedure for which to install the icon' },
{ name => 'icon_type', type => 'enum GimpIconType',
desc => 'The type of the icon' },
@ -296,8 +308,10 @@ HELP
&neo_pdb_misc('2008', '2.6');
$lib_private = 1;
@inargs = (
{ name => 'handler', type => 'enum GimpPDBErrorHandler', wrap => 1,
{ name => 'handler', type => 'enum GimpPDBErrorHandler',
desc => "Who is responsible for handling procedure call errors" }
);
@ -330,8 +344,10 @@ HELP
&neo_pdb_misc('2008', '2.6');
$lib_private = 1;
@outargs = (
{ name => 'handler', type => 'enum GimpPDBErrorHandler', wrap => 1,
{ name => 'handler', type => 'enum GimpPDBErrorHandler',
desc => "Who is responsible for handling procedure call errors" }
);

View File

@ -26,8 +26,10 @@ HELP
&std_pdb_misc;
$lib_private = 1;
@inargs = (
{ name => 'message', type => 'string', null_ok => 1, wrap => 1,
{ name => 'message', type => 'string', null_ok => 1,
desc => 'Message to use in the progress dialog' },
{ name => 'gdisplay', type => 'display', none_ok => 1,
desc => 'GimpDisplay to update progressbar in, or -1 for a separate
@ -61,8 +63,10 @@ HELP
&std_pdb_misc;
$lib_private = 1;
@inargs = (
{ name => 'percentage', type => 'float', wrap => 1,
{ name => 'percentage', type => 'float',
desc => 'Percentage of progress completed which must
be between 0.0 and 1.0' }
);
@ -217,10 +221,11 @@ HELP
&mitch_pdb_misc('2004', '2.2');
$lib_private = 1;
@inargs = (
{ name => 'progress_callback', type => 'string', non_empty => 1,
desc => 'The callback PDB proc to call',
wrap => 1 }
desc => 'The callback PDB proc to call' }
);
%invoke = (
@ -247,10 +252,11 @@ HELP
&mitch_pdb_misc('2004', '2.2');
$lib_private = 1;
@inargs = (
{ name => 'progress_callback', type => 'string', non_empty => 1,
desc => 'The name of the callback registered for this progress',
wrap => 1 }
desc => 'The name of the callback registered for this progress' }
);
%invoke = (

View File

@ -178,6 +178,8 @@ HELP
&std_pdb_misc;
$lib_private = 1;
@inargs = (
{ name => 'drawable', type => 'drawable',
desc => 'The drawable from which to float selection' },
@ -188,7 +190,7 @@ HELP
);
@outargs = (
{ name => 'layer', type => 'layer', wrap => 1,
{ name => 'layer', type => 'layer',
desc => 'The floated layer' }
);

View File

@ -23,9 +23,11 @@ sub unit_get_number_of_units {
&mitch_pdb_misc('1999');
$lib_private = 1;
@outargs = (
{ name => 'num_units', type => 'int32', libdef => 'GIMP_UNIT_END',
desc => 'The number of units', wrap => 1 }
desc => 'The number of units' }
);
%invoke = (
@ -46,9 +48,11 @@ HELP
&mitch_pdb_misc('1999');
$lib_private = 1;
@outargs = (
{ name => 'num_units', type => 'int32', libdef => 'GIMP_UNIT_END',
desc => 'The number of built-in units', wrap => 1 }
desc => 'The number of built-in units' }
);
%invoke = (
@ -71,8 +75,10 @@ HELP
&mitch_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'identifier', type => 'string', wrap => 1, non_empty => 1,
{ name => 'identifier', type => 'string', non_empty => 1,
desc => "The new unit's identifier" },
{ name => 'factor', type => 'float',
desc => "The new unit's factor" },
@ -91,7 +97,7 @@ HELP
@outargs = (
{ name => 'unit_id', type => 'unit',
desc => "The new unit's ID",
wrap => 1, libdef => 'GIMP_UNIT_INCH' }
libdef => 'GIMP_UNIT_INCH' }
);
%invoke = (
@ -114,9 +120,11 @@ HELP
&mitch_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'unit_id', type => 'unit',
desc => "The unit's integer ID", wrap => 1 }
desc => "The unit's integer ID" }
);
@outargs = (
@ -144,9 +152,11 @@ HELP
&mitch_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'unit_id', type => 'unit',
desc => "The unit's integer ID", wrap => 1 },
desc => "The unit's integer ID" },
{ name => 'deletion_flag', type => 'boolean',
desc => 'The new deletion flag of the unit' }
);
@ -171,9 +181,11 @@ HELP
&mitch_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'unit_id', type => 'unit',
desc => "The unit's integer ID", wrap => 1 }
desc => "The unit's integer ID" }
);
@outargs = (
@ -200,9 +212,11 @@ HELP
&mitch_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'unit_id', type => 'unit',
desc => "The unit's integer ID", wrap => 1 }
desc => "The unit's integer ID" }
);
@outargs = (
@ -230,9 +244,11 @@ HELP
&mitch_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'unit_id', type => 'unit',
desc => "The unit's integer ID", wrap => 1 }
desc => "The unit's integer ID" }
);
@outargs = (
@ -258,9 +274,11 @@ HELP
&mitch_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'unit_id', type => 'unit',
desc => "The unit's integer ID", wrap => 1 }
desc => "The unit's integer ID" }
);
@outargs = (
@ -286,9 +304,11 @@ HELP
&mitch_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'unit_id', type => 'unit',
desc => "The unit's integer ID", wrap => 1 }
desc => "The unit's integer ID" }
);
@outargs = (
@ -311,9 +331,11 @@ sub unit_get_singular {
&mitch_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'unit_id', type => 'unit',
desc => "The unit's integer ID", wrap => 1 }
desc => "The unit's integer ID" }
);
@outargs = (
@ -336,9 +358,11 @@ sub unit_get_plural {
&mitch_pdb_misc('1999');
$lib_private = 1;
@inargs = (
{ name => 'unit_id', type => 'unit',
desc => "The unit's integer ID", wrap => 1 }
desc => "The unit's integer ID" }
);
@outargs = (

View File

@ -86,10 +86,15 @@ sub generate {
my @inargs = @{$proc->{inargs}} if (defined $proc->{inargs});
my @outargs = @{$proc->{outargs}} if (defined $proc->{outargs});
my $funcname = "gimp_$name"; my $wrapped = "";
my $funcname = "gimp_$name";
my $wrapped = "";
my %usednames;
my $retdesc = " * Returns:";
if ($proc->{lib_private}) {
$wrapped = '_';
}
if ($proc->{deprecated}) {
if ($proc->{deprecated} eq 'NONE') {
push @{$out->{protos}}, "GIMP_DEPRECATED\n";
@ -223,8 +228,6 @@ sub generate {
# This is the list of g_value_set_foo
$arg_array .= eval qq/" $arg->{set_value_func};\n"/;
$wrapped = "_" if exists $_->{wrap};
$usednames{$_->{name}}++;
$arglist .= &libtype($_, 0);
@ -279,8 +282,6 @@ sub generate {
$return_marshal = "" unless $once++;
$wrapped = "_" if exists $_->{wrap};
$_->{libname} = exists $usednames{$_->{name}} ? "ret_$_->{name}"
: $_->{name};

View File

@ -68,7 +68,8 @@ $evalcode = <<'CODE';
# Variables to evaluate and insert into the PDB structure
my @procvars = qw($name $group $blurb $help $author $copyright $date $since
$deprecated @inargs @outargs %invoke $canonical_name);
$deprecated @inargs @outargs %invoke $canonical_name
$lib_private);
# These are attached to the group structure
my @groupvars = qw($desc $doc_title $doc_short_desc $doc_long_desc