line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#!perl -w |
2
|
|
|
|
|
|
|
package Mac::Apps::PBar; |
3
|
|
|
|
|
|
|
require 5.00201; |
4
|
1
|
|
|
1
|
|
735
|
use vars qw($VERSION @ISA @EXPORT $be $evt); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
85
|
|
5
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
6
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
28
|
|
7
|
1
|
|
|
1
|
|
4
|
use Exporter; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
8
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
86
|
|
9
|
1
|
|
|
1
|
|
1566
|
use Mac::AppleEvents; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
use Mac::Apps::Launch; |
11
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
@EXPORT = (); |
13
|
|
|
|
|
|
|
$VERSION = sprintf("%d.%02d", q$Revision: 1.30 $ =~ /(\d+)\.(\d+)/); |
14
|
|
|
|
|
|
|
$be = ''; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new { |
18
|
|
|
|
|
|
|
my $pkg = shift; |
19
|
|
|
|
|
|
|
my $title = shift; |
20
|
|
|
|
|
|
|
my $ppos = shift; |
21
|
|
|
|
|
|
|
$pkg = \*$pkg; |
22
|
|
|
|
|
|
|
bless $pkg; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
${*$pkg}{'windobj'} = "obj{want:type(cwin), |
25
|
|
|
|
|
|
|
from:null(), form:indx, seld:long(1)}"; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
${*$pkg}{'progobj'} = "obj{want:type(PBar), |
28
|
|
|
|
|
|
|
from:${*$pkg}{'windobj'}, form:indx, seld:long(1)}"; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
$pkg->launch_pbar; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$evt = AEBuildAppleEvent('core', 'crel', typeApplSignature, 'PBar', 0, 0, |
33
|
|
|
|
|
|
|
"kocl: type(cwin), prdt:{ pnam: Ò$titleÓ , ppos:[$ppos] }") or die $^E; |
34
|
|
|
|
|
|
|
$pkg->runEvent($evt); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
$pkg; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub launch_pbar { |
40
|
|
|
|
|
|
|
LaunchApps(['PBar'],1); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub data { |
44
|
|
|
|
|
|
|
my $pkg = shift; |
45
|
|
|
|
|
|
|
my $str = shift; |
46
|
|
|
|
|
|
|
my $dat = shift; |
47
|
|
|
|
|
|
|
if (!$dat && keys %$str) { |
48
|
|
|
|
|
|
|
my $s; |
49
|
|
|
|
|
|
|
foreach $s (keys %$str) { |
50
|
|
|
|
|
|
|
$pkg->_procData($s,$$str{$s}); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} elsif ($str && $dat) { |
53
|
|
|
|
|
|
|
$pkg->_procData($str,$dat); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub _procData { |
58
|
|
|
|
|
|
|
my $pkg = shift; |
59
|
|
|
|
|
|
|
my $str = shift; |
60
|
|
|
|
|
|
|
my $dat = shift; |
61
|
|
|
|
|
|
|
my $obj = "obj{want:type(prop), from:${*$pkg}{'progobj'}, |
62
|
|
|
|
|
|
|
form:prop, seld:type($str)}"; |
63
|
|
|
|
|
|
|
my $evt = AEBuildAppleEvent('core', 'setd', typeApplSignature, |
64
|
|
|
|
|
|
|
'PBar', 0, 0, "'----':$obj, data:Ò$datÓ ") or die $^E; |
65
|
|
|
|
|
|
|
$pkg->runEvent($evt) |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub close_window { |
69
|
|
|
|
|
|
|
my $pkg = shift; |
70
|
|
|
|
|
|
|
my $evt = AEBuildAppleEvent('aevt', 'quit', typeApplSignature, |
71
|
|
|
|
|
|
|
'PBar', 0, 0, "'----':''") or die $^E; |
72
|
|
|
|
|
|
|
$pkg->runEvent($evt) |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub runEvent { |
76
|
|
|
|
|
|
|
my $pkg = shift; |
77
|
|
|
|
|
|
|
my $evt = shift; |
78
|
|
|
|
|
|
|
#print AEPrint($evt), "\n"; |
79
|
|
|
|
|
|
|
my $rep = AESend($evt, kAEWaitReply) or die $^E; |
80
|
|
|
|
|
|
|
#print AEPrint($rep), "\n\n"; |
81
|
|
|
|
|
|
|
AEDisposeDesc $evt; |
82
|
|
|
|
|
|
|
AEDisposeDesc $rep; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
__END__ |