ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.137 by root, Wed Apr 19 21:38:05 2006 UTC vs.
Revision 1.138 by root, Wed Apr 19 23:37:49 2006 UTC

87 87
88package CFClient::UI::Base; 88package CFClient::UI::Base;
89 89
90use strict; 90use strict;
91 91
92use SDL::OpenGL; 92use CFClient::OpenGL;
93 93
94sub new { 94sub new {
95 my $class = shift; 95 my $class = shift;
96 96
97 my $self = bless { 97 my $self = bless {
324package CFClient::UI::DrawBG; 324package CFClient::UI::DrawBG;
325 325
326our @ISA = CFClient::UI::Base::; 326our @ISA = CFClient::UI::Base::;
327 327
328use strict; 328use strict;
329use SDL::OpenGL; 329use CFClient::OpenGL;
330 330
331sub new { 331sub 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
483package CFClient::UI::Window; 483package CFClient::UI::Window;
484 484
485our @ISA = CFClient::UI::Bin::; 485our @ISA = CFClient::UI::Bin::;
486 486
487use SDL::OpenGL; 487use CFClient::OpenGL;
488 488
489sub new { 489sub 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
566package CFClient::UI::Frame; 566package CFClient::UI::Frame;
567 567
568our @ISA = CFClient::UI::Bin::; 568our @ISA = CFClient::UI::Bin::;
569 569
570use SDL::OpenGL; 570use CFClient::OpenGL;
571 571
572sub size_request { 572sub 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
608package CFClient::UI::FancyFrame; 608package CFClient::UI::FancyFrame;
609 609
610our @ISA = CFClient::UI::Bin::; 610our @ISA = CFClient::UI::Bin::;
611 611
612use SDL::OpenGL; 612use CFClient::OpenGL;
613 613
614my @tex = 614my @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
749our @ISA = CFClient::UI::Base::; 749our @ISA = CFClient::UI::Base::;
750 750
751use List::Util qw(max sum); 751use List::Util qw(max sum);
752 752
753use SDL::OpenGL; 753use CFClient::OpenGL;
754 754
755sub new { 755sub new {
756 my $class = shift; 756 my $class = shift;
757 757
758 $class->SUPER::new ( 758 $class->SUPER::new (
999 999
1000package CFClient::UI::Label; 1000package CFClient::UI::Label;
1001 1001
1002our @ISA = CFClient::UI::Base::; 1002our @ISA = CFClient::UI::Base::;
1003 1003
1004use SDL::OpenGL; 1004use CFClient::OpenGL;
1005 1005
1006sub new { 1006sub 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
1112package CFClient::UI::EntryBase; 1112package CFClient::UI::EntryBase;
1113 1113
1114our @ISA = CFClient::UI::Label::; 1114our @ISA = CFClient::UI::Label::;
1115 1115
1116use SDL::OpenGL; 1116use CFClient::OpenGL;
1117 1117
1118sub new { 1118sub new {
1119 my $class = shift; 1119 my $class = shift;
1120 1120
1121 $class->SUPER::new ( 1121 $class->SUPER::new (
1278 1278
1279package CFClient::UI::Entry; 1279package CFClient::UI::Entry;
1280 1280
1281our @ISA = CFClient::UI::EntryBase::; 1281our @ISA = CFClient::UI::EntryBase::;
1282 1282
1283use SDL::OpenGL; 1283use CFClient::OpenGL;
1284 1284
1285sub key_down { 1285sub key_down {
1286 my ($self, $ev) = @_; 1286 my ($self, $ev) = @_;
1287 1287
1288 my $sym = $ev->{sym}; 1288 my $sym = $ev->{sym};
1301 1301
1302package CFClient::UI::Button; 1302package CFClient::UI::Button;
1303 1303
1304our @ISA = CFClient::UI::Label::; 1304our @ISA = CFClient::UI::Label::;
1305 1305
1306use SDL::OpenGL; 1306use CFClient::OpenGL;
1307 1307
1308my @tex = 1308my @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
1365my @tex = 1365my @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
1369use SDL::OpenGL; 1369use CFClient::OpenGL;
1370 1370
1371sub new { 1371sub new {
1372 my $class = shift; 1372 my $class = shift;
1373 1373
1374 $class->SUPER::new ( 1374 $class->SUPER::new (
1424 1424
1425package CFClient::UI::VGauge; 1425package CFClient::UI::VGauge;
1426 1426
1427our @ISA = CFClient::UI::Base::; 1427our @ISA = CFClient::UI::Base::;
1428 1428
1429use SDL::OpenGL; 1429use CFClient::OpenGL;
1430 1430
1431my %tex = ( 1431my %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
1532package CFClient::UI::Slider; 1532package CFClient::UI::Slider;
1533 1533
1534use strict; 1534use strict;
1535 1535
1536use SDL::OpenGL; 1536use CFClient::OpenGL;
1537 1537
1538our @ISA = CFClient::UI::DrawBG::; 1538our @ISA = CFClient::UI::DrawBG::;
1539 1539
1540my @tex = 1540my @tex =
1541 map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } 1541 map { new_from_file CFClient::Texture CFClient::find_rcfile $_ }
1666 1666
1667package CFClient::UI::TextView; 1667package CFClient::UI::TextView;
1668 1668
1669our @ISA = CFClient::UI::HBox::; 1669our @ISA = CFClient::UI::HBox::;
1670 1670
1671use SDL::OpenGL; 1671use CFClient::OpenGL;
1672 1672
1673sub new { 1673sub 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
1825package CFClient::UI::Animator; 1825package CFClient::UI::Animator;
1826 1826
1827use SDL::OpenGL; 1827use CFClient::OpenGL;
1828 1828
1829our @ISA = CFClient::UI::Bin::; 1829our @ISA = CFClient::UI::Bin::;
1830 1830
1831sub moveto { 1831sub moveto {
1832 my ($self, $x, $y) = @_; 1832 my ($self, $x, $y) = @_;
1905 1905
1906package CFClient::UI::Root; 1906package CFClient::UI::Root;
1907 1907
1908our @ISA = CFClient::UI::Container::; 1908our @ISA = CFClient::UI::Container::;
1909 1909
1910use SDL::OpenGL; 1910use CFClient::OpenGL;
1911 1911
1912sub check_size { 1912sub check_size {
1913 my ($self) = @_; 1913 my ($self) = @_;
1914 1914
1915 $self->configure (0, 0, $::WITH, $::HEIGHT); 1915 $self->configure (0, 0, $::WITH, $::HEIGHT);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines