diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-01 18:24:37 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-01 18:24:37 -0600 |
commit | 4e997a9c6e25689dca65a2ec573a599699ef8170 (patch) | |
tree | fdb5ecac42fb8204df9fc8c9abe1c784d4719e0e /PerlQt/lib | |
parent | bfa107694b2507a7116f8856cafe4ab1375da8a9 (diff) | |
download | libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.tar.gz libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.zip |
Initial TQt conversion
Diffstat (limited to 'PerlQt/lib')
-rw-r--r-- | PerlQt/lib/Qt/GlobalSpace.pm | 10 | ||||
-rw-r--r-- | PerlQt/lib/Qt/attributes.pm | 8 | ||||
-rw-r--r-- | PerlQt/lib/Qt/constants.pm | 2 | ||||
-rw-r--r-- | PerlQt/lib/Qt/debug.pm | 8 | ||||
-rw-r--r-- | PerlQt/lib/Qt/enumerations.pm | 6 | ||||
-rw-r--r-- | PerlQt/lib/Qt/isa.pm | 24 | ||||
-rw-r--r-- | PerlQt/lib/Qt/properties.pm | 4 | ||||
-rw-r--r-- | PerlQt/lib/Qt/signals.pm | 22 | ||||
-rw-r--r-- | PerlQt/lib/Qt/slots.pm | 20 |
9 files changed, 52 insertions, 52 deletions
diff --git a/PerlQt/lib/Qt/GlobalSpace.pm b/PerlQt/lib/Qt/GlobalSpace.pm index 65e481a..75f30a2 100644 --- a/PerlQt/lib/Qt/GlobalSpace.pm +++ b/PerlQt/lib/Qt/GlobalSpace.pm @@ -1,11 +1,11 @@ -package Qt::GlobalSpace; +package TQt::GlobalSpace; use strict; -require Qt; +require TQt; require Exporter; our @ISA = qw(Exporter); our @EXPORT; -our $allMeth = Qt::_internal::findAllMethods( Qt::_internal::idClass("QGlobalSpace") ); +our $allMeth = TQt::_internal::findAllMethods( TQt::_internal::idClass("TQGlobalSpace") ); no strict 'refs'; for my $proto( keys %$allMeth ) @@ -14,8 +14,8 @@ for my $proto( keys %$allMeth ) $proto =~ s/[\#\$\?]+$//; *{ $proto } = sub { - $Qt::_internal::autoload::AUTOLOAD = "Qt::GlobalSpace\::$proto"; - goto &Qt::GlobalSpace::AUTOLOAD + $TQt::_internal::autoload::AUTOLOAD = "TQt::GlobalSpace\::$proto"; + goto &TQt::GlobalSpace::AUTOLOAD } unless defined &$proto; push @EXPORT, $proto; } diff --git a/PerlQt/lib/Qt/attributes.pm b/PerlQt/lib/Qt/attributes.pm index 3a25487..4398fa5 100644 --- a/PerlQt/lib/Qt/attributes.pm +++ b/PerlQt/lib/Qt/attributes.pm @@ -1,10 +1,10 @@ -package Qt::attributes; +package TQt::attributes; # # I plan to support public/protected/private attributes. here goes. # Attributes default to protected. # # package MyBase; -# use Qt::attributes qw( +# use TQt::attributes qw( # private: # foo # protected: @@ -14,7 +14,7 @@ package Qt::attributes; # ); # # package MyDerived; -# use Qt::isa qw(MyBase); +# use TQt::isa qw(MyBase); # # sub foo { # # 1 way to access private attributes from derived class @@ -43,7 +43,7 @@ sub import { for my $attribute (@_) { exists ${ ${$caller . '::META'}{'attributes'} }{$attribute} and next; - Qt::_internal::installattribute($caller, $attribute); + TQt::_internal::installattribute($caller, $attribute); ${ ${$caller . '::META'}{'attributes'} }{$attribute} = 1; } } diff --git a/PerlQt/lib/Qt/constants.pm b/PerlQt/lib/Qt/constants.pm index 9c7081c..5bdeed0 100644 --- a/PerlQt/lib/Qt/constants.pm +++ b/PerlQt/lib/Qt/constants.pm @@ -1,4 +1,4 @@ -package Qt::constants; +package TQt::constants; require Exporter; diff --git a/PerlQt/lib/Qt/debug.pm b/PerlQt/lib/Qt/debug.pm index 28c0a43..a0f4e19 100644 --- a/PerlQt/lib/Qt/debug.pm +++ b/PerlQt/lib/Qt/debug.pm @@ -1,5 +1,5 @@ -package Qt::debug; -use Qt; +package TQt::debug; +use TQt; our %channel = ( 'ambiguous' => 0x01, @@ -23,14 +23,14 @@ sub import { $usage++; } } - Qt::_internal::setDebug($db); + TQt::_internal::setDebug($db); print "Available channels: \n\t". join("\n\t", sort keys %channel). "\n" if $usage; } sub unimport { - Qt::_internal::setDebug(0); + TQt::_internal::setDebug(0); } 1;
\ No newline at end of file diff --git a/PerlQt/lib/Qt/enumerations.pm b/PerlQt/lib/Qt/enumerations.pm index 003b65b..9fea98f 100644 --- a/PerlQt/lib/Qt/enumerations.pm +++ b/PerlQt/lib/Qt/enumerations.pm @@ -1,15 +1,15 @@ -package Qt::enumerations; +package TQt::enumerations; # # Proposed usage: # # package MyWidget; # -# use Qt::enumerations MyInfo => { +# use TQt::enumerations MyInfo => { # Foo => 1, # Bar => 10, # Baz => 64 # }; # -# use Qt::enumerations MyInfo => [qw(Foo Bar Baz)]; +# use TQt::enumerations MyInfo => [qw(Foo Bar Baz)]; # 1; diff --git a/PerlQt/lib/Qt/isa.pm b/PerlQt/lib/Qt/isa.pm index fb4b646..71e9391 100644 --- a/PerlQt/lib/Qt/isa.pm +++ b/PerlQt/lib/Qt/isa.pm @@ -1,4 +1,4 @@ -package Qt::isa; +package TQt::isa; use strict; sub import { @@ -10,12 +10,12 @@ sub import { my $pm = $caller . ".pm"; $pm =~ s!::!/!g; unless(exists $::INC{$pm}) { - $::INC{$pm} = $::INC{"Qt/isa.pm"}; + $::INC{$pm} = $::INC{"TQt/isa.pm"}; } for my $super (@_) { push @{ $caller . '::ISA' }, $super; - push @{ ${$caller . '::META'}{'superClass'} }, $super; # if isa(QObject)? + push @{ ${$caller . '::META'}{'superClass'} }, $super; # if isa(TQObject)? } *{ $caller . '::className' } = sub { # closure on $caller @@ -23,10 +23,10 @@ sub import { }; ${ $caller. '::_INTERNAL_STATIC_'}{'SUPER'} = bless {}, " $caller"; - Qt::_internal::installsuper($caller) unless defined &{ $caller.'::SUPER' }; + TQt::_internal::installsuper($caller) unless defined &{ $caller.'::SUPER' }; *{ $caller . '::metaObject' } = sub { - Qt::_internal::getMetaObject($caller); + TQt::_internal::getMetaObject($caller); }; *{ $caller . '::import' } = sub { @@ -53,18 +53,18 @@ sub import { { if(! defined &{$incaller.'::'.$attribute }) { - Qt::_internal::installattribute($incaller, $attribute); + TQt::_internal::installattribute($incaller, $attribute); ${ ${$incaller .'::META'}{'attributes'} }{$attribute} = 1; } } } }; - Qt::_internal::installautoload(" $caller"); - Qt::_internal::installautoload(" $caller"); - Qt::_internal::installautoload($caller); + TQt::_internal::installautoload(" $caller"); + TQt::_internal::installautoload(" $caller"); + TQt::_internal::installautoload($caller); { - package Qt::AutoLoad; + package TQt::AutoLoad; my $autosub = \&{ " $caller\::_UTOLOAD" }; *{ " $caller\::AUTOLOAD" } = sub { &$autosub }; $autosub = \&{ " $caller\::_UTOLOAD" }; @@ -72,10 +72,10 @@ sub import { $autosub = \&{ "$caller\::_UTOLOAD" }; *{ "$caller\::AUTOLOAD" } = sub { &$autosub }; } - Qt::_internal::installthis($caller); + TQt::_internal::installthis($caller); # operator overloading - *{ " $caller\::ISA" } = ["Qt::base::_overload"]; + *{ " $caller\::ISA" } = ["TQt::base::_overload"]; } 1; diff --git a/PerlQt/lib/Qt/properties.pm b/PerlQt/lib/Qt/properties.pm index 5dfcdb7..951cdb6 100644 --- a/PerlQt/lib/Qt/properties.pm +++ b/PerlQt/lib/Qt/properties.pm @@ -1,8 +1,8 @@ -package Qt::properties; +package TQt::properties; # # Proposed usage: # -# use Qt::properties foo => { +# use TQt::properties foo => { # TYPE => 'bool', # READ => 'getFoo', # WRITE => 'setFoo', diff --git a/PerlQt/lib/Qt/signals.pm b/PerlQt/lib/Qt/signals.pm index 00aa061..1f454c1 100644 --- a/PerlQt/lib/Qt/signals.pm +++ b/PerlQt/lib/Qt/signals.pm @@ -1,11 +1,11 @@ -package Qt::signals; +package TQt::signals; use Carp; # # Proposed usage: # -# use Qt::signals fooActivated => ['int']; +# use TQt::signals fooActivated => ['int']; # -# use Qt::signals fooActivated => { +# use TQt::signals fooActivated => { # name => 'fooActivated(int)', # args => ['int'] # }; @@ -16,21 +16,21 @@ use Carp; sub import { no strict 'refs'; my $self = shift; - my $caller = $self eq "Qt::signals" ? (caller)[0] : $self; + my $caller = $self eq "TQt::signals" ? (caller)[0] : $self; my $parent = ${ $caller . '::ISA' }[0]; my $parent_qt_emit = $parent . '::qt_emit'; - Qt::_internal::installqt_invoke($caller . '::qt_emit') unless defined &{ $caller. '::qt_emit' }; + TQt::_internal::installqt_invoke($caller . '::qt_emit') unless defined &{ $caller. '::qt_emit' }; # *{ $caller . '::qt_emit' } = sub { # my $meta = \%{ $caller . '::META' }; # die unless $meta->{object}; # my $offset = $_[0] - $meta->{object}->signalOffset; # if($offset >= 0) { -# Qt::_internal::invoke(Qt::this(), $meta->{signals}[$offset], $_[1]); +# TQt::_internal::invoke(TQt::this(), $meta->{signals}[$offset], $_[1]); # return 1; # } else { -# Qt::this()->$parent_qt_emit(@_); +# TQt::this()->$parent_qt_emit(@_); # } # } unless defined &{ $caller . '::qt_emit' }; @@ -49,17 +49,17 @@ sub import { my $signal_index = $#{ $meta->{signals} }; my $argcnt = scalar @$args; - my $mocargs = Qt::_internal::allocateMocArguments($argcnt); + my $mocargs = TQt::_internal::allocateMocArguments($argcnt); my $i = 0; for my $arg (@$args) { my $a = $arg; $a =~ s/^const\s+//; - if($a =~ /^(bool|int|double|char\*|QString)&?$/) { + if($a =~ /^(bool|int|double|char\*|TQString)&?$/) { $a = $1; } else { $a = 'ptr'; } - my $valid = Qt::_internal::setMocType($mocargs, $i, $arg, $a); + my $valid = TQt::_internal::setMocType($mocargs, $i, $arg, $a); die "Invalid type for signal argument ($arg)\n" unless $valid; $i++; } @@ -69,7 +69,7 @@ sub import { $signal->{mocargs} = $mocargs; $signal->{argcnt} = $argcnt; - Qt::_internal::installsignal("$caller\::$signalname"); + TQt::_internal::installsignal("$caller\::$signalname"); } @_ and $meta->{changed} = 1; } diff --git a/PerlQt/lib/Qt/slots.pm b/PerlQt/lib/Qt/slots.pm index 5d1daf6..c12990e 100644 --- a/PerlQt/lib/Qt/slots.pm +++ b/PerlQt/lib/Qt/slots.pm @@ -1,11 +1,11 @@ -package Qt::slots; +package TQt::slots; use Carp; # # Proposed usage: # -# use Qt::slots changeSomething => ['int']; +# use TQt::slots changeSomething => ['int']; # -# use Qt::slots 'changeSomething(int)' => { +# use TQt::slots 'changeSomething(int)' => { # args => ['int'], # call => 'changeSomething' # }; @@ -14,21 +14,21 @@ use Carp; sub import { no strict 'refs'; my $self = shift; - my $caller = $self eq "Qt::slots" ? (caller)[0] : $self; + my $caller = $self eq "TQt::slots" ? (caller)[0] : $self; my $parent = ${ $caller . '::ISA' }[0]; my $parent_qt_invoke = $parent . '::qt_invoke'; - Qt::_internal::installqt_invoke($caller . '::qt_invoke') unless defined &{ $caller. '::qt_invoke' }; + TQt::_internal::installqt_invoke($caller . '::qt_invoke') unless defined &{ $caller. '::qt_invoke' }; # *{ $caller . '::qt_invoke' } = sub { # my $meta = \%{ $caller . '::META' }; # die unless $meta->{object}; # my $offset = $_[0] - $meta->{object}->slotOffset; # if($offset >= 0) { -# Qt::_internal::invoke(Qt::this(), $meta->{slots}[$offset], $_[1]); +# TQt::_internal::invoke(TQt::this(), $meta->{slots}[$offset], $_[1]); # return 1; # } else { -# Qt::this()->$parent_qt_invoke(@_); +# TQt::this()->$parent_qt_invoke(@_); # } # } unless defined &{ $caller . '::qt_invoke' }; @@ -58,17 +58,17 @@ sub import { my $slot_index = $#{ $meta->{slots} }; my $argcnt = scalar @$args; - my $mocargs = Qt::_internal::allocateMocArguments($argcnt); + my $mocargs = TQt::_internal::allocateMocArguments($argcnt); my $i = 0; for my $arg (@$args) { my $a = $arg; $a =~ s/^const\s+//; - if($a =~ /^(bool|int|double|char\*|QString)&?$/) { + if($a =~ /^(bool|int|double|char\*|TQString)&?$/) { $a = $1; } else { $a = 'ptr'; } - my $valid = Qt::_internal::setMocType($mocargs, $i, $arg, $a); + my $valid = TQt::_internal::setMocType($mocargs, $i, $arg, $a); die "Invalid type for slot argument ($arg)\n" unless $valid; $i++; } |