--- deliantra/Deliantra-Client/DC/UI.pm 2006/04/11 13:05:12 1.59 +++ deliantra/Deliantra-Client/DC/UI.pm 2006/04/11 13:14:36 1.60 @@ -1,4 +1,4 @@ -package Crossfire::Client::Widget; +package CFClient::Widget; use strict; @@ -7,7 +7,7 @@ use SDL::OpenGL; use SDL::OpenGL::Constants; -use Crossfire::Client; +use CFClient; our ($FOCUS, $HOVER, $GRAB); # various widgets @@ -212,9 +212,9 @@ ############################################################################# -package Crossfire::Client::Widget::Container; +package CFClient::Widget::Container; -our @ISA = Crossfire::Client::Widget::; +our @ISA = CFClient::Widget::; sub new { my ($class, @widgets) = @_; @@ -271,9 +271,9 @@ ############################################################################# -package Crossfire::Client::Widget::Bin; +package CFClient::Widget::Bin; -our @ISA = Crossfire::Client::Widget::Container::; +our @ISA = CFClient::Widget::Container::; sub child { $_[0]->{children}[0] } @@ -291,9 +291,9 @@ ############################################################################# -package Crossfire::Client::Widget::Window; +package CFClient::Widget::Window; -our @ISA = Crossfire::Client::Widget::Bin::; +our @ISA = CFClient::Widget::Bin::; use SDL::OpenGL; @@ -316,7 +316,7 @@ my ($self) = @_; $self->{texture} = - Crossfire::Client::Texture->new_from_opengl ( + CFClient::Texture->new_from_opengl ( $self->{w}, $self->{h}, sub { $self->child->draw } ); } @@ -352,9 +352,9 @@ ############################################################################# -package Crossfire::Client::Widget::Frame; +package CFClient::Widget::Frame; -our @ISA = Crossfire::Client::Widget::Bin::; +our @ISA = CFClient::Widget::Bin::; use SDL::OpenGL; @@ -398,14 +398,14 @@ ############################################################################# -package Crossfire::Client::Widget::FancyFrame; +package CFClient::Widget::FancyFrame; -our @ISA = Crossfire::Client::Widget::Bin::; +our @ISA = CFClient::Widget::Bin::; use SDL::OpenGL; my @tex = - map { new_from_file Crossfire::Client::Texture Crossfire::Client::find_rcfile $_ } + map { new_from_file CFClient::Texture CFClient::find_rcfile $_ } qw(d1_bg.png d1_border_top.png d1_border_right.png d1_border_left.png d1_border_bottom.png); sub size_request { @@ -481,9 +481,9 @@ ############################################################################# -package Crossfire::Client::Widget::Table; +package CFClient::Widget::Table; -our @ISA = Crossfire::Client::Widget::Bin::; +our @ISA = CFClient::Widget::Bin::; use SDL::OpenGL; @@ -568,9 +568,9 @@ ############################################################################# -package Crossfire::Client::Widget::VBox; +package CFClient::Widget::VBox; -our @ISA = Crossfire::Client::Widget::Container::; +our @ISA = CFClient::Widget::Container::; use SDL::OpenGL; @@ -628,9 +628,9 @@ ############################################################################# -package Crossfire::Client::Widget::Label; +package CFClient::Widget::Label; -our @ISA = Crossfire::Client::Widget::; +our @ISA = CFClient::Widget::; use SDL::OpenGL; @@ -645,7 +645,7 @@ y => $y, z => $z, height => $height, - layout => new Crossfire::Client::Layout, + layout => new CFClient::Layout, ); $self->set_text ($text); @@ -679,7 +679,7 @@ # $self->{texture}{height}, # ) # } else { -# my ($w, $h, $data) = Crossfire::Client::font_render "Yy", $self->{height}; +# my ($w, $h, $data) = CFClient::font_render "Yy", $self->{height}; # # ($w, $h) # } @@ -697,7 +697,7 @@ my $tex = $self->{texture} ||= do { $self->{layout}->set_width ($self->{w}); - new_from_layout Crossfire::Client::Texture $self->{layout}; + new_from_layout CFClient::Texture $self->{layout}; }; glEnable GL_BLEND; @@ -715,9 +715,9 @@ ############################################################################# -package Crossfire::Client::Widget::Entry; +package CFClient::Widget::Entry; -our @ISA = Crossfire::Client::Widget::Label::; +our @ISA = CFClient::Widget::Label::; use SDL; use SDL::OpenGL; @@ -773,7 +773,7 @@ ############################################################################# -package Crossfire::Client::Widget::MapWidget; +package CFClient::Widget::MapWidget; use strict; @@ -783,7 +783,7 @@ use SDL::OpenGL; use SDL::OpenGL::Constants; -our @ISA = Crossfire::Client::Widget::; +our @ISA = CFClient::Widget::; sub key_down { print "MAPKEYDOWN\n"; @@ -869,7 +869,7 @@ glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; - $darkness = new Crossfire::Client::Texture + $darkness = new CFClient::Texture width => $sw4, height => $sh, data => $darkness, @@ -936,11 +936,11 @@ ############################################################################# -package Crossfire::Client::Widget::Animator; +package CFClient::Widget::Animator; use SDL::OpenGL; -our @ISA = Crossfire::Client::Widget::Bin::; +our @ISA = CFClient::Widget::Bin::; sub moveto { my ($self, $x, $y) = @_; @@ -978,9 +978,9 @@ ############################################################################# -package Crossfire::Client::Widget::Toplevel; +package CFClient::Widget::Toplevel; -our @ISA = Crossfire::Client::Widget::Container::; +our @ISA = CFClient::Widget::Container::; sub size_request { ($::WIDTH, $::HEIGHT) @@ -1024,9 +1024,9 @@ ############################################################################# -package Crossfire::Client::Widget; +package CFClient::Widget; -$TOPLEVEL = new Crossfire::Client::Widget::Toplevel; +$TOPLEVEL = new CFClient::Widget::Toplevel; 1