[gimp-perl] Update demo extension.
- From: Ed J <edj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp-perl] Update demo extension.
- Date: Thu, 22 May 2014 07:41:50 +0000 (UTC)
commit 62e63c692442cf2a88ec20662f9d0b293aa6a5a7
Author: Ed J <edj src gnome org>
Date: Thu May 22 08:41:10 2014 +0100
Update demo extension.
examples/example-extension | 59 ++++++++++++------------------------
examples/example-extension-tester | 34 ---------------------
2 files changed, 20 insertions(+), 73 deletions(-)
---
diff --git a/examples/example-extension b/examples/example-extension
index 0a19cd9..b0d3e77 100755
--- a/examples/example-extension
+++ b/examples/example-extension
@@ -1,62 +1,43 @@
#!/usr/bin/perl -w
use strict;
-use Gimp qw(:auto __ N_);
+use Gimp;
+#BEGIN { $Gimp::verbose = 3; }
+use Gimp::Fu;
use Gimp::Extension;
-#$Gimp::verbose = 1;
-my $persist;
-
-register_temp
- 'extension_test_temp',
- "Demo Gimp-Perl temp proc", "Demo a Gimp-Perl extension's temp proc",
- undef, '',
- [
- # must take this parameter first, can take others
- [ &Gimp::PDB_INT32, 'run_mode', 'Run-mode', 0 ],
- [ &Gimp::PDB_INT32, 'number', 'Input number', 0 ],
- ],
- [ [ &Gimp::PDB_INT32, 'retval', 'Retval', ], ], sub {
- my ($run_mode, $num) = @_;
- # here could bring up UI if $run_mode == RUN_INTERACTIVE
- $persist += $num;
- $persist;
- };
-
-podregister { $persist = $_[1]; Gtk2->main; };
-
+my $number;
+podregister_temp demo_show => sub { die "$number\n" };
+podregister { $number = $input; Gtk2->main; };
exit main;
__END__
=head1 NAME
-extension_test - test Gimp::Extension
+extension_demo - Demo extension showing persistent data
=head1 SYNOPSIS
-<Image>/Filters/Languages/_Perl/Test _Extension
+<Image>/Filters/Languages/_Perl/_Extension Demo
=head1 DESCRIPTION
-Installs a temporary procedure, C<extension_test_temp>. This takes args
-of C<$run_mode, $number>, adds the number to the extension's persistent
-data number, and returns its new value.
+Enter a number when it starts, then see that number with the temporary
+procedure.
+
+=head1 PARAMETERS
-The extension itself's C<num> parameter is the initial value of the
-persistent storage number, if given. The number does not persist across
-runs of GIMP.
+ [PF_INT8, 'input', 'Input value', 5],
-See L<examples/example-extension-tester> for a small L<Gimp::Fu> plugin
-that exercises this extension.
+=head1 TEMPORARY PROCEDURES
-=head1 PARAMETERS
+=head2 demo_show - Show persistent info
- [&Gimp::PDB_INT32, "run_mode", "Interactive:0=yes,1=no"],
- [&Gimp::PDB_INT32, "num", "Initial number value"],
+Show the number held in the extension.
-=head1 RETURN VALUES
+=head3 SYNOPSIS
- [&Gimp::PDB_INT32, "retnum", "Number returned"],
+<Image>/Filters/Languages/_Perl/_Extension Demo Temp
=head1 AUTHOR
@@ -64,8 +45,8 @@ Ed J
=head1 DATE
-2014-05-03
+2014-05-22
=head1 LICENSE
-Same terms as Gimp-Perl.
+As per Gimp-Perl.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]