11 |
use neb::Tree::LayoutBox; |
use neb::Tree::LayoutBox; |
12 |
use neb::Tree::HBox; |
use neb::Tree::HBox; |
13 |
use neb::Tree::VBox; |
use neb::Tree::VBox; |
14 |
|
use neb::Tree::VolatileHBox; |
15 |
|
use neb::Tree::VolatileVBox; |
16 |
|
|
17 |
# esto engancha como se llaman las clases con como se llaman los tags |
# esto engancha como se llaman las clases con como se llaman los tags |
18 |
# que invocan las clases. |
# que invocan las clases. |
19 |
my %classes = ( 'lam:hbox' => 'HBox', |
my %classes = ( 'lam:hbox' => 'VolatileHBox', |
20 |
'lam:vbox' => 'VBox', |
'lam:vbox' => 'VolatileVBox', |
21 |
'form' => 'VBox', |
'form' => 'VBox', |
22 |
'label' => 'ScreenObject', |
'label' => 'ScreenObject', |
23 |
'entry' => 'ScreenObject', |
'entry' => 'ScreenObject', |
24 |
'button' => 'Button', |
'button' => 'ScreenObject', |
25 |
'label' => 'Label'); |
'label' => 'ScreenObject'); |
26 |
|
|
27 |
# create a regexp to find out whether we handle a given tag |
# create a regexp to find out whether we handle a given tag |
28 |
my $handled_tags = '^(' . join("|", map quotemeta, keys %classes) . ')$'; |
my $handled_tags = '^(' . join("|", map quotemeta, keys %classes) . ')$'; |
29 |
$handled_tags = qr/$handled_tags/; |
$handled_tags = qr/$handled_tags/; |
42 |
my $name = shift; |
my $name = shift; |
43 |
my $class = 'neb::Tree::'; |
my $class = 'neb::Tree::'; |
44 |
|
|
45 |
|
die("Run XML file through neb first!") if $name =~ /^neb:/; |
46 |
|
|
47 |
if ($name =~ $handled_tags) |
if ($name =~ $handled_tags) |
48 |
{ |
{ |
49 |
$class .= exists $classes{$1} ? $classes{$1} : $1; |
$class .= exists $classes{$1} ? $classes{$1} : $1; |