From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksirc/puke/palistbox.pm | 117 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 ksirc/puke/palistbox.pm (limited to 'ksirc/puke/palistbox.pm') diff --git a/ksirc/puke/palistbox.pm b/ksirc/puke/palistbox.pm new file mode 100644 index 00000000..e1dcb691 --- /dev/null +++ b/ksirc/puke/palistbox.pm @@ -0,0 +1,117 @@ + +&::PukeSendMessage($::PUKE_WIDGET_LOAD, + $::PUKE_CONTROLLER, + $::PWIDGET_ALISTBOX, + "palistbox.so", + sub { my %ARG = %{shift()}; + if($ARG{'iArg'} == 1){ + print "*E* PAListBox Load failed!\n"; + } + } + ); + + +package PAListBox; +@ISA = qw(PListBox); +use strict; + +if($PListBox::usage == undef){ + $PListBox::usage = 0; +} + +sub new { + my $class = shift; + my $self = $class->SUPER::new($class, @_); + + $self->{widgetType} = $::PWIDGET_ALISTBOX; + + if($class eq 'PAListBox'){ + $self->create(); + } + + $self->installHandler($::PUKE_LISTBOX_SELECTED_ACK, sub{$self->selected(@_)}); + + return $self; + +} + +sub DESTROY { + my $self = shift; + $self->SUPER::DESTROY(@_); + $PAListBox::usage--; + if($PAListBox::usage == 0){ + &::PukeSendMessage($::PUKE_WIDGET_UNLOAD, + 0, + $::PWIDGET_ALISTBOX, + "", + sub {} + ); + + } +} + +sub inSort { + my $self = shift; + my $text = shift; + my $top = shift; + + $self->sendMessage('iCommand' => $::PUKE_LISTBOX_INSERT_SORT, + 'cArg' => $text, + 'iArg' => $text >= 1 ? 1 : 0, + 'CallBack' => sub {}); + +} + +sub isTop { + my $self = shift; + my $text = shift; + + my %ret = $self->sendMessage('iCommand' => $::PUKE_ALISTBOX_ISTOP, + 'cArg' => $text, + 'CallBack' => sub {}); + + return $ret{'iArg'}; + +} + +sub findNick { + my $self = shift; + my $text = shift; + + my %ret = $self->sendMessage('iCommand' => $::PUKE_ALISTBOX_FIND_NICK, + 'cArg' => $text, + 'CallBack' => sub {}, + 'WaitFor' => 1); + + return $ret{'iArg'}; + +} + +sub smallHighligh { + my $self = shift; + my $text = shift; + my $highlight = shift; + + $self->sendMessage('iCommand' => $::PUKE_ALISTBOX_SMALL_HIGHLIGHT, + 'cArg' => $text, + 'iArg' => $highlight, + 'CallBack' => sub {}); + +} + +sub bigHighligh { + my $self = shift; + my $text = shift; + my $highlight = shift; + + $self->sendMessage('iCommand' => $::PUKE_ALISTBOX_BIG_HIGHLIGHT, + 'cArg' => $text, + 'iArg' => $highlight, + 'CallBack' => sub {}); + +} + + +package main; + +1; -- cgit v1.2.1