aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormertz2003-09-15 16:17:06 +0000
committermertz2003-09-15 16:17:06 +0000
commit8b34baa437e87479674b6ae723ea33b7423bb374 (patch)
tree49354bcfe24daf3ceef869ea65adc29795e49128
parent82bbdccfb51dbabc48ffde029058bd9aa68c24c8 (diff)
downloadtkzinc-8b34baa437e87479674b6ae723ea33b7423bb374.zip
tkzinc-8b34baa437e87479674b6ae723ea33b7423bb374.tar.gz
tkzinc-8b34baa437e87479674b6ae723ea33b7423bb374.tar.bz2
tkzinc-8b34baa437e87479674b6ae723ea33b7423bb374.tar.xz
perl modules ZincTrace ZincTraceErrors and ZincDebug have been renamed
Tk::Zinc::Trace Tk::Zinc::TraceErrors and Tk::Zinc::debug and moved accordingly
-rw-r--r--Makefile.in1
-rw-r--r--Perl/Zinc/Debug.pm51
-rw-r--r--Perl/Zinc/Trace.pm12
-rw-r--r--Perl/Zinc/TraceErrors.pm12
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/tiger.pl8
-rw-r--r--doc/refman.tex26
6 files changed, 58 insertions, 52 deletions
diff --git a/Makefile.in b/Makefile.in
index 9ce8b89..7ce6433 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -538,7 +538,6 @@ perl: binaries
@if test "x$(PERL_TK_LIB)" != "x"; then \
cd Perl; perl Makefile.PL; make; \
cd demos; perl Makefile.PL; make; \
- cd ../debug; perl Makefile.PL; make; \
fi
testperl: binaries
diff --git a/Perl/Zinc/Debug.pm b/Perl/Zinc/Debug.pm
index b12333c..207f5b6 100644
--- a/Perl/Zinc/Debug.pm
+++ b/Perl/Zinc/Debug.pm
@@ -1,13 +1,12 @@
-# ZincDebug Perl Module :
+# Tk::Zinc::Debug Perl Module :
#
-# For debugging/analysing a Zinc application. Only one instance
-# of zinc can be managed.
+# For debugging/analysing a Zinc application.
#
# Author : Daniel Etienne <etienne@cena.fr>
#
# $Id$
#---------------------------------------------------------------------------
-package ZincDebug;
+package Tk::Zinc::Debug;
use vars qw( $VERSION );
($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
@@ -56,10 +55,10 @@ my %cmdoptions;
my $initobjectfunction;
BEGIN {
- # test if ZincDebug is loaded using the -M perl option
+ # test if Tk::Zinc::Debug is loaded using the -M perl option
$preload = 1 if (caller(2))[2] == 0;
return unless $preload;
- # parse ZincDebug options
+ # parse Tk::Zinc::Debug options
require Getopt::Long;
Getopt::Long::Configure('pass_through');
Getopt::Long::GetOptions(\%cmdoptions,
@@ -76,10 +75,10 @@ BEGIN {
}
-# Hack to capture the instance of zinc. ZincDebug functions are invoked here.
+# Hack to capture the instance of zinc. Tk::Zinc::Debug functions are invoked here.
# Note that created bindings might be overloaded by the application.
sub Tk::Zinc::InitObject {
- print "ZincDebug is ON\n";
+ print "Tk::Zinc::Debug is ON\n";
# invoke function possibly overloaded in other modules
&$initobjectfunction(@_) if $initobjectfunction;
return unless $preload;
@@ -118,7 +117,7 @@ sub tree {
my $zinc = shift;
unless ($zinc) {
- carp "In ZincDebug module, tree() function, widget must be specified\n";
+ carp "In Tk::Zinc::Debug module, tree() function, widget must be specified\n";
return;
}
&newinstance($zinc);
@@ -133,7 +132,7 @@ sub tree {
# options
my %options = @_;
for my $opt (keys(%options)) {
- carp "in ZincDebug module, tree() function, unknown option $opt\n"
+ carp "in Tk::Zinc::Debug module, tree() function, unknown option $opt\n"
unless ($opt eq '-itemModBtn' or $opt eq '-key' or $opt eq '-tkey' or
$opt eq '-optionsToDisplay' or $opt eq '-optionsFormat');
}
@@ -161,7 +160,7 @@ sub tree {
['Control', 2];
$options{-optionsFormat} = 'column' unless $options{-optionsFormat};
if ($options{-optionsFormat} ne 'row' and $options{-optionsFormat} ne 'column') {
- carp "in ZincDebug module, tree() function, expected values for ".
+ carp "in Tk::Zinc::Debug module, tree() function, expected values for ".
"-optionsFormat are 'row' or 'column'. Option is set to 'column'\n";
$options{-optionsFormat} = 'column';
}
@@ -192,14 +191,14 @@ sub finditems {
my $zinc = shift;
unless ($zinc) {
- carp "In ZincDebug module, finditems() function, widget must be specified\n";
+ carp "In Tk::Zinc::Debug module, finditems() function, widget must be specified\n";
return;
}
&newinstance($zinc);
# options
my %options = @_;
for my $opt (keys(%options)) {
- carp "in ZincDebug module, finditems() function, unknown option $opt\n"
+ carp "in Tk::Zinc::Debug module, finditems() function, unknown option $opt\n"
unless ($opt eq '-color' or $opt eq '-enclosedModBtn' or
$opt eq '-overlapModBtn' or $opt eq '-searchKey');
}
@@ -286,14 +285,14 @@ sub snapshot {
my $zinc = shift;
unless ($zinc) {
- carp "In ZincDebug module, snapshot() function, widget must be specified\n";
+ carp "In Tk::Zinc::Debug module, snapshot() function, widget must be specified\n";
return;
}
&newinstance($zinc);
# options
my %options = @_;
for my $opt (keys(%options)) {
- carp "in ZincDebug module, snapshot() function, unknown option $opt\n"
+ carp "in Tk::Zinc::Debug module, snapshot() function, unknown option $opt\n"
unless ($opt eq '-key' or $opt eq '-skey' or
$opt eq '-verbosity' or $opt eq '-basename');
}
@@ -1803,7 +1802,7 @@ sub printWindow {
}
else {
my $dir = `pwd`; chomp ($dir);
- print "ZincDebug: Zinc window snapshot saved in $dir". "/$filename\n"
+ print "Tk::Zinc::Debug: Zinc window snapshot saved in $dir". "/$filename\n"
if $verbosity;
}
@@ -1837,11 +1836,11 @@ sub showErrorWhilePrinting {
# display complete help screen
sub showgeneralhelp {
if (@instances == 1) {
- &showinstancehelp($instances[0], "ZincDebug help", 1);
+ &showinstancehelp($instances[0], "Tk::Zinc::Debug help", 1);
} elsif (@instances > 1) {
$help_tl{gene}->destroy if $help_tl{gene} and Tk::Exists($help_tl{gene});
$help_tl{gene} = $instances[0]->Toplevel;
- $help_tl{gene}->title("ZincDebug general help");
+ $help_tl{gene}->title("Tk::Zinc::Debug general help");
my $text = $help_tl{gene}->Scrolled('Text', -font =>
scalar $instances[0]->cget(-font),
@@ -1874,7 +1873,7 @@ sub showgeneralhelp {
$fm->Button(-text => 'Help',
-cursor => 'top_left_arrow',
-command => [\&showinstancehelp, $instances[$i],
- 'ZincDebug help about instance #'.$j],
+ 'Tk::Zinc::Debug help about instance #'.$j],
)->grid(-row => $j, -column => 4);
#&showinstancehelp($_);
}
@@ -2227,16 +2226,16 @@ __END__
=head1 NAME
-ZincDebug - a perl module for analysing a Zinc application.
+Tk::Zinc::Debug - a perl module for analysing a Zinc application.
=head1 SYNOPSIS
- perl -MZincDebug zincscript [zincscript-opts] [zincdebug-opts]
+ perl -MTk::Zinc::Debug zincscript [zincscript-opts] [zincdebug-opts]
or
- use ZincDebug;
+ use Tk::Zinc::Debug;
my $zinc = MainWindow->new()->Zinc()->pack;
finditems($zinc, [options]);
tree($zinc, [options]);
@@ -2245,7 +2244,7 @@ ZincDebug - a perl module for analysing a Zinc application.
=head1 DESCRIPTION
-ZincDebug provides an interface to help developers to debug or analyse Zinc applications.
+Tk::Zinc::Debug provides an interface to help developers to debug or analyse Zinc applications.
With B<finditems()> function, you are able to scan all items which are enclosed in a rectangular area you have first drawn by drag & drop, or all items which overlap it. Result is a Tk table which presents details (options, coordinates, ...) about found items; you can also highlight a particular item, even if it's not visible, by clicking on its corresponding button in the table. You can also display particular item's features by entering this id in dedicated entry field
@@ -2255,8 +2254,8 @@ With B<snapshot()> function, you are able to snapshot the application window, in
Press B<Escape> key in the toplevel of the application to have some help about available input sequences.
-B<If you load ZincDebug using the -M perl option, nothing needs to be added to your code>. By default, all the previous specific functions are invoked with their default attributes for each instance of Zinc widget. You can overload these by passing the same options to the command. Note that perl arrays must be transformed to comma separated string. For example:
- perl -M ZincDebug zincscript -optionsToDisplay '-tags'
+B<If you load Tk::Zinc::Debug using the -M perl option, nothing needs to be added to your code>. By default, all the previous specific functions are invoked with their default attributes for each instance of Zinc widget. You can overload these by passing the same options to the command. Note that perl arrays must be transformed to comma separated string. For example:
+ perl -M Tk::Zinc::Debug zincscript -optionsToDisplay '-tags'
-optionsFormat row -itemModBtn Control,1
@@ -2346,6 +2345,8 @@ Daniel Etienne <etienne@cena.fr>
=head1 HISTORY
+Sep 15 2003 : due to CPAN-isation, the ZincDebug module has been renamed Tk::Zinc::Debug
+
May 20 2003 : perl code can be generated from the items tree, with some limitations concerning transformations and images.
Mar 11 2003 : ZincDebug can manage several instances of Zinc widget. Options of ZincDebug functions can be set on the command line.
diff --git a/Perl/Zinc/Trace.pm b/Perl/Zinc/Trace.pm
index ec284d8..fcd595f 100644
--- a/Perl/Zinc/Trace.pm
+++ b/Perl/Zinc/Trace.pm
@@ -17,12 +17,14 @@
# This may be very usefull when your application segfaults and
# when you have no idea where this happens in your code.
#
-# To trap Tk::Zinc errors, use rather the ZincTraceErrors package.
+# $Id$
+#
+# To trap Tk::Zinc errors, use rather the Tk::Zinc::TraceErrors package.
#
# for using this file do some thing like :
-# perl -MZincTrace myappli.pl
+# perl -MTk::Zinc::Trace myappli.pl
-package ZincTrace;
+package Tk::Zinc::Trace;
use vars qw( $VERSION );
($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
@@ -34,11 +36,11 @@ use Tk::Zinc::TraceUtils;
my $WidgetMethodfunction;
BEGIN {
if ($ZincTraceErrors::on == 1) {
- print STDERR "ZincTrace: incompatible package ZincTraceErrors is already ".
+ print STDERR "Tk::Zinc::Trace: incompatible package Tk::Zinc::TraceErrors is already ".
"loaded (exit 1)\n";
exit 1;
}
- print "ZincTrace is ON\n";
+ print "Tk::Zinc::Trace is ON\n";
$ZincTrace::on = 1;
select STDOUT; $|=1; ## for flushing the trace output
# save current Tk::Zinc::InitObject function; it will be invoked in
diff --git a/Perl/Zinc/TraceErrors.pm b/Perl/Zinc/TraceErrors.pm
index 95d9e08..a56586c 100644
--- a/Perl/Zinc/TraceErrors.pm
+++ b/Perl/Zinc/TraceErrors.pm
@@ -18,14 +18,16 @@
# module name, the line number and the complete error messages are reported
# for each error.
#
+# $Id$
+#
# When you have no idea where this happens in your code or when your
-# application segfaults, use the ZincTrace package which traces every
+# application segfaults, use the Tk::Zinc::Trace package which traces every
# Tk::Zinc method call.
#
# for using this file do some thing like :
-# perl -MZincTraceErrors myappli.pl
+# perl -MTk::Zinc::TraceErrors myappli.pl
-package ZincTraceErrors;
+package Tk::Zinc::TraceErrors;
use vars qw( $VERSION );
($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
@@ -43,11 +45,11 @@ BEGIN {
my $_bold = "";
if ($ZincTrace::on == 1) {
- print STDERR $bold."ZincTraceErrors: incompatible package ZincTrace is already ".
+ print STDERR $bold."Tk::Zinc::TraceErrors: incompatible package Tk::Zinc::Trace is already ".
"loaded".$_bold." (exit 1)\n";
exit 1;
}
- print $bold."ZincTraceErrors is ON".$_bold."\n";
+ print $bold."Tk::Zinc::TraceErrors is ON".$_bold."\n";
$ZincTraceErrors::on = 1;
select STDOUT; $|=1; ## for flushing the trace output
# save current Tk::Zinc::InitObject function; it will be invoked in
diff --git a/Perl/demos/Tk/demos/zinc_lib/tiger.pl b/Perl/demos/Tk/demos/zinc_lib/tiger.pl
index 5e0ef15..6a54a23 100644
--- a/Perl/demos/Tk/demos/zinc_lib/tiger.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/tiger.pl
@@ -8,7 +8,7 @@ use vars qw( $VERSION );
($VERSION) = sprintf("%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/);
use Tk::Zinc;
-use ZincDebug;
+use Tk::Zinc::Debug;
my $mw = MainWindow->new();
$mw->title('tiger generated form svg');
@@ -22,14 +22,14 @@ my $zinc = $mw->Zinc(-width => $WIDTH, -height => $HEIGHT,
-reshape => 1,
-fullreshape => 1,
)->pack;
-&ZincDebug::finditems($zinc);
-&ZincDebug::tree($zinc, -optionsToDisplay => '-tags', -optionsFormat => 'row');
+&Tk::Zinc::Debug::finditems($zinc);
+&Tk::Zinc::Debug::tree($zinc, -optionsToDisplay => '-tags', -optionsFormat => 'row');
my $top_group = $zinc->add('group', 1);
$text = "
Drag-Button 1 for moving the tiger,
Drag-Button 2 for zooming the tiger,
-esc for getting help on ZincDebug functions.
+esc for getting help on Tk::Zinc::Debug functions.
";
my $clip= $zinc->add('curve',1,
diff --git a/doc/refman.tex b/doc/refman.tex
index 701fe16..4d6a02c 100644
--- a/doc/refman.tex
+++ b/doc/refman.tex
@@ -313,6 +313,8 @@ It has been replaced by the GLU library. So TkZinc is again fully free software.
\item the syntax of gradient has been changed, mainly to accomodate with any color specification
defined for X. {\bf Beware that old gradient are no more compatible}
\item conical gradient type has been added; gradient paramaters has been extended.
+\item Perl modules ZincDebug, ZincTrace and ZincTraceErrors have been renamed Tk::Zinc::Debug
+Tk::Zinc::Trace and Tk::Zinc::Trace.
\item TkZinc comes now with a ZincTrace.pm module to trace every TkZinc method call
\item the hierarchical view in ZincDebug.pm can now display some choosen attributes
in a choosen format.
@@ -4573,26 +4575,26 @@ named AlphaStipple0 to AlphaStipple15, AlphaStipple0 being the most transparent.
-\section{ZincDebug.pm}
+\section{Tk::Zinc::Debug.pm}
-\ident{ZincDebug.pm} is a Perl module useful for debugging purpose. It can be used in a
+\ident{Tk::Zinc::Debug.pm} is a Perl module useful for debugging purpose. It can be used in a
Perl application using TkZinc to display the hierarchical tree of items, to display
items selected by their id or tags, to grab items with the mouse and to get the list of
items enclosed or overlapped by a rectangle designated by the mouse. You will be
presented a list of items, with many interesting attributes such as position, priority,
visibility, group...\ and even more information on request. Much of the selected items
attributes can be interactively modified. When an application uses
-\ident{ZincDebug.pm}, you can get a short reminder by depressing the {\tt Esc} key in
+\ident{Tk::Zinc::Debug.pm}, you can get a short reminder by depressing the {\tt Esc} key in
the main window of this application. For more information, please refer to the
-\ident{ZincDebug.pm} man pages with the classical command {\tt man ZincDebug}
+\ident{Tk::Zinc::Debug.pm} man pages with the classical command {\tt man Tk::Zinc::Debug}
To use this module, you can import it either by adding, for example, the following
statements in your source code:
-\code{\\use ZincDebug;\\
+\code{\\use Tk::Zinc::Debug;\\
finditems(\$zinc);\\
tree(\$zinc, -optionsToDisplay => '-tags', -optionsFormat => 'row');\\}
or simply by using the -M option of Perl:
-\code{\\perl -MZincDebug yourscript.pl\\}
+\code{\\perl -MTk::Zinc::Debug yourscript.pl\\}
\section{Tracing TkZinc methods call in Perl/Tk}
@@ -4605,7 +4607,7 @@ or tracking some nasty segfault which should never occure since TkZinc is
Because you sometime get some errors inside \ident{TkZinc} with a cryptic message
like {\tt ".... errors in Tk.pm line 228"}, it may be usefull to know where exactly
in your code is the error. There is a simple and convenient mean to do this, just
-by using a small module called \ident{ZincTraceErrors.pm}, released with \ident{TkZinc}.
+by using a small module called \ident{Tk::Zinc::TraceErrors}, released with \ident{TkZinc}.
It traces every call of a TkZinc method inducing a Tk error. It prints on
the standard output the following informations:
\begin{itemize}
@@ -4618,14 +4620,14 @@ the standard output the following informations:
To use this module you can import it either by adding the following
statement in your source code:
-\code{\\use ZincTraceErrors;\\} or better, by using the -M option of Perl:
-\code{\\perl -MZincTraceErrors yourscript.pl\\}
+\code{\\use Tk::Zinc::TraceErrors;\\} or better, by using the -M option of Perl:
+\code{\\perl -MTk::Zinc::TraceErrors yourscript.pl\\}
\subsection{Tracking TkZinc segfaults in Perl/Tk}
If you encounters a segfault in one Perl/Tk script and you suspects
that TkZinc might be responsible, you should use a small module called
-\ident{ZincTraceErrors.pm}, released with \ident{TkZinc}.
+\ident{Tk::Zinc::Trace}, released with \ident{TkZinc}.
It traces every call of a TkZinc method. The method call is printed
on the standard output before the effective call, and the
result of the invokation is printed after the call. To be sure
@@ -4643,8 +4645,8 @@ It prints on the standard output the following informations:
To use this module you can import it either by adding the following
statement in your source code:
-\code{\\use ZincTrace;\\} or better, by using the -M option of Perl:
-\code{\\perl -MZincTrace yourscript.pl\\}
+\code{\\use Tk::Zinc::Trace;\\} or better, by using the -M option of Perl:
+\code{\\perl -MTk::Zinc::Trace yourscript.pl\\}
\section{zinc-demos}