… | |
… | |
87 | |
87 | |
88 | package CFClient::UI::Base; |
88 | package CFClient::UI::Base; |
89 | |
89 | |
90 | use strict; |
90 | use strict; |
91 | |
91 | |
92 | use SDL::OpenGL; |
92 | use CFClient::OpenGL; |
93 | |
93 | |
94 | sub new { |
94 | sub new { |
95 | my $class = shift; |
95 | my $class = shift; |
96 | |
96 | |
97 | my $self = bless { |
97 | my $self = bless { |
… | |
… | |
324 | package CFClient::UI::DrawBG; |
324 | package CFClient::UI::DrawBG; |
325 | |
325 | |
326 | our @ISA = CFClient::UI::Base::; |
326 | our @ISA = CFClient::UI::Base::; |
327 | |
327 | |
328 | use strict; |
328 | use strict; |
329 | use SDL::OpenGL; |
329 | use CFClient::OpenGL; |
330 | |
330 | |
331 | sub new { |
331 | sub new { |
332 | my $class = shift; |
332 | my $class = shift; |
333 | |
333 | |
334 | # range [value, low, high, page] |
334 | # range [value, low, high, page] |
… | |
… | |
482 | |
482 | |
483 | package CFClient::UI::Window; |
483 | package CFClient::UI::Window; |
484 | |
484 | |
485 | our @ISA = CFClient::UI::Bin::; |
485 | our @ISA = CFClient::UI::Bin::; |
486 | |
486 | |
487 | use SDL::OpenGL; |
487 | use CFClient::OpenGL; |
488 | |
488 | |
489 | sub new { |
489 | sub new { |
490 | my ($class, %arg) = @_; |
490 | my ($class, %arg) = @_; |
491 | |
491 | |
492 | my $self = $class->SUPER::new (%arg); |
492 | my $self = $class->SUPER::new (%arg); |
… | |
… | |
565 | |
565 | |
566 | package CFClient::UI::Frame; |
566 | package CFClient::UI::Frame; |
567 | |
567 | |
568 | our @ISA = CFClient::UI::Bin::; |
568 | our @ISA = CFClient::UI::Bin::; |
569 | |
569 | |
570 | use SDL::OpenGL; |
570 | use CFClient::OpenGL; |
571 | |
571 | |
572 | sub size_request { |
572 | sub size_request { |
573 | my ($self) = @_; |
573 | my ($self) = @_; |
574 | my $chld = $self->child |
574 | my $chld = $self->child |
575 | or return (0, 0); |
575 | or return (0, 0); |
… | |
… | |
607 | |
607 | |
608 | package CFClient::UI::FancyFrame; |
608 | package CFClient::UI::FancyFrame; |
609 | |
609 | |
610 | our @ISA = CFClient::UI::Bin::; |
610 | our @ISA = CFClient::UI::Bin::; |
611 | |
611 | |
612 | use SDL::OpenGL; |
612 | use CFClient::OpenGL; |
613 | |
613 | |
614 | my @tex = |
614 | my @tex = |
615 | map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } |
615 | map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } |
616 | qw(d1_bg.png d1_border_top.png d1_border_right.png d1_border_left.png d1_border_bottom.png); |
616 | qw(d1_bg.png d1_border_top.png d1_border_right.png d1_border_left.png d1_border_bottom.png); |
617 | |
617 | |
… | |
… | |
748 | |
748 | |
749 | our @ISA = CFClient::UI::Base::; |
749 | our @ISA = CFClient::UI::Base::; |
750 | |
750 | |
751 | use List::Util qw(max sum); |
751 | use List::Util qw(max sum); |
752 | |
752 | |
753 | use SDL::OpenGL; |
753 | use CFClient::OpenGL; |
754 | |
754 | |
755 | sub new { |
755 | sub new { |
756 | my $class = shift; |
756 | my $class = shift; |
757 | |
757 | |
758 | $class->SUPER::new ( |
758 | $class->SUPER::new ( |
… | |
… | |
999 | |
999 | |
1000 | package CFClient::UI::Label; |
1000 | package CFClient::UI::Label; |
1001 | |
1001 | |
1002 | our @ISA = CFClient::UI::Base::; |
1002 | our @ISA = CFClient::UI::Base::; |
1003 | |
1003 | |
1004 | use SDL::OpenGL; |
1004 | use CFClient::OpenGL; |
1005 | |
1005 | |
1006 | sub new { |
1006 | sub new { |
1007 | my ($class, %arg) = @_; |
1007 | my ($class, %arg) = @_; |
1008 | |
1008 | |
1009 | my $self = $class->SUPER::new ( |
1009 | my $self = $class->SUPER::new ( |
… | |
… | |
1111 | |
1111 | |
1112 | package CFClient::UI::EntryBase; |
1112 | package CFClient::UI::EntryBase; |
1113 | |
1113 | |
1114 | our @ISA = CFClient::UI::Label::; |
1114 | our @ISA = CFClient::UI::Label::; |
1115 | |
1115 | |
1116 | use SDL::OpenGL; |
1116 | use CFClient::OpenGL; |
1117 | |
1117 | |
1118 | sub new { |
1118 | sub new { |
1119 | my $class = shift; |
1119 | my $class = shift; |
1120 | |
1120 | |
1121 | $class->SUPER::new ( |
1121 | $class->SUPER::new ( |
… | |
… | |
1278 | |
1278 | |
1279 | package CFClient::UI::Entry; |
1279 | package CFClient::UI::Entry; |
1280 | |
1280 | |
1281 | our @ISA = CFClient::UI::EntryBase::; |
1281 | our @ISA = CFClient::UI::EntryBase::; |
1282 | |
1282 | |
1283 | use SDL::OpenGL; |
1283 | use CFClient::OpenGL; |
1284 | |
1284 | |
1285 | sub key_down { |
1285 | sub key_down { |
1286 | my ($self, $ev) = @_; |
1286 | my ($self, $ev) = @_; |
1287 | |
1287 | |
1288 | my $sym = $ev->{sym}; |
1288 | my $sym = $ev->{sym}; |
… | |
… | |
1301 | |
1301 | |
1302 | package CFClient::UI::Button; |
1302 | package CFClient::UI::Button; |
1303 | |
1303 | |
1304 | our @ISA = CFClient::UI::Label::; |
1304 | our @ISA = CFClient::UI::Label::; |
1305 | |
1305 | |
1306 | use SDL::OpenGL; |
1306 | use CFClient::OpenGL; |
1307 | |
1307 | |
1308 | my @tex = |
1308 | my @tex = |
1309 | map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } |
1309 | map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } |
1310 | qw(b1_button_active.png); |
1310 | qw(b1_button_active.png); |
1311 | |
1311 | |
… | |
… | |
1364 | |
1364 | |
1365 | my @tex = |
1365 | my @tex = |
1366 | map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } |
1366 | map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } |
1367 | qw(c1_checkbox_bg.png c1_checkbox_active.png); |
1367 | qw(c1_checkbox_bg.png c1_checkbox_active.png); |
1368 | |
1368 | |
1369 | use SDL::OpenGL; |
1369 | use CFClient::OpenGL; |
1370 | |
1370 | |
1371 | sub new { |
1371 | sub new { |
1372 | my $class = shift; |
1372 | my $class = shift; |
1373 | |
1373 | |
1374 | $class->SUPER::new ( |
1374 | $class->SUPER::new ( |
… | |
… | |
1424 | |
1424 | |
1425 | package CFClient::UI::VGauge; |
1425 | package CFClient::UI::VGauge; |
1426 | |
1426 | |
1427 | our @ISA = CFClient::UI::Base::; |
1427 | our @ISA = CFClient::UI::Base::; |
1428 | |
1428 | |
1429 | use SDL::OpenGL; |
1429 | use CFClient::OpenGL; |
1430 | |
1430 | |
1431 | my %tex = ( |
1431 | my %tex = ( |
1432 | food => [ |
1432 | food => [ |
1433 | map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } |
1433 | map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } |
1434 | qw/g1_food_gauge_empty.png g1_food_gauge_full.png/ |
1434 | qw/g1_food_gauge_empty.png g1_food_gauge_full.png/ |
… | |
… | |
1531 | |
1531 | |
1532 | package CFClient::UI::Slider; |
1532 | package CFClient::UI::Slider; |
1533 | |
1533 | |
1534 | use strict; |
1534 | use strict; |
1535 | |
1535 | |
1536 | use SDL::OpenGL; |
1536 | use CFClient::OpenGL; |
1537 | |
1537 | |
1538 | our @ISA = CFClient::UI::DrawBG::; |
1538 | our @ISA = CFClient::UI::DrawBG::; |
1539 | |
1539 | |
1540 | my @tex = |
1540 | my @tex = |
1541 | map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } |
1541 | map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } |
… | |
… | |
1666 | |
1666 | |
1667 | package CFClient::UI::TextView; |
1667 | package CFClient::UI::TextView; |
1668 | |
1668 | |
1669 | our @ISA = CFClient::UI::HBox::; |
1669 | our @ISA = CFClient::UI::HBox::; |
1670 | |
1670 | |
1671 | use SDL::OpenGL; |
1671 | use CFClient::OpenGL; |
1672 | |
1672 | |
1673 | sub new { |
1673 | sub new { |
1674 | my $class = shift; |
1674 | my $class = shift; |
1675 | |
1675 | |
1676 | my $self = $class->SUPER::new ( |
1676 | my $self = $class->SUPER::new ( |
… | |
… | |
1822 | |
1822 | |
1823 | ############################################################################# |
1823 | ############################################################################# |
1824 | |
1824 | |
1825 | package CFClient::UI::Animator; |
1825 | package CFClient::UI::Animator; |
1826 | |
1826 | |
1827 | use SDL::OpenGL; |
1827 | use CFClient::OpenGL; |
1828 | |
1828 | |
1829 | our @ISA = CFClient::UI::Bin::; |
1829 | our @ISA = CFClient::UI::Bin::; |
1830 | |
1830 | |
1831 | sub moveto { |
1831 | sub moveto { |
1832 | my ($self, $x, $y) = @_; |
1832 | my ($self, $x, $y) = @_; |
… | |
… | |
1905 | |
1905 | |
1906 | package CFClient::UI::Root; |
1906 | package CFClient::UI::Root; |
1907 | |
1907 | |
1908 | our @ISA = CFClient::UI::Container::; |
1908 | our @ISA = CFClient::UI::Container::; |
1909 | |
1909 | |
1910 | use SDL::OpenGL; |
1910 | use CFClient::OpenGL; |
1911 | |
1911 | |
1912 | sub check_size { |
1912 | sub check_size { |
1913 | my ($self) = @_; |
1913 | my ($self) = @_; |
1914 | |
1914 | |
1915 | $self->configure (0, 0, $::WITH, $::HEIGHT); |
1915 | $self->configure (0, 0, $::WITH, $::HEIGHT); |