summaryrefslogtreecommitdiffstats
path: root/ksirc/puke/palistbox.pm
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /ksirc/puke/palistbox.pm
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
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
Diffstat (limited to 'ksirc/puke/palistbox.pm')
-rw-r--r--ksirc/puke/palistbox.pm117
1 files changed, 117 insertions, 0 deletions
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;