aboutsummaryrefslogtreecommitdiff
path: root/Perl/Zinc
diff options
context:
space:
mode:
authormertz2003-09-15 16:17:06 +0000
committermertz2003-09-15 16:17:06 +0000
commit8b34baa437e87479674b6ae723ea33b7423bb374 (patch)
tree49354bcfe24daf3ceef869ea65adc29795e49128 /Perl/Zinc
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
Diffstat (limited to 'Perl/Zinc')
-rw-r--r--Perl/Zinc/Debug.pm51
-rw-r--r--Perl/Zinc/Trace.pm12
-rw-r--r--Perl/Zinc/TraceErrors.pm12
3 files changed, 40 insertions, 35 deletions
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