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.35 by root, Sun Apr 9 17:34:15 2006 UTC vs.
Revision 1.36 by elmex, Sun Apr 9 17:39:56 2006 UTC

6 6
7use SDL::OpenGL; 7use SDL::OpenGL;
8use SDL::OpenGL::Constants; 8use SDL::OpenGL::Constants;
9 9
10our $FOCUS; # the widget with current focus 10our $FOCUS; # the widget with current focus
11#our @ACTIVE_WIDGETS;
12 11
13# class methods for events 12# class methods for events
14sub feed_sdl_key_down_event { $FOCUS->key_down ($_[0]) if $FOCUS } 13sub feed_sdl_key_down_event { $FOCUS->key_down ($_[0]) if $FOCUS }
15sub feed_sdl_key_up_event { $FOCUS->key_up ($_[0]) if $FOCUS } 14sub feed_sdl_key_up_event { $FOCUS->key_up ($_[0]) if $FOCUS }
16sub feed_sdl_button_down_event { } 15sub feed_sdl_button_down_event { }
20 my $class = shift; 19 my $class = shift;
21 20
22 bless { @_ }, $class 21 bless { @_ }, $class
23} 22}
24 23
25#sub activate {
26# push @ACTIVE_WIDGETS, $_[0];
27# Scalar::Util::weaken $ACTIVE_WIDGETS[-1];
28#}
29
30#sub deactivate {
31# @ACTIVE_WIDGETS =
32# sort { $a->{z} <=> $b->{z} }
33# grep { $_ && $_ != $_[0] }
34# @ACTIVE_WIDGETS;
35#}
36
37sub move { 24sub move {
38 my ($self, $x, $y, $z) = @_; 25 my ($self, $x, $y, $z) = @_;
39 $self->{x} = $x; 26 $self->{x} = $x;
40 $self->{y} = $y; 27 $self->{y} = $y;
41 $self->{z} = $z if defined $z; 28 $self->{z} = $z if defined $z;
44sub needs_redraw { 31sub needs_redraw {
45 0 32 0
46} 33}
47 34
48sub size_request { 35sub size_request {
36 require Carp;
49 die "size_request is abtract"; 37 Carp::confess "size_request is abtract";
38}
39
40sub size_allocate {
41 my ($self, $w, $h) = @_;
42 $self->w ($w);
43 $self->h ($h);
50} 44}
51 45
52sub focus_in { 46sub focus_in {
53 my ($widget) = @_; 47 my ($widget) = @_;
54 $FOCUS = $widget; 48 $FOCUS = $widget;
72 66
73sub button_up { 67sub button_up {
74 my ($widget, $sdlev) = @_; 68 my ($widget, $sdlev) = @_;
75} 69}
76 70
77sub w { $_[0]->{w} } 71sub w { $_[0]->{w} = $_[1] if $_[1]; $_[0]->{w} }
78sub h { $_[0]->{h} } 72sub h { $_[0]->{h} = $_[1] if $_[1]; $_[0]->{h} }
79sub x { $_[0]->{x} = $_[1] if $_[1]; $_[0]->{x} } 73sub x { $_[0]->{x} = $_[1] if $_[1]; $_[0]->{x} }
80sub y { $_[0]->{y} = $_[1] if $_[1]; $_[0]->{y} } 74sub y { $_[0]->{y} = $_[1] if $_[1]; $_[0]->{y} }
81sub z { $_[0]->{z} = $_[1] if $_[1]; $_[0]->{z} } 75sub z { $_[0]->{z} = $_[1] if $_[1]; $_[0]->{z} }
82 76
83sub draw { 77sub draw {
132 126
133package Crossfire::Client::Widget::Bin; 127package Crossfire::Client::Widget::Bin;
134 128
135our @ISA = Crossfire::Client::Widget::; 129our @ISA = Crossfire::Client::Widget::;
136 130
137sub add { $_[0]->{child} = $_[1]; $_[1]->set_parent ($_[0]); $_[1]->update } 131sub add { $_[0]->{child} = $_[1]; $_[1]->set_parent ($_[0]); $_[1]->{expand} = $_[2] }
138
139sub get { $_[0]->{child} } 132sub get { $_[0]->{child} }
140 133
141sub remove { 134sub remove {
142 my ($self, $chld) = @_; 135 my ($self, $chld) = @_;
143 delete $self->{child} 136 delete $self->{child}
145} 138}
146 139
147sub size_request { 140sub size_request {
148 $_[0]->{child}->size_request if $_[0]->{child} 141 $_[0]->{child}->size_request if $_[0]->{child}
149} 142}
143sub size_allocate {
144 my ($self, $w, $h) = @_;
145 $self->SUPER::size_allocate ($w, $h);
146 $self->{child}->size_allocate ($w, $h)
147 if $self->{child}
148}
150 149
151sub _draw { 150sub _draw {
152 my ($self) = @_; 151 my ($self) = @_;
153 152
154 $self->{child}->draw; 153 $self->{child}->draw;
167 @{$self->{childs}} = 166 @{$self->{childs}} =
168 sort { $a->{z} <=> $b->{z} } 167 sort { $a->{z} <=> $b->{z} }
169 @{$self->{childs}}; 168 @{$self->{childs}};
170 169
171 $chld->set_parent ($self); 170 $chld->set_parent ($self);
171 $chld->size_allocate ($chld->size_request);
172} 172}
173 173
174sub remove { 174sub remove {
175 my ($self, $chld) = @_; 175 my ($self, $chld) = @_;
176 @{$self->{childs}} = 176 @{$self->{childs}} =
196 196
197use SDL::OpenGL; 197use SDL::OpenGL;
198 198
199sub add { 199sub add {
200 my ($self, $chld) = @_; 200 my ($self, $chld) = @_;
201 warn "ADD $chld\n";
201 $self->SUPER::add ($chld); 202 $self->SUPER::add ($chld);
202 $chld->set_parent ($self); 203 $chld->set_parent ($self);
203 $self->update; #TODO: Move this to the size_request event propably?
204} 204}
205 205
206sub remove { 206sub remove {
207 my ($self) = @_; 207 my ($self) = @_;
208 # TODO FIXME: removing a child from a window will crash, see render_chld 208 # TODO FIXME: removing a child from a window will crash, see render_chld
209 $self->update; 209 # $self->update;
210} 210}
211 211
212sub update { 212sub update {
213 my ($self) = @_; 213 my ($self) = @_;
214 $self->render_chld; 214 $self->render_chld;
217sub render_chld { 217sub render_chld {
218 my ($self) = @_; 218 my ($self) = @_;
219 my $chld = $self->get; 219 my $chld = $self->get;
220 my ($w, $h) = $self->size_request; 220 my ($w, $h) = $self->size_request;
221 221
222 require Carp;
223 Carp::cluck "RENDERCHI $w $h";
224 warn "RENDERCHI $w $h\n";
222 $self->{texture} = 225 $self->{texture} =
223 Crossfire::Client::Texture->new_from_opengl ( 226 Crossfire::Client::Texture->new_from_opengl (
224 $w, $h, sub { $chld->draw } 227 $w, $h, sub { $chld->draw }
225 ); 228 );
226 $self->{texture}->upload; 229 $self->{texture}->upload;
227} 230}
228 231
229sub size_request { 232sub size_request {
230 my ($self) = @_; 233 my ($self) = @_;
231 my $chld = $self->get 234 ($self->w, $self->h)
232 or return (0, 0);
233 $chld->size_request
234} 235}
235 236
236sub _draw { 237sub size_allocate {
237 my ($self) = @_; 238 my ($self, $w, $h) = @_;
238 239
239 my ($w, $h) = $self->size_request;#TODO# use width/height of texture 240 $self->w ($w);
241 $self->h ($h);
242 $self->get->size_allocate ($w, $h);
243
244 $self->update; #TODO: Move this to the size_request event propably?
245}
246
247sub _draw {
248 my ($self) = @_;
249
250 my ($w, $h) = ($self->w, $self->h);
240 251
241 my $tex = $self->{texture} 252 my $tex = $self->{texture}
242 or return; 253 or return;
243 254
244 glEnable GL_BLEND; 255 glEnable GL_BLEND;
269 or return (0, 0); 280 or return (0, 0);
270 281
271 $chld->move (2, 2); 282 $chld->move (2, 2);
272 283
273 map { $_ + 4 } $chld->size_request; 284 map { $_ + 4 } $chld->size_request;
285}
286
287sub size_allocate {
288 my ($self, $w, $h) = @_;
289
290 $self->w ($w);
291 $self->h ($h);
292
293 $self->get->size_allocate ($w - 4, $h - 4);
294 $self->get->move (2, 2);
274} 295}
275 296
276sub _draw { 297sub _draw {
277 my ($self) = @_; 298 my ($self) = @_;
278 299
304 $self->{txts} = [ 325 $self->{txts} = [
305 map { new_from_file Crossfire::Client::Texture Crossfire::Client::find_rcfile $_ } 326 map { new_from_file Crossfire::Client::Texture Crossfire::Client::find_rcfile $_ }
306 qw/d1_bg.png d1_border_top.png d1_border_right.png d1_border_left.png d1_border_bottom.png/ 327 qw/d1_bg.png d1_border_top.png d1_border_right.png d1_border_left.png d1_border_bottom.png/
307 ]; 328 ];
308 $self 329 $self
309
310} 330}
311 331
312sub size_request { 332sub size_request {
313 my ($self) = @_; 333 my ($self) = @_;
314 my ($w, $h) = $self->get->size_request; 334 my ($w, $h) = $self->get->size_request;
316 $h += $self->{txts}->[1]->{height}; 336 $h += $self->{txts}->[1]->{height};
317 $h += $self->{txts}->[4]->{height}; 337 $h += $self->{txts}->[4]->{height};
318 $w += $self->{txts}->[2]->{width}; 338 $w += $self->{txts}->[2]->{width};
319 $w += $self->{txts}->[3]->{width}; 339 $w += $self->{txts}->[3]->{width};
320 340
341 ($w, $h)
342}
343
344sub size_allocate {
345 my ($self, $w, $h) = @_;
346
347 $self->w ($w);
348 $self->h ($h);
349 $h -= $self->{txts}->[1]->{height};
350 $h -= $self->{txts}->[4]->{height};
351 $w -= $self->{txts}->[2]->{width};
352 $w -= $self->{txts}->[3]->{width};
353
354 $h = $h < 0 ? 0 : $h;
355 $w = $w < 0 ? 0 : $w;
356 warn "CHILD:$w $h\n";
357 $self->get->size_allocate ($w, $h);
321 $self->get->move ($self->{txts}->[3]->{width}, $self->{txts}->[1]->{height}); 358 $self->get->move ($self->{txts}->[3]->{width}, $self->{txts}->[1]->{height});
322
323 ($w, $h)
324} 359}
325 360
326sub _draw { 361sub _draw {
327 my ($self) = @_; 362 my ($self) = @_;
328 363
329 my ($w, $h) = $self->size_request; 364 my ($w, $h) = ($self->w, $self->h);
330 my ($cw, $ch) = $self->get->size_request; 365 my ($cw, $ch) = ($self->get->w, $self->get->h);
331 366
332 glEnable GL_BLEND; 367 glEnable GL_BLEND;
333 glEnable GL_TEXTURE_2D; 368 glEnable GL_TEXTURE_2D;
334 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; 369 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
335 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; 370 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE;
336
337 371
338 my $top = $self->{txts}->[1]; 372 my $top = $self->{txts}->[1];
339 glBindTexture GL_TEXTURE_2D, $top->{name}; 373 glBindTexture GL_TEXTURE_2D, $top->{name};
340 374
341 glColor 1, 1, 1, 0.8;
342
343 glBegin GL_QUADS; 375 glBegin GL_QUADS;
344 glTexCoord 0, 0; glVertex 0 , 0; 376 glTexCoord 0, 0; glVertex 0 , 0;
345 glTexCoord 0, 1; glVertex 0 , $top->{height}; 377 glTexCoord 0, 1; glVertex 0 , $top->{height};
346 glTexCoord 1, 1; glVertex $w , $top->{height}; 378 glTexCoord 1, 1; glVertex $w , $top->{height};
347 glTexCoord 1, 0; glVertex $w , 0; 379 glTexCoord 1, 0; glVertex $w , 0;
348 glEnd; 380 glEnd;
349 381
350 my $left = $self->{txts}->[3]; 382 my $left = $self->{txts}->[3];
351 glBindTexture GL_TEXTURE_2D, $left->{name}; 383 glBindTexture GL_TEXTURE_2D, $left->{name};
352 384
353 glColor 1, 1, 1, 0.8;
354
355 glBegin GL_QUADS; 385 glBegin GL_QUADS;
356 glTexCoord 0, 0; glVertex 0 , $top->{height}; 386 glTexCoord 0, 0; glVertex 0 , $top->{height};
357 glTexCoord 0, 1; glVertex 0 , $top->{height} + $ch; 387 glTexCoord 0, 1; glVertex 0 , $top->{height} + $ch;
358 glTexCoord 1, 1; glVertex $left->{width}, $top->{height} + $ch; 388 glTexCoord 1, 1; glVertex $left->{width}, $top->{height} + $ch;
359 glTexCoord 1, 0; glVertex $left->{width}, $top->{height}; 389 glTexCoord 1, 0; glVertex $left->{width}, $top->{height};
360 glEnd; 390 glEnd;
361 391
362 my $right = $self->{txts}->[2]; 392 my $right = $self->{txts}->[2];
363 glBindTexture GL_TEXTURE_2D, $right->{name}; 393 glBindTexture GL_TEXTURE_2D, $right->{name};
364 394
365 glColor 1, 1, 1, 0.8;
366
367 glBegin GL_QUADS; 395 glBegin GL_QUADS;
368 glTexCoord 0, 0; glVertex $w - $right->{width}, $top->{height}; 396 glTexCoord 0, 0; glVertex $w - $right->{width}, $top->{height};
369 glTexCoord 0, 1; glVertex $w - $right->{width}, $top->{height} + $ch; 397 glTexCoord 0, 1; glVertex $w - $right->{width}, $top->{height} + $ch;
370 glTexCoord 1, 1; glVertex $w , $top->{height} + $ch; 398 glTexCoord 1, 1; glVertex $w , $top->{height} + $ch;
371 glTexCoord 1, 0; glVertex $w , $top->{height}; 399 glTexCoord 1, 0; glVertex $w , $top->{height};
372 glEnd; 400 glEnd;
373 401
374 my $bottom = $self->{txts}->[4]; 402 my $bottom = $self->{txts}->[4];
375 glBindTexture GL_TEXTURE_2D, $bottom->{name}; 403 glBindTexture GL_TEXTURE_2D, $bottom->{name};
376 404
377 glColor 1, 1, 1, 0.8;
378
379 glBegin GL_QUADS; 405 glBegin GL_QUADS;
380 glTexCoord 0, 0; glVertex 0 , $h - $bottom->{height}; 406 glTexCoord 0, 0; glVertex 0 , $h - $bottom->{height};
381 glTexCoord 0, 1; glVertex 0 , $h; 407 glTexCoord 0, 1; glVertex 0 , $h;
382 glTexCoord 1, 1; glVertex $w , $h; 408 glTexCoord 1, 1; glVertex $w , $h;
383 glTexCoord 1, 0; glVertex $w , $h - $bottom->{height}; 409 glTexCoord 1, 0; glVertex $w , $h - $bottom->{height};
384 glEnd; 410 glEnd;
385 411
386 my $bg = $self->{txts}->[0]; 412 my $bg = $self->{txts}->[0];
387 glBindTexture GL_TEXTURE_2D, $bg->{name}; 413 glBindTexture GL_TEXTURE_2D, $bg->{name};
414 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE;
388 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT; 415 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT;
389 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT; 416 glTexParameter GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT;
390 417
391 glColor 1, 1, 1, 0.8;
392
393 my $rep_x = $cw / $bg->{width}; 418 my $rep_x = $cw / $bg->{width};
394 my $rep_y = $ch / $bg->{height}; 419 my $rep_y = $ch / $bg->{height};
395 420
396 glBegin GL_QUADS; 421 glBegin GL_QUADS;
397 glTexCoord 0, 0; glVertex $left->{width}, $top->{height}; 422 glTexCoord 0, 0; glVertex $left->{width}, $top->{height};
398 glTexCoord 0, $rep_y; glVertex $left->{width}, $top->{height} + $ch; 423 glTexCoord 0, $rep_y; glVertex $left->{width}, $top->{height} + $ch;
399 glTexCoord $rep_x, $rep_y; glVertex $left->{width} + $cw , $top->{height} + $ch; 424 glTexCoord $rep_x, $rep_y; glVertex $left->{width} + $cw , $top->{height} + $ch;
400 glTexCoord $rep_x, 0; glVertex $left->{width} + $cw , $top->{height}; 425 glTexCoord $rep_x, 0; glVertex $left->{width} + $cw , $top->{height};
401 glEnd; 426 glEnd;
402
403 $self->get->draw;
404 427
405 glDisable GL_BLEND; 428 glDisable GL_BLEND;
406 glDisable GL_TEXTURE_2D; 429 glDisable GL_TEXTURE_2D;
430
431 $self->get->draw;
432
407} 433}
408 434
409package Crossfire::Client::Widget::Table; 435package Crossfire::Client::Widget::Table;
410 436
411our @ISA = Crossfire::Client::Widget::Bin::; 437our @ISA = Crossfire::Client::Widget::Bin::;
496our @ISA = Crossfire::Client::Widget::Bin::; 522our @ISA = Crossfire::Client::Widget::Bin::;
497 523
498use SDL::OpenGL; 524use SDL::OpenGL;
499 525
500sub add { 526sub add {
501 my ($self, $chld) = @_; 527 my ($self, $chld, $expand) = @_;
502 push @{$self->{childs}}, $chld; 528 push @{$self->{childs}}, $chld;
529 $chld->{expand} = $expand;
503 $chld->set_parent ($self); 530 $chld->set_parent ($self);
504 $self->update; 531 $self->update;
505} 532}
506 533
507sub size_request { 534sub size_request {
515 } 542 }
516 543
517 return ($ws, $hs); 544 return ($ws, $hs);
518} 545}
519 546
547sub size_allocate {
548 my ($self, $w, $h) = @_;
549
550 $self->w ($w);
551 $self->h ($h);
552
553 my $exp;
554 my @oth;
555 # find expand widget
556 for (@{$self->{childs}}) {
557 if ($_->{expand}) {
558 $exp = $_;
559 last;
560 }
561 push @oth, $_;
562 }
563
564 my ($ow, $oh);
565
566 # get sizes of other widgets
567 for (@oth) {
568 my ($w, $h) = $_->size_request;
569 $oh += $h;
570 if ($ow < $w) { $ow = $w }
571 }
572
573 my $y = 0;
574 for (@{$self->{childs}}) {
575 $_->move (0, $y);
576
577 if ($_ == $exp) {
578 $_->size_allocate ($w, $h - $oh);
579 $y += $h - $oh;
580 } else {
581 my ($cw, $h) = $_->size_request;
582 $_->size_allocate ($w, $h);
583 $y += $h;
584 }
585 }
586}
587
520sub _draw { 588sub _draw {
521 my ($self) = @_; 589 my ($self) = @_;
522 590
523 my ($x, $y); 591 my ($x, $y);
524 for (@{$self->{childs} || []}) { 592 for (@{$self->{childs} || []}) {
525 $_->move (0, $y, 0); #TODO: move to size_request
526 $_->draw; 593 $_->draw;
527 my ($w, $h) = $_->size_request;
528 $y += $h; 594 $y += $_->h;
529 } 595 }
530} 596}
531 597
532package Crossfire::Client::Widget::Label; 598package Crossfire::Client::Widget::Label;
533 599
579 glEnable GL_TEXTURE_2D; 645 glEnable GL_TEXTURE_2D;
580 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA; 646 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
581 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE; 647 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
582 glBindTexture GL_TEXTURE_2D, $tex->{name}; 648 glBindTexture GL_TEXTURE_2D, $tex->{name};
583 649
584 glColor 1, 1, 1, 0.6; # TODO color 650 glColor 1, 0, 0, 1; # TODO color
585 651
586 glBegin GL_QUADS; 652 glBegin GL_QUADS;
587 glTexCoord 0, 0; glVertex 0 , 0; 653 glTexCoord 0, 0; glVertex 0 , 0;
588 glTexCoord 0, 1; glVertex 0 , $tex->{height}; 654 glTexCoord 0, 1; glVertex 0 , $tex->{height};
589 glTexCoord 1, 1; glVertex $tex->{width}, $tex->{height}; 655 glTexCoord 1, 1; glVertex $tex->{width}, $tex->{height};
619 $text .= chr $uni; 685 $text .= chr $uni;
620 } 686 }
621 $self->set_text ($text); 687 $self->set_text ($text);
622} 688}
623 689
624
625# XXX: TextView isn't neccessary with pango multiline text rendering
626package Crossfire::Client::Widget::TextView;
627
628use strict;
629
630our @ISA = qw/Crossfire::Client::Widget/;
631
632use SDL::OpenGL;
633use SDL::OpenGL::Constants;
634
635sub new {
636 my ($class, $text, $h) = @_;
637 my $self = $class->SUPER::new ();
638
639 $self->{txt_height} = $h;
640 @{$self->{lines}} = split /\r?\n/, $text;
641
642 for (split /\r?\n/, $text) {
643 $self->add_line ($_);
644 }
645 $self
646}
647
648#sub render_lines {
649# my ($self) = @_;
650#
651# $self->{txt_lines} = [];
652#
653# for (@{$self->{lines}}) {
654# push @{$self->{txt_lines}},
655# new_from_ttf Crossfire::Client::Texture $self->{ttf}, $_;
656# }
657#}
658
659sub add_line {
660 my ($self, $line) = @_;
661 push @{$self->{lines}}, $line;
662
663 push @{$self->{txt_lines}},
664 new_from_text Crossfire::Client::Texture $line, $self->{txt_height};
665}
666
667sub size_request {
668 my ($self) = @_;
669
670 my $w = 0;
671 my $h = 0;
672
673 for (@{$self->{txt_lines}}) {
674 if ($w < $_->{width}) { $w = $_->{width} }
675 $h += $_->{height};
676 }
677
678 return ($w, $h);
679}
680
681sub draw_line {
682 my ($self, $tex, $y) = @_;
683
684 glBindTexture GL_TEXTURE_2D, $tex->{name};
685
686 glColor 1, 0, 1;
687
688 glBegin GL_QUADS;
689 glTexCoord 0, 0; glVertex 0 , $y;
690 glTexCoord 0, 1; glVertex 0 , $y + $tex->{height};
691 glTexCoord 1, 1; glVertex $tex->{width}, $y + $tex->{height};
692 glTexCoord 1, 0; glVertex $tex->{width}, $y;
693 glEnd;
694}
695
696sub _draw {
697 my ($self) = @_;
698
699 glEnable GL_BLEND;
700 glEnable GL_TEXTURE_2D;
701 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;#DECAL;
702
703 my $l = 0;
704 for (@{$self->{txt_lines}}) {
705 $self->draw_line ($_, $l);
706 $l += $_->{height};
707 }
708
709 glDisable GL_BLEND;
710 glDisable GL_TEXTURE_2D;
711}
712
713package Crossfire::Client::Widget::MapWidget; 690package Crossfire::Client::Widget::MapWidget;
714 691
715use strict; 692use strict;
716 693
717use List::Util qw(min max); 694use List::Util qw(min max);
725sub key_down { 702sub key_down {
726 print "MAPKEYDOWN\n"; 703 print "MAPKEYDOWN\n";
727} 704}
728 705
729sub key_up { 706sub key_up {
707}
708
709sub size_request {
710
711}
712
713sub size_allocate {
730} 714}
731 715
732sub _draw { 716sub _draw {
733 my ($self) = @_; 717 my ($self) = @_;
734 718

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines