Commit b440e06b authored by Marc Lehmann's avatar Marc Lehmann

See plug-ins/perl/Changes

parent 8475a4f8
......@@ -3,6 +3,10 @@ Revision history for Gimp-Perl extension.
- more configuration cleanups
- fixed Gimp::Fu to respect RUN_WITH_LAST_VALS again
- added more oo-prefixes to channels and layers (see Gimp::OO)
- added preliminary gimp_init/gimp_end functions, see Gimp(3).
- 'require 5.004_04' and added use base declarations
- improved future compatibility
- improved constant inlining
1.0441 Sat Oct 24 22:52:05 CEST 1998
- t/run.t does much less when no tests are requested
......
......@@ -8,9 +8,10 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD %EXPORT_TAGS @EXPORT_FAIL
@gimp_gui_functions
$help $verbose $host $gimp_main);
use base qw(DynaLoader);
require DynaLoader;
@ISA = qw(DynaLoader);
$VERSION = 1.0441;
@_param = qw(
......@@ -218,6 +219,8 @@ for(qw(_gimp_procedure_available gimp_call_procedure set_trace)) {
}
*main = *gimp_main = \&{"${interface_pkg}::gimp_main"};
*init = *gimp_init = \&{"${interface_pkg}::gimp_init"};
*end = *gimp_end = \&{"${interface_pkg}::gimp_end" };
@PREFIXES=("gimp_", "");
......@@ -577,6 +580,18 @@ speak for you), or just plain interesting functions.
Should be called immediately when perl is initialized. Arguments are not yet
supported. Initializations can later be done in the init function.
=item init(), end (), gimp_init(), gimp_end()
These is an alternative and experimental interface that replaces the call to
gimp_main and the net callback. At the moment it only works for the Net
interface (L<Gimp::Net>), and not as a native plug-in. Here's an example:
use Gimp;
Gimp::init;
<do something with the gimp>
Gimp::end;
=item gimp_install_procedure(name, blurb, help, author, copyright, date, menu_path, image_types, type, [params], [return_vals])
Mostly same as gimp_install_procedure. The parameters and return values for
......
......@@ -6,8 +6,8 @@ use Tie::Hash;
use Gimp qw();
use Exporter ();
use vars qw(@EXPORT @ISA);
use base qw(Tie::StdHash Exporter);
@ISA = qw(Tie::StdHash Exporter);
@EXPORT = qw();
sub FETCH {
......
......@@ -11,6 +11,7 @@ use File::Basename;
use Gtk;
use Gtk::ColorSelectButton;
use Data::Dumper;
use base qw(Exporter);
require Exporter;
require DynaLoader;
......@@ -73,20 +74,20 @@ sub PF_LAYER () { PARAM_LAYER };
sub PF_CHANNEL () { PARAM_CHANNEL };
sub PF_DRAWABLE () { PARAM_DRAWABLE };
sub PF_TOGGLE () { &PARAM_END+1 };
sub PF_SLIDER () { &PARAM_END+2 };
sub PF_FONT () { &PARAM_END+3 };
sub PF_SPINNER () { &PARAM_END+4 };
sub PF_ADJUSTMENT(){ &PARAM_END+5 }; # compatibility fix for script-fu
sub PF_BRUSH () { &PARAM_END+6 };
sub PF_PATTERN () { &PARAM_END+7 };
sub PF_GRADIENT () { &PARAM_END+8 };
sub PF_TOGGLE () { PARAM_END+1 };
sub PF_SLIDER () { PARAM_END+2 };
sub PF_FONT () { PARAM_END+3 };
sub PF_SPINNER () { PARAM_END+4 };
sub PF_ADJUSTMENT(){ PARAM_END+5 }; # compatibility fix for script-fu _ONLY_
sub PF_BRUSH () { PARAM_END+6 };
sub PF_PATTERN () { PARAM_END+7 };
sub PF_GRADIENT () { PARAM_END+8 };
sub PF_BOOL () { PF_TOGGLE };
sub PF_INT () { PF_INT32 };
sub PF_VALUE () { PF_STRING };
sub Gimp::RUN_FULLINTERACTIVE { &Gimp::RUN_INTERACTIVE+100 }; # you don't want to know
sub Gimp::RUN_FULLINTERACTIVE (){ Gimp::RUN_INTERACTIVE+100 }; # you don't want to know
%pf_type2string = (
&PF_INT8 => 'small integer',
......@@ -115,7 +116,6 @@ sub Gimp::RUN_FULLINTERACTIVE { &Gimp::RUN_INTERACTIVE+100 }; # you don't want t
PF_SLIDER PF_INT PF_SPINNER PF_ADJUSTMENT
PF_BRUSH PF_PATTERN PF_GRADIENT);
@ISA = qw(Exporter);
@EXPORT = (qw(register main gimp_main xlfd_size),@_params);
@EXPORT_OK = qw(interact $run_mode save_image);
%EXPORT_TAGS = (params => [@_params]);
......
......@@ -3,17 +3,25 @@ package Gimp::Lib;
use strict;
use Carp;
use vars qw($VERSION @ISA);
use base qw(DynaLoader);
require DynaLoader;
@ISA = qw(DynaLoader);
$VERSION = $Gimp::VERSION;
use subs qw(
gimp_call_procedure gimp_main
_gimp_procedure_available set_trace
gimp_call_procedure gimp_main gimp_init
_gimp_procedure_available set_trace gimp_end
);
sub gimp_init {
die "gimp_init not implemented for the Lib interface";
}
sub gimp_end {
die "gimp_end not implemented for in the Lib interface";
}
sub import {}
bootstrap Gimp::Lib $VERSION;
......
......@@ -22,7 +22,11 @@
/* I actually do care a bit about older perls... */
#ifndef ERRSV
# define ERRSV GvSV(errgv)
# define ERRSV perl_get_sv("@",FALSE)
#endif
/* And also for newer perls... */
#ifndef na
# define na PL_na
#endif
/* FIXME */
......
......@@ -7,7 +7,7 @@ package Gimp::Net;
use strict;
use Carp;
use vars qw(
$VERSION @ISA
$VERSION
$default_tcp_port $default_unix_dir $default_unix_sock
$server_fh $trace_level $trace_res $auth $gimp_pid
);
......@@ -15,8 +15,6 @@ use subs qw(gimp_call_procedure);
use IO::Socket;
@ISA = ();
$default_tcp_port = 10009;
$default_unix_dir = "/tmp/gimp-perl-serv/";
$default_unix_sock = "gimp-perl-serv";
......@@ -171,7 +169,7 @@ sub try_connect {
undef $auth;
}
sub gimp_main {
sub gimp_init {
if (defined($Gimp::host)) {
$server_fh = try_connect ($Gimp::host);
} elsif (defined($ENV{GIMP_HOST})) {
......@@ -201,14 +199,23 @@ sub gimp_main {
print "authorization ok, but: $r[1]\n" if $Gimp::verbose and $r[1];
}
}
}
sub gimp_end {
kill 'KILL',$gimp_pid if $gimp_pid;
undef $gimp_pid;
}
sub gimp_main {
gimp_init;
no strict 'refs';
&{caller()."::net"};
gimp_end;
return 0;
}
END {
kill 'KILL',$gimp_pid if $gimp_pid;
gimp_end;
}
1;
......
......@@ -3,12 +3,12 @@ package Gimp::PDL;
use Carp;
use Gimp;
use PDL;
use base qw(Exporter);
require Exporter;
require DynaLoader;
require AutoLoader;
@ISA = qw(Exporter);
@EXPORT = ();
$old_w = $^W; $^W = 0;
......
......@@ -83,8 +83,8 @@ sub new($$$$) {
package Gimp::UI::PreviewSelect;
use Gtk;
use base 'Gtk::Button';
@ISA='Gtk::Button';
register_type Gimp::UI::PreviewSelect;
sub GTK_CLASS_INIT {
......@@ -176,8 +176,8 @@ sub GTK_OBJECT_INIT {
package Gimp::UI::PatternSelect;
use Gtk;
use base 'Gimp::UI::PreviewSelect';
@ISA = 'Gimp::UI::PreviewSelect';
register_type Gimp::UI::PatternSelect;
sub get_title { "Pattern Selection Dialog" }
......@@ -225,8 +225,8 @@ sub new {
package Gimp::UI::BrushSelect;
use Gtk;
use base 'Gimp::UI::PreviewSelect';
@ISA='Gimp::UI::PreviewSelect';
register_type Gimp::UI::BrushSelect;
sub get_title { "Brush Selection Dialog" }
......@@ -268,8 +268,8 @@ sub new {
package Gimp::UI::GradientSelect;
use Gtk;
use base 'Gimp::UI::PreviewSelect';
@ISA='Gimp::UI::PreviewSelect';
register_type Gimp::UI::GradientSelect;
sub get_title { "Gradient Selection Dialog" }
......
require 5.004_04;
use ExtUtils::MakeMaker;
use Config;
......
......@@ -9,9 +9,7 @@ bugs
* perl_fu_webify in homepage-logo.pl
* save_image should be called for non-null return values
[DONE] * attempt to free unreferenced
* drawable is compatible to layer AND VICE VERSA (convert_sv2gimp)
[DONE] * return values do not at all work
* enable t/run.t again (but how? different solutions
for gimp-1.0 and gimp-1.1???)
* wait for working gimp_file_load (or do it myself?)
......@@ -21,16 +19,15 @@ bugs
important issues
* substr 4th argument form for Net:: -> require 5.005!!!! DO IT!
* use Gimp qw(GIMP_HOST=jfjf)???
* brushes look inverted
* zero-copy PDL support
* gimp_init, gimp_deinit
[DONE] * gimp_init, gimp_deinit
* duplicate HAVE_VPRINTF in gimp
* get rid of superfluous image arguments
[DONE] * put it into the cvs tree
* weighted movement in drawing tools
* -DMIN_PERL_DEFINE
[DONE] * PF_PALETTE (maybe not) <-- NOT
[DONE] * kill RUN_INTERACTIVE/run_mode-shit
* --function localfunc to select one of the registered scripts
* brush etc. buttons (maybe use gimp's interface, but
only when local(?))
......
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